rtl818x: merge tx/rx descriptor flags
[deliverable/linux.git] / drivers / net / wireless / libertas / if_usb.h
CommitLineData
10078321
HS
1#ifndef _LBS_IF_USB_H
2#define _LBS_IF_USB_H
435a1acb 3
4f82f5c8
DW
4#include <linux/wait.h>
5#include <linux/timer.h>
6
6bc822b5
DW
7struct lbs_private;
8
876c9d3a
MT
9/**
10 * This file contains definition for USB interface.
11 */
eae86bf3
DW
12#define CMD_TYPE_REQUEST 0xF00DFACE
13#define CMD_TYPE_DATA 0xBEADC0DE
14#define CMD_TYPE_INDICATION 0xBEEFFACE
876c9d3a 15
eae86bf3 16#define IPFIELD_ALIGN_OFFSET 2
876c9d3a 17
eae86bf3
DW
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 */
876c9d3a 23
eae86bf3 24struct bootcmd
876c9d3a 25{
eae86bf3
DW
26 __le32 magic;
27 uint8_t cmd;
28 uint8_t pad[11];
876c9d3a
MT
29};
30
eae86bf3
DW
31#define BOOT_CMD_RESP_OK 0x0001
32#define BOOT_CMD_RESP_FAIL 0x0000
876c9d3a 33
eae86bf3 34struct bootcmdresp
876c9d3a 35{
eae86bf3
DW
36 __le32 magic;
37 uint8_t cmd;
38 uint8_t result;
39 uint8_t pad[2];
876c9d3a
MT
40};
41
42/** USB card description structure*/
eae86bf3 43struct if_usb_card {
876c9d3a
MT
44 struct usb_device *udev;
45 struct urb *rx_urb, *tx_urb;
6bc822b5 46 struct lbs_private *priv;
876c9d3a 47
eae86bf3 48 struct sk_buff *rx_skb;
eae86bf3
DW
49
50 uint8_t ep_in;
51 uint8_t ep_out;
876c9d3a 52
eae86bf3
DW
53 int8_t bootcmdresp;
54
55 int ep_in_size;
56
57 void *ep_out_buf;
58 int ep_out_size;
876c9d3a 59
954ee164 60 const struct firmware *fw;
4f82f5c8
DW
61 struct timer_list fw_timeout;
62 wait_queue_head_t fw_wq;
eae86bf3
DW
63 uint32_t fwseqnum;
64 uint32_t totalbytes;
65 uint32_t fwlastblksent;
66 uint8_t CRC_OK;
67 uint8_t fwdnldover;
68 uint8_t fwfinalblk;
69 uint8_t surprise_removed;
70
4365929d 71 __le16 boot2_version;
876c9d3a
MT
72};
73
74/** fwheader */
75struct fwheader {
981f187b
DW
76 __le32 dnldcmd;
77 __le32 baseaddr;
78 __le32 datalength;
79 __le32 CRC;
876c9d3a
MT
80};
81
82#define FW_MAX_DATA_BLK_SIZE 600
83/** FWData */
eae86bf3
DW
84struct fwdata {
85 struct fwheader hdr;
981f187b 86 __le32 seqnum;
eae86bf3 87 uint8_t data[0];
876c9d3a
MT
88};
89
90/** fwsyncheader */
91struct fwsyncheader {
981f187b
DW
92 __le32 cmd;
93 __le32 seqnum;
876c9d3a
MT
94};
95
96#define FW_HAS_DATA_TO_RECV 0x00000001
97#define FW_HAS_LAST_BLOCK 0x00000004
98
876c9d3a 99
435a1acb 100#endif
This page took 0.425302 seconds and 5 git commands to generate.