ath9k.h 30 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066
  1. /*
  2. * Copyright (c) 2008 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. #ifndef ATH9K_H
  17. #define ATH9K_H
  18. #include <linux/io.h>
  19. #define ATHEROS_VENDOR_ID 0x168c
  20. #define AR5416_DEVID_PCI 0x0023
  21. #define AR5416_DEVID_PCIE 0x0024
  22. #define AR9160_DEVID_PCI 0x0027
  23. #define AR9280_DEVID_PCI 0x0029
  24. #define AR9280_DEVID_PCIE 0x002a
  25. #define AR5416_AR9100_DEVID 0x000b
  26. #define AR_SUBVENDOR_ID_NOG 0x0e11
  27. #define AR_SUBVENDOR_ID_NEW_A 0x7065
  28. #define ATH9K_TXERR_XRETRY 0x01
  29. #define ATH9K_TXERR_FILT 0x02
  30. #define ATH9K_TXERR_FIFO 0x04
  31. #define ATH9K_TXERR_XTXOP 0x08
  32. #define ATH9K_TXERR_TIMER_EXPIRED 0x10
  33. #define ATH9K_TX_BA 0x01
  34. #define ATH9K_TX_PWRMGMT 0x02
  35. #define ATH9K_TX_DESC_CFG_ERR 0x04
  36. #define ATH9K_TX_DATA_UNDERRUN 0x08
  37. #define ATH9K_TX_DELIM_UNDERRUN 0x10
  38. #define ATH9K_TX_SW_ABORTED 0x40
  39. #define ATH9K_TX_SW_FILTERED 0x80
  40. #define NBBY 8
  41. struct ath_tx_status {
  42. u32 ts_tstamp;
  43. u16 ts_seqnum;
  44. u8 ts_status;
  45. u8 ts_ratecode;
  46. u8 ts_rateindex;
  47. int8_t ts_rssi;
  48. u8 ts_shortretry;
  49. u8 ts_longretry;
  50. u8 ts_virtcol;
  51. u8 ts_antenna;
  52. u8 ts_flags;
  53. int8_t ts_rssi_ctl0;
  54. int8_t ts_rssi_ctl1;
  55. int8_t ts_rssi_ctl2;
  56. int8_t ts_rssi_ext0;
  57. int8_t ts_rssi_ext1;
  58. int8_t ts_rssi_ext2;
  59. u8 pad[3];
  60. u32 ba_low;
  61. u32 ba_high;
  62. u32 evm0;
  63. u32 evm1;
  64. u32 evm2;
  65. };
  66. struct ath_rx_status {
  67. u32 rs_tstamp;
  68. u16 rs_datalen;
  69. u8 rs_status;
  70. u8 rs_phyerr;
  71. int8_t rs_rssi;
  72. u8 rs_keyix;
  73. u8 rs_rate;
  74. u8 rs_antenna;
  75. u8 rs_more;
  76. int8_t rs_rssi_ctl0;
  77. int8_t rs_rssi_ctl1;
  78. int8_t rs_rssi_ctl2;
  79. int8_t rs_rssi_ext0;
  80. int8_t rs_rssi_ext1;
  81. int8_t rs_rssi_ext2;
  82. u8 rs_isaggr;
  83. u8 rs_moreaggr;
  84. u8 rs_num_delims;
  85. u8 rs_flags;
  86. u32 evm0;
  87. u32 evm1;
  88. u32 evm2;
  89. };
  90. #define ATH9K_RXERR_CRC 0x01
  91. #define ATH9K_RXERR_PHY 0x02
  92. #define ATH9K_RXERR_FIFO 0x04
  93. #define ATH9K_RXERR_DECRYPT 0x08
  94. #define ATH9K_RXERR_MIC 0x10
  95. #define ATH9K_RX_MORE 0x01
  96. #define ATH9K_RX_MORE_AGGR 0x02
  97. #define ATH9K_RX_GI 0x04
  98. #define ATH9K_RX_2040 0x08
  99. #define ATH9K_RX_DELIM_CRC_PRE 0x10
  100. #define ATH9K_RX_DELIM_CRC_POST 0x20
  101. #define ATH9K_RX_DECRYPT_BUSY 0x40
  102. #define ATH9K_RXKEYIX_INVALID ((u8)-1)
  103. #define ATH9K_TXKEYIX_INVALID ((u32)-1)
  104. struct ath_desc {
  105. u32 ds_link;
  106. u32 ds_data;
  107. u32 ds_ctl0;
  108. u32 ds_ctl1;
  109. u32 ds_hw[20];
  110. union {
  111. struct ath_tx_status tx;
  112. struct ath_rx_status rx;
  113. void *stats;
  114. } ds_us;
  115. void *ds_vdata;
  116. } __packed;
  117. #define ds_txstat ds_us.tx
  118. #define ds_rxstat ds_us.rx
  119. #define ds_stat ds_us.stats
  120. #define ATH9K_TXDESC_CLRDMASK 0x0001
  121. #define ATH9K_TXDESC_NOACK 0x0002
  122. #define ATH9K_TXDESC_RTSENA 0x0004
  123. #define ATH9K_TXDESC_CTSENA 0x0008
  124. #define ATH9K_TXDESC_INTREQ 0x0010
  125. #define ATH9K_TXDESC_VEOL 0x0020
  126. #define ATH9K_TXDESC_EXT_ONLY 0x0040
  127. #define ATH9K_TXDESC_EXT_AND_CTL 0x0080
  128. #define ATH9K_TXDESC_VMF 0x0100
  129. #define ATH9K_TXDESC_FRAG_IS_ON 0x0200
  130. #define ATH9K_RXDESC_INTREQ 0x0020
  131. enum hal_capability_type {
  132. HAL_CAP_CIPHER = 0,
  133. HAL_CAP_TKIP_MIC,
  134. HAL_CAP_TKIP_SPLIT,
  135. HAL_CAP_PHYCOUNTERS,
  136. HAL_CAP_DIVERSITY,
  137. HAL_CAP_PSPOLL,
  138. HAL_CAP_TXPOW,
  139. HAL_CAP_PHYDIAG,
  140. HAL_CAP_MCAST_KEYSRCH,
  141. HAL_CAP_TSF_ADJUST,
  142. HAL_CAP_WME_TKIPMIC,
  143. HAL_CAP_RFSILENT,
  144. HAL_CAP_ANT_CFG_2GHZ,
  145. HAL_CAP_ANT_CFG_5GHZ
  146. };
  147. struct hal_capabilities {
  148. u32 halChanSpreadSupport:1,
  149. halChapTuningSupport:1,
  150. halMicAesCcmSupport:1,
  151. halMicCkipSupport:1,
  152. halMicTkipSupport:1,
  153. halCipherAesCcmSupport:1,
  154. halCipherCkipSupport:1,
  155. halCipherTkipSupport:1,
  156. halVEOLSupport:1,
  157. halBssIdMaskSupport:1,
  158. halMcastKeySrchSupport:1,
  159. halTsfAddSupport:1,
  160. halChanHalfRate:1,
  161. halChanQuarterRate:1,
  162. halHTSupport:1,
  163. halGTTSupport:1,
  164. halFastCCSupport:1,
  165. halRfSilentSupport:1,
  166. halWowSupport:1,
  167. halCSTSupport:1,
  168. halEnhancedPmSupport:1,
  169. halAutoSleepSupport:1,
  170. hal4kbSplitTransSupport:1,
  171. halWowMatchPatternExact:1;
  172. u32 halWirelessModes;
  173. u16 halTotalQueues;
  174. u16 halKeyCacheSize;
  175. u16 halLow5GhzChan, halHigh5GhzChan;
  176. u16 halLow2GhzChan, halHigh2GhzChan;
  177. u16 halNumMRRetries;
  178. u16 halRtsAggrLimit;
  179. u8 halTxChainMask;
  180. u8 halRxChainMask;
  181. u16 halTxTrigLevelMax;
  182. u16 halRegCap;
  183. u8 halNumGpioPins;
  184. u8 halNumAntCfg2GHz;
  185. u8 halNumAntCfg5GHz;
  186. };
  187. struct hal_ops_config {
  188. int ath_hal_dma_beacon_response_time;
  189. int ath_hal_sw_beacon_response_time;
  190. int ath_hal_additional_swba_backoff;
  191. int ath_hal_6mb_ack;
  192. int ath_hal_cwmIgnoreExtCCA;
  193. u8 ath_hal_pciePowerSaveEnable;
  194. u8 ath_hal_pcieL1SKPEnable;
  195. u8 ath_hal_pcieClockReq;
  196. u32 ath_hal_pcieWaen;
  197. int ath_hal_pciePowerReset;
  198. u8 ath_hal_pcieRestore;
  199. u8 ath_hal_analogShiftReg;
  200. u8 ath_hal_htEnable;
  201. u32 ath_hal_ofdmTrigLow;
  202. u32 ath_hal_ofdmTrigHigh;
  203. u32 ath_hal_cckTrigHigh;
  204. u32 ath_hal_cckTrigLow;
  205. u32 ath_hal_enableANI;
  206. u8 ath_hal_noiseImmunityLvl;
  207. u32 ath_hal_ofdmWeakSigDet;
  208. u32 ath_hal_cckWeakSigThr;
  209. u8 ath_hal_spurImmunityLvl;
  210. u8 ath_hal_firStepLvl;
  211. int8_t ath_hal_rssiThrHigh;
  212. int8_t ath_hal_rssiThrLow;
  213. u16 ath_hal_diversityControl;
  214. u16 ath_hal_antennaSwitchSwap;
  215. int ath_hal_serializeRegMode;
  216. int ath_hal_intrMitigation;
  217. #define SPUR_DISABLE 0
  218. #define SPUR_ENABLE_IOCTL 1
  219. #define SPUR_ENABLE_EEPROM 2
  220. #define AR_EEPROM_MODAL_SPURS 5
  221. #define AR_SPUR_5413_1 1640
  222. #define AR_SPUR_5413_2 1200
  223. #define AR_NO_SPUR 0x8000
  224. #define AR_BASE_FREQ_2GHZ 2300
  225. #define AR_BASE_FREQ_5GHZ 4900
  226. #define AR_SPUR_FEEQ_BOUND_HT40 19
  227. #define AR_SPUR_FEEQ_BOUND_HT20 10
  228. int ath_hal_spurMode;
  229. u16 ath_hal_spurChans[AR_EEPROM_MODAL_SPURS][2];
  230. };
  231. enum ath9k_tx_queue {
  232. ATH9K_TX_QUEUE_INACTIVE = 0,
  233. ATH9K_TX_QUEUE_DATA,
  234. ATH9K_TX_QUEUE_BEACON,
  235. ATH9K_TX_QUEUE_CAB,
  236. ATH9K_TX_QUEUE_UAPSD,
  237. ATH9K_TX_QUEUE_PSPOLL
  238. };
  239. #define ATH9K_NUM_TX_QUEUES 10
  240. enum ath9k_tx_queue_subtype {
  241. ATH9K_WME_AC_BK = 0,
  242. ATH9K_WME_AC_BE,
  243. ATH9K_WME_AC_VI,
  244. ATH9K_WME_AC_VO,
  245. ATH9K_WME_UPSD
  246. };
  247. enum ath9k_tx_queue_flags {
  248. TXQ_FLAG_TXOKINT_ENABLE = 0x0001,
  249. TXQ_FLAG_TXERRINT_ENABLE = 0x0001,
  250. TXQ_FLAG_TXDESCINT_ENABLE = 0x0002,
  251. TXQ_FLAG_TXEOLINT_ENABLE = 0x0004,
  252. TXQ_FLAG_TXURNINT_ENABLE = 0x0008,
  253. TXQ_FLAG_BACKOFF_DISABLE = 0x0010,
  254. TXQ_FLAG_COMPRESSION_ENABLE = 0x0020,
  255. TXQ_FLAG_RDYTIME_EXP_POLICY_ENABLE = 0x0040,
  256. TXQ_FLAG_FRAG_BURST_BACKOFF_ENABLE = 0x0080,
  257. };
  258. struct ath9k_txq_info {
  259. u32 tqi_ver;
  260. enum ath9k_tx_queue_subtype tqi_subtype;
  261. enum ath9k_tx_queue_flags tqi_qflags;
  262. u32 tqi_priority;
  263. u32 tqi_aifs;
  264. u32 tqi_cwmin;
  265. u32 tqi_cwmax;
  266. u16 tqi_shretry;
  267. u16 tqi_lgretry;
  268. u32 tqi_cbrPeriod;
  269. u32 tqi_cbrOverflowLimit;
  270. u32 tqi_burstTime;
  271. u32 tqi_readyTime;
  272. u32 tqi_compBuf;
  273. };
  274. #define ATH9K_TXQ_USEDEFAULT ((u32) -1)
  275. #define ATH9K_DECOMP_MASK_SIZE 128
  276. #define ATH9K_READY_TIME_LO_BOUND 50
  277. #define ATH9K_READY_TIME_HI_BOUND 96
  278. enum ath9k_pkt_type {
  279. ATH9K_PKT_TYPE_NORMAL = 0,
  280. ATH9K_PKT_TYPE_ATIM,
  281. ATH9K_PKT_TYPE_PSPOLL,
  282. ATH9K_PKT_TYPE_BEACON,
  283. ATH9K_PKT_TYPE_PROBE_RESP,
  284. ATH9K_PKT_TYPE_CHIRP,
  285. ATH9K_PKT_TYPE_GRP_POLL,
  286. };
  287. struct ath9k_tx_queue_info {
  288. u32 tqi_ver;
  289. enum ath9k_tx_queue tqi_type;
  290. enum ath9k_tx_queue_subtype tqi_subtype;
  291. enum ath9k_tx_queue_flags tqi_qflags;
  292. u32 tqi_priority;
  293. u32 tqi_aifs;
  294. u32 tqi_cwmin;
  295. u32 tqi_cwmax;
  296. u16 tqi_shretry;
  297. u16 tqi_lgretry;
  298. u32 tqi_cbrPeriod;
  299. u32 tqi_cbrOverflowLimit;
  300. u32 tqi_burstTime;
  301. u32 tqi_readyTime;
  302. u32 tqi_physCompBuf;
  303. u32 tqi_intFlags;
  304. };
  305. enum ath9k_rx_filter {
  306. ATH9K_RX_FILTER_UCAST = 0x00000001,
  307. ATH9K_RX_FILTER_MCAST = 0x00000002,
  308. ATH9K_RX_FILTER_BCAST = 0x00000004,
  309. ATH9K_RX_FILTER_CONTROL = 0x00000008,
  310. ATH9K_RX_FILTER_BEACON = 0x00000010,
  311. ATH9K_RX_FILTER_PROM = 0x00000020,
  312. ATH9K_RX_FILTER_PROBEREQ = 0x00000080,
  313. ATH9K_RX_FILTER_PSPOLL = 0x00004000,
  314. ATH9K_RX_FILTER_PHYERR = 0x00000100,
  315. ATH9K_RX_FILTER_PHYRADAR = 0x00002000,
  316. };
  317. enum ath9k_int {
  318. ATH9K_INT_RX = 0x00000001,
  319. ATH9K_INT_RXDESC = 0x00000002,
  320. ATH9K_INT_RXNOFRM = 0x00000008,
  321. ATH9K_INT_RXEOL = 0x00000010,
  322. ATH9K_INT_RXORN = 0x00000020,
  323. ATH9K_INT_TX = 0x00000040,
  324. ATH9K_INT_TXDESC = 0x00000080,
  325. ATH9K_INT_TIM_TIMER = 0x00000100,
  326. ATH9K_INT_TXURN = 0x00000800,
  327. ATH9K_INT_MIB = 0x00001000,
  328. ATH9K_INT_RXPHY = 0x00004000,
  329. ATH9K_INT_RXKCM = 0x00008000,
  330. ATH9K_INT_SWBA = 0x00010000,
  331. ATH9K_INT_BMISS = 0x00040000,
  332. ATH9K_INT_BNR = 0x00100000,
  333. ATH9K_INT_TIM = 0x00200000,
  334. ATH9K_INT_DTIM = 0x00400000,
  335. ATH9K_INT_DTIMSYNC = 0x00800000,
  336. ATH9K_INT_GPIO = 0x01000000,
  337. ATH9K_INT_CABEND = 0x02000000,
  338. ATH9K_INT_CST = 0x10000000,
  339. ATH9K_INT_GTT = 0x20000000,
  340. ATH9K_INT_FATAL = 0x40000000,
  341. ATH9K_INT_GLOBAL = 0x80000000,
  342. ATH9K_INT_BMISC = ATH9K_INT_TIM |
  343. ATH9K_INT_DTIM |
  344. ATH9K_INT_DTIMSYNC |
  345. ATH9K_INT_CABEND,
  346. ATH9K_INT_COMMON = ATH9K_INT_RXNOFRM |
  347. ATH9K_INT_RXDESC |
  348. ATH9K_INT_RXEOL |
  349. ATH9K_INT_RXORN |
  350. ATH9K_INT_TXURN |
  351. ATH9K_INT_TXDESC |
  352. ATH9K_INT_MIB |
  353. ATH9K_INT_RXPHY |
  354. ATH9K_INT_RXKCM |
  355. ATH9K_INT_SWBA |
  356. ATH9K_INT_BMISS |
  357. ATH9K_INT_GPIO,
  358. ATH9K_INT_NOCARD = 0xffffffff
  359. };
  360. struct ath9k_rate_table {
  361. int rateCount;
  362. u8 rateCodeToIndex[256];
  363. struct {
  364. u8 valid;
  365. u8 phy;
  366. u32 rateKbps;
  367. u8 rateCode;
  368. u8 shortPreamble;
  369. u8 dot11Rate;
  370. u8 controlRate;
  371. u16 lpAckDuration;
  372. u16 spAckDuration;
  373. } info[32];
  374. };
  375. #define ATH9K_RATESERIES_RTS_CTS 0x0001
  376. #define ATH9K_RATESERIES_2040 0x0002
  377. #define ATH9K_RATESERIES_HALFGI 0x0004
  378. struct ath9k_11n_rate_series {
  379. u32 Tries;
  380. u32 Rate;
  381. u32 PktDuration;
  382. u32 ChSel;
  383. u32 RateFlags;
  384. };
  385. #define CHANNEL_CW_INT 0x00002
  386. #define CHANNEL_CCK 0x00020
  387. #define CHANNEL_OFDM 0x00040
  388. #define CHANNEL_2GHZ 0x00080
  389. #define CHANNEL_5GHZ 0x00100
  390. #define CHANNEL_PASSIVE 0x00200
  391. #define CHANNEL_DYN 0x00400
  392. #define CHANNEL_HALF 0x04000
  393. #define CHANNEL_QUARTER 0x08000
  394. #define CHANNEL_HT20 0x10000
  395. #define CHANNEL_HT40PLUS 0x20000
  396. #define CHANNEL_HT40MINUS 0x40000
  397. #define CHANNEL_INTERFERENCE 0x01
  398. #define CHANNEL_DFS 0x02
  399. #define CHANNEL_4MS_LIMIT 0x04
  400. #define CHANNEL_DFS_CLEAR 0x08
  401. #define CHANNEL_DISALLOW_ADHOC 0x10
  402. #define CHANNEL_PER_11D_ADHOC 0x20
  403. #define CHANNEL_A (CHANNEL_5GHZ|CHANNEL_OFDM)
  404. #define CHANNEL_B (CHANNEL_2GHZ|CHANNEL_CCK)
  405. #define CHANNEL_G (CHANNEL_2GHZ|CHANNEL_OFDM)
  406. #define CHANNEL_G_HT20 (CHANNEL_2GHZ|CHANNEL_HT20)
  407. #define CHANNEL_A_HT20 (CHANNEL_5GHZ|CHANNEL_HT20)
  408. #define CHANNEL_G_HT40PLUS (CHANNEL_2GHZ|CHANNEL_HT40PLUS)
  409. #define CHANNEL_G_HT40MINUS (CHANNEL_2GHZ|CHANNEL_HT40MINUS)
  410. #define CHANNEL_A_HT40PLUS (CHANNEL_5GHZ|CHANNEL_HT40PLUS)
  411. #define CHANNEL_A_HT40MINUS (CHANNEL_5GHZ|CHANNEL_HT40MINUS)
  412. #define CHANNEL_ALL \
  413. (CHANNEL_OFDM| \
  414. CHANNEL_CCK| \
  415. CHANNEL_2GHZ | \
  416. CHANNEL_5GHZ | \
  417. CHANNEL_HT20 | \
  418. CHANNEL_HT40PLUS | \
  419. CHANNEL_HT40MINUS)
  420. struct ath9k_channel {
  421. u16 channel;
  422. u32 channelFlags;
  423. u8 privFlags;
  424. int8_t maxRegTxPower;
  425. int8_t maxTxPower;
  426. int8_t minTxPower;
  427. u32 chanmode;
  428. int32_t CalValid;
  429. bool oneTimeCalsDone;
  430. int8_t iCoff;
  431. int8_t qCoff;
  432. int16_t rawNoiseFloor;
  433. int8_t antennaMax;
  434. u32 regDmnFlags;
  435. u32 conformanceTestLimit[3]; /* 0:11a, 1: 11b, 2:11g */
  436. #ifdef ATH_NF_PER_CHAN
  437. struct ath9k_nfcal_hist nfCalHist[NUM_NF_READINGS];
  438. #endif
  439. };
  440. #define IS_CHAN_A(_c) ((((_c)->channelFlags & CHANNEL_A) == CHANNEL_A) || \
  441. (((_c)->channelFlags & CHANNEL_A_HT20) == CHANNEL_A_HT20) || \
  442. (((_c)->channelFlags & CHANNEL_A_HT40PLUS) == CHANNEL_A_HT40PLUS) || \
  443. (((_c)->channelFlags & CHANNEL_A_HT40MINUS) == CHANNEL_A_HT40MINUS))
  444. #define IS_CHAN_B(_c) (((_c)->channelFlags & CHANNEL_B) == CHANNEL_B)
  445. #define IS_CHAN_G(_c) ((((_c)->channelFlags & (CHANNEL_G)) == CHANNEL_G) || \
  446. (((_c)->channelFlags & CHANNEL_G_HT20) == CHANNEL_G_HT20) || \
  447. (((_c)->channelFlags & CHANNEL_G_HT40PLUS) == CHANNEL_G_HT40PLUS) || \
  448. (((_c)->channelFlags & CHANNEL_G_HT40MINUS) == CHANNEL_G_HT40MINUS))
  449. #define IS_CHAN_CCK(_c) (((_c)->channelFlags & CHANNEL_CCK) != 0)
  450. #define IS_CHAN_OFDM(_c) (((_c)->channelFlags & CHANNEL_OFDM) != 0)
  451. #define IS_CHAN_5GHZ(_c) (((_c)->channelFlags & CHANNEL_5GHZ) != 0)
  452. #define IS_CHAN_2GHZ(_c) (((_c)->channelFlags & CHANNEL_2GHZ) != 0)
  453. #define IS_CHAN_PASSIVE(_c) (((_c)->channelFlags & CHANNEL_PASSIVE) != 0)
  454. #define IS_CHAN_HALF_RATE(_c) (((_c)->channelFlags & CHANNEL_HALF) != 0)
  455. #define IS_CHAN_QUARTER_RATE(_c) (((_c)->channelFlags & CHANNEL_QUARTER) != 0)
  456. /* These macros check chanmode and not channelFlags */
  457. #define IS_CHAN_HT20(_c) (((_c)->chanmode == CHANNEL_A_HT20) || \
  458. ((_c)->chanmode == CHANNEL_G_HT20))
  459. #define IS_CHAN_HT40(_c) (((_c)->chanmode == CHANNEL_A_HT40PLUS) || \
  460. ((_c)->chanmode == CHANNEL_A_HT40MINUS) || \
  461. ((_c)->chanmode == CHANNEL_G_HT40PLUS) || \
  462. ((_c)->chanmode == CHANNEL_G_HT40MINUS))
  463. #define IS_CHAN_HT(_c) (IS_CHAN_HT20((_c)) || IS_CHAN_HT40((_c)))
  464. #define IS_CHAN_IN_PUBLIC_SAFETY_BAND(_c) ((_c) > 4940 && (_c) < 4990)
  465. #define IS_CHAN_A_5MHZ_SPACED(_c) \
  466. ((((_c)->channelFlags & CHANNEL_5GHZ) != 0) && \
  467. (((_c)->channel % 20) != 0) && \
  468. (((_c)->channel % 10) != 0))
  469. struct ath9k_keyval {
  470. u8 kv_type;
  471. u8 kv_pad;
  472. u16 kv_len;
  473. u8 kv_val[16];
  474. u8 kv_mic[8];
  475. u8 kv_txmic[8];
  476. };
  477. enum ath9k_key_type {
  478. ATH9K_KEY_TYPE_CLEAR,
  479. ATH9K_KEY_TYPE_WEP,
  480. ATH9K_KEY_TYPE_AES,
  481. ATH9K_KEY_TYPE_TKIP,
  482. };
  483. enum ath9k_cipher {
  484. ATH9K_CIPHER_WEP = 0,
  485. ATH9K_CIPHER_AES_OCB = 1,
  486. ATH9K_CIPHER_AES_CCM = 2,
  487. ATH9K_CIPHER_CKIP = 3,
  488. ATH9K_CIPHER_TKIP = 4,
  489. ATH9K_CIPHER_CLR = 5,
  490. ATH9K_CIPHER_MIC = 127
  491. };
  492. #define AR_EEPROM_EEPCAP_COMPRESS_DIS 0x0001
  493. #define AR_EEPROM_EEPCAP_AES_DIS 0x0002
  494. #define AR_EEPROM_EEPCAP_FASTFRAME_DIS 0x0004
  495. #define AR_EEPROM_EEPCAP_BURST_DIS 0x0008
  496. #define AR_EEPROM_EEPCAP_MAXQCU 0x01F0
  497. #define AR_EEPROM_EEPCAP_MAXQCU_S 4
  498. #define AR_EEPROM_EEPCAP_HEAVY_CLIP_EN 0x0200
  499. #define AR_EEPROM_EEPCAP_KC_ENTRIES 0xF000
  500. #define AR_EEPROM_EEPCAP_KC_ENTRIES_S 12
  501. #define AR_EEPROM_EEREGCAP_EN_FCC_MIDBAND 0x0040
  502. #define AR_EEPROM_EEREGCAP_EN_KK_U1_EVEN 0x0080
  503. #define AR_EEPROM_EEREGCAP_EN_KK_U2 0x0100
  504. #define AR_EEPROM_EEREGCAP_EN_KK_MIDBAND 0x0200
  505. #define AR_EEPROM_EEREGCAP_EN_KK_U1_ODD 0x0400
  506. #define AR_EEPROM_EEREGCAP_EN_KK_NEW_11A 0x0800
  507. #define AR_EEPROM_EEREGCAP_EN_KK_U1_ODD_PRE4_0 0x4000
  508. #define AR_EEPROM_EEREGCAP_EN_KK_NEW_11A_PRE4_0 0x8000
  509. #define SD_NO_CTL 0xE0
  510. #define NO_CTL 0xff
  511. #define CTL_MODE_M 7
  512. #define CTL_11A 0
  513. #define CTL_11B 1
  514. #define CTL_11G 2
  515. #define CTL_2GHT20 5
  516. #define CTL_5GHT20 6
  517. #define CTL_2GHT40 7
  518. #define CTL_5GHT40 8
  519. #define AR_EEPROM_MAC(i) (0x1d+(i))
  520. #define EEP_SCALE 100
  521. #define EEP_DELTA 10
  522. #define AR_EEPROM_RFSILENT_GPIO_SEL 0x001c
  523. #define AR_EEPROM_RFSILENT_GPIO_SEL_S 2
  524. #define AR_EEPROM_RFSILENT_POLARITY 0x0002
  525. #define AR_EEPROM_RFSILENT_POLARITY_S 1
  526. #define CTRY_DEBUG 0x1ff
  527. #define CTRY_DEFAULT 0
  528. enum reg_ext_bitmap {
  529. REG_EXT_JAPAN_MIDBAND = 1,
  530. REG_EXT_FCC_DFS_HT40 = 2,
  531. REG_EXT_JAPAN_NONDFS_HT40 = 3,
  532. REG_EXT_JAPAN_DFS_HT40 = 4
  533. };
  534. struct ath9k_country_entry {
  535. u16 countryCode;
  536. u16 regDmnEnum;
  537. u16 regDmn5G;
  538. u16 regDmn2G;
  539. u8 isMultidomain;
  540. u8 iso[3];
  541. };
  542. #define REG_WRITE(_ah, _reg, _val) iowrite32(_val, _ah->ah_sh + _reg)
  543. #define REG_READ(_ah, _reg) ioread32(_ah->ah_sh + _reg)
  544. #define SM(_v, _f) (((_v) << _f##_S) & _f)
  545. #define MS(_v, _f) (((_v) & _f) >> _f##_S)
  546. #define REG_RMW(_a, _r, _set, _clr) \
  547. REG_WRITE(_a, _r, (REG_READ(_a, _r) & ~(_clr)) | (_set))
  548. #define REG_RMW_FIELD(_a, _r, _f, _v) \
  549. REG_WRITE(_a, _r, \
  550. (REG_READ(_a, _r) & ~_f) | (((_v) << _f##_S) & _f))
  551. #define REG_SET_BIT(_a, _r, _f) \
  552. REG_WRITE(_a, _r, REG_READ(_a, _r) | _f)
  553. #define REG_CLR_BIT(_a, _r, _f) \
  554. REG_WRITE(_a, _r, REG_READ(_a, _r) & ~_f)
  555. #define ATH9K_COMP_BUF_MAX_SIZE 9216
  556. #define ATH9K_COMP_BUF_ALIGN_SIZE 512
  557. #define ATH9K_TXQ_USE_LOCKOUT_BKOFF_DIS 0x00000001
  558. #define INIT_AIFS 2
  559. #define INIT_CWMIN 15
  560. #define INIT_CWMIN_11B 31
  561. #define INIT_CWMAX 1023
  562. #define INIT_SH_RETRY 10
  563. #define INIT_LG_RETRY 10
  564. #define INIT_SSH_RETRY 32
  565. #define INIT_SLG_RETRY 32
  566. #define WLAN_CTRL_FRAME_SIZE (2+2+6+4)
  567. #define ATH_AMPDU_LIMIT_MAX (64 * 1024 - 1)
  568. #define ATH_AMPDU_LIMIT_DEFAULT ATH_AMPDU_LIMIT_MAX
  569. #define IEEE80211_WEP_IVLEN 3
  570. #define IEEE80211_WEP_KIDLEN 1
  571. #define IEEE80211_WEP_CRCLEN 4
  572. #define IEEE80211_MAX_MPDU_LEN (3840 + FCS_LEN + \
  573. (IEEE80211_WEP_IVLEN + \
  574. IEEE80211_WEP_KIDLEN + \
  575. IEEE80211_WEP_CRCLEN))
  576. #define IEEE80211_MAX_LEN (2300 + FCS_LEN + \
  577. (IEEE80211_WEP_IVLEN + \
  578. IEEE80211_WEP_KIDLEN + \
  579. IEEE80211_WEP_CRCLEN))
  580. #define MAX_REG_ADD_COUNT 129
  581. #define MAX_RATE_POWER 63
  582. enum ath9k_power_mode {
  583. ATH9K_PM_AWAKE = 0,
  584. ATH9K_PM_FULL_SLEEP,
  585. ATH9K_PM_NETWORK_SLEEP,
  586. ATH9K_PM_UNDEFINED
  587. };
  588. #define HAL_ANTENNA_MIN_MODE 0
  589. #define HAL_ANTENNA_FIXED_A 1
  590. #define HAL_ANTENNA_FIXED_B 2
  591. #define HAL_ANTENNA_MAX_MODE 3
  592. struct ath9k_mib_stats {
  593. u32 ackrcv_bad;
  594. u32 rts_bad;
  595. u32 rts_good;
  596. u32 fcs_bad;
  597. u32 beacons;
  598. };
  599. enum ath9k_ant_setting {
  600. ATH9K_ANT_VARIABLE = 0,
  601. ATH9K_ANT_FIXED_A,
  602. ATH9K_ANT_FIXED_B
  603. };
  604. enum ath9k_opmode {
  605. ATH9K_M_STA = 1,
  606. ATH9K_M_IBSS = 0,
  607. ATH9K_M_HOSTAP = 6,
  608. ATH9K_M_MONITOR = 8
  609. };
  610. #define ATH9K_SLOT_TIME_6 6
  611. #define ATH9K_SLOT_TIME_9 9
  612. #define ATH9K_SLOT_TIME_20 20
  613. enum ath9k_ht_macmode {
  614. ATH9K_HT_MACMODE_20 = 0,
  615. ATH9K_HT_MACMODE_2040 = 1,
  616. };
  617. enum ath9k_ht_extprotspacing {
  618. ATH9K_HT_EXTPROTSPACING_20 = 0,
  619. ATH9K_HT_EXTPROTSPACING_25 = 1,
  620. };
  621. struct ath9k_ht_cwm {
  622. enum ath9k_ht_macmode ht_macmode;
  623. enum ath9k_ht_extprotspacing ht_extprotspacing;
  624. };
  625. enum hal_freq_band {
  626. HAL_FREQ_BAND_5GHZ = 0,
  627. HAL_FREQ_BAND_2GHZ = 1,
  628. };
  629. enum ath9k_ani_cmd {
  630. ATH9K_ANI_PRESENT = 0x1,
  631. ATH9K_ANI_NOISE_IMMUNITY_LEVEL = 0x2,
  632. ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION = 0x4,
  633. ATH9K_ANI_CCK_WEAK_SIGNAL_THR = 0x8,
  634. ATH9K_ANI_FIRSTEP_LEVEL = 0x10,
  635. ATH9K_ANI_SPUR_IMMUNITY_LEVEL = 0x20,
  636. ATH9K_ANI_MODE = 0x40,
  637. ATH9K_ANI_PHYERR_RESET = 0x80,
  638. ATH9K_ANI_ALL = 0xff
  639. };
  640. enum phytype {
  641. PHY_DS,
  642. PHY_FH,
  643. PHY_OFDM,
  644. PHY_HT,
  645. PHY_MAX
  646. };
  647. #define PHY_CCK PHY_DS
  648. enum start_adhoc_option {
  649. START_ADHOC_NO_11A,
  650. START_ADHOC_PER_11D,
  651. START_ADHOC_IN_11A,
  652. START_ADHOC_IN_11B,
  653. };
  654. enum ath9k_tp_scale {
  655. ATH9K_TP_SCALE_MAX = 0,
  656. ATH9K_TP_SCALE_50,
  657. ATH9K_TP_SCALE_25,
  658. ATH9K_TP_SCALE_12,
  659. ATH9K_TP_SCALE_MIN
  660. };
  661. enum ser_reg_mode {
  662. SER_REG_MODE_OFF = 0,
  663. SER_REG_MODE_ON = 1,
  664. SER_REG_MODE_AUTO = 2,
  665. };
  666. #define AR_PHY_CCA_MAX_GOOD_VALUE -85
  667. #define AR_PHY_CCA_MAX_HIGH_VALUE -62
  668. #define AR_PHY_CCA_MIN_BAD_VALUE -121
  669. #define AR_PHY_CCA_FILTERWINDOW_LENGTH_INIT 3
  670. #define AR_PHY_CCA_FILTERWINDOW_LENGTH 5
  671. #define ATH9K_NF_CAL_HIST_MAX 5
  672. #define NUM_NF_READINGS 6
  673. struct ath9k_nfcal_hist {
  674. int16_t nfCalBuffer[ATH9K_NF_CAL_HIST_MAX];
  675. u8 currIndex;
  676. int16_t privNF;
  677. u8 invalidNFcount;
  678. };
  679. struct ath9k_beacon_state {
  680. u32 bs_nexttbtt;
  681. u32 bs_nextdtim;
  682. u32 bs_intval;
  683. #define ATH9K_BEACON_PERIOD 0x0000ffff
  684. #define ATH9K_BEACON_ENA 0x00800000
  685. #define ATH9K_BEACON_RESET_TSF 0x01000000
  686. u32 bs_dtimperiod;
  687. u16 bs_cfpperiod;
  688. u16 bs_cfpmaxduration;
  689. u32 bs_cfpnext;
  690. u16 bs_timoffset;
  691. u16 bs_bmissthreshold;
  692. u32 bs_sleepduration;
  693. };
  694. struct ath9k_node_stats {
  695. u32 ns_avgbrssi;
  696. u32 ns_avgrssi;
  697. u32 ns_avgtxrssi;
  698. u32 ns_avgtxrate;
  699. };
  700. #define ATH9K_RSSI_EP_MULTIPLIER (1<<7)
  701. enum ath9k_gpio_output_mux_type {
  702. ATH9K_GPIO_OUTPUT_MUX_AS_OUTPUT,
  703. ATH9K_GPIO_OUTPUT_MUX_AS_PCIE_ATTENTION_LED,
  704. ATH9K_GPIO_OUTPUT_MUX_AS_PCIE_POWER_LED,
  705. ATH9K_GPIO_OUTPUT_MUX_AS_MAC_NETWORK_LED,
  706. ATH9K_GPIO_OUTPUT_MUX_AS_MAC_POWER_LED,
  707. ATH9K_GPIO_OUTPUT_MUX_NUM_ENTRIES
  708. };
  709. enum {
  710. ATH9K_RESET_POWER_ON,
  711. ATH9K_RESET_WARM,
  712. ATH9K_RESET_COLD,
  713. };
  714. #define AH_USE_EEPROM 0x1
  715. struct ath_hal {
  716. u32 ah_magic;
  717. u16 ah_devid;
  718. u16 ah_subvendorid;
  719. struct ath_softc *ah_sc;
  720. void __iomem *ah_sh;
  721. u16 ah_countryCode;
  722. u32 ah_macVersion;
  723. u16 ah_macRev;
  724. u16 ah_phyRev;
  725. u16 ah_analog5GhzRev;
  726. u16 ah_analog2GhzRev;
  727. u8 ah_decompMask[ATH9K_DECOMP_MASK_SIZE];
  728. u32 ah_flags;
  729. enum ath9k_opmode ah_opmode;
  730. struct hal_ops_config ah_config;
  731. struct hal_capabilities ah_caps;
  732. int16_t ah_powerLimit;
  733. u16 ah_maxPowerLevel;
  734. u32 ah_tpScale;
  735. u16 ah_currentRD;
  736. u16 ah_currentRDExt;
  737. u16 ah_currentRDInUse;
  738. u16 ah_currentRD5G;
  739. u16 ah_currentRD2G;
  740. char ah_iso[4];
  741. enum start_adhoc_option ah_adHocMode;
  742. bool ah_commonMode;
  743. struct ath9k_channel ah_channels[150];
  744. u32 ah_nchan;
  745. struct ath9k_channel *ah_curchan;
  746. u16 ah_rfsilent;
  747. bool ah_rfkillEnabled;
  748. bool ah_isPciExpress;
  749. u16 ah_txTrigLevel;
  750. #ifndef ATH_NF_PER_CHAN
  751. struct ath9k_nfcal_hist nfCalHist[NUM_NF_READINGS];
  752. #endif
  753. };
  754. enum wireless_mode {
  755. WIRELESS_MODE_11a = 0,
  756. WIRELESS_MODE_11b = 2,
  757. WIRELESS_MODE_11g = 3,
  758. WIRELESS_MODE_11NA_HT20 = 6,
  759. WIRELESS_MODE_11NG_HT20 = 7,
  760. WIRELESS_MODE_11NA_HT40PLUS = 8,
  761. WIRELESS_MODE_11NA_HT40MINUS = 9,
  762. WIRELESS_MODE_11NG_HT40PLUS = 10,
  763. WIRELESS_MODE_11NG_HT40MINUS = 11,
  764. WIRELESS_MODE_MAX
  765. };
  766. enum {
  767. ATH9K_MODE_SEL_11A = 0x00001,
  768. ATH9K_MODE_SEL_11B = 0x00002,
  769. ATH9K_MODE_SEL_11G = 0x00004,
  770. ATH9K_MODE_SEL_11NG_HT20 = 0x00008,
  771. ATH9K_MODE_SEL_11NA_HT20 = 0x00010,
  772. ATH9K_MODE_SEL_11NG_HT40PLUS = 0x00020,
  773. ATH9K_MODE_SEL_11NG_HT40MINUS = 0x00040,
  774. ATH9K_MODE_SEL_11NA_HT40PLUS = 0x00080,
  775. ATH9K_MODE_SEL_11NA_HT40MINUS = 0x00100,
  776. ATH9K_MODE_SEL_2GHZ = (ATH9K_MODE_SEL_11B |
  777. ATH9K_MODE_SEL_11G |
  778. ATH9K_MODE_SEL_11NG_HT20),
  779. ATH9K_MODE_SEL_5GHZ = (ATH9K_MODE_SEL_11A |
  780. ATH9K_MODE_SEL_11NA_HT20),
  781. ATH9K_MODE_SEL_ALL = 0xffffffff
  782. };
  783. struct chan_centers {
  784. u16 synth_center;
  785. u16 ctl_center;
  786. u16 ext_center;
  787. };
  788. int ath_hal_getcapability(struct ath_hal *ah,
  789. enum hal_capability_type type,
  790. u32 capability,
  791. u32 *result);
  792. const struct ath9k_rate_table *ath9k_hw_getratetable(struct ath_hal *ah,
  793. u32 mode);
  794. void ath9k_hw_detach(struct ath_hal *ah);
  795. struct ath_hal *ath9k_hw_attach(u16 devid,
  796. struct ath_softc *sc,
  797. void __iomem *mem,
  798. int *error);
  799. bool ath9k_regd_init_channels(struct ath_hal *ah,
  800. u32 maxchans, u32 *nchans,
  801. u8 *regclassids,
  802. u32 maxregids, u32 *nregids,
  803. u16 cc, u32 modeSelect,
  804. bool enableOutdoor,
  805. bool enableExtendedChannels);
  806. u32 ath9k_hw_mhz2ieee(struct ath_hal *ah, u32 freq, u32 flags);
  807. enum ath9k_int ath9k_hw_set_interrupts(struct ath_hal *ah,
  808. enum ath9k_int ints);
  809. bool ath9k_hw_reset(struct ath_hal *ah, enum ath9k_opmode opmode,
  810. struct ath9k_channel *chan,
  811. enum ath9k_ht_macmode macmode,
  812. u8 txchainmask, u8 rxchainmask,
  813. enum ath9k_ht_extprotspacing extprotspacing,
  814. bool bChannelChange,
  815. int *status);
  816. bool ath9k_hw_phy_disable(struct ath_hal *ah);
  817. void ath9k_hw_reset_calvalid(struct ath_hal *ah, struct ath9k_channel *chan,
  818. bool *isCalDone);
  819. void ath9k_hw_ani_monitor(struct ath_hal *ah,
  820. const struct ath9k_node_stats *stats,
  821. struct ath9k_channel *chan);
  822. bool ath9k_hw_calibrate(struct ath_hal *ah,
  823. struct ath9k_channel *chan,
  824. u8 rxchainmask,
  825. bool longcal,
  826. bool *isCalDone);
  827. int16_t ath9k_hw_getchan_noise(struct ath_hal *ah,
  828. struct ath9k_channel *chan);
  829. void ath9k_hw_write_associd(struct ath_hal *ah, const u8 *bssid,
  830. u16 assocId);
  831. void ath9k_hw_setrxfilter(struct ath_hal *ah, u32 bits);
  832. void ath9k_hw_write_associd(struct ath_hal *ah, const u8 *bssid,
  833. u16 assocId);
  834. bool ath9k_hw_stoptxdma(struct ath_hal *ah, u32 q);
  835. void ath9k_hw_reset_tsf(struct ath_hal *ah);
  836. bool ath9k_hw_keyisvalid(struct ath_hal *ah, u16 entry);
  837. bool ath9k_hw_keysetmac(struct ath_hal *ah, u16 entry,
  838. const u8 *mac);
  839. bool ath9k_hw_set_keycache_entry(struct ath_hal *ah,
  840. u16 entry,
  841. const struct ath9k_keyval *k,
  842. const u8 *mac,
  843. int xorKey);
  844. bool ath9k_hw_set_tsfadjust(struct ath_hal *ah,
  845. u32 setting);
  846. void ath9k_hw_configpcipowersave(struct ath_hal *ah, int restore);
  847. bool ath9k_hw_intrpend(struct ath_hal *ah);
  848. bool ath9k_hw_getisr(struct ath_hal *ah, enum ath9k_int *masked);
  849. bool ath9k_hw_updatetxtriglevel(struct ath_hal *ah,
  850. bool bIncTrigLevel);
  851. void ath9k_hw_procmibevent(struct ath_hal *ah,
  852. const struct ath9k_node_stats *stats);
  853. bool ath9k_hw_setrxabort(struct ath_hal *ah, bool set);
  854. void ath9k_hw_set11nmac2040(struct ath_hal *ah, enum ath9k_ht_macmode mode);
  855. bool ath9k_hw_phycounters(struct ath_hal *ah);
  856. bool ath9k_hw_keyreset(struct ath_hal *ah, u16 entry);
  857. bool ath9k_hw_getcapability(struct ath_hal *ah,
  858. enum hal_capability_type type,
  859. u32 capability,
  860. u32 *result);
  861. bool ath9k_hw_setcapability(struct ath_hal *ah,
  862. enum hal_capability_type type,
  863. u32 capability,
  864. u32 setting,
  865. int *status);
  866. u32 ath9k_hw_getdefantenna(struct ath_hal *ah);
  867. void ath9k_hw_getmac(struct ath_hal *ah, u8 *mac);
  868. void ath9k_hw_getbssidmask(struct ath_hal *ah, u8 *mask);
  869. bool ath9k_hw_setbssidmask(struct ath_hal *ah,
  870. const u8 *mask);
  871. bool ath9k_hw_setpower(struct ath_hal *ah,
  872. enum ath9k_power_mode mode);
  873. enum ath9k_int ath9k_hw_intrget(struct ath_hal *ah);
  874. u64 ath9k_hw_gettsf64(struct ath_hal *ah);
  875. u32 ath9k_hw_getdefantenna(struct ath_hal *ah);
  876. bool ath9k_hw_setslottime(struct ath_hal *ah, u32 us);
  877. bool ath9k_hw_setantennaswitch(struct ath_hal *ah,
  878. enum ath9k_ant_setting settings,
  879. struct ath9k_channel *chan,
  880. u8 *tx_chainmask,
  881. u8 *rx_chainmask,
  882. u8 *antenna_cfgd);
  883. void ath9k_hw_setantenna(struct ath_hal *ah, u32 antenna);
  884. int ath9k_hw_select_antconfig(struct ath_hal *ah,
  885. u32 cfg);
  886. bool ath9k_hw_puttxbuf(struct ath_hal *ah, u32 q,
  887. u32 txdp);
  888. bool ath9k_hw_txstart(struct ath_hal *ah, u32 q);
  889. u16 ath9k_hw_computetxtime(struct ath_hal *ah,
  890. const struct ath9k_rate_table *rates,
  891. u32 frameLen, u16 rateix,
  892. bool shortPreamble);
  893. void ath9k_hw_set11n_ratescenario(struct ath_hal *ah, struct ath_desc *ds,
  894. struct ath_desc *lastds,
  895. u32 durUpdateEn, u32 rtsctsRate,
  896. u32 rtsctsDuration,
  897. struct ath9k_11n_rate_series series[],
  898. u32 nseries, u32 flags);
  899. void ath9k_hw_set11n_burstduration(struct ath_hal *ah,
  900. struct ath_desc *ds,
  901. u32 burstDuration);
  902. void ath9k_hw_cleartxdesc(struct ath_hal *ah, struct ath_desc *ds);
  903. u32 ath9k_hw_reverse_bits(u32 val, u32 n);
  904. bool ath9k_hw_resettxqueue(struct ath_hal *ah, u32 q);
  905. u32 ath9k_regd_get_ctl(struct ath_hal *ah, struct ath9k_channel *chan);
  906. u32 ath9k_regd_get_antenna_allowed(struct ath_hal *ah,
  907. struct ath9k_channel *chan);
  908. u32 ath9k_hw_mhz2ieee(struct ath_hal *ah, u32 freq, u32 flags);
  909. bool ath9k_hw_gettxqueueprops(struct ath_hal *ah, int q,
  910. struct ath9k_txq_info *qInfo);
  911. bool ath9k_hw_settxqueueprops(struct ath_hal *ah, int q,
  912. const struct ath9k_txq_info *qInfo);
  913. struct ath9k_channel *ath9k_regd_check_channel(struct ath_hal *ah,
  914. const struct ath9k_channel *c);
  915. void ath9k_hw_set11n_txdesc(struct ath_hal *ah, struct ath_desc *ds,
  916. u32 pktLen, enum ath9k_pkt_type type,
  917. u32 txPower, u32 keyIx,
  918. enum ath9k_key_type keyType, u32 flags);
  919. bool ath9k_hw_filltxdesc(struct ath_hal *ah, struct ath_desc *ds,
  920. u32 segLen, bool firstSeg,
  921. bool lastSeg,
  922. const struct ath_desc *ds0);
  923. u32 ath9k_hw_GetMibCycleCountsPct(struct ath_hal *ah,
  924. u32 *rxc_pcnt,
  925. u32 *rxf_pcnt,
  926. u32 *txf_pcnt);
  927. void ath9k_hw_dmaRegDump(struct ath_hal *ah);
  928. void ath9k_hw_beaconinit(struct ath_hal *ah,
  929. u32 next_beacon, u32 beacon_period);
  930. void ath9k_hw_set_sta_beacon_timers(struct ath_hal *ah,
  931. const struct ath9k_beacon_state *bs);
  932. bool ath9k_hw_setuprxdesc(struct ath_hal *ah, struct ath_desc *ds,
  933. u32 size, u32 flags);
  934. void ath9k_hw_putrxbuf(struct ath_hal *ah, u32 rxdp);
  935. void ath9k_hw_rxena(struct ath_hal *ah);
  936. void ath9k_hw_setopmode(struct ath_hal *ah);
  937. bool ath9k_hw_setmac(struct ath_hal *ah, const u8 *mac);
  938. void ath9k_hw_setmcastfilter(struct ath_hal *ah, u32 filter0,
  939. u32 filter1);
  940. u32 ath9k_hw_getrxfilter(struct ath_hal *ah);
  941. void ath9k_hw_startpcureceive(struct ath_hal *ah);
  942. void ath9k_hw_stoppcurecv(struct ath_hal *ah);
  943. bool ath9k_hw_stopdmarecv(struct ath_hal *ah);
  944. int ath9k_hw_rxprocdesc(struct ath_hal *ah,
  945. struct ath_desc *ds, u32 pa,
  946. struct ath_desc *nds, u64 tsf);
  947. u32 ath9k_hw_gettxbuf(struct ath_hal *ah, u32 q);
  948. int ath9k_hw_txprocdesc(struct ath_hal *ah,
  949. struct ath_desc *ds);
  950. void ath9k_hw_set11n_aggr_middle(struct ath_hal *ah, struct ath_desc *ds,
  951. u32 numDelims);
  952. void ath9k_hw_set11n_aggr_first(struct ath_hal *ah, struct ath_desc *ds,
  953. u32 aggrLen);
  954. void ath9k_hw_set11n_aggr_last(struct ath_hal *ah, struct ath_desc *ds);
  955. bool ath9k_hw_releasetxqueue(struct ath_hal *ah, u32 q);
  956. void ath9k_hw_gettxintrtxqs(struct ath_hal *ah, u32 *txqs);
  957. void ath9k_hw_clr11n_aggr(struct ath_hal *ah, struct ath_desc *ds);
  958. void ath9k_hw_set11n_virtualmorefrag(struct ath_hal *ah,
  959. struct ath_desc *ds, u32 vmf);
  960. bool ath9k_hw_set_txpowerlimit(struct ath_hal *ah, u32 limit);
  961. bool ath9k_regd_is_public_safety_sku(struct ath_hal *ah);
  962. int ath9k_hw_setuptxqueue(struct ath_hal *ah, enum ath9k_tx_queue type,
  963. const struct ath9k_txq_info *qInfo);
  964. u32 ath9k_hw_numtxpending(struct ath_hal *ah, u32 q);
  965. const char *ath9k_hw_probe(u16 vendorid, u16 devid);
  966. bool ath9k_hw_disable(struct ath_hal *ah);
  967. void ath9k_hw_rfdetach(struct ath_hal *ah);
  968. void ath9k_hw_get_channel_centers(struct ath_hal *ah,
  969. struct ath9k_channel *chan,
  970. struct chan_centers *centers);
  971. bool ath9k_get_channel_edges(struct ath_hal *ah,
  972. u16 flags, u16 *low,
  973. u16 *high);
  974. #endif