diff options
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/hif_usb.h')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/hif_usb.h | 105 |
1 files changed, 105 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.h b/drivers/net/wireless/ath/ath9k/hif_usb.h new file mode 100644 index 00000000000..7cc3762a678 --- /dev/null +++ b/drivers/net/wireless/ath/ath9k/hif_usb.h | |||
@@ -0,0 +1,105 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2010 Atheros Communications Inc. | ||
3 | * | ||
4 | * Permission to use, copy, modify, and/or distribute this software for any | ||
5 | * purpose with or without fee is hereby granted, provided that the above | ||
6 | * copyright notice and this permission notice appear in all copies. | ||
7 | * | ||
8 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
9 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
10 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
11 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
12 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
13 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
14 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
15 | */ | ||
16 | |||
17 | #ifndef HTC_USB_H | ||
18 | #define HTC_USB_H | ||
19 | |||
20 | #define AR9271_FIRMWARE 0x501000 | ||
21 | #define AR9271_FIRMWARE_TEXT 0x903000 | ||
22 | |||
23 | #define FIRMWARE_DOWNLOAD 0x30 | ||
24 | #define FIRMWARE_DOWNLOAD_COMP 0x31 | ||
25 | |||
26 | #define ATH_USB_RX_STREAM_MODE_TAG 0x4e00 | ||
27 | #define ATH_USB_TX_STREAM_MODE_TAG 0x697e | ||
28 | |||
29 | /* FIXME: Verify these numbers (with Windows) */ | ||
30 | #define MAX_TX_URB_NUM 8 | ||
31 | #define MAX_TX_BUF_NUM 1024 | ||
32 | #define MAX_TX_BUF_SIZE 32768 | ||
33 | #define MAX_TX_AGGR_NUM 20 | ||
34 | |||
35 | #define MAX_RX_URB_NUM 8 | ||
36 | #define MAX_RX_BUF_SIZE 16384 | ||
37 | |||
38 | #define MAX_REG_OUT_URB_NUM 1 | ||
39 | #define MAX_REG_OUT_BUF_NUM 8 | ||
40 | |||
41 | #define MAX_REG_IN_BUF_SIZE 64 | ||
42 | |||
43 | /* USB Endpoint definition */ | ||
44 | #define USB_WLAN_TX_PIPE 1 | ||
45 | #define USB_WLAN_RX_PIPE 2 | ||
46 | #define USB_REG_IN_PIPE 3 | ||
47 | #define USB_REG_OUT_PIPE 4 | ||
48 | |||
49 | #define HIF_USB_MAX_RXPIPES 2 | ||
50 | #define HIF_USB_MAX_TXPIPES 4 | ||
51 | |||
52 | struct tx_buf { | ||
53 | u8 *buf; | ||
54 | u16 len; | ||
55 | u16 offset; | ||
56 | struct urb *urb; | ||
57 | struct sk_buff_head skb_queue; | ||
58 | struct hif_device_usb *hif_dev; | ||
59 | struct list_head list; | ||
60 | }; | ||
61 | |||
62 | #define HIF_USB_TX_STOP BIT(0) | ||
63 | #define HIF_USB_TX_FLUSH BIT(1) | ||
64 | |||
65 | struct hif_usb_tx { | ||
66 | u8 flags; | ||
67 | u8 tx_buf_cnt; | ||
68 | u16 tx_skb_cnt; | ||
69 | struct sk_buff_head tx_skb_queue; | ||
70 | struct list_head tx_buf; | ||
71 | struct list_head tx_pending; | ||
72 | spinlock_t tx_lock; | ||
73 | }; | ||
74 | |||
75 | struct cmd_buf { | ||
76 | struct sk_buff *skb; | ||
77 | struct hif_device_usb *hif_dev; | ||
78 | }; | ||
79 | |||
80 | #define HIF_USB_START BIT(0) | ||
81 | |||
82 | struct hif_device_usb { | ||
83 | u16 device_id; | ||
84 | struct usb_device *udev; | ||
85 | struct usb_interface *interface; | ||
86 | const struct firmware *firmware; | ||
87 | struct htc_target *htc_handle; | ||
88 | u8 flags; | ||
89 | |||
90 | struct hif_usb_tx tx; | ||
91 | |||
92 | struct urb *wlan_rx_data_urb[MAX_RX_URB_NUM]; | ||
93 | struct urb *reg_in_urb; | ||
94 | |||
95 | struct sk_buff *remain_skb; | ||
96 | int rx_remain_len; | ||
97 | int rx_pkt_len; | ||
98 | int rx_transfer_len; | ||
99 | int rx_pad_len; | ||
100 | }; | ||
101 | |||
102 | int ath9k_hif_usb_init(void); | ||
103 | void ath9k_hif_usb_exit(void); | ||
104 | |||
105 | #endif /* HTC_USB_H */ | ||