提交 eae86bf3 编写于 作者: D David Woodhouse 提交者: David S. Miller

libertas: clean up if_usb driver

It was just getting on my tits, really.
Signed-off-by: NDavid Woodhouse <dwmw2@infradead.org>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 b926d6b3
...@@ -9,72 +9,67 @@ struct lbs_private; ...@@ -9,72 +9,67 @@ struct lbs_private;
/** /**
* This file contains definition for USB interface. * This file contains definition for USB interface.
*/ */
#define CMD_TYPE_REQUEST 0xF00DFACE #define CMD_TYPE_REQUEST 0xF00DFACE
#define CMD_TYPE_DATA 0xBEADC0DE #define CMD_TYPE_DATA 0xBEADC0DE
#define CMD_TYPE_INDICATION 0xBEEFFACE #define CMD_TYPE_INDICATION 0xBEEFFACE
#define IPFIELD_ALIGN_OFFSET 2 #define IPFIELD_ALIGN_OFFSET 2
#define BOOT_CMD_FW_BY_USB 0x01 #define BOOT_CMD_FW_BY_USB 0x01
#define BOOT_CMD_FW_IN_EEPROM 0x02 #define BOOT_CMD_FW_IN_EEPROM 0x02
#define BOOT_CMD_UPDATE_BOOT2 0x03 #define BOOT_CMD_UPDATE_BOOT2 0x03
#define BOOT_CMD_UPDATE_FW 0x04 #define BOOT_CMD_UPDATE_FW 0x04
#define BOOT_CMD_MAGIC_NUMBER 0x4C56524D /* M=>0x4D,R=>0x52,V=>0x56,L=>0x4C */ #define BOOT_CMD_MAGIC_NUMBER 0x4C56524D /* LVRM */
struct bootcmdstr struct bootcmd
{ {
__le32 u32magicnumber; __le32 magic;
u8 u8cmd_tag; uint8_t cmd;
u8 au8dumy[11]; uint8_t pad[11];
}; };
#define BOOT_CMD_RESP_OK 0x0001 #define BOOT_CMD_RESP_OK 0x0001
#define BOOT_CMD_RESP_FAIL 0x0000 #define BOOT_CMD_RESP_FAIL 0x0000
struct bootcmdrespStr struct bootcmdresp
{ {
__le32 u32magicnumber; __le32 magic;
u8 u8cmd_tag; uint8_t cmd;
u8 u8result; uint8_t result;
u8 au8dumy[2]; uint8_t pad[2];
};
/* read callback private data */
struct read_cb_info {
struct usb_card_rec *cardp;
struct sk_buff *skb;
}; };
/** USB card description structure*/ /** USB card description structure*/
struct usb_card_rec { struct if_usb_card {
struct usb_device *udev; struct usb_device *udev;
struct urb *rx_urb, *tx_urb; struct urb *rx_urb, *tx_urb;
struct lbs_private *priv; struct lbs_private *priv;
struct read_cb_info rinfo;
int bulk_in_size; struct sk_buff *rx_skb;
u8 bulk_in_endpointAddr; uint32_t usb_event_cause;
uint8_t usb_int_cause;
uint8_t ep_in;
uint8_t ep_out;
u8 *bulk_out_buffer; int8_t bootcmdresp;
int bulk_out_size;
u8 bulk_out_endpointAddr; int ep_in_size;
void *ep_out_buf;
int ep_out_size;
const struct firmware *fw; const struct firmware *fw;
struct timer_list fw_timeout; struct timer_list fw_timeout;
wait_queue_head_t fw_wq; wait_queue_head_t fw_wq;
u8 CRC_OK; uint32_t fwseqnum;
u32 fwseqnum; uint32_t totalbytes;
u32 lastseqnum; uint32_t fwlastblksent;
u32 totalbytes; uint8_t CRC_OK;
u32 fwlastblksent; uint8_t fwdnldover;
u8 fwdnldover; uint8_t fwfinalblk;
u8 fwfinalblk; uint8_t surprise_removed;
u8 surprise_removed;
u32 usb_event_cause;
u8 usb_int_cause;
s8 bootcmdresp;
}; };
/** fwheader */ /** fwheader */
...@@ -87,10 +82,10 @@ struct fwheader { ...@@ -87,10 +82,10 @@ struct fwheader {
#define FW_MAX_DATA_BLK_SIZE 600 #define FW_MAX_DATA_BLK_SIZE 600
/** FWData */ /** FWData */
struct FWData { struct fwdata {
struct fwheader fwheader; struct fwheader hdr;
__le32 seqnum; __le32 seqnum;
u8 data[FW_MAX_DATA_BLK_SIZE]; uint8_t data[0];
}; };
/** fwsyncheader */ /** fwsyncheader */
...@@ -102,7 +97,5 @@ struct fwsyncheader { ...@@ -102,7 +97,5 @@ struct fwsyncheader {
#define FW_HAS_DATA_TO_RECV 0x00000001 #define FW_HAS_DATA_TO_RECV 0x00000001
#define FW_HAS_LAST_BLOCK 0x00000004 #define FW_HAS_LAST_BLOCK 0x00000004
#define FW_DATA_XMIT_SIZE \
sizeof(struct fwheader) + le32_to_cpu(fwdata->fwheader.datalength) + sizeof(u32)
#endif #endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册