pcmcia: CompactFlash driver for PA Semi Electra boards
[pv_ops_mirror.git] / drivers / net / wireless / libertas / if_usb.h
blobe07a10ed28b5d34447ab28cd97d9be71faea8f73
1 #ifndef _LIBERTAS_IF_USB_H
2 #define _LIBERTAS_IF_USB_H
4 #include <linux/list.h>
6 /**
7 * This file contains definition for USB interface.
8 */
9 #define CMD_TYPE_REQUEST 0xF00DFACE
10 #define CMD_TYPE_DATA 0xBEADC0DE
11 #define CMD_TYPE_INDICATION 0xBEEFFACE
13 #define IPFIELD_ALIGN_OFFSET 2
15 #define BOOT_CMD_FW_BY_USB 0x01
16 #define BOOT_CMD_FW_IN_EEPROM 0x02
17 #define BOOT_CMD_UPDATE_BOOT2 0x03
18 #define BOOT_CMD_UPDATE_FW 0x04
19 #define BOOT_CMD_MAGIC_NUMBER 0x4C56524D /* M=>0x4D,R=>0x52,V=>0x56,L=>0x4C */
21 struct bootcmdstr
23 __le32 u32magicnumber;
24 u8 u8cmd_tag;
25 u8 au8dumy[11];
28 #define BOOT_CMD_RESP_OK 0x0001
29 #define BOOT_CMD_RESP_FAIL 0x0000
31 struct bootcmdrespStr
33 __le32 u32magicnumber;
34 u8 u8cmd_tag;
35 u8 u8result;
36 u8 au8dumy[2];
39 /* read callback private data */
40 struct read_cb_info {
41 struct usb_card_rec *cardp;
42 struct sk_buff *skb;
45 /** USB card description structure*/
46 struct usb_card_rec {
47 struct list_head list;
48 struct net_device *eth_dev;
49 struct usb_device *udev;
50 struct urb *rx_urb, *tx_urb;
51 void *priv;
52 struct read_cb_info rinfo;
54 int bulk_in_size;
55 u8 bulk_in_endpointAddr;
57 u8 *bulk_out_buffer;
58 int bulk_out_size;
59 u8 bulk_out_endpointAddr;
61 const struct firmware *fw;
62 u8 CRC_OK;
63 u32 fwseqnum;
64 u32 lastseqnum;
65 u32 totalbytes;
66 u32 fwlastblksent;
67 u8 fwdnldover;
68 u8 fwfinalblk;
69 u8 surprise_removed;
71 u32 usb_event_cause;
72 u8 usb_int_cause;
74 u8 rx_urb_recall;
76 u8 bootcmdresp;
79 /** fwheader */
80 struct fwheader {
81 __le32 dnldcmd;
82 __le32 baseaddr;
83 __le32 datalength;
84 __le32 CRC;
87 #define FW_MAX_DATA_BLK_SIZE 600
88 /** FWData */
89 struct FWData {
90 struct fwheader fwheader;
91 __le32 seqnum;
92 u8 data[FW_MAX_DATA_BLK_SIZE];
95 /** fwsyncheader */
96 struct fwsyncheader {
97 __le32 cmd;
98 __le32 seqnum;
101 #define FW_HAS_DATA_TO_RECV 0x00000001
102 #define FW_HAS_LAST_BLOCK 0x00000004
104 #define FW_DATA_XMIT_SIZE \
105 sizeof(struct fwheader) + le32_to_cpu(fwdata->fwheader.datalength) + sizeof(u32)
107 #endif