]> git.kernelconcepts.de Git - karo-tx-linux.git/blob - drivers/net/wireless/mwifiex/usb.h
4c41c2a193c553106f61010574a0e656c49cfc2f
[karo-tx-linux.git] / drivers / net / wireless / mwifiex / usb.h
1 /*
2  * This file contains definitions for mwifiex USB interface driver.
3  *
4  * Copyright (C) 2012-2014, Marvell International Ltd.
5  *
6  * This software file (the "File") is distributed by Marvell International
7  * Ltd. under the terms of the GNU General Public License Version 2, June 1991
8  * (the "License").  You may use, redistribute and/or modify this File in
9  * accordance with the terms and conditions of the License, a copy of which
10  * is available by writing to the Free Software Foundation, Inc.,
11  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
12  * worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
13  *
14  * THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
15  * IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
16  * ARE EXPRESSLY DISCLAIMED.  The License provides additional details about
17  * this warranty disclaimer.
18  */
19
20 #ifndef _MWIFIEX_USB_H
21 #define _MWIFIEX_USB_H
22
23 #include <linux/usb.h>
24
25 #define USB8XXX_VID             0x1286
26
27 #define USB8797_PID_1           0x2043
28 #define USB8797_PID_2           0x2044
29 #define USB8897_PID_1           0x2045
30 #define USB8897_PID_2           0x2046
31
32 #define USB8XXX_FW_DNLD         1
33 #define USB8XXX_FW_READY        2
34 #define USB8XXX_FW_MAX_RETRY    3
35
36 #define MWIFIEX_TX_DATA_URB     6
37 #define MWIFIEX_RX_DATA_URB     6
38 #define MWIFIEX_USB_TIMEOUT     100
39
40 #define USB8797_DEFAULT_FW_NAME "mrvl/usb8797_uapsta.bin"
41 #define USB8897_DEFAULT_FW_NAME "mrvl/usb8897_uapsta.bin"
42
43 #define FW_DNLD_TX_BUF_SIZE     620
44 #define FW_DNLD_RX_BUF_SIZE     2048
45 #define FW_HAS_LAST_BLOCK       0x00000004
46
47 #define FW_DATA_XMIT_SIZE \
48         (sizeof(struct fw_header) + dlen + sizeof(u32))
49
50 struct urb_context {
51         struct mwifiex_adapter *adapter;
52         struct sk_buff *skb;
53         struct urb *urb;
54         u8 ep;
55 };
56
57 struct usb_card_rec {
58         struct mwifiex_adapter *adapter;
59         struct usb_device *udev;
60         struct usb_interface *intf;
61         u8 rx_cmd_ep;
62         struct urb_context rx_cmd;
63         atomic_t rx_cmd_urb_pending;
64         struct urb_context rx_data_list[MWIFIEX_RX_DATA_URB];
65         u8 usb_boot_state;
66         u8 rx_data_ep;
67         atomic_t rx_data_urb_pending;
68         u8 tx_data_ep;
69         u8 tx_cmd_ep;
70         atomic_t tx_data_urb_pending;
71         atomic_t tx_cmd_urb_pending;
72         int bulk_out_maxpktsize;
73         struct urb_context tx_cmd;
74         int tx_data_ix;
75         struct urb_context tx_data_list[MWIFIEX_TX_DATA_URB];
76 };
77
78 struct fw_header {
79         __le32 dnld_cmd;
80         __le32 base_addr;
81         __le32 data_len;
82         __le32 crc;
83 };
84
85 struct fw_sync_header {
86         __le32 cmd;
87         __le32 seq_num;
88 };
89
90 struct fw_data {
91         struct fw_header fw_hdr;
92         __le32 seq_num;
93         u8 data[1];
94 };
95
96 /* This function is called after the card has woken up. */
97 static inline int
98 mwifiex_pm_wakeup_card_complete(struct mwifiex_adapter *adapter)
99 {
100         return 0;
101 }
102
103 #endif /*_MWIFIEX_USB_H */