]>
Commit | Line | Data |
---|---|---|
fb9987d0 S |
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 | |
b1762862 | 22 | #define AR7010_FIRMWARE_TEXT 0x906000 |
fb9987d0 S |
23 | |
24 | #define FIRMWARE_DOWNLOAD 0x30 | |
25 | #define FIRMWARE_DOWNLOAD_COMP 0x31 | |
26 | ||
27 | #define ATH_USB_RX_STREAM_MODE_TAG 0x4e00 | |
28 | #define ATH_USB_TX_STREAM_MODE_TAG 0x697e | |
29 | ||
30 | /* FIXME: Verify these numbers (with Windows) */ | |
31 | #define MAX_TX_URB_NUM 8 | |
32 | #define MAX_TX_BUF_NUM 1024 | |
33 | #define MAX_TX_BUF_SIZE 32768 | |
34 | #define MAX_TX_AGGR_NUM 20 | |
35 | ||
36 | #define MAX_RX_URB_NUM 8 | |
37 | #define MAX_RX_BUF_SIZE 16384 | |
c503269a | 38 | #define MAX_PKT_NUM_IN_TRANSFER 10 |
fb9987d0 S |
39 | |
40 | #define MAX_REG_OUT_URB_NUM 1 | |
41 | #define MAX_REG_OUT_BUF_NUM 8 | |
42 | ||
43 | #define MAX_REG_IN_BUF_SIZE 64 | |
44 | ||
45 | /* USB Endpoint definition */ | |
46 | #define USB_WLAN_TX_PIPE 1 | |
47 | #define USB_WLAN_RX_PIPE 2 | |
48 | #define USB_REG_IN_PIPE 3 | |
49 | #define USB_REG_OUT_PIPE 4 | |
50 | ||
51 | #define HIF_USB_MAX_RXPIPES 2 | |
52 | #define HIF_USB_MAX_TXPIPES 4 | |
53 | ||
54 | struct tx_buf { | |
55 | u8 *buf; | |
56 | u16 len; | |
57 | u16 offset; | |
58 | struct urb *urb; | |
59 | struct sk_buff_head skb_queue; | |
60 | struct hif_device_usb *hif_dev; | |
61 | struct list_head list; | |
62 | }; | |
63 | ||
64 | #define HIF_USB_TX_STOP BIT(0) | |
fb9987d0 S |
65 | |
66 | struct hif_usb_tx { | |
67 | u8 flags; | |
68 | u8 tx_buf_cnt; | |
69 | u16 tx_skb_cnt; | |
70 | struct sk_buff_head tx_skb_queue; | |
71 | struct list_head tx_buf; | |
72 | struct list_head tx_pending; | |
73 | spinlock_t tx_lock; | |
74 | }; | |
75 | ||
76 | struct cmd_buf { | |
77 | struct sk_buff *skb; | |
78 | struct hif_device_usb *hif_dev; | |
79 | }; | |
80 | ||
81 | #define HIF_USB_START BIT(0) | |
82 | ||
83 | struct hif_device_usb { | |
84 | u16 device_id; | |
85 | struct usb_device *udev; | |
86 | struct usb_interface *interface; | |
87 | const struct firmware *firmware; | |
88 | struct htc_target *htc_handle; | |
fb9987d0 | 89 | struct hif_usb_tx tx; |
fb9987d0 | 90 | struct urb *reg_in_urb; |
6f0f2669 | 91 | struct usb_anchor regout_submitted; |
6335ed0f | 92 | struct usb_anchor rx_submitted; |
fb9987d0 | 93 | struct sk_buff *remain_skb; |
ce43cee5 | 94 | const char *fw_name; |
fb9987d0 S |
95 | int rx_remain_len; |
96 | int rx_pkt_len; | |
97 | int rx_transfer_len; | |
98 | int rx_pad_len; | |
46baa1a2 | 99 | spinlock_t rx_lock; |
6335ed0f | 100 | u8 flags; /* HIF_USB_* */ |
fb9987d0 S |
101 | }; |
102 | ||
103 | int ath9k_hif_usb_init(void); | |
104 | void ath9k_hif_usb_exit(void); | |
105 | ||
106 | #endif /* HTC_USB_H */ |