diff options
author | David Woodhouse <dwmw2@infradead.org> | 2007-12-14 00:47:05 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:07:27 -0500 |
commit | eae86bf378de981696697426831bd9db68930740 (patch) | |
tree | 36ddcb42add91bb2f52ff57e1abe929129f413a6 /drivers/net/wireless/libertas/if_usb.h | |
parent | b926d6b31e2dd8f1bc21a9576aff0e486e21d32a (diff) |
libertas: clean up if_usb driver
It was just getting on my tits, really.
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/libertas/if_usb.h')
-rw-r--r-- | drivers/net/wireless/libertas/if_usb.h | 95 |
1 files changed, 44 insertions, 51 deletions
diff --git a/drivers/net/wireless/libertas/if_usb.h b/drivers/net/wireless/libertas/if_usb.h index 668410f82057..77066911230b 100644 --- a/drivers/net/wireless/libertas/if_usb.h +++ b/drivers/net/wireless/libertas/if_usb.h | |||
@@ -9,72 +9,67 @@ struct lbs_private; | |||
9 | /** | 9 | /** |
10 | * This file contains definition for USB interface. | 10 | * This file contains definition for USB interface. |
11 | */ | 11 | */ |
12 | #define CMD_TYPE_REQUEST 0xF00DFACE | 12 | #define CMD_TYPE_REQUEST 0xF00DFACE |
13 | #define CMD_TYPE_DATA 0xBEADC0DE | 13 | #define CMD_TYPE_DATA 0xBEADC0DE |
14 | #define CMD_TYPE_INDICATION 0xBEEFFACE | 14 | #define CMD_TYPE_INDICATION 0xBEEFFACE |
15 | 15 | ||
16 | #define IPFIELD_ALIGN_OFFSET 2 | 16 | #define IPFIELD_ALIGN_OFFSET 2 |
17 | 17 | ||
18 | #define BOOT_CMD_FW_BY_USB 0x01 | 18 | #define BOOT_CMD_FW_BY_USB 0x01 |
19 | #define BOOT_CMD_FW_IN_EEPROM 0x02 | 19 | #define BOOT_CMD_FW_IN_EEPROM 0x02 |
20 | #define BOOT_CMD_UPDATE_BOOT2 0x03 | 20 | #define BOOT_CMD_UPDATE_BOOT2 0x03 |
21 | #define BOOT_CMD_UPDATE_FW 0x04 | 21 | #define BOOT_CMD_UPDATE_FW 0x04 |
22 | #define BOOT_CMD_MAGIC_NUMBER 0x4C56524D /* M=>0x4D,R=>0x52,V=>0x56,L=>0x4C */ | 22 | #define BOOT_CMD_MAGIC_NUMBER 0x4C56524D /* LVRM */ |
23 | 23 | ||
24 | struct bootcmdstr | 24 | struct bootcmd |
25 | { | 25 | { |
26 | __le32 u32magicnumber; | 26 | __le32 magic; |
27 | u8 u8cmd_tag; | 27 | uint8_t cmd; |
28 | u8 au8dumy[11]; | 28 | uint8_t pad[11]; |
29 | }; | 29 | }; |
30 | 30 | ||
31 | #define BOOT_CMD_RESP_OK 0x0001 | 31 | #define BOOT_CMD_RESP_OK 0x0001 |
32 | #define BOOT_CMD_RESP_FAIL 0x0000 | 32 | #define BOOT_CMD_RESP_FAIL 0x0000 |
33 | 33 | ||
34 | struct bootcmdrespStr | 34 | struct bootcmdresp |
35 | { | 35 | { |
36 | __le32 u32magicnumber; | 36 | __le32 magic; |
37 | u8 u8cmd_tag; | 37 | uint8_t cmd; |
38 | u8 u8result; | 38 | uint8_t result; |
39 | u8 au8dumy[2]; | 39 | uint8_t pad[2]; |
40 | }; | ||
41 | |||
42 | /* read callback private data */ | ||
43 | struct read_cb_info { | ||
44 | struct usb_card_rec *cardp; | ||
45 | struct sk_buff *skb; | ||
46 | }; | 40 | }; |
47 | 41 | ||
48 | /** USB card description structure*/ | 42 | /** USB card description structure*/ |
49 | struct usb_card_rec { | 43 | struct if_usb_card { |
50 | struct usb_device *udev; | 44 | struct usb_device *udev; |
51 | struct urb *rx_urb, *tx_urb; | 45 | struct urb *rx_urb, *tx_urb; |
52 | struct lbs_private *priv; | 46 | struct lbs_private *priv; |
53 | struct read_cb_info rinfo; | ||
54 | 47 | ||
55 | int bulk_in_size; | 48 | struct sk_buff *rx_skb; |
56 | u8 bulk_in_endpointAddr; | 49 | uint32_t usb_event_cause; |
50 | uint8_t usb_int_cause; | ||
51 | |||
52 | uint8_t ep_in; | ||
53 | uint8_t ep_out; | ||
57 | 54 | ||
58 | u8 *bulk_out_buffer; | 55 | int8_t bootcmdresp; |
59 | int bulk_out_size; | 56 | |
60 | u8 bulk_out_endpointAddr; | 57 | int ep_in_size; |
58 | |||
59 | void *ep_out_buf; | ||
60 | int ep_out_size; | ||
61 | 61 | ||
62 | const struct firmware *fw; | 62 | const struct firmware *fw; |
63 | struct timer_list fw_timeout; | 63 | struct timer_list fw_timeout; |
64 | wait_queue_head_t fw_wq; | 64 | wait_queue_head_t fw_wq; |
65 | u8 CRC_OK; | 65 | uint32_t fwseqnum; |
66 | u32 fwseqnum; | 66 | uint32_t totalbytes; |
67 | u32 lastseqnum; | 67 | uint32_t fwlastblksent; |
68 | u32 totalbytes; | 68 | uint8_t CRC_OK; |
69 | u32 fwlastblksent; | 69 | uint8_t fwdnldover; |
70 | u8 fwdnldover; | 70 | uint8_t fwfinalblk; |
71 | u8 fwfinalblk; | 71 | uint8_t surprise_removed; |
72 | u8 surprise_removed; | 72 | |
73 | |||
74 | u32 usb_event_cause; | ||
75 | u8 usb_int_cause; | ||
76 | |||
77 | s8 bootcmdresp; | ||
78 | }; | 73 | }; |
79 | 74 | ||
80 | /** fwheader */ | 75 | /** fwheader */ |
@@ -87,10 +82,10 @@ struct fwheader { | |||
87 | 82 | ||
88 | #define FW_MAX_DATA_BLK_SIZE 600 | 83 | #define FW_MAX_DATA_BLK_SIZE 600 |
89 | /** FWData */ | 84 | /** FWData */ |
90 | struct FWData { | 85 | struct fwdata { |
91 | struct fwheader fwheader; | 86 | struct fwheader hdr; |
92 | __le32 seqnum; | 87 | __le32 seqnum; |
93 | u8 data[FW_MAX_DATA_BLK_SIZE]; | 88 | uint8_t data[0]; |
94 | }; | 89 | }; |
95 | 90 | ||
96 | /** fwsyncheader */ | 91 | /** fwsyncheader */ |
@@ -102,7 +97,5 @@ struct fwsyncheader { | |||
102 | #define FW_HAS_DATA_TO_RECV 0x00000001 | 97 | #define FW_HAS_DATA_TO_RECV 0x00000001 |
103 | #define FW_HAS_LAST_BLOCK 0x00000004 | 98 | #define FW_HAS_LAST_BLOCK 0x00000004 |
104 | 99 | ||
105 | #define FW_DATA_XMIT_SIZE \ | ||
106 | sizeof(struct fwheader) + le32_to_cpu(fwdata->fwheader.datalength) + sizeof(u32) | ||
107 | 100 | ||
108 | #endif | 101 | #endif |