Merge git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[wrt350n-kernel.git] / drivers / net / wireless / libertas / if_usb.h
blobe4829a391eb9be7ed39688eb1cc5e04eadd14168
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
34 struct bootcmdresp
36 __le32 magic;
37 uint8_t cmd;
38 uint8_t result;
39 uint8_t pad[2];
42 /** USB card description structure*/
43 struct if_usb_card {
44 struct usb_device *udev;
45 struct urb *rx_urb, *tx_urb;
46 struct lbs_private *priv;
48 struct sk_buff *rx_skb;
49 uint32_t usb_event_cause;
50 uint8_t usb_int_cause;
52 uint8_t ep_in;
53 uint8_t ep_out;
55 int8_t bootcmdresp;
57 int ep_in_size;
59 void *ep_out_buf;
60 int ep_out_size;
62 const struct firmware *fw;
63 struct timer_list fw_timeout;
64 wait_queue_head_t fw_wq;
65 uint32_t fwseqnum;
66 uint32_t totalbytes;
67 uint32_t fwlastblksent;
68 uint8_t CRC_OK;
69 uint8_t fwdnldover;
70 uint8_t fwfinalblk;
71 uint8_t surprise_removed;
73 __le16 boot2_version;
76 /** fwheader */
77 struct fwheader {
78 __le32 dnldcmd;
79 __le32 baseaddr;
80 __le32 datalength;
81 __le32 CRC;
84 #define FW_MAX_DATA_BLK_SIZE 600
85 /** FWData */
86 struct fwdata {
87 struct fwheader hdr;
88 __le32 seqnum;
89 uint8_t data[0];
92 /** fwsyncheader */
93 struct fwsyncheader {
94 __le32 cmd;
95 __le32 seqnum;
98 #define FW_HAS_DATA_TO_RECV 0x00000001
99 #define FW_HAS_LAST_BLOCK 0x00000004
102 #endif