OLD | NEW |
1 /* | 1 //------------------------------------------------------------------------------ |
2 * | 2 // Copyright (c) 2004-2010 Atheros Communications Inc. |
3 * Copyright (c) 2004-2010 Atheros Communications Inc. | 3 // All rights reserved. |
4 * All rights reserved. | |
5 * | |
6 * | |
7 // This program is free software; you can redistribute it and/or modify | |
8 // it under the terms of the GNU General Public License version 2 as | |
9 // published by the Free Software Foundation; | |
10 // | 4 // |
11 // Software distributed under the License is distributed on an "AS | 5 // |
12 // IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or | 6 // |
13 // implied. See the License for the specific language governing | 7 // Permission to use, copy, modify, and/or distribute this software for any |
14 // rights and limitations under the License. | 8 // purpose with or without fee is hereby granted, provided that the above |
| 9 // copyright notice and this permission notice appear in all copies. |
| 10 // |
| 11 // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
| 12 // WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
| 13 // MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
| 14 // ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
| 15 // WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
| 16 // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
| 17 // OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
15 // | 18 // |
16 // | 19 // |
17 * | 20 // |
18 */ | 21 // Author(s): ="Atheros" |
| 22 //------------------------------------------------------------------------------ |
19 | 23 |
20 #ifndef _AR6000_H_ | 24 #ifndef _AR6000_H_ |
21 #define _AR6000_H_ | 25 #define _AR6000_H_ |
22 | 26 |
23 #include <linux/version.h> | |
24 | |
25 | |
26 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17) | |
27 #include <linux/config.h> | |
28 #elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33) | |
29 #include <linux/autoconf.h> | |
30 #else | |
31 #include <generated/autoconf.h> | |
32 #endif | |
33 #include <linux/init.h> | 27 #include <linux/init.h> |
34 #include <linux/kernel.h> | |
35 #include <linux/sched.h> | 28 #include <linux/sched.h> |
36 #include <linux/spinlock.h> | 29 #include <linux/spinlock.h> |
37 #include <linux/skbuff.h> | |
38 #include <linux/if_ether.h> | 30 #include <linux/if_ether.h> |
39 #include <linux/netdevice.h> | |
40 #include <linux/etherdevice.h> | 31 #include <linux/etherdevice.h> |
41 #include <net/iw_handler.h> | 32 #include <net/iw_handler.h> |
42 #include <linux/if_arp.h> | 33 #include <linux/if_arp.h> |
43 #include <linux/ip.h> | 34 #include <linux/ip.h> |
44 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26) | |
45 #include <asm/semaphore.h> | |
46 #else | |
47 #include <linux/semaphore.h> | |
48 #endif | |
49 #include <linux/wireless.h> | 35 #include <linux/wireless.h> |
50 #ifdef ATH6K_CONFIG_CFG80211 | 36 #ifdef ATH6K_CONFIG_CFG80211 |
51 #include <net/cfg80211.h> | 37 #include <net/cfg80211.h> |
52 #endif /* ATH6K_CONFIG_CFG80211 */ | 38 #endif /* ATH6K_CONFIG_CFG80211 */ |
53 #include <linux/module.h> | 39 #include <linux/module.h> |
54 #include <asm/io.h> | 40 #include <asm/io.h> |
55 | 41 |
56 #include <a_config.h> | 42 #include <a_config.h> |
57 #include <athdefs.h> | 43 #include <athdefs.h> |
58 #include "a_types.h" | 44 #include "a_types.h" |
59 #include "a_osapi.h" | 45 #include "a_osapi.h" |
60 #include "htc_api.h" | 46 #include "htc_api.h" |
61 #include "wmi.h" | 47 #include "wmi.h" |
62 #include "a_drv.h" | 48 #include "a_drv.h" |
63 #include "bmi.h" | 49 #include "bmi.h" |
64 #include <ieee80211.h> | 50 #include <ieee80211.h> |
65 #include <ieee80211_ioctl.h> | 51 #include <ieee80211_ioctl.h> |
66 #include <wlan_api.h> | 52 #include <wlan_api.h> |
67 #include <wmi_api.h> | 53 #include <wmi_api.h> |
68 #include "gpio_api.h" | 54 #include "gpio_api.h" |
69 #include "gpio.h" | 55 #include "gpio.h" |
70 #include "pkt_log.h" | 56 #include "pkt_log.h" |
71 #include "aggr_recv_api.h" | 57 #include "aggr_recv_api.h" |
72 #include <host_version.h> | 58 #include <host_version.h> |
73 #include <linux/rtnetlink.h> | 59 #include <linux/rtnetlink.h> |
74 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) | |
75 #include <asm/uaccess.h> | |
76 #else | |
77 #include <linux/init.h> | 60 #include <linux/init.h> |
78 #include <linux/moduleparam.h> | 61 #include <linux/moduleparam.h> |
79 #endif | |
80 #include "ar6000_api.h" | 62 #include "ar6000_api.h" |
81 #ifdef CONFIG_HOST_TCMD_SUPPORT | 63 #ifdef CONFIG_HOST_TCMD_SUPPORT |
82 #include <testcmd.h> | 64 #include <testcmd.h> |
83 #endif | 65 #endif |
84 #include <linux/firmware.h> | 66 #include <linux/firmware.h> |
85 | 67 |
86 #include "targaddrs.h" | 68 #include "targaddrs.h" |
87 #include "dbglog_api.h" | 69 #include "dbglog_api.h" |
88 #include "ar6000_diag.h" | 70 #include "ar6000_diag.h" |
89 #include "common_drv.h" | 71 #include "common_drv.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 #define AR6000_MAX_AMSDU_RX_BUFFERS 4 | 134 #define AR6000_MAX_AMSDU_RX_BUFFERS 4 |
153 #define AR6000_AMSDU_REFILL_THRESHOLD 3 | 135 #define AR6000_AMSDU_REFILL_THRESHOLD 3 |
154 #define AR6000_AMSDU_BUFFER_SIZE (WMI_MAX_AMSDU_RX_DATA_FRAME_LENGTH +
128) | 136 #define AR6000_AMSDU_BUFFER_SIZE (WMI_MAX_AMSDU_RX_DATA_FRAME_LENGTH +
128) |
155 #define AR6000_MAX_RX_MESSAGE_SIZE (max(WMI_MAX_NORMAL_RX_DATA_FRAME_LENG
TH,WMI_MAX_AMSDU_RX_DATA_FRAME_LENGTH)) | 137 #define AR6000_MAX_RX_MESSAGE_SIZE (max(WMI_MAX_NORMAL_RX_DATA_FRAME_LENG
TH,WMI_MAX_AMSDU_RX_DATA_FRAME_LENGTH)) |
156 | 138 |
157 #define AR6000_TX_TIMEOUT 10 | 139 #define AR6000_TX_TIMEOUT 10 |
158 #define AR6000_ETH_ADDR_LEN 6 | 140 #define AR6000_ETH_ADDR_LEN 6 |
159 #define AR6000_MAX_ENDPOINTS 4 | 141 #define AR6000_MAX_ENDPOINTS 4 |
160 #define MAX_NODE_NUM 15 | 142 #define MAX_NODE_NUM 15 |
161 /* MAX_HI_COOKIE_NUM are reserved for high priority traffic */ | 143 /* MAX_HI_COOKIE_NUM are reserved for high priority traffic */ |
162 #define MAX_DEF_COOKIE_NUM 150 | 144 #define MAX_DEF_COOKIE_NUM 180 |
163 #define MAX_HI_COOKIE_NUM 15 /* 10% of MAX_COOKIE_NUM */ | 145 #define MAX_HI_COOKIE_NUM 18 /* 10% of MAX_COOKIE_NUM */ |
164 #define MAX_COOKIE_NUM (MAX_DEF_COOKIE_NUM + MAX_HI_COOKIE_NU
M) | 146 #define MAX_COOKIE_NUM (MAX_DEF_COOKIE_NUM + MAX_HI_COOKIE_NU
M) |
165 | 147 |
166 /* MAX_DEFAULT_SEND_QUEUE_DEPTH is used to set the default queue depth for the | 148 /* MAX_DEFAULT_SEND_QUEUE_DEPTH is used to set the default queue depth for the |
167 * WMM send queues. If a queue exceeds this depth htc will query back to the | 149 * WMM send queues. If a queue exceeds this depth htc will query back to the |
168 * OS specific layer by calling EpSendFull(). This gives the OS layer the | 150 * OS specific layer by calling EpSendFull(). This gives the OS layer the |
169 * opportunity to drop the packet if desired. Therefore changing | 151 * opportunity to drop the packet if desired. Therefore changing |
170 * MAX_DEFAULT_SEND_QUEUE_DEPTH does not affect resource utilization but | 152 * MAX_DEFAULT_SEND_QUEUE_DEPTH does not affect resource utilization but |
171 * does impact the threshold used to identify if a packet should be | 153 * does impact the threshold used to identify if a packet should be |
172 * dropped. */ | 154 * dropped. */ |
173 #define MAX_DEFAULT_SEND_QUEUE_DEPTH (MAX_DEF_COOKIE_NUM / WMM_NUM_AC) | 155 #define MAX_DEFAULT_SEND_QUEUE_DEPTH (MAX_DEF_COOKIE_NUM / WMM_NUM_AC) |
174 | 156 |
175 #define AR6000_HB_CHALLENGE_RESP_FREQ_DEFAULT 1 | 157 #define AR6000_HB_CHALLENGE_RESP_FREQ_DEFAULT 1 |
176 #define AR6000_HB_CHALLENGE_RESP_MISS_THRES_DEFAULT 1 | 158 #define AR6000_HB_CHALLENGE_RESP_MISS_THRES_DEFAULT 1 |
177 #define A_DISCONNECT_TIMER_INTERVAL 10 * 1000 | 159 #define A_DISCONNECT_TIMER_INTERVAL 10 * 1000 |
178 #define A_DEFAULT_LISTEN_INTERVAL 100 | 160 #define A_DEFAULT_LISTEN_INTERVAL 100 |
179 #define A_MAX_WOW_LISTEN_INTERVAL 1000 | 161 #define A_MAX_WOW_LISTEN_INTERVAL 1000 |
180 | 162 |
181 enum { | 163 enum { |
182 DRV_HB_CHALLENGE = 0, | 164 DRV_HB_CHALLENGE = 0, |
183 APP_HB_CHALLENGE | 165 APP_HB_CHALLENGE |
184 }; | 166 }; |
185 | 167 |
186 enum { | 168 enum { |
187 WLAN_INIT_MODE_NONE = 0, | 169 WLAN_INIT_MODE_NONE = 0, |
188 WLAN_INIT_MODE_USR, | 170 WLAN_INIT_MODE_USR, |
189 WLAN_INIT_MODE_UDEV, | 171 WLAN_INIT_MODE_UDEV, |
190 WLAN_INIT_MODE_DRV | 172 WLAN_INIT_MODE_DRV |
191 }; | 173 }; |
192 | 174 |
| 175 /* Suspend - configuration */ |
| 176 enum { |
| 177 WLAN_SUSPEND_CUT_PWR = 0, |
| 178 WLAN_SUSPEND_DEEP_SLEEP, |
| 179 WLAN_SUSPEND_WOW, |
| 180 WLAN_SUSPEND_CUT_PWR_IF_BT_OFF |
| 181 }; |
| 182 |
| 183 /* WiFi OFF - configuration */ |
| 184 enum { |
| 185 WLAN_OFF_CUT_PWR = 0, |
| 186 WLAN_OFF_DEEP_SLEEP, |
| 187 }; |
| 188 |
| 189 /* WLAN low power state */ |
| 190 enum { |
| 191 WLAN_POWER_STATE_ON = 0, |
| 192 WLAN_POWER_STATE_CUT_PWR = 1, |
| 193 WLAN_POWER_STATE_DEEP_SLEEP, |
| 194 WLAN_POWER_STATE_WOW |
| 195 }; |
| 196 |
| 197 /* WLAN WoW State */ |
| 198 enum { |
| 199 WLAN_WOW_STATE_NONE = 0, |
| 200 WLAN_WOW_STATE_SUSPENDED, |
| 201 WLAN_WOW_STATE_SUSPENDING |
| 202 }; |
| 203 |
| 204 |
193 typedef enum _AR6K_BIN_FILE { | 205 typedef enum _AR6K_BIN_FILE { |
194 AR6K_OTP_FILE, | 206 AR6K_OTP_FILE, |
195 AR6K_FIRMWARE_FILE, | 207 AR6K_FIRMWARE_FILE, |
196 AR6K_PATCH_FILE, | 208 AR6K_PATCH_FILE, |
197 AR6K_BOARD_DATA_FILE, | 209 AR6K_BOARD_DATA_FILE, |
198 } AR6K_BIN_FILE; | 210 } AR6K_BIN_FILE; |
199 | 211 |
200 #ifdef SETUPHCI_ENABLED | 212 #ifdef SETUPHCI_ENABLED |
201 #define SETUPHCI_DEFAULT 1 | 213 #define SETUPHCI_DEFAULT 1 |
202 #else | 214 #else |
203 #define SETUPHCI_DEFAULT 0 | 215 #define SETUPHCI_DEFAULT 0 |
204 #endif /* SETUPHCI_ENABLED */ | 216 #endif /* SETUPHCI_ENABLED */ |
205 | 217 |
| 218 #ifdef SETUPHCIPAL_ENABLED |
| 219 #define SETUPHCIPAL_DEFAULT 1 |
| 220 #else |
| 221 #define SETUPHCIPAL_DEFAULT 0 |
| 222 #endif /* SETUPHCIPAL_ENABLED */ |
| 223 |
206 #ifdef SETUPBTDEV_ENABLED | 224 #ifdef SETUPBTDEV_ENABLED |
207 #define SETUPBTDEV_DEFAULT 1 | 225 #define SETUPBTDEV_DEFAULT 1 |
208 #else | 226 #else |
209 #define SETUPBTDEV_DEFAULT 0 | 227 #define SETUPBTDEV_DEFAULT 0 |
210 #endif /* SETUPBTDEV_ENABLED */ | 228 #endif /* SETUPBTDEV_ENABLED */ |
211 | 229 |
212 #ifdef BMIENABLE_SET | 230 #ifdef BMIENABLE_SET |
213 #define BMIENABLE_DEFAULT 1 | 231 #define BMIENABLE_DEFAULT 1 |
214 #else | 232 #else |
215 #define BMIENABLE_DEFAULT 0 | 233 #define BMIENABLE_DEFAULT 0 |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 #ifdef AR600x_SD31_XXX | 327 #ifdef AR600x_SD31_XXX |
310 #define AR6003_REV2_BOARD_DATA_FILE "ath6k/AR6003/hw2.0/bdata.SD31.bin" | 328 #define AR6003_REV2_BOARD_DATA_FILE "ath6k/AR6003/hw2.0/bdata.SD31.bin" |
311 #elif defined(AR600x_SD32_XXX) | 329 #elif defined(AR600x_SD32_XXX) |
312 #define AR6003_REV2_BOARD_DATA_FILE "ath6k/AR6003/hw2.0/bdata.SD32.bin" | 330 #define AR6003_REV2_BOARD_DATA_FILE "ath6k/AR6003/hw2.0/bdata.SD32.bin" |
313 #elif defined(AR600x_WB31_XXX) | 331 #elif defined(AR600x_WB31_XXX) |
314 #define AR6003_REV2_BOARD_DATA_FILE "ath6k/AR6003/hw2.0/bdata.WB31.bin" | 332 #define AR6003_REV2_BOARD_DATA_FILE "ath6k/AR6003/hw2.0/bdata.WB31.bin" |
315 #else | 333 #else |
316 #define AR6003_REV2_BOARD_DATA_FILE "ath6k/AR6003/hw2.0/bdata.CUSTOM.bin
" | 334 #define AR6003_REV2_BOARD_DATA_FILE "ath6k/AR6003/hw2.0/bdata.CUSTOM.bin
" |
317 #endif /* Board Data File */ | 335 #endif /* Board Data File */ |
318 | 336 |
| 337 /* Power states */ |
| 338 enum { |
| 339 WLAN_PWR_CTRL_UP = 0, |
| 340 WLAN_PWR_CTRL_CUT_PWR, |
| 341 WLAN_PWR_CTRL_DEEP_SLEEP, |
| 342 WLAN_PWR_CTRL_WOW, |
| 343 WLAN_PWR_CTRL_DEEP_SLEEP_DISABLED |
| 344 }; |
| 345 |
319 /* HTC RAW streams */ | 346 /* HTC RAW streams */ |
320 typedef enum _HTC_RAW_STREAM_ID { | 347 typedef enum _HTC_RAW_STREAM_ID { |
321 HTC_RAW_STREAM_NOT_MAPPED = -1, | 348 HTC_RAW_STREAM_NOT_MAPPED = -1, |
322 HTC_RAW_STREAM_0 = 0, | 349 HTC_RAW_STREAM_0 = 0, |
323 HTC_RAW_STREAM_1 = 1, | 350 HTC_RAW_STREAM_1 = 1, |
324 HTC_RAW_STREAM_2 = 2, | 351 HTC_RAW_STREAM_2 = 2, |
325 HTC_RAW_STREAM_3 = 3, | 352 HTC_RAW_STREAM_3 = 3, |
326 HTC_RAW_STREAM_NUM_MAX | 353 HTC_RAW_STREAM_NUM_MAX |
327 } HTC_RAW_STREAM_ID; | 354 } HTC_RAW_STREAM_ID; |
328 | 355 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 #endif /* ATH6K_CONFIG_CFG80211 */ | 396 #endif /* ATH6K_CONFIG_CFG80211 */ |
370 | 397 |
371 | 398 |
372 struct ar_node_mapping { | 399 struct ar_node_mapping { |
373 A_UINT8 macAddress[6]; | 400 A_UINT8 macAddress[6]; |
374 A_UINT8 epId; | 401 A_UINT8 epId; |
375 A_UINT8 txPending; | 402 A_UINT8 txPending; |
376 }; | 403 }; |
377 | 404 |
378 struct ar_cookie { | 405 struct ar_cookie { |
379 A_UINT32 arc_bp[2]; /* Must be first field */ | 406 unsigned long arc_bp[2]; /* Must be first field */ |
380 HTC_PACKET HtcPkt; /* HTC packet wrapper */ | 407 HTC_PACKET HtcPkt; /* HTC packet wrapper */ |
381 struct ar_cookie *arc_list_next; | 408 struct ar_cookie *arc_list_next; |
382 }; | 409 }; |
383 | 410 |
384 struct ar_hb_chlng_resp { | 411 struct ar_hb_chlng_resp { |
385 A_TIMER timer; | 412 A_TIMER timer; |
386 A_UINT32 frequency; | 413 A_UINT32 frequency; |
387 A_UINT32 seqNum; | 414 A_UINT32 seqNum; |
388 A_BOOL outstanding; | 415 A_BOOL outstanding; |
389 A_UINT8 missCnt; | 416 A_UINT8 missCnt; |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
537 A_UINT8 sta_list_index; /* AP mode */ | 564 A_UINT8 sta_list_index; /* AP mode */ |
538 struct ieee80211req_key ap_mode_bkey; /* AP mode */ | 565 struct ieee80211req_key ap_mode_bkey; /* AP mode */ |
539 A_NETBUF_QUEUE_T mcastpsq; /* power save q for Mcast frames */ | 566 A_NETBUF_QUEUE_T mcastpsq; /* power save q for Mcast frames */ |
540 A_MUTEX_T mcastpsqLock; | 567 A_MUTEX_T mcastpsqLock; |
541 A_BOOL DTIMExpired; /* flag to indicate DTIM expired */ | 568 A_BOOL DTIMExpired; /* flag to indicate DTIM expired */ |
542 A_UINT8 intra_bss; /* enable/disable intra bss data forwar
d */ | 569 A_UINT8 intra_bss; /* enable/disable intra bss data forwar
d */ |
543 void *aggr_cntxt; | 570 void *aggr_cntxt; |
544 #ifndef EXPORT_HCI_BRIDGE_INTERFACE | 571 #ifndef EXPORT_HCI_BRIDGE_INTERFACE |
545 void *hcidev_info; | 572 void *hcidev_info; |
546 #endif | 573 #endif |
| 574 void *hcipal_info; |
547 WMI_AP_MODE_STAT arAPStats; | 575 WMI_AP_MODE_STAT arAPStats; |
548 A_UINT8 ap_hidden_ssid; | 576 A_UINT8 ap_hidden_ssid; |
549 A_UINT8 ap_country_code[3]; | 577 A_UINT8 ap_country_code[3]; |
550 A_UINT8 ap_wmode; | 578 A_UINT8 ap_wmode; |
551 A_UINT8 ap_dtim_period; | 579 A_UINT8 ap_dtim_period; |
552 A_UINT16 ap_beacon_interval; | 580 A_UINT16 ap_beacon_interval; |
553 A_UINT16 arRTS; | 581 A_UINT16 arRTS; |
554 A_UINT16 arACS; /* AP mode - Auto Channel Selection */ | 582 A_UINT16 arACS; /* AP mode - Auto Channel Selection */ |
555 HTC_PACKET_QUEUE amsdu_rx_buffer_queue; | 583 HTC_PACKET_QUEUE amsdu_rx_buffer_queue; |
556 A_BOOL bIsDestroyProgress; /* flag to indicate ar6k destroy
is in progress */ | 584 A_BOOL bIsDestroyProgress; /* flag to indicate ar6k destroy
is in progress */ |
557 A_TIMER disconnect_timer; | 585 A_TIMER disconnect_timer; |
558 A_UINT8 rxMetaVersion; | 586 A_UINT8 rxMetaVersion; |
559 #ifdef WAPI_ENABLE | 587 #ifdef WAPI_ENABLE |
560 A_UINT8 arWapiEnable; | 588 A_UINT8 arWapiEnable; |
561 #endif | 589 #endif |
562 WMI_BTCOEX_CONFIG_EVENT arBtcoexConfig; | 590 WMI_BTCOEX_CONFIG_EVENT arBtcoexConfig; |
563 WMI_BTCOEX_STATS_EVENT arBtcoexStats; | 591 WMI_BTCOEX_STATS_EVENT arBtcoexStats; |
564 A_INT32 (*exitCallback)(void *config); /* generic callback
at AR6K exit */ | 592 A_INT32 (*exitCallback)(void *config); /* generic callback
at AR6K exit */ |
565 HIF_DEVICE_OS_DEVICE_INFO osDevInfo; | 593 HIF_DEVICE_OS_DEVICE_INFO osDevInfo; |
566 #ifdef ATH6K_CONFIG_CFG80211 | 594 #ifdef ATH6K_CONFIG_CFG80211 |
567 struct wireless_dev *wdev; | 595 struct wireless_dev *wdev; |
568 struct cfg80211_scan_request *scan_request; | 596 struct cfg80211_scan_request *scan_request; |
569 struct ar_key keys[WMI_MAX_KEY_INDEX + 1]; | 597 struct ar_key keys[WMI_MAX_KEY_INDEX + 1]; |
570 #endif /* ATH6K_CONFIG_CFG80211 */ | 598 #endif /* ATH6K_CONFIG_CFG80211 */ |
571 #if CONFIG_PM | 599 A_UINT16 arWlanPowerState; |
572 A_UINT16 arOsPowerCtrl; | 600 A_BOOL arWlanOff; |
| 601 #ifdef CONFIG_PM |
573 A_UINT16 arWowState; | 602 A_UINT16 arWowState; |
| 603 A_BOOL arBTOff; |
| 604 A_BOOL arBTSharing; |
| 605 A_UINT16 arSuspendConfig; |
| 606 A_UINT16 arWlanOffConfig; |
| 607 A_UINT16 arWow2Config; |
574 #endif | 608 #endif |
575 A_UINT8 scan_triggered; | 609 A_UINT8 scan_triggered; |
576 WMI_SCAN_PARAMS_CMD scParams; | 610 WMI_SCAN_PARAMS_CMD scParams; |
577 A_UINT8 mcast_filters[MAC_MAX_FILTERS_PER_LIST][4]; | 611 #define AR_MCAST_FILTER_MAC_ADDR_SIZE 4 |
| 612 A_UINT8 mcast_filters[MAC_MAX_FILTERS_PER_LIST][AR_MCAST_FIL
TER_MAC_ADDR_SIZE]; |
578 A_UINT8 bdaddr[6]; | 613 A_UINT8 bdaddr[6]; |
| 614 A_BOOL scanSpecificSsid; |
| 615 #ifdef CONFIG_AP_VIRTUAL_ADAPTER_SUPPORT |
| 616 void *arApDev; |
| 617 #endif |
579 } AR_SOFTC_T; | 618 } AR_SOFTC_T; |
580 | 619 |
581 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) | 620 #ifdef CONFIG_AP_VIRTUAL_ADAPTER_SUPPORT |
582 /* Looks like we need this for 2.4 kernels */ | 621 typedef struct { |
583 static inline void *ar6k_priv(struct net_device *dev) | 622 struct net_device *arNetDev; /* net_device pointer */ |
584 { | 623 AR_SOFTC_T *arDev; /* ar device pointer */ |
585 return(dev->priv); | 624 struct net_device *arStaNetDev; /* net_device pointer */ |
586 } | 625 } AR_VIRTUAL_INTERFACE_T; |
587 #else | 626 #endif /* CONFIG_AP_VIRTUAL_ADAPTER_SUPPORT */ |
| 627 |
588 #ifdef ATH6K_CONFIG_CFG80211 | 628 #ifdef ATH6K_CONFIG_CFG80211 |
589 static inline void *ar6k_priv(struct net_device *dev) | 629 static inline void *ar6k_priv(struct net_device *dev) |
590 { | 630 { |
591 return (wdev_priv(dev->ieee80211_ptr)); | 631 return (wdev_priv(dev->ieee80211_ptr)); |
592 } | 632 } |
593 #else | 633 #else |
| 634 #ifdef CONFIG_AP_VIRTUAL_ADAPTER_SUPPORT |
| 635 static inline void *ar6k_priv(struct net_device *dev) |
| 636 { |
| 637 extern struct net_device *arApNetDev; |
| 638 |
| 639 if (arApNetDev == dev) { |
| 640 /* return arDev saved in virtual interface context */ |
| 641 AR_VIRTUAL_INTERFACE_T *arVirDev; |
| 642 arVirDev = netdev_priv(dev); |
| 643 return arVirDev->arDev; |
| 644 } else { |
| 645 return netdev_priv(dev); |
| 646 } |
| 647 } |
| 648 #else |
594 #define ar6k_priv netdev_priv | 649 #define ar6k_priv netdev_priv |
| 650 #endif /* CONFIG_AP_VIRTUAL_ADAPTER_SUPPORT */ |
595 #endif /* ATH6K_CONFIG_CFG80211 */ | 651 #endif /* ATH6K_CONFIG_CFG80211 */ |
596 #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) */ | 652 |
| 653 #define SET_HCI_BUS_TYPE(pHciDev, __bus, __type) do { \ |
| 654 (pHciDev)->bus = (__bus); \ |
| 655 (pHciDev)->dev_type = (__type); \ |
| 656 } while(0) |
| 657 |
| 658 #define GET_INODE_FROM_FILEP(filp) \ |
| 659 (filp)->f_path.dentry->d_inode |
597 | 660 |
598 #define arAc2EndpointID(ar,ac) (ar)->arAc2EpMapping[(ac)] | 661 #define arAc2EndpointID(ar,ac) (ar)->arAc2EpMapping[(ac)] |
599 #define arSetAc2EndpointIDMap(ar,ac,ep) \ | 662 #define arSetAc2EndpointIDMap(ar,ac,ep) \ |
600 { (ar)->arAc2EpMapping[(ac)] = (ep); \ | 663 { (ar)->arAc2EpMapping[(ac)] = (ep); \ |
601 (ar)->arEp2AcMapping[(ep)] = (ac); } | 664 (ar)->arEp2AcMapping[(ep)] = (ac); } |
602 #define arEndpoint2Ac(ar,ep) (ar)->arEp2AcMapping[(ep)] | 665 #define arEndpoint2Ac(ar,ep) (ar)->arEp2AcMapping[(ep)] |
603 | 666 |
604 #define arRawIfEnabled(ar) (ar)->arRawIfInit | 667 #define arRawIfEnabled(ar) (ar)->arRawIfInit |
605 #define arRawStream2EndpointID(ar,raw) (ar)->arRawHtc->arRaw2EpMapping[
(raw)] | 668 #define arRawStream2EndpointID(ar,raw) (ar)->arRawHtc->arRaw2EpMapping[
(raw)] |
606 #define arSetRawStream2EndpointIDMap(ar,raw,ep) \ | 669 #define arSetRawStream2EndpointIDMap(ar,raw,ep) \ |
607 { (ar)->arRawHtc->arRaw2EpMapping[(raw)] = (ep); \ | 670 { (ar)->arRawHtc->arRaw2EpMapping[(raw)] = (ep); \ |
608 (ar)->arRawHtc->arEp2RawMapping[(ep)] = (raw); } | 671 (ar)->arRawHtc->arEp2RawMapping[(ep)] = (raw); } |
609 #define arEndpoint2RawStreamID(ar,ep) (ar)->arRawHtc->arEp2RawMapping[
(ep)] | 672 #define arEndpoint2RawStreamID(ar,ep) (ar)->arRawHtc->arEp2RawMapping[
(ep)] |
610 | 673 |
611 struct ar_giwscan_param { | 674 struct ar_giwscan_param { |
612 char *current_ev; | 675 char *current_ev; |
613 char *end_buf; | 676 char *end_buf; |
614 A_UINT32 bytes_needed; | 677 A_UINT32 bytes_needed; |
615 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) | |
616 struct iw_request_info *info; | 678 struct iw_request_info *info; |
617 #endif | |
618 }; | 679 }; |
619 | 680 |
620 #define AR6000_STAT_INC(ar, stat) (ar->arNetStats.stat++) | 681 #define AR6000_STAT_INC(ar, stat) (ar->arNetStats.stat++) |
621 | 682 |
622 #define AR6000_SPIN_LOCK(lock, param) do { \ | 683 #define AR6000_SPIN_LOCK(lock, param) do { \ |
623 if (irqs_disabled()) { \ | 684 if (irqs_disabled()) { \ |
624 AR_DEBUG_PRINTF(ATH_DEBUG_TRC,("IRQs disabled:AR6000_LOCK\n"));
\ | 685 AR_DEBUG_PRINTF(ATH_DEBUG_TRC,("IRQs disabled:AR6000_LOCK\n"));
\ |
625 } \ | 686 } \ |
626 spin_lock_bh(lock); \ | 687 spin_lock_bh(lock); \ |
627 } while (0) | 688 } while (0) |
628 | 689 |
629 #define AR6000_SPIN_UNLOCK(lock, param) do { \ | 690 #define AR6000_SPIN_UNLOCK(lock, param) do { \ |
630 if (irqs_disabled()) { \ | 691 if (irqs_disabled()) { \ |
631 AR_DEBUG_PRINTF(ATH_DEBUG_TRC,("IRQs disabled: AR6000_UNLOCK\n"));
\ | 692 AR_DEBUG_PRINTF(ATH_DEBUG_TRC,("IRQs disabled: AR6000_UNLOCK\n"));
\ |
632 } \ | 693 } \ |
633 spin_unlock_bh(lock); \ | 694 spin_unlock_bh(lock); \ |
634 } while (0) | 695 } while (0) |
635 | 696 |
636 int ar6000_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); | 697 int ar6000_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); |
637 int ar6000_ioctl_dispatcher(struct net_device *dev, struct ifreq *rq, int cmd); | 698 int ar6000_ioctl_dispatcher(struct net_device *dev, struct ifreq *rq, int cmd); |
638 void ar6000_gpio_init(void); | 699 void ar6000_gpio_init(void); |
639 void ar6000_init_profile_info(AR_SOFTC_T *ar); | 700 void ar6000_init_profile_info(AR_SOFTC_T *ar); |
640 void ar6000_install_static_wep_keys(AR_SOFTC_T *ar); | 701 void ar6000_install_static_wep_keys(AR_SOFTC_T *ar); |
641 int ar6000_init(struct net_device *dev); | 702 int ar6000_init(struct net_device *dev); |
642 int ar6000_dbglog_get_debug_logs(AR_SOFTC_T *ar); | 703 int ar6000_dbglog_get_debug_logs(AR_SOFTC_T *ar); |
643 void ar6000_TxDataCleanup(AR_SOFTC_T *ar); | 704 void ar6000_TxDataCleanup(AR_SOFTC_T *ar); |
644 int ar6000_acl_data_tx(struct sk_buff *skb, struct net_device *dev); | 705 int ar6000_acl_data_tx(struct sk_buff *skb, struct net_device *dev); |
| 706 void ar6000_restart_endpoint(struct net_device *dev); |
| 707 void ar6000_stop_endpoint(struct net_device *dev, A_BOOL keepprofile, A_BOOL get
dbglogs); |
645 | 708 |
646 #ifdef HTC_RAW_INTERFACE | 709 #ifdef HTC_RAW_INTERFACE |
647 | 710 |
648 #ifndef __user | 711 #ifndef __user |
649 #define __user | 712 #define __user |
650 #endif | 713 #endif |
651 | 714 |
652 int ar6000_htc_raw_open(AR_SOFTC_T *ar); | 715 int ar6000_htc_raw_open(AR_SOFTC_T *ar); |
653 int ar6000_htc_raw_close(AR_SOFTC_T *ar); | 716 int ar6000_htc_raw_close(AR_SOFTC_T *ar); |
654 ssize_t ar6000_htc_raw_read(AR_SOFTC_T *ar, | 717 ssize_t ar6000_htc_raw_read(AR_SOFTC_T *ar, |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
690 ATH_DEBUG_DECLARE_EXTERN(misc); | 753 ATH_DEBUG_DECLARE_EXTERN(misc); |
691 | 754 |
692 extern A_UINT8 bcast_mac[]; | 755 extern A_UINT8 bcast_mac[]; |
693 extern A_UINT8 null_mac[]; | 756 extern A_UINT8 null_mac[]; |
694 | 757 |
695 #ifdef __cplusplus | 758 #ifdef __cplusplus |
696 } | 759 } |
697 #endif | 760 #endif |
698 | 761 |
699 #endif /* _AR6000_H_ */ | 762 #endif /* _AR6000_H_ */ |
OLD | NEW |