OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * |
| 3 * Copyright (c) 2004-2010 Atheros Communications Inc. |
| 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 // |
| 11 // Software distributed under the License is distributed on an "AS |
| 12 // IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or |
| 13 // implied. See the License for the specific language governing |
| 14 // rights and limitations under the License. |
| 15 // |
| 16 // |
| 17 * |
| 18 */ |
| 19 |
| 20 #ifndef _AR6000_H_ |
| 21 #define _AR6000_H_ |
| 22 |
| 23 #include <linux/version.h> |
| 24 |
| 25 |
| 26 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17) |
| 27 #include <linux/config.h> |
| 28 #else |
| 29 #include <linux/autoconf.h> |
| 30 #endif |
| 31 #include <linux/init.h> |
| 32 #include <linux/kernel.h> |
| 33 #include <linux/spinlock.h> |
| 34 #include <linux/skbuff.h> |
| 35 #include <linux/if_ether.h> |
| 36 #include <linux/netdevice.h> |
| 37 #include <linux/etherdevice.h> |
| 38 #include <net/iw_handler.h> |
| 39 #include <linux/if_arp.h> |
| 40 #include <linux/ip.h> |
| 41 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26) |
| 42 #include <asm/semaphore.h> |
| 43 #else |
| 44 #include <linux/semaphore.h> |
| 45 #endif |
| 46 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32) |
| 47 #include <linux/sched.h> |
| 48 #endif |
| 49 #include <linux/wireless.h> |
| 50 #ifdef CONFIG_CFG80211 |
| 51 #include <net/cfg80211.h> |
| 52 #endif /* CONFIG_CFG80211 */ |
| 53 #include <linux/module.h> |
| 54 #include <asm/io.h> |
| 55 |
| 56 #include <a_config.h> |
| 57 #include <athdefs.h> |
| 58 #include "a_types.h" |
| 59 #include "a_osapi.h" |
| 60 #include "htc_api.h" |
| 61 #include "wmi.h" |
| 62 #include "a_drv.h" |
| 63 #include "bmi.h" |
| 64 #include <ieee80211.h> |
| 65 #include <ieee80211_ioctl.h> |
| 66 #include <wlan_api.h> |
| 67 #include <wmi_api.h> |
| 68 #include "gpio_api.h" |
| 69 #include "gpio.h" |
| 70 #include "pkt_log.h" |
| 71 #include "aggr_recv_api.h" |
| 72 #include <host_version.h> |
| 73 #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> |
| 78 #include <linux/moduleparam.h> |
| 79 #endif |
| 80 #include "ar6000_api.h" |
| 81 #ifdef CONFIG_HOST_TCMD_SUPPORT |
| 82 #include <testcmd.h> |
| 83 #endif |
| 84 #include <linux/firmware.h> |
| 85 |
| 86 #include "targaddrs.h" |
| 87 #include "dbglog_api.h" |
| 88 #include "ar6000_diag.h" |
| 89 #include "common_drv.h" |
| 90 #include "roaming.h" |
| 91 #include "hci_transport_api.h" |
| 92 #define ATH_MODULE_NAME driver |
| 93 #include "a_debug.h" |
| 94 #include "hw/apb_map.h" |
| 95 #include "hw/rtc_reg.h" |
| 96 #include "hw/mbox_reg.h" |
| 97 |
| 98 #define ATH_DEBUG_DBG_LOG ATH_DEBUG_MAKE_MODULE_MASK(0) |
| 99 #define ATH_DEBUG_WLAN_CONNECT ATH_DEBUG_MAKE_MODULE_MASK(1) |
| 100 #define ATH_DEBUG_WLAN_SCAN ATH_DEBUG_MAKE_MODULE_MASK(2) |
| 101 #define ATH_DEBUG_WLAN_TX ATH_DEBUG_MAKE_MODULE_MASK(3) |
| 102 #define ATH_DEBUG_WLAN_RX ATH_DEBUG_MAKE_MODULE_MASK(4) |
| 103 #define ATH_DEBUG_HTC_RAW ATH_DEBUG_MAKE_MODULE_MASK(5) |
| 104 #define ATH_DEBUG_HCI_BRIDGE ATH_DEBUG_MAKE_MODULE_MASK(6) |
| 105 #define ATH_DEBUG_HCI_RECV ATH_DEBUG_MAKE_MODULE_MASK(7) |
| 106 #define ATH_DEBUG_HCI_SEND ATH_DEBUG_MAKE_MODULE_MASK(8) |
| 107 #define ATH_DEBUG_HCI_DUMP ATH_DEBUG_MAKE_MODULE_MASK(9) |
| 108 |
| 109 #ifndef __dev_put |
| 110 #define __dev_put(dev) dev_put(dev) |
| 111 #endif |
| 112 |
| 113 |
| 114 #ifdef USER_KEYS |
| 115 |
| 116 #define USER_SAVEDKEYS_STAT_INIT 0 |
| 117 #define USER_SAVEDKEYS_STAT_RUN 1 |
| 118 |
| 119 // TODO this needs to move into the AR_SOFTC struct |
| 120 struct USER_SAVEDKEYS { |
| 121 struct ieee80211req_key ucast_ik; |
| 122 struct ieee80211req_key bcast_ik; |
| 123 CRYPTO_TYPE keyType; |
| 124 A_BOOL keyOk; |
| 125 }; |
| 126 #endif |
| 127 |
| 128 #define DBG_INFO 0x00000001 |
| 129 #define DBG_ERROR 0x00000002 |
| 130 #define DBG_WARNING 0x00000004 |
| 131 #define DBG_SDIO 0x00000008 |
| 132 #define DBG_HIF 0x00000010 |
| 133 #define DBG_HTC 0x00000020 |
| 134 #define DBG_WMI 0x00000040 |
| 135 #define DBG_WMI2 0x00000080 |
| 136 #define DBG_DRIVER 0x00000100 |
| 137 |
| 138 #define DBG_DEFAULTS (DBG_ERROR|DBG_WARNING) |
| 139 |
| 140 |
| 141 A_STATUS ar6000_ReadRegDiag(HIF_DEVICE *hifDevice, A_UINT32 *address, A_UINT32 *
data); |
| 142 A_STATUS ar6000_WriteRegDiag(HIF_DEVICE *hifDevice, A_UINT32 *address, A_UINT32
*data); |
| 143 |
| 144 #ifdef __cplusplus |
| 145 extern "C" { |
| 146 #endif |
| 147 |
| 148 #define MAX_AR6000 1 |
| 149 #define AR6000_MAX_RX_BUFFERS 16 |
| 150 #define AR6000_BUFFER_SIZE 1664 |
| 151 #define AR6000_MAX_AMSDU_RX_BUFFERS 4 |
| 152 #define AR6000_AMSDU_REFILL_THRESHOLD 3 |
| 153 #define AR6000_AMSDU_BUFFER_SIZE (WMI_MAX_AMSDU_RX_DATA_FRAME_LENGTH +
128) |
| 154 #define AR6000_MAX_RX_MESSAGE_SIZE (max(WMI_MAX_NORMAL_RX_DATA_FRAME_LENG
TH,WMI_MAX_AMSDU_RX_DATA_FRAME_LENGTH)) |
| 155 |
| 156 #define AR6000_TX_TIMEOUT 10 |
| 157 #define AR6000_ETH_ADDR_LEN 6 |
| 158 #define AR6000_MAX_ENDPOINTS 4 |
| 159 #define MAX_NODE_NUM 15 |
| 160 /* MAX_HI_COOKIE_NUM are reserved for high priority traffic */ |
| 161 #define MAX_DEF_COOKIE_NUM 150 |
| 162 #define MAX_HI_COOKIE_NUM 15 /* 10% of MAX_COOKIE_NUM */ |
| 163 #define MAX_COOKIE_NUM (MAX_DEF_COOKIE_NUM + MAX_HI_COOKIE_NU
M) |
| 164 |
| 165 /* MAX_DEFAULT_SEND_QUEUE_DEPTH is used to set the default queue depth for the |
| 166 * WMM send queues. If a queue exceeds this depth htc will query back to the |
| 167 * OS specific layer by calling EpSendFull(). This gives the OS layer the |
| 168 * opportunity to drop the packet if desired. Therefore changing |
| 169 * MAX_DEFAULT_SEND_QUEUE_DEPTH does not affect resource utilization but |
| 170 * does impact the threshold used to identify if a packet should be |
| 171 * dropped. */ |
| 172 #define MAX_DEFAULT_SEND_QUEUE_DEPTH (MAX_DEF_COOKIE_NUM / WMM_NUM_AC) |
| 173 |
| 174 #define AR6000_HB_CHALLENGE_RESP_FREQ_DEFAULT 1 |
| 175 #define AR6000_HB_CHALLENGE_RESP_MISS_THRES_DEFAULT 1 |
| 176 #define A_DISCONNECT_TIMER_INTERVAL 10 * 1000 |
| 177 |
| 178 enum { |
| 179 DRV_HB_CHALLENGE = 0, |
| 180 APP_HB_CHALLENGE |
| 181 }; |
| 182 |
| 183 enum { |
| 184 WLAN_INIT_MODE_NONE = 0, |
| 185 WLAN_INIT_MODE_USR, |
| 186 WLAN_INIT_MODE_UDEV, |
| 187 WLAN_INIT_MODE_DRV |
| 188 }; |
| 189 |
| 190 #define AR6003_HW10_CONFIG "AR6003_HW10_CONFIG" |
| 191 |
| 192 #ifdef INIT_MODE_DRV_ENABLED |
| 193 #ifdef AR6003 |
| 194 #ifdef HW10 |
| 195 #define DATA_DOWNLOAD_ADDRESS 0x542800 |
| 196 #define PATCH_DOWNLOAD_ADDRESS 0x57ea6c |
| 197 #define AR6K_OTP_DATA_FILE "ath6k/AR6003/hw1.0/otp.data" |
| 198 #define AR6K_OTP_BIN_FILE "ath6k/AR6003/hw1.0/otp.bin" |
| 199 #define AR6K_FIRMWARE_FILE "ath6k/AR6003/hw1.0/athwlan.bin.z77" |
| 200 #define AR6K_PATCH_FILE "ath6k/AR6003/hw1.0/data.patch.bin" |
| 201 #ifdef AR600x_SD31_XXX |
| 202 #define AR6K_BOARD_DATA_FILE "ath6k/AR6003/hw1.0/bdata.SD31.bin" |
| 203 #elif defined(AR600x_SD32_XXX) |
| 204 #define AR6K_BOARD_DATA_FILE "ath6k/AR6003/hw1.0/bdata.SD32.bin" |
| 205 #elif defined(AR600x_WB31_XXX) |
| 206 #define AR6K_BOARD_DATA_FILE "ath6k/AR6003/hw1.0/bdata.WB31.bin" |
| 207 #elif defined(AR600x_CUSTOM_XXX) |
| 208 #define AR6K_BOARD_DATA_FILE "ath6k/AR6003/hw1.0/bdata.CUSTOM.bin" |
| 209 #else |
| 210 #error Board Data File Not Specified |
| 211 #endif /* Board Data File */ |
| 212 #elif defined(HW20) |
| 213 #error Chip Revision Not Supported |
| 214 #else |
| 215 #error Chip Revision Not Supported |
| 216 #endif /* Chip Revision */ |
| 217 #else |
| 218 #error Chip Generation Not Supported |
| 219 #endif /* Chip Generation */ |
| 220 #endif /* INIT_MODE_DRV_ENABLED */ |
| 221 |
| 222 /* HTC RAW streams */ |
| 223 typedef enum _HTC_RAW_STREAM_ID { |
| 224 HTC_RAW_STREAM_NOT_MAPPED = -1, |
| 225 HTC_RAW_STREAM_0 = 0, |
| 226 HTC_RAW_STREAM_1 = 1, |
| 227 HTC_RAW_STREAM_2 = 2, |
| 228 HTC_RAW_STREAM_3 = 3, |
| 229 HTC_RAW_STREAM_NUM_MAX |
| 230 } HTC_RAW_STREAM_ID; |
| 231 |
| 232 #define RAW_HTC_READ_BUFFERS_NUM 4 |
| 233 #define RAW_HTC_WRITE_BUFFERS_NUM 4 |
| 234 |
| 235 #define HTC_RAW_BUFFER_SIZE 1664 |
| 236 |
| 237 typedef struct { |
| 238 int currPtr; |
| 239 int length; |
| 240 unsigned char data[HTC_RAW_BUFFER_SIZE]; |
| 241 HTC_PACKET HTCPacket; |
| 242 } raw_htc_buffer; |
| 243 |
| 244 #ifdef CONFIG_HOST_TCMD_SUPPORT |
| 245 /* |
| 246 * add TCMD_MODE besides wmi and bypasswmi |
| 247 * in TCMD_MODE, only few TCMD releated wmi commands |
| 248 * counld be hanlder |
| 249 */ |
| 250 enum { |
| 251 AR6000_WMI_MODE = 0, |
| 252 AR6000_BYPASS_MODE, |
| 253 AR6000_TCMD_MODE, |
| 254 AR6000_WLAN_MODE |
| 255 }; |
| 256 #endif /* CONFIG_HOST_TCMD_SUPPORT */ |
| 257 |
| 258 struct ar_wep_key { |
| 259 A_UINT8 arKeyIndex; |
| 260 A_UINT8 arKeyLen; |
| 261 A_UINT8 arKey[64]; |
| 262 } ; |
| 263 |
| 264 #ifdef CONFIG_CFG80211 |
| 265 struct ar_key { |
| 266 A_UINT8 key[WLAN_MAX_KEY_LEN]; |
| 267 A_UINT8 key_len; |
| 268 A_UINT8 seq[IW_ENCODE_SEQ_MAX_SIZE]; |
| 269 A_UINT8 seq_len; |
| 270 A_UINT32 cipher; |
| 271 }; |
| 272 #endif /* CONFIG_CFG80211 */ |
| 273 |
| 274 |
| 275 struct ar_node_mapping { |
| 276 A_UINT8 macAddress[6]; |
| 277 A_UINT8 epId; |
| 278 A_UINT8 txPending; |
| 279 }; |
| 280 |
| 281 struct ar_cookie { |
| 282 A_UINT32 arc_bp[2]; /* Must be first field */ |
| 283 HTC_PACKET HtcPkt; /* HTC packet wrapper */ |
| 284 struct ar_cookie *arc_list_next; |
| 285 }; |
| 286 |
| 287 struct ar_hb_chlng_resp { |
| 288 A_TIMER timer; |
| 289 A_UINT32 frequency; |
| 290 A_UINT32 seqNum; |
| 291 A_BOOL outstanding; |
| 292 A_UINT8 missCnt; |
| 293 A_UINT8 missThres; |
| 294 }; |
| 295 |
| 296 /* Per STA data, used in AP mode */ |
| 297 /*TODO: All this should move to OS independent dir */ |
| 298 |
| 299 #define STA_PWR_MGMT_MASK 0x1 |
| 300 #define STA_PWR_MGMT_SHIFT 0x0 |
| 301 #define STA_PWR_MGMT_AWAKE 0x0 |
| 302 #define STA_PWR_MGMT_SLEEP 0x1 |
| 303 |
| 304 #define STA_SET_PWR_SLEEP(sta) (sta->flags |= (STA_PWR_MGMT_MASK << STA_PWR_MGMT
_SHIFT)) |
| 305 #define STA_CLR_PWR_SLEEP(sta) (sta->flags &= ~(STA_PWR_MGMT_MASK << STA_PWR_MGM
T_SHIFT)) |
| 306 #define STA_IS_PWR_SLEEP(sta) ((sta->flags >> STA_PWR_MGMT_SHIFT) & STA_PWR_MGMT
_MASK) |
| 307 |
| 308 #define STA_PS_POLLED_MASK 0x1 |
| 309 #define STA_PS_POLLED_SHIFT 0x1 |
| 310 #define STA_SET_PS_POLLED(sta) (sta->flags |= (STA_PS_POLLED_MASK << STA_PS_POLL
ED_SHIFT)) |
| 311 #define STA_CLR_PS_POLLED(sta) (sta->flags &= ~(STA_PS_POLLED_MASK << STA_PS_POL
LED_SHIFT)) |
| 312 #define STA_IS_PS_POLLED(sta) (sta->flags & (STA_PS_POLLED_MASK << STA_PS_POLLED
_SHIFT)) |
| 313 |
| 314 typedef struct { |
| 315 A_UINT16 flags; |
| 316 A_UINT8 mac[ATH_MAC_LEN]; |
| 317 A_UINT8 aid; |
| 318 A_UINT8 keymgmt; |
| 319 A_UINT8 ucipher; |
| 320 A_UINT8 auth; |
| 321 A_UINT8 wpa_ie[IEEE80211_MAX_IE]; |
| 322 A_NETBUF_QUEUE_T psq; /* power save q */ |
| 323 A_MUTEX_T psqLock; |
| 324 } sta_t; |
| 325 |
| 326 typedef struct ar6_softc { |
| 327 struct net_device *arNetDev; /* net_device pointer */ |
| 328 void *arWmi; |
| 329 int arTxPending[ENDPOINT_MAX]; |
| 330 int arTotalTxDataPending; |
| 331 A_UINT8 arNumDataEndPts; |
| 332 A_BOOL arWmiEnabled; |
| 333 A_BOOL arWmiReady; |
| 334 A_BOOL arConnected; |
| 335 HTC_HANDLE arHtcTarget; |
| 336 void *arHifDevice; |
| 337 spinlock_t arLock; |
| 338 struct semaphore arSem; |
| 339 int arSsidLen; |
| 340 u_char arSsid[32]; |
| 341 A_UINT8 arNextMode; |
| 342 A_UINT8 arNetworkType; |
| 343 A_UINT8 arDot11AuthMode; |
| 344 A_UINT8 arAuthMode; |
| 345 A_UINT8 arPairwiseCrypto; |
| 346 A_UINT8 arPairwiseCryptoLen; |
| 347 A_UINT8 arGroupCrypto; |
| 348 A_UINT8 arGroupCryptoLen; |
| 349 A_UINT8 arDefTxKeyIndex; |
| 350 struct ar_wep_key arWepKeyList[WMI_MAX_KEY_INDEX + 1]; |
| 351 A_UINT8 arBssid[6]; |
| 352 A_UINT8 arReqBssid[6]; |
| 353 A_UINT16 arChannelHint; |
| 354 A_UINT16 arBssChannel; |
| 355 A_UINT16 arListenInterval; |
| 356 struct ar6000_version arVersion; |
| 357 A_UINT32 arTargetType; |
| 358 A_INT8 arRssi; |
| 359 A_UINT8 arTxPwr; |
| 360 A_BOOL arTxPwrSet; |
| 361 A_INT32 arBitRate; |
| 362 struct net_device_stats arNetStats; |
| 363 struct iw_statistics arIwStats; |
| 364 A_INT8 arNumChannels; |
| 365 A_UINT16 arChannelList[32]; |
| 366 A_UINT32 arRegCode; |
| 367 A_BOOL statsUpdatePending; |
| 368 TARGET_STATS arTargetStats; |
| 369 A_INT8 arMaxRetries; |
| 370 A_UINT8 arPhyCapability; |
| 371 #ifdef CONFIG_HOST_TCMD_SUPPORT |
| 372 A_UINT8 tcmdRxReport; |
| 373 A_UINT32 tcmdRxTotalPkt; |
| 374 A_INT32 tcmdRxRssi; |
| 375 A_UINT32 tcmdPm; |
| 376 A_UINT32 arTargetMode; |
| 377 A_UINT32 tcmdRxcrcErrPkt; |
| 378 A_UINT32 tcmdRxsecErrPkt; |
| 379 A_UINT16 tcmdRateCnt[TCMD_MAX_RATES]; |
| 380 A_UINT16 tcmdRateCntShortGuard[TCMD_MAX_RATES]; |
| 381 #endif |
| 382 AR6000_WLAN_STATE arWlanState; |
| 383 struct ar_node_mapping arNodeMap[MAX_NODE_NUM]; |
| 384 A_UINT8 arIbssPsEnable; |
| 385 A_UINT8 arNodeNum; |
| 386 A_UINT8 arNexEpId; |
| 387 struct ar_cookie *arCookieList; |
| 388 A_UINT32 arCookieCount; |
| 389 A_UINT32 arRateMask; |
| 390 A_UINT8 arSkipScan; |
| 391 A_UINT16 arBeaconInterval; |
| 392 A_BOOL arConnectPending; |
| 393 A_BOOL arWmmEnabled; |
| 394 struct ar_hb_chlng_resp arHBChallengeResp; |
| 395 A_UINT8 arKeepaliveConfigured; |
| 396 A_UINT32 arMgmtFilter; |
| 397 HTC_ENDPOINT_ID arAc2EpMapping[WMM_NUM_AC]; |
| 398 A_BOOL arAcStreamActive[WMM_NUM_AC]; |
| 399 A_UINT8 arAcStreamPriMap[WMM_NUM_AC]; |
| 400 A_UINT8 arHiAcStreamActivePri; |
| 401 A_UINT8 arEp2AcMapping[ENDPOINT_MAX]; |
| 402 HTC_ENDPOINT_ID arControlEp; |
| 403 #ifdef HTC_RAW_INTERFACE |
| 404 HTC_ENDPOINT_ID arRaw2EpMapping[HTC_RAW_STREAM_NUM_MAX]; |
| 405 HTC_RAW_STREAM_ID arEp2RawMapping[ENDPOINT_MAX]; |
| 406 struct semaphore raw_htc_read_sem[HTC_RAW_STREAM_NUM_MAX]; |
| 407 struct semaphore raw_htc_write_sem[HTC_RAW_STREAM_NUM_MAX]; |
| 408 wait_queue_head_t raw_htc_read_queue[HTC_RAW_STREAM_NUM_MAX]; |
| 409 wait_queue_head_t raw_htc_write_queue[HTC_RAW_STREAM_NUM_MAX]; |
| 410 raw_htc_buffer raw_htc_read_buffer[HTC_RAW_STREAM_NUM_MAX][RAW_HTC_
READ_BUFFERS_NUM]; |
| 411 raw_htc_buffer raw_htc_write_buffer[HTC_RAW_STREAM_NUM_MAX][RAW_HTC
_WRITE_BUFFERS_NUM]; |
| 412 A_BOOL write_buffer_available[HTC_RAW_STREAM_NUM_MAX]; |
| 413 A_BOOL read_buffer_available[HTC_RAW_STREAM_NUM_MAX]; |
| 414 #endif |
| 415 A_BOOL arNetQueueStopped; |
| 416 A_BOOL arRawIfInit; |
| 417 int arDeviceIndex; |
| 418 COMMON_CREDIT_STATE_INFO arCreditStateInfo; |
| 419 A_BOOL arWMIControlEpFull; |
| 420 A_BOOL dbgLogFetchInProgress; |
| 421 A_UCHAR log_buffer[DBGLOG_HOST_LOG_BUFFER_SIZE]; |
| 422 A_UINT32 log_cnt; |
| 423 A_UINT32 dbglog_init_done; |
| 424 A_UINT32 arConnectCtrlFlags; |
| 425 #ifdef USER_KEYS |
| 426 A_INT32 user_savedkeys_stat; |
| 427 A_UINT32 user_key_ctrl; |
| 428 struct USER_SAVEDKEYS user_saved_keys; |
| 429 #endif |
| 430 USER_RSSI_THOLD rssi_map[12]; |
| 431 A_UINT8 arUserBssFilter; |
| 432 A_UINT16 ap_profile_flag; /* AP mode */ |
| 433 WMI_AP_ACL g_acl; /* AP mode */ |
| 434 sta_t sta_list[AP_MAX_NUM_STA]; /* AP mode */ |
| 435 A_UINT8 sta_list_index; /* AP mode */ |
| 436 struct ieee80211req_key ap_mode_bkey; /* AP mode */ |
| 437 A_NETBUF_QUEUE_T mcastpsq; /* power save q for Mcast frames */ |
| 438 A_MUTEX_T mcastpsqLock; |
| 439 A_BOOL DTIMExpired; /* flag to indicate DTIM expired */ |
| 440 A_UINT8 intra_bss; /* enable/disable intra bss data forwar
d */ |
| 441 void *aggr_cntxt; |
| 442 #ifndef EXPORT_HCI_BRIDGE_INTERFACE |
| 443 void *hcidev_info; |
| 444 #endif |
| 445 WMI_AP_MODE_STAT arAPStats; |
| 446 A_UINT8 ap_hidden_ssid; |
| 447 A_UINT8 ap_country_code[3]; |
| 448 A_UINT8 ap_wmode; |
| 449 A_UINT8 ap_dtim_period; |
| 450 A_UINT16 ap_beacon_interval; |
| 451 A_UINT16 arRTS; |
| 452 A_UINT16 arACS; /* AP mode - Auto Channel Selection */ |
| 453 HTC_PACKET_QUEUE amsdu_rx_buffer_queue; |
| 454 A_BOOL bIsDestroyProgress; /* flag to indicate ar6k destroy
is in progress */ |
| 455 A_TIMER disconnect_timer; |
| 456 A_UINT8 rxMetaVersion; |
| 457 #ifdef WAPI_ENABLE |
| 458 A_UINT8 arWapiEnable; |
| 459 #endif |
| 460 WMI_BTCOEX_CONFIG_EVENT arBtcoexConfig; |
| 461 WMI_BTCOEX_STATS_EVENT arBtcoexStats; |
| 462 A_INT32 (*exitCallback)(void *config); /* generic callback
at AR6K exit */ |
| 463 HIF_DEVICE_OS_DEVICE_INFO osDevInfo; |
| 464 #ifdef CONFIG_CFG80211 |
| 465 struct wireless_dev *wdev; |
| 466 struct cfg80211_scan_request *scan_request; |
| 467 struct ar_key keys[WMI_MAX_KEY_INDEX + 1]; |
| 468 #endif /* CONFIG_CFG80211 */ |
| 469 } AR_SOFTC_T; |
| 470 |
| 471 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) |
| 472 /* Looks like we need this for 2.4 kernels */ |
| 473 static inline void *ar6k_priv(struct net_device *dev) |
| 474 { |
| 475 return(dev->priv); |
| 476 } |
| 477 #else |
| 478 #ifdef CONFIG_CFG80211 |
| 479 static inline void *ar6k_priv(struct net_device *dev) |
| 480 { |
| 481 return (wdev_priv(dev->ieee80211_ptr)); |
| 482 } |
| 483 #else |
| 484 #define ar6k_priv netdev_priv |
| 485 #endif /* CONFIG_CFG80211 */ |
| 486 #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) */ |
| 487 |
| 488 #define arAc2EndpointID(ar,ac) (ar)->arAc2EpMapping[(ac)] |
| 489 #define arSetAc2EndpointIDMap(ar,ac,ep) \ |
| 490 { (ar)->arAc2EpMapping[(ac)] = (ep); \ |
| 491 (ar)->arEp2AcMapping[(ep)] = (ac); } |
| 492 #define arEndpoint2Ac(ar,ep) (ar)->arEp2AcMapping[(ep)] |
| 493 |
| 494 #define arRawIfEnabled(ar) (ar)->arRawIfInit |
| 495 #define arRawStream2EndpointID(ar,raw) (ar)->arRaw2EpMapping[(raw)] |
| 496 #define arSetRawStream2EndpointIDMap(ar,raw,ep) \ |
| 497 { (ar)->arRaw2EpMapping[(raw)] = (ep); \ |
| 498 (ar)->arEp2RawMapping[(ep)] = (raw); } |
| 499 #define arEndpoint2RawStreamID(ar,ep) (ar)->arEp2RawMapping[(ep)] |
| 500 |
| 501 struct ar_giwscan_param { |
| 502 char *current_ev; |
| 503 char *end_buf; |
| 504 A_UINT32 bytes_needed; |
| 505 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) |
| 506 struct iw_request_info *info; |
| 507 #endif |
| 508 }; |
| 509 |
| 510 #define AR6000_STAT_INC(ar, stat) (ar->arNetStats.stat++) |
| 511 |
| 512 #define AR6000_SPIN_LOCK(lock, param) do { \ |
| 513 if (irqs_disabled()) { \ |
| 514 AR_DEBUG_PRINTF(ATH_DEBUG_TRC,("IRQs disabled:AR6000_LOCK\n"));
\ |
| 515 } \ |
| 516 spin_lock_bh(lock); \ |
| 517 } while (0) |
| 518 |
| 519 #define AR6000_SPIN_UNLOCK(lock, param) do { \ |
| 520 if (irqs_disabled()) { \ |
| 521 AR_DEBUG_PRINTF(ATH_DEBUG_TRC,("IRQs disabled: AR6000_UNLOCK\n"));
\ |
| 522 } \ |
| 523 spin_unlock_bh(lock); \ |
| 524 } while (0) |
| 525 |
| 526 int ar6000_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); |
| 527 int ar6000_ioctl_dispatcher(struct net_device *dev, struct ifreq *rq, int cmd); |
| 528 void ar6000_gpio_init(void); |
| 529 void ar6000_init_profile_info(AR_SOFTC_T *ar); |
| 530 void ar6000_install_static_wep_keys(AR_SOFTC_T *ar); |
| 531 int ar6000_init(struct net_device *dev); |
| 532 int ar6000_dbglog_get_debug_logs(AR_SOFTC_T *ar); |
| 533 void ar6000_TxDataCleanup(AR_SOFTC_T *ar); |
| 534 int ar6000_acl_data_tx(struct sk_buff *skb, struct net_device *dev); |
| 535 |
| 536 #ifdef HTC_RAW_INTERFACE |
| 537 |
| 538 #ifndef __user |
| 539 #define __user |
| 540 #endif |
| 541 |
| 542 int ar6000_htc_raw_open(AR_SOFTC_T *ar); |
| 543 int ar6000_htc_raw_close(AR_SOFTC_T *ar); |
| 544 ssize_t ar6000_htc_raw_read(AR_SOFTC_T *ar, |
| 545 HTC_RAW_STREAM_ID StreamID, |
| 546 char __user *buffer, size_t count); |
| 547 ssize_t ar6000_htc_raw_write(AR_SOFTC_T *ar, |
| 548 HTC_RAW_STREAM_ID StreamID, |
| 549 char __user *buffer, size_t count); |
| 550 |
| 551 #endif /* HTC_RAW_INTERFACE */ |
| 552 |
| 553 /* AP mode */ |
| 554 /*TODO: These routines should be moved to a file that is common across OS */ |
| 555 sta_t * |
| 556 ieee80211_find_conn(AR_SOFTC_T *ar, A_UINT8 *node_addr); |
| 557 |
| 558 sta_t * |
| 559 ieee80211_find_conn_for_aid(AR_SOFTC_T *ar, A_UINT8 aid); |
| 560 |
| 561 A_UINT8 |
| 562 remove_sta(AR_SOFTC_T *ar, A_UINT8 *mac, A_UINT16 reason); |
| 563 |
| 564 /* HCI support */ |
| 565 |
| 566 #ifndef EXPORT_HCI_BRIDGE_INTERFACE |
| 567 A_STATUS ar6000_setup_hci(AR_SOFTC_T *ar); |
| 568 void ar6000_cleanup_hci(AR_SOFTC_T *ar); |
| 569 void ar6000_set_default_ar3kconfig(AR_SOFTC_T *ar, void *ar3kconfig); |
| 570 |
| 571 /* HCI bridge testing */ |
| 572 A_STATUS hci_test_send(AR_SOFTC_T *ar, struct sk_buff *skb); |
| 573 #endif |
| 574 |
| 575 ATH_DEBUG_DECLARE_EXTERN(htc); |
| 576 ATH_DEBUG_DECLARE_EXTERN(wmi); |
| 577 ATH_DEBUG_DECLARE_EXTERN(bmi); |
| 578 ATH_DEBUG_DECLARE_EXTERN(hif); |
| 579 ATH_DEBUG_DECLARE_EXTERN(wlan); |
| 580 ATH_DEBUG_DECLARE_EXTERN(misc); |
| 581 |
| 582 extern A_UINT8 bcast_mac[]; |
| 583 extern A_UINT8 null_mac[]; |
| 584 |
| 585 #ifdef __cplusplus |
| 586 } |
| 587 #endif |
| 588 |
| 589 #endif /* _AR6000_H_ */ |
OLD | NEW |