1 //------------------------------------------------------------------------------
2 // Copyright (c) 2004-2010 Atheros Communications Inc.
3 // All rights reserved.
7 // Permission to use, copy, modify, and/or distribute this software for any
8 // purpose with or without fee is hereby granted, provided that the above
9 // copyright notice and this permission notice appear in all copies.
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.
21 // Author(s): ="Atheros"
22 //------------------------------------------------------------------------------
27 #include <linux/init.h>
28 #include <linux/sched.h>
29 #include <linux/spinlock.h>
30 #include <linux/if_ether.h>
31 #include <linux/etherdevice.h>
32 #include <net/iw_handler.h>
33 #include <linux/if_arp.h>
35 #include <linux/wireless.h>
36 #include <net/cfg80211.h>
37 #include <linux/module.h>
48 #include <ieee80211.h>
49 #include <ieee80211_ioctl.h>
55 #include "aggr_recv_api.h"
56 #include <host_version.h>
57 #include <linux/rtnetlink.h>
58 #include <linux/init.h>
59 #include <linux/moduleparam.h>
60 #include "ar6000_api.h"
61 #ifdef CONFIG_HOST_TCMD_SUPPORT
64 #include <linux/firmware.h>
66 #include "targaddrs.h"
67 #include "dbglog_api.h"
68 #include "ar6000_diag.h"
69 #include "common_drv.h"
71 #include "hci_transport_api.h"
72 #define ATH_MODULE_NAME driver
74 #include "hw/apb_map.h"
75 #include "hw/rtc_reg.h"
76 #include "hw/mbox_reg.h"
77 #include "hw/gpio_reg.h"
79 #define ATH_DEBUG_DBG_LOG ATH_DEBUG_MAKE_MODULE_MASK(0)
80 #define ATH_DEBUG_WLAN_CONNECT ATH_DEBUG_MAKE_MODULE_MASK(1)
81 #define ATH_DEBUG_WLAN_SCAN ATH_DEBUG_MAKE_MODULE_MASK(2)
82 #define ATH_DEBUG_WLAN_TX ATH_DEBUG_MAKE_MODULE_MASK(3)
83 #define ATH_DEBUG_WLAN_RX ATH_DEBUG_MAKE_MODULE_MASK(4)
84 #define ATH_DEBUG_HTC_RAW ATH_DEBUG_MAKE_MODULE_MASK(5)
85 #define ATH_DEBUG_HCI_BRIDGE ATH_DEBUG_MAKE_MODULE_MASK(6)
86 #define ATH_DEBUG_HCI_RECV ATH_DEBUG_MAKE_MODULE_MASK(7)
87 #define ATH_DEBUG_HCI_SEND ATH_DEBUG_MAKE_MODULE_MASK(8)
88 #define ATH_DEBUG_HCI_DUMP ATH_DEBUG_MAKE_MODULE_MASK(9)
91 #define __dev_put(dev) dev_put(dev)
95 #define USER_SAVEDKEYS_STAT_INIT 0
96 #define USER_SAVEDKEYS_STAT_RUN 1
98 // TODO this needs to move into the AR_SOFTC struct
99 struct USER_SAVEDKEYS {
100 struct ieee80211req_key ucast_ik;
101 struct ieee80211req_key bcast_ik;
106 #define DBG_INFO 0x00000001
107 #define DBG_ERROR 0x00000002
108 #define DBG_WARNING 0x00000004
109 #define DBG_SDIO 0x00000008
110 #define DBG_HIF 0x00000010
111 #define DBG_HTC 0x00000020
112 #define DBG_WMI 0x00000040
113 #define DBG_WMI2 0x00000080
114 #define DBG_DRIVER 0x00000100
116 #define DBG_DEFAULTS (DBG_ERROR|DBG_WARNING)
119 int ar6000_ReadRegDiag(struct hif_device *hifDevice, u32 *address, u32 *data);
120 int ar6000_WriteRegDiag(struct hif_device *hifDevice, u32 *address, u32 *data);
127 #define AR6000_MAX_RX_BUFFERS 16
128 #define AR6000_BUFFER_SIZE 1664
129 #define AR6000_MAX_AMSDU_RX_BUFFERS 4
130 #define AR6000_AMSDU_REFILL_THRESHOLD 3
131 #define AR6000_AMSDU_BUFFER_SIZE (WMI_MAX_AMSDU_RX_DATA_FRAME_LENGTH + 128)
132 #define AR6000_MAX_RX_MESSAGE_SIZE (max(WMI_MAX_NORMAL_RX_DATA_FRAME_LENGTH,WMI_MAX_AMSDU_RX_DATA_FRAME_LENGTH))
134 #define AR6000_TX_TIMEOUT 10
135 #define AR6000_ETH_ADDR_LEN 6
136 #define AR6000_MAX_ENDPOINTS 4
137 #define MAX_NODE_NUM 15
138 /* MAX_HI_COOKIE_NUM are reserved for high priority traffic */
139 #define MAX_DEF_COOKIE_NUM 180
140 #define MAX_HI_COOKIE_NUM 18 /* 10% of MAX_COOKIE_NUM */
141 #define MAX_COOKIE_NUM (MAX_DEF_COOKIE_NUM + MAX_HI_COOKIE_NUM)
143 /* MAX_DEFAULT_SEND_QUEUE_DEPTH is used to set the default queue depth for the
144 * WMM send queues. If a queue exceeds this depth htc will query back to the
145 * OS specific layer by calling EpSendFull(). This gives the OS layer the
146 * opportunity to drop the packet if desired. Therefore changing
147 * MAX_DEFAULT_SEND_QUEUE_DEPTH does not affect resource utilization but
148 * does impact the threshold used to identify if a packet should be
150 #define MAX_DEFAULT_SEND_QUEUE_DEPTH (MAX_DEF_COOKIE_NUM / WMM_NUM_AC)
152 #define AR6000_HB_CHALLENGE_RESP_FREQ_DEFAULT 1
153 #define AR6000_HB_CHALLENGE_RESP_MISS_THRES_DEFAULT 1
154 #define A_DISCONNECT_TIMER_INTERVAL 10 * 1000
155 #define A_DEFAULT_LISTEN_INTERVAL 100
156 #define A_MAX_WOW_LISTEN_INTERVAL 1000
159 DRV_HB_CHALLENGE = 0,
164 WLAN_INIT_MODE_NONE = 0,
170 /* Suspend - configuration */
172 WLAN_SUSPEND_CUT_PWR = 0,
173 WLAN_SUSPEND_DEEP_SLEEP,
175 WLAN_SUSPEND_CUT_PWR_IF_BT_OFF
178 /* WiFi OFF - configuration */
180 WLAN_OFF_CUT_PWR = 0,
184 /* WLAN low power state */
186 WLAN_POWER_STATE_ON = 0,
187 WLAN_POWER_STATE_CUT_PWR = 1,
188 WLAN_POWER_STATE_DEEP_SLEEP,
194 WLAN_WOW_STATE_NONE = 0,
195 WLAN_WOW_STATE_SUSPENDED,
196 WLAN_WOW_STATE_SUSPENDING
200 typedef enum _AR6K_BIN_FILE {
204 AR6K_BOARD_DATA_FILE,
207 #ifdef SETUPHCI_ENABLED
208 #define SETUPHCI_DEFAULT 1
210 #define SETUPHCI_DEFAULT 0
211 #endif /* SETUPHCI_ENABLED */
213 #ifdef SETUPBTDEV_ENABLED
214 #define SETUPBTDEV_DEFAULT 1
216 #define SETUPBTDEV_DEFAULT 0
217 #endif /* SETUPBTDEV_ENABLED */
219 #ifdef ENABLEUARTPRINT_SET
220 #define ENABLEUARTPRINT_DEFAULT 1
222 #define ENABLEUARTPRINT_DEFAULT 0
223 #endif /* ENABLEARTPRINT_SET */
225 #ifdef ATH6K_CONFIG_HIF_VIRTUAL_SCATTER
226 #define NOHIFSCATTERSUPPORT_DEFAULT 1
227 #else /* ATH6K_CONFIG_HIF_VIRTUAL_SCATTER */
228 #define NOHIFSCATTERSUPPORT_DEFAULT 0
229 #endif /* ATH6K_CONFIG_HIF_VIRTUAL_SCATTER */
231 #ifdef AR600x_BT_AR3001
232 #define AR3KHCIBAUD_DEFAULT 3000000
233 #define HCIUARTSCALE_DEFAULT 1
234 #define HCIUARTSTEP_DEFAULT 8937
236 #define AR3KHCIBAUD_DEFAULT 0
237 #define HCIUARTSCALE_DEFAULT 0
238 #define HCIUARTSTEP_DEFAULT 0
239 #endif /* AR600x_BT_AR3001 */
241 #define WLAN_INIT_MODE_DEFAULT WLAN_INIT_MODE_DRV
243 #define AR6K_PATCH_DOWNLOAD_ADDRESS(_param, _ver) do { \
244 if ((_ver) == AR6003_REV1_VERSION) { \
245 (_param) = AR6003_REV1_PATCH_DOWNLOAD_ADDRESS; \
246 } else if ((_ver) == AR6003_REV2_VERSION) { \
247 (_param) = AR6003_REV2_PATCH_DOWNLOAD_ADDRESS; \
249 AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unknown Version: %d\n", _ver)); \
254 #define AR6K_DATA_DOWNLOAD_ADDRESS(_param, _ver) do { \
255 if ((_ver) == AR6003_REV1_VERSION) { \
256 (_param) = AR6003_REV1_DATA_DOWNLOAD_ADDRESS; \
257 } else if ((_ver) == AR6003_REV2_VERSION) { \
258 (_param) = AR6003_REV2_DATA_DOWNLOAD_ADDRESS; \
260 AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unknown Version: %d\n", _ver)); \
265 #define AR6K_APP_START_OVERRIDE_ADDRESS(_param, _ver) do { \
266 if ((_ver) == AR6003_REV1_VERSION) { \
267 (_param) = AR6003_REV1_APP_START_OVERRIDE; \
268 } else if ((_ver) == AR6003_REV2_VERSION) { \
269 (_param) = AR6003_REV2_APP_START_OVERRIDE; \
271 AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unknown Version: %d\n", _ver)); \
276 /* AR6003 1.0 definitions */
277 #define AR6003_REV1_VERSION 0x300002ba
278 #define AR6003_REV1_DATA_DOWNLOAD_ADDRESS AR6003_REV1_OTP_DATA_ADDRESS
279 #define AR6003_REV1_PATCH_DOWNLOAD_ADDRESS 0x57ea6c
280 #define AR6003_REV1_OTP_FILE "ath6k/AR6003/hw1.0/otp.bin.z77"
281 #define AR6003_REV1_FIRMWARE_FILE "ath6k/AR6003/hw1.0/athwlan.bin.z77"
282 #define AR6003_REV1_TCMD_FIRMWARE_FILE "ath6k/AR6003/hw1.0/athtcmd_ram.bin"
283 #define AR6003_REV1_ART_FIRMWARE_FILE "ath6k/AR6003/hw1.0/device.bin"
284 #define AR6003_REV1_PATCH_FILE "ath6k/AR6003/hw1.0/data.patch.bin"
285 #define AR6003_REV1_EPPING_FIRMWARE_FILE "ath6k/AR6003/hw1.0/endpointping.bin"
286 #ifdef CONFIG_AR600x_SD31_XXX
287 #define AR6003_REV1_BOARD_DATA_FILE "ath6k/AR6003/hw1.0/bdata.SD31.bin"
288 #elif defined(AR600x_SD32_XXX)
289 #define AR6003_REV1_BOARD_DATA_FILE "ath6k/AR6003/hw1.0/bdata.SD32.bin"
290 #elif defined(CONFIG_AR600x_WB31_XXX)
291 #define AR6003_REV1_BOARD_DATA_FILE "ath6k/AR6003/hw1.0/bdata.WB31.bin"
293 #define AR6003_REV1_BOARD_DATA_FILE "ath6k/AR6003/hw1.0/bdata.CUSTOM.bin"
294 #endif /* Board Data File */
296 /* AR6003 2.0 definitions */
297 #define AR6003_REV2_VERSION 0x30000384
298 #define AR6003_REV2_DATA_DOWNLOAD_ADDRESS AR6003_REV2_OTP_DATA_ADDRESS
299 #define AR6003_REV2_PATCH_DOWNLOAD_ADDRESS 0x57e910
300 #define AR6003_REV2_OTP_FILE "ath6k/AR6003/hw2.0/otp.bin.z77"
301 #define AR6003_REV2_FIRMWARE_FILE "ath6k/AR6003/hw2.0/athwlan.bin.z77"
302 #define AR6003_REV2_TCMD_FIRMWARE_FILE "ath6k/AR6003/hw2.0/athtcmd_ram.bin"
303 #define AR6003_REV2_ART_FIRMWARE_FILE "ath6k/AR6003/hw2.0/device.bin"
304 #define AR6003_REV2_PATCH_FILE "ath6k/AR6003/hw2.0/data.patch.bin"
305 #define AR6003_REV2_EPPING_FIRMWARE_FILE "ath6k/AR6003/hw2.0/endpointping.bin"
306 #ifdef CONFIG_AR600x_SD31_XXX
307 #define AR6003_REV2_BOARD_DATA_FILE "ath6k/AR6003/hw2.0/bdata.SD31.bin"
308 #elif defined(AR600x_SD32_XXX)
309 #define AR6003_REV2_BOARD_DATA_FILE "ath6k/AR6003/hw2.0/bdata.SD32.bin"
310 #elif defined(CONFIG_AR600x_WB31_XXX)
311 #define AR6003_REV2_BOARD_DATA_FILE "ath6k/AR6003/hw2.0/bdata.WB31.bin"
313 #define AR6003_REV2_BOARD_DATA_FILE "ath6k/AR6003/hw2.0/bdata.CUSTOM.bin"
314 #endif /* Board Data File */
318 WLAN_PWR_CTRL_UP = 0,
319 WLAN_PWR_CTRL_CUT_PWR,
320 WLAN_PWR_CTRL_DEEP_SLEEP,
322 WLAN_PWR_CTRL_DEEP_SLEEP_DISABLED
325 /* HTC RAW streams */
326 typedef enum _HTC_RAW_STREAM_ID {
327 HTC_RAW_STREAM_NOT_MAPPED = -1,
328 HTC_RAW_STREAM_0 = 0,
329 HTC_RAW_STREAM_1 = 1,
330 HTC_RAW_STREAM_2 = 2,
331 HTC_RAW_STREAM_3 = 3,
332 HTC_RAW_STREAM_NUM_MAX
335 #define RAW_HTC_READ_BUFFERS_NUM 4
336 #define RAW_HTC_WRITE_BUFFERS_NUM 4
338 #define HTC_RAW_BUFFER_SIZE 1664
343 unsigned char data[HTC_RAW_BUFFER_SIZE];
344 struct htc_packet HTCPacket;
347 #ifdef CONFIG_HOST_TCMD_SUPPORT
349 * add TCMD_MODE besides wmi and bypasswmi
350 * in TCMD_MODE, only few TCMD releated wmi commands
359 #endif /* CONFIG_HOST_TCMD_SUPPORT */
368 u8 key[WLAN_MAX_KEY_LEN];
370 u8 seq[IW_ENCODE_SEQ_MAX_SIZE];
381 struct ar_node_mapping {
388 unsigned long arc_bp[2]; /* Must be first field */
389 struct htc_packet HtcPkt; /* HTC packet wrapper */
390 struct ar_cookie *arc_list_next;
393 struct ar_hb_chlng_resp {
402 /* Per STA data, used in AP mode */
403 /*TODO: All this should move to OS independent dir */
405 #define STA_PWR_MGMT_MASK 0x1
406 #define STA_PWR_MGMT_SHIFT 0x0
407 #define STA_PWR_MGMT_AWAKE 0x0
408 #define STA_PWR_MGMT_SLEEP 0x1
410 #define STA_SET_PWR_SLEEP(sta) (sta->flags |= (STA_PWR_MGMT_MASK << STA_PWR_MGMT_SHIFT))
411 #define STA_CLR_PWR_SLEEP(sta) (sta->flags &= ~(STA_PWR_MGMT_MASK << STA_PWR_MGMT_SHIFT))
412 #define STA_IS_PWR_SLEEP(sta) ((sta->flags >> STA_PWR_MGMT_SHIFT) & STA_PWR_MGMT_MASK)
414 #define STA_PS_POLLED_MASK 0x1
415 #define STA_PS_POLLED_SHIFT 0x1
416 #define STA_SET_PS_POLLED(sta) (sta->flags |= (STA_PS_POLLED_MASK << STA_PS_POLLED_SHIFT))
417 #define STA_CLR_PS_POLLED(sta) (sta->flags &= ~(STA_PS_POLLED_MASK << STA_PS_POLLED_SHIFT))
418 #define STA_IS_PS_POLLED(sta) (sta->flags & (STA_PS_POLLED_MASK << STA_PS_POLLED_SHIFT))
427 u8 wpa_ie[IEEE80211_MAX_IE];
428 A_NETBUF_QUEUE_T psq; /* power save q */
432 typedef struct ar6_raw_htc {
433 HTC_ENDPOINT_ID arRaw2EpMapping[HTC_RAW_STREAM_NUM_MAX];
434 HTC_RAW_STREAM_ID arEp2RawMapping[ENDPOINT_MAX];
435 struct semaphore raw_htc_read_sem[HTC_RAW_STREAM_NUM_MAX];
436 struct semaphore raw_htc_write_sem[HTC_RAW_STREAM_NUM_MAX];
437 wait_queue_head_t raw_htc_read_queue[HTC_RAW_STREAM_NUM_MAX];
438 wait_queue_head_t raw_htc_write_queue[HTC_RAW_STREAM_NUM_MAX];
439 raw_htc_buffer raw_htc_read_buffer[HTC_RAW_STREAM_NUM_MAX][RAW_HTC_READ_BUFFERS_NUM];
440 raw_htc_buffer raw_htc_write_buffer[HTC_RAW_STREAM_NUM_MAX][RAW_HTC_WRITE_BUFFERS_NUM];
441 bool write_buffer_available[HTC_RAW_STREAM_NUM_MAX];
442 bool read_buffer_available[HTC_RAW_STREAM_NUM_MAX];
446 struct net_device *arNetDev; /* net_device pointer */
448 int arTxPending[ENDPOINT_MAX];
449 int arTotalTxDataPending;
454 HTC_HANDLE arHtcTarget;
457 struct semaphore arSem;
465 u8 arPairwiseCryptoLen;
469 struct ar_wep_key arWepKeyList[WMI_MAX_KEY_INDEX + 1];
474 u16 arListenIntervalB;
475 u16 arListenIntervalT;
476 struct ar6000_version arVersion;
482 struct net_device_stats arNetStats;
483 struct iw_statistics arIwStats;
485 u16 arChannelList[32];
487 bool statsUpdatePending;
488 TARGET_STATS arTargetStats;
491 #ifdef CONFIG_HOST_TCMD_SUPPORT
499 u16 tcmdRateCnt[TCMD_MAX_RATES];
500 u16 tcmdRateCntShortGuard[TCMD_MAX_RATES];
502 AR6000_WLAN_STATE arWlanState;
503 struct ar_node_mapping arNodeMap[MAX_NODE_NUM];
507 struct ar_cookie *arCookieList;
511 u16 arBeaconInterval;
512 bool arConnectPending;
514 struct ar_hb_chlng_resp arHBChallengeResp;
515 u8 arKeepaliveConfigured;
517 HTC_ENDPOINT_ID arAc2EpMapping[WMM_NUM_AC];
518 bool arAcStreamActive[WMM_NUM_AC];
519 u8 arAcStreamPriMap[WMM_NUM_AC];
520 u8 arHiAcStreamActivePri;
521 u8 arEp2AcMapping[ENDPOINT_MAX];
522 HTC_ENDPOINT_ID arControlEp;
523 #ifdef HTC_RAW_INTERFACE
524 AR_RAW_HTC_T *arRawHtc;
526 bool arNetQueueStopped;
529 struct common_credit_state_info arCreditStateInfo;
530 bool arWMIControlEpFull;
531 bool dbgLogFetchInProgress;
532 u8 log_buffer[DBGLOG_HOST_LOG_BUFFER_SIZE];
534 u32 dbglog_init_done;
535 u32 arConnectCtrlFlags;
536 s32 user_savedkeys_stat;
538 struct USER_SAVEDKEYS user_saved_keys;
539 USER_RSSI_THOLD rssi_map[12];
541 u16 ap_profile_flag; /* AP mode */
542 WMI_AP_ACL g_acl; /* AP mode */
543 sta_t sta_list[AP_MAX_NUM_STA]; /* AP mode */
544 u8 sta_list_index; /* AP mode */
545 struct ieee80211req_key ap_mode_bkey; /* AP mode */
546 A_NETBUF_QUEUE_T mcastpsq; /* power save q for Mcast frames */
547 A_MUTEX_T mcastpsqLock;
548 bool DTIMExpired; /* flag to indicate DTIM expired */
549 u8 intra_bss; /* enable/disable intra bss data forward */
551 #ifndef EXPORT_HCI_BRIDGE_INTERFACE
554 WMI_AP_MODE_STAT arAPStats;
556 u8 ap_country_code[3];
559 u16 ap_beacon_interval;
561 u16 arACS; /* AP mode - Auto Channel Selection */
562 struct htc_packet_queue amsdu_rx_buffer_queue;
563 bool bIsDestroyProgress; /* flag to indicate ar6k destroy is in progress */
564 A_TIMER disconnect_timer;
569 WMI_BTCOEX_CONFIG_EVENT arBtcoexConfig;
570 WMI_BTCOEX_STATS_EVENT arBtcoexStats;
571 s32 (*exitCallback)(void *config); /* generic callback at AR6K exit */
572 struct hif_device_os_device_info osDevInfo;
573 struct wireless_dev *wdev;
574 struct cfg80211_scan_request *scan_request;
575 struct ar_key keys[WMI_MAX_KEY_INDEX + 1];
577 u16 arWlanPowerState;
588 WMI_SCAN_PARAMS_CMD scParams;
589 #define AR_MCAST_FILTER_MAC_ADDR_SIZE 4
590 u8 mcast_filters[MAC_MAX_FILTERS_PER_LIST][AR_MCAST_FILTER_MAC_ADDR_SIZE];
592 bool scanSpecificSsid;
593 #ifdef CONFIG_AP_VIRTUAL_ADAPTER_SUPPORT
598 #ifdef CONFIG_AP_VIRTUAL_ADAPTER_SUPPORT
599 struct ar_virtual_interface {
600 struct net_device *arNetDev; /* net_device pointer */
601 struct ar6_softc *arDev; /* ar device pointer */
602 struct net_device *arStaNetDev; /* net_device pointer */
604 #endif /* CONFIG_AP_VIRTUAL_ADAPTER_SUPPORT */
606 static inline void *ar6k_priv(struct net_device *dev)
608 return (wdev_priv(dev->ieee80211_ptr));
611 #define SET_HCI_BUS_TYPE(pHciDev, __bus, __type) do { \
612 (pHciDev)->bus = (__bus); \
613 (pHciDev)->dev_type = (__type); \
616 #define GET_INODE_FROM_FILEP(filp) \
617 (filp)->f_path.dentry->d_inode
619 #define arAc2EndpointID(ar,ac) (ar)->arAc2EpMapping[(ac)]
620 #define arSetAc2EndpointIDMap(ar,ac,ep) \
621 { (ar)->arAc2EpMapping[(ac)] = (ep); \
622 (ar)->arEp2AcMapping[(ep)] = (ac); }
623 #define arEndpoint2Ac(ar,ep) (ar)->arEp2AcMapping[(ep)]
625 #define arRawIfEnabled(ar) (ar)->arRawIfInit
626 #define arRawStream2EndpointID(ar,raw) (ar)->arRawHtc->arRaw2EpMapping[(raw)]
627 #define arSetRawStream2EndpointIDMap(ar,raw,ep) \
628 { (ar)->arRawHtc->arRaw2EpMapping[(raw)] = (ep); \
629 (ar)->arRawHtc->arEp2RawMapping[(ep)] = (raw); }
630 #define arEndpoint2RawStreamID(ar,ep) (ar)->arRawHtc->arEp2RawMapping[(ep)]
632 struct ar_giwscan_param {
636 struct iw_request_info *info;
639 #define AR6000_STAT_INC(ar, stat) (ar->arNetStats.stat++)
641 #define AR6000_SPIN_LOCK(lock, param) do { \
642 if (irqs_disabled()) { \
643 AR_DEBUG_PRINTF(ATH_DEBUG_TRC,("IRQs disabled:AR6000_LOCK\n")); \
645 spin_lock_bh(lock); \
648 #define AR6000_SPIN_UNLOCK(lock, param) do { \
649 if (irqs_disabled()) { \
650 AR_DEBUG_PRINTF(ATH_DEBUG_TRC,("IRQs disabled: AR6000_UNLOCK\n")); \
652 spin_unlock_bh(lock); \
655 void ar6000_init_profile_info(struct ar6_softc *ar);
656 void ar6000_install_static_wep_keys(struct ar6_softc *ar);
657 int ar6000_init(struct net_device *dev);
658 int ar6000_dbglog_get_debug_logs(struct ar6_softc *ar);
659 void ar6000_TxDataCleanup(struct ar6_softc *ar);
660 int ar6000_acl_data_tx(struct sk_buff *skb, struct net_device *dev);
661 void ar6000_restart_endpoint(struct net_device *dev);
662 void ar6000_stop_endpoint(struct net_device *dev, bool keepprofile, bool getdbglogs);
664 #ifdef HTC_RAW_INTERFACE
670 int ar6000_htc_raw_open(struct ar6_softc *ar);
671 int ar6000_htc_raw_close(struct ar6_softc *ar);
672 ssize_t ar6000_htc_raw_read(struct ar6_softc *ar,
673 HTC_RAW_STREAM_ID StreamID,
674 char __user *buffer, size_t count);
675 ssize_t ar6000_htc_raw_write(struct ar6_softc *ar,
676 HTC_RAW_STREAM_ID StreamID,
677 char __user *buffer, size_t count);
679 #endif /* HTC_RAW_INTERFACE */
682 /*TODO: These routines should be moved to a file that is common across OS */
684 ieee80211_find_conn(struct ar6_softc *ar, u8 *node_addr);
687 ieee80211_find_conn_for_aid(struct ar6_softc *ar, u8 aid);
689 u8 remove_sta(struct ar6_softc *ar, u8 *mac, u16 reason);
693 #ifndef EXPORT_HCI_BRIDGE_INTERFACE
694 int ar6000_setup_hci(struct ar6_softc *ar);
695 void ar6000_cleanup_hci(struct ar6_softc *ar);
696 void ar6000_set_default_ar3kconfig(struct ar6_softc *ar, void *ar3kconfig);
698 /* HCI bridge testing */
699 int hci_test_send(struct ar6_softc *ar, struct sk_buff *skb);
702 ATH_DEBUG_DECLARE_EXTERN(htc);
703 ATH_DEBUG_DECLARE_EXTERN(wmi);
704 ATH_DEBUG_DECLARE_EXTERN(bmi);
705 ATH_DEBUG_DECLARE_EXTERN(hif);
706 ATH_DEBUG_DECLARE_EXTERN(wlan);
707 ATH_DEBUG_DECLARE_EXTERN(misc);
709 extern u8 bcast_mac[];
710 extern u8 null_mac[];
716 #endif /* _AR6000_H_ */