#include <asm/types.h>


#define _BULK_DATA_LEN 64


#define EZUSB_REQUEST_FW_TRANS 0xA0
#define EZUSB_CPUCS_REG        0x7F92
#define EZUSB_REQUEST_TRIGER   0xAA
#define EZUSB_REQUEST_TRIG_AC  0xAC

#define BRIDGE_RID_ACK         0x0710
#define BRIDGE_RID_RX          0x0701
#define BRIDGE_RID_TX          0x0700
#define BRIDGE_RID_INIT1       0x0702
#define BRIDGE_RID_DOCMD       0x0860


#define DEF_TIMEOUT (3*HZ)

struct bridge_req_packet {
	__u16 x00; /* 0x0210 */
	__u8  reply_count;
	__u8  x03; /* 0x00 */
	__u8  x04; /* 0x01 for data frames, 0x02 otherwise */
	__u8  x05; /* 0x00 */
	__u16 size; /* transport size */
	__u16 crc; /* CRC up to here */
	__u16 hermes_len;
	__u16 hermes_rid;
	__u8  data[0];
} __attribute__ ((packed));

struct bridge_ans_packet {
	__u16 x00; /* 0x0210 */
	__u8  x02; /* 0x00 */
	__u8  reply_count;
	__u16 x04; /* 0x0001 */
	__u16 size; /* transport size */
	__u16 crc; /* CRC up to here */
	__u16 hermes_len;
	__u16 hermes_rid;
	__u8  data[0];
} __attribute__ ((packed));

#define BULK_BUF_SIZE 2048
#define MAX_DATA_SIZE (BULK_BUF_SIZE - max(sizeof(struct bridge_ans_packet), \
					   sizeof(struct bridge_req_packet)))

#define EZ_USB_FW_SIZE 0x1B40
struct ez_usb_fw
{
	u16 size;
	u16 card_variant_offset;
	u8 *code;
};
