Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
if_usb.h
Go to the documentation of this file.
1 #ifndef _LBS_IF_USB_H
2 #define _LBS_IF_USB_H
3 
4 #include <linux/wait.h>
5 #include <linux/timer.h>
6 
7 struct lbs_private;
8 
9 /*
10  * This file contains definition for USB interface.
11  */
12 #define CMD_TYPE_REQUEST 0xF00DFACE
13 #define CMD_TYPE_DATA 0xBEADC0DE
14 #define CMD_TYPE_INDICATION 0xBEEFFACE
15 
16 #define IPFIELD_ALIGN_OFFSET 2
17 
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 */
23 
24 struct bootcmd
25 {
28  uint8_t pad[11];
29 };
30 
31 #define BOOT_CMD_RESP_OK 0x0001
32 #define BOOT_CMD_RESP_FAIL 0x0000
33 #define BOOT_CMD_RESP_NOT_SUPPORTED 0x0002
34 
36 {
41 };
42 
43 /* USB card description structure*/
44 struct if_usb_card {
45  struct usb_device *udev;
46  uint32_t model; /* MODEL_* */
47  struct urb *rx_urb, *tx_urb;
48  struct lbs_private *priv;
49 
50  struct sk_buff *rx_skb;
51 
54 
55  /* bootcmdresp == 0 means command is pending
56  * bootcmdresp < 0 means error
57  * bootcmdresp > 0 is a BOOT_CMD_RESP_* from firmware
58  */
60 
62 
63  void *ep_out_buf;
65 
66  const struct firmware *fw;
76 
78 };
79 
80 /* fwheader */
81 struct fwheader {
86 };
87 
88 #define FW_MAX_DATA_BLK_SIZE 600
89 /* FWData */
90 struct fwdata {
91  struct fwheader hdr;
94 };
95 
96 /* fwsyncheader */
97 struct fwsyncheader {
100 };
101 
102 #define FW_HAS_DATA_TO_RECV 0x00000001
103 #define FW_HAS_LAST_BLOCK 0x00000004
104 
105 
106 #endif