[ARM] pxa: Gumstix Verdex PCMCIA support
[linux-2.6/verdex.git] / drivers / net / wireless / libertas / if_usb.h
blob5ba0aee0eb2f7e6eac289583a990f51fc1daf2f6
1 #ifndef _LBS_IF_USB_H
2 #define _LBS_IF_USB_H
4 #include <linux/wait.h>
5 #include <linux/timer.h>
7 struct lbs_private;
9 /**
10 * This file contains definition for USB interface.
12 #define CMD_TYPE_REQUEST 0xF00DFACE
13 #define CMD_TYPE_DATA 0xBEADC0DE
14 #define CMD_TYPE_INDICATION 0xBEEFFACE
16 #define IPFIELD_ALIGN_OFFSET 2
18 #define BOOT_CMD_FW_BY_USB 0x01
19 #define BOOT_CMD_FW_IN_EEPROM 0x02
20 #define BOOT_CMD_UPDATE_BOOT2 0x03
21 #define BOOT_CMD_UPDATE_FW 0x04
22 #define BOOT_CMD_MAGIC_NUMBER 0x4C56524D /* LVRM */
24 struct bootcmd
26 __le32 magic;
27 uint8_t cmd;
28 uint8_t pad[11];
31 #define BOOT_CMD_RESP_OK 0x0001
32 #define BOOT_CMD_RESP_FAIL 0x0000
33 #define BOOT_CMD_RESP_NOT_SUPPORTED 0x0002
35 struct bootcmdresp
37 __le32 magic;
38 uint8_t cmd;
39 uint8_t result;
40 uint8_t pad[2];
43 /** USB card description structure*/
44 struct if_usb_card {
45 struct usb_device *udev;
46 struct urb *rx_urb, *tx_urb;
47 struct lbs_private *priv;
49 struct sk_buff *rx_skb;
51 uint8_t ep_in;
52 uint8_t ep_out;
54 /* bootcmdresp == 0 means command is pending
55 * bootcmdresp < 0 means error
56 * bootcmdresp > 0 is a BOOT_CMD_RESP_* from firmware
58 int8_t bootcmdresp;
60 int ep_in_size;
62 void *ep_out_buf;
63 int ep_out_size;
65 const struct firmware *fw;
66 struct timer_list fw_timeout;
67 wait_queue_head_t fw_wq;
68 uint32_t fwseqnum;
69 uint32_t totalbytes;
70 uint32_t fwlastblksent;
71 uint8_t CRC_OK;
72 uint8_t fwdnldover;
73 uint8_t fwfinalblk;
74 uint8_t surprise_removed;
76 __le16 boot2_version;
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 hdr;
91 __le32 seqnum;
92 uint8_t data[0];
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
105 #endif