ath9k.h 29 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022
  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. /* ATH9K_TXDESC_INTREQ forces a tx interrupt to be generated for
  125. * the descriptor its marked on. We take a tx interrupt to reap
  126. * descriptors when the h/w hits an EOL condition or
  127. * when the descriptor is specifically marked to generate
  128. * an interrupt with this flag. Descriptors should be
  129. * marked periodically to insure timely replenishing of the
  130. * supply needed for sending frames. Defering interrupts
  131. * reduces system load and potentially allows more concurrent
  132. * work to be done but if done to aggressively can cause
  133. * senders to backup. When the hardware queue is left too
  134. * large rate control information may also be too out of
  135. * date. An Alternative for this is TX interrupt mitigation
  136. * but this needs more testing. */
  137. #define ATH9K_TXDESC_INTREQ 0x0010
  138. #define ATH9K_TXDESC_VEOL 0x0020
  139. #define ATH9K_TXDESC_EXT_ONLY 0x0040
  140. #define ATH9K_TXDESC_EXT_AND_CTL 0x0080
  141. #define ATH9K_TXDESC_VMF 0x0100
  142. #define ATH9K_TXDESC_FRAG_IS_ON 0x0200
  143. #define ATH9K_TXDESC_CAB 0x0400
  144. #define ATH9K_RXDESC_INTREQ 0x0020
  145. enum wireless_mode {
  146. ATH9K_MODE_11A = 0,
  147. ATH9K_MODE_11B = 2,
  148. ATH9K_MODE_11G = 3,
  149. ATH9K_MODE_11NA_HT20 = 6,
  150. ATH9K_MODE_11NG_HT20 = 7,
  151. ATH9K_MODE_11NA_HT40PLUS = 8,
  152. ATH9K_MODE_11NA_HT40MINUS = 9,
  153. ATH9K_MODE_11NG_HT40PLUS = 10,
  154. ATH9K_MODE_11NG_HT40MINUS = 11,
  155. ATH9K_MODE_MAX
  156. };
  157. enum ath9k_hw_caps {
  158. ATH9K_HW_CAP_CHAN_SPREAD = BIT(0),
  159. ATH9K_HW_CAP_MIC_AESCCM = BIT(1),
  160. ATH9K_HW_CAP_MIC_CKIP = BIT(2),
  161. ATH9K_HW_CAP_MIC_TKIP = BIT(3),
  162. ATH9K_HW_CAP_CIPHER_AESCCM = BIT(4),
  163. ATH9K_HW_CAP_CIPHER_CKIP = BIT(5),
  164. ATH9K_HW_CAP_CIPHER_TKIP = BIT(6),
  165. ATH9K_HW_CAP_VEOL = BIT(7),
  166. ATH9K_HW_CAP_BSSIDMASK = BIT(8),
  167. ATH9K_HW_CAP_MCAST_KEYSEARCH = BIT(9),
  168. ATH9K_HW_CAP_CHAN_HALFRATE = BIT(10),
  169. ATH9K_HW_CAP_CHAN_QUARTERRATE = BIT(11),
  170. ATH9K_HW_CAP_HT = BIT(12),
  171. ATH9K_HW_CAP_GTT = BIT(13),
  172. ATH9K_HW_CAP_FASTCC = BIT(14),
  173. ATH9K_HW_CAP_RFSILENT = BIT(15),
  174. ATH9K_HW_CAP_WOW = BIT(16),
  175. ATH9K_HW_CAP_CST = BIT(17),
  176. ATH9K_HW_CAP_ENHANCEDPM = BIT(18),
  177. ATH9K_HW_CAP_AUTOSLEEP = BIT(19),
  178. ATH9K_HW_CAP_4KB_SPLITTRANS = BIT(20),
  179. ATH9K_HW_CAP_WOW_MATCHPATTERN_EXACT = BIT(21),
  180. };
  181. enum ath9k_capability_type {
  182. ATH9K_CAP_CIPHER = 0,
  183. ATH9K_CAP_TKIP_MIC,
  184. ATH9K_CAP_TKIP_SPLIT,
  185. ATH9K_CAP_PHYCOUNTERS,
  186. ATH9K_CAP_DIVERSITY,
  187. ATH9K_CAP_TXPOW,
  188. ATH9K_CAP_PHYDIAG,
  189. ATH9K_CAP_MCAST_KEYSRCH,
  190. ATH9K_CAP_TSF_ADJUST,
  191. ATH9K_CAP_WME_TKIPMIC,
  192. ATH9K_CAP_RFSILENT,
  193. ATH9K_CAP_ANT_CFG_2GHZ,
  194. ATH9K_CAP_ANT_CFG_5GHZ
  195. };
  196. struct ath9k_hw_capabilities {
  197. u32 hw_caps; /* ATH9K_HW_CAP_* from ath9k_hw_caps */
  198. DECLARE_BITMAP(wireless_modes, ATH9K_MODE_MAX); /* ATH9K_MODE_* */
  199. u16 total_queues;
  200. u16 keycache_size;
  201. u16 low_5ghz_chan, high_5ghz_chan;
  202. u16 low_2ghz_chan, high_2ghz_chan;
  203. u16 num_mr_retries;
  204. u16 rts_aggr_limit;
  205. u8 tx_chainmask;
  206. u8 rx_chainmask;
  207. u16 tx_triglevel_max;
  208. u16 reg_cap;
  209. u8 num_gpio_pins;
  210. u8 num_antcfg_2ghz;
  211. u8 num_antcfg_5ghz;
  212. };
  213. struct ath9k_ops_config {
  214. int dma_beacon_response_time;
  215. int sw_beacon_response_time;
  216. int additional_swba_backoff;
  217. int ack_6mb;
  218. int cwm_ignore_extcca;
  219. u8 pcie_powersave_enable;
  220. u8 pcie_l1skp_enable;
  221. u8 pcie_clock_req;
  222. u32 pcie_waen;
  223. int pcie_power_reset;
  224. u8 pcie_restore;
  225. u8 analog_shiftreg;
  226. u8 ht_enable;
  227. u32 ofdm_trig_low;
  228. u32 ofdm_trig_high;
  229. u32 cck_trig_high;
  230. u32 cck_trig_low;
  231. u32 enable_ani;
  232. u8 noise_immunity_level;
  233. u32 ofdm_weaksignal_det;
  234. u32 cck_weaksignal_thr;
  235. u8 spur_immunity_level;
  236. u8 firstep_level;
  237. int8_t rssi_thr_high;
  238. int8_t rssi_thr_low;
  239. u16 diversity_control;
  240. u16 antenna_switch_swap;
  241. int serialize_regmode;
  242. int intr_mitigation;
  243. #define SPUR_DISABLE 0
  244. #define SPUR_ENABLE_IOCTL 1
  245. #define SPUR_ENABLE_EEPROM 2
  246. #define AR_EEPROM_MODAL_SPURS 5
  247. #define AR_SPUR_5413_1 1640
  248. #define AR_SPUR_5413_2 1200
  249. #define AR_NO_SPUR 0x8000
  250. #define AR_BASE_FREQ_2GHZ 2300
  251. #define AR_BASE_FREQ_5GHZ 4900
  252. #define AR_SPUR_FEEQ_BOUND_HT40 19
  253. #define AR_SPUR_FEEQ_BOUND_HT20 10
  254. int spurmode;
  255. u16 spurchans[AR_EEPROM_MODAL_SPURS][2];
  256. };
  257. enum ath9k_tx_queue {
  258. ATH9K_TX_QUEUE_INACTIVE = 0,
  259. ATH9K_TX_QUEUE_DATA,
  260. ATH9K_TX_QUEUE_BEACON,
  261. ATH9K_TX_QUEUE_CAB,
  262. ATH9K_TX_QUEUE_UAPSD,
  263. ATH9K_TX_QUEUE_PSPOLL
  264. };
  265. #define ATH9K_NUM_TX_QUEUES 10
  266. enum ath9k_tx_queue_subtype {
  267. ATH9K_WME_AC_BK = 0,
  268. ATH9K_WME_AC_BE,
  269. ATH9K_WME_AC_VI,
  270. ATH9K_WME_AC_VO,
  271. ATH9K_WME_UPSD
  272. };
  273. enum ath9k_tx_queue_flags {
  274. TXQ_FLAG_TXOKINT_ENABLE = 0x0001,
  275. TXQ_FLAG_TXERRINT_ENABLE = 0x0001,
  276. TXQ_FLAG_TXDESCINT_ENABLE = 0x0002,
  277. TXQ_FLAG_TXEOLINT_ENABLE = 0x0004,
  278. TXQ_FLAG_TXURNINT_ENABLE = 0x0008,
  279. TXQ_FLAG_BACKOFF_DISABLE = 0x0010,
  280. TXQ_FLAG_COMPRESSION_ENABLE = 0x0020,
  281. TXQ_FLAG_RDYTIME_EXP_POLICY_ENABLE = 0x0040,
  282. TXQ_FLAG_FRAG_BURST_BACKOFF_ENABLE = 0x0080,
  283. };
  284. #define ATH9K_TXQ_USEDEFAULT ((u32) -1)
  285. #define ATH9K_DECOMP_MASK_SIZE 128
  286. #define ATH9K_READY_TIME_LO_BOUND 50
  287. #define ATH9K_READY_TIME_HI_BOUND 96
  288. enum ath9k_pkt_type {
  289. ATH9K_PKT_TYPE_NORMAL = 0,
  290. ATH9K_PKT_TYPE_ATIM,
  291. ATH9K_PKT_TYPE_PSPOLL,
  292. ATH9K_PKT_TYPE_BEACON,
  293. ATH9K_PKT_TYPE_PROBE_RESP,
  294. ATH9K_PKT_TYPE_CHIRP,
  295. ATH9K_PKT_TYPE_GRP_POLL,
  296. };
  297. struct ath9k_tx_queue_info {
  298. u32 tqi_ver;
  299. enum ath9k_tx_queue tqi_type;
  300. enum ath9k_tx_queue_subtype tqi_subtype;
  301. enum ath9k_tx_queue_flags tqi_qflags;
  302. u32 tqi_priority;
  303. u32 tqi_aifs;
  304. u32 tqi_cwmin;
  305. u32 tqi_cwmax;
  306. u16 tqi_shretry;
  307. u16 tqi_lgretry;
  308. u32 tqi_cbrPeriod;
  309. u32 tqi_cbrOverflowLimit;
  310. u32 tqi_burstTime;
  311. u32 tqi_readyTime;
  312. u32 tqi_physCompBuf;
  313. u32 tqi_intFlags;
  314. };
  315. enum ath9k_rx_filter {
  316. ATH9K_RX_FILTER_UCAST = 0x00000001,
  317. ATH9K_RX_FILTER_MCAST = 0x00000002,
  318. ATH9K_RX_FILTER_BCAST = 0x00000004,
  319. ATH9K_RX_FILTER_CONTROL = 0x00000008,
  320. ATH9K_RX_FILTER_BEACON = 0x00000010,
  321. ATH9K_RX_FILTER_PROM = 0x00000020,
  322. ATH9K_RX_FILTER_PROBEREQ = 0x00000080,
  323. ATH9K_RX_FILTER_PSPOLL = 0x00004000,
  324. ATH9K_RX_FILTER_PHYERR = 0x00000100,
  325. ATH9K_RX_FILTER_PHYRADAR = 0x00002000,
  326. };
  327. enum ath9k_int {
  328. ATH9K_INT_RX = 0x00000001,
  329. ATH9K_INT_RXDESC = 0x00000002,
  330. ATH9K_INT_RXNOFRM = 0x00000008,
  331. ATH9K_INT_RXEOL = 0x00000010,
  332. ATH9K_INT_RXORN = 0x00000020,
  333. ATH9K_INT_TX = 0x00000040,
  334. ATH9K_INT_TXDESC = 0x00000080,
  335. ATH9K_INT_TIM_TIMER = 0x00000100,
  336. ATH9K_INT_TXURN = 0x00000800,
  337. ATH9K_INT_MIB = 0x00001000,
  338. ATH9K_INT_RXPHY = 0x00004000,
  339. ATH9K_INT_RXKCM = 0x00008000,
  340. ATH9K_INT_SWBA = 0x00010000,
  341. ATH9K_INT_BMISS = 0x00040000,
  342. ATH9K_INT_BNR = 0x00100000,
  343. ATH9K_INT_TIM = 0x00200000,
  344. ATH9K_INT_DTIM = 0x00400000,
  345. ATH9K_INT_DTIMSYNC = 0x00800000,
  346. ATH9K_INT_GPIO = 0x01000000,
  347. ATH9K_INT_CABEND = 0x02000000,
  348. ATH9K_INT_CST = 0x10000000,
  349. ATH9K_INT_GTT = 0x20000000,
  350. ATH9K_INT_FATAL = 0x40000000,
  351. ATH9K_INT_GLOBAL = 0x80000000,
  352. ATH9K_INT_BMISC = ATH9K_INT_TIM |
  353. ATH9K_INT_DTIM |
  354. ATH9K_INT_DTIMSYNC |
  355. ATH9K_INT_CABEND,
  356. ATH9K_INT_COMMON = ATH9K_INT_RXNOFRM |
  357. ATH9K_INT_RXDESC |
  358. ATH9K_INT_RXEOL |
  359. ATH9K_INT_RXORN |
  360. ATH9K_INT_TXURN |
  361. ATH9K_INT_TXDESC |
  362. ATH9K_INT_MIB |
  363. ATH9K_INT_RXPHY |
  364. ATH9K_INT_RXKCM |
  365. ATH9K_INT_SWBA |
  366. ATH9K_INT_BMISS |
  367. ATH9K_INT_GPIO,
  368. ATH9K_INT_NOCARD = 0xffffffff
  369. };
  370. struct ath9k_rate_table {
  371. int rateCount;
  372. u8 rateCodeToIndex[256];
  373. struct {
  374. u8 valid;
  375. u8 phy;
  376. u32 rateKbps;
  377. u8 rateCode;
  378. u8 shortPreamble;
  379. u8 dot11Rate;
  380. u8 controlRate;
  381. u16 lpAckDuration;
  382. u16 spAckDuration;
  383. } info[32];
  384. };
  385. #define ATH9K_RATESERIES_RTS_CTS 0x0001
  386. #define ATH9K_RATESERIES_2040 0x0002
  387. #define ATH9K_RATESERIES_HALFGI 0x0004
  388. struct ath9k_11n_rate_series {
  389. u32 Tries;
  390. u32 Rate;
  391. u32 PktDuration;
  392. u32 ChSel;
  393. u32 RateFlags;
  394. };
  395. #define CHANNEL_CW_INT 0x00002
  396. #define CHANNEL_CCK 0x00020
  397. #define CHANNEL_OFDM 0x00040
  398. #define CHANNEL_2GHZ 0x00080
  399. #define CHANNEL_5GHZ 0x00100
  400. #define CHANNEL_PASSIVE 0x00200
  401. #define CHANNEL_DYN 0x00400
  402. #define CHANNEL_HALF 0x04000
  403. #define CHANNEL_QUARTER 0x08000
  404. #define CHANNEL_HT20 0x10000
  405. #define CHANNEL_HT40PLUS 0x20000
  406. #define CHANNEL_HT40MINUS 0x40000
  407. #define CHANNEL_INTERFERENCE 0x01
  408. #define CHANNEL_DFS 0x02
  409. #define CHANNEL_4MS_LIMIT 0x04
  410. #define CHANNEL_DFS_CLEAR 0x08
  411. #define CHANNEL_DISALLOW_ADHOC 0x10
  412. #define CHANNEL_PER_11D_ADHOC 0x20
  413. #define CHANNEL_A (CHANNEL_5GHZ|CHANNEL_OFDM)
  414. #define CHANNEL_B (CHANNEL_2GHZ|CHANNEL_CCK)
  415. #define CHANNEL_G (CHANNEL_2GHZ|CHANNEL_OFDM)
  416. #define CHANNEL_G_HT20 (CHANNEL_2GHZ|CHANNEL_HT20)
  417. #define CHANNEL_A_HT20 (CHANNEL_5GHZ|CHANNEL_HT20)
  418. #define CHANNEL_G_HT40PLUS (CHANNEL_2GHZ|CHANNEL_HT40PLUS)
  419. #define CHANNEL_G_HT40MINUS (CHANNEL_2GHZ|CHANNEL_HT40MINUS)
  420. #define CHANNEL_A_HT40PLUS (CHANNEL_5GHZ|CHANNEL_HT40PLUS)
  421. #define CHANNEL_A_HT40MINUS (CHANNEL_5GHZ|CHANNEL_HT40MINUS)
  422. #define CHANNEL_ALL \
  423. (CHANNEL_OFDM| \
  424. CHANNEL_CCK| \
  425. CHANNEL_2GHZ | \
  426. CHANNEL_5GHZ | \
  427. CHANNEL_HT20 | \
  428. CHANNEL_HT40PLUS | \
  429. CHANNEL_HT40MINUS)
  430. struct ath9k_channel {
  431. u16 channel;
  432. u32 channelFlags;
  433. u8 privFlags;
  434. int8_t maxRegTxPower;
  435. int8_t maxTxPower;
  436. int8_t minTxPower;
  437. u32 chanmode;
  438. int32_t CalValid;
  439. bool oneTimeCalsDone;
  440. int8_t iCoff;
  441. int8_t qCoff;
  442. int16_t rawNoiseFloor;
  443. int8_t antennaMax;
  444. u32 regDmnFlags;
  445. u32 conformanceTestLimit[3]; /* 0:11a, 1: 11b, 2:11g */
  446. #ifdef ATH_NF_PER_CHAN
  447. struct ath9k_nfcal_hist nfCalHist[NUM_NF_READINGS];
  448. #endif
  449. };
  450. #define IS_CHAN_A(_c) ((((_c)->channelFlags & CHANNEL_A) == CHANNEL_A) || \
  451. (((_c)->channelFlags & CHANNEL_A_HT20) == CHANNEL_A_HT20) || \
  452. (((_c)->channelFlags & CHANNEL_A_HT40PLUS) == CHANNEL_A_HT40PLUS) || \
  453. (((_c)->channelFlags & CHANNEL_A_HT40MINUS) == CHANNEL_A_HT40MINUS))
  454. #define IS_CHAN_B(_c) (((_c)->channelFlags & CHANNEL_B) == CHANNEL_B)
  455. #define IS_CHAN_G(_c) ((((_c)->channelFlags & (CHANNEL_G)) == CHANNEL_G) || \
  456. (((_c)->channelFlags & CHANNEL_G_HT20) == CHANNEL_G_HT20) || \
  457. (((_c)->channelFlags & CHANNEL_G_HT40PLUS) == CHANNEL_G_HT40PLUS) || \
  458. (((_c)->channelFlags & CHANNEL_G_HT40MINUS) == CHANNEL_G_HT40MINUS))
  459. #define IS_CHAN_CCK(_c) (((_c)->channelFlags & CHANNEL_CCK) != 0)
  460. #define IS_CHAN_OFDM(_c) (((_c)->channelFlags & CHANNEL_OFDM) != 0)
  461. #define IS_CHAN_5GHZ(_c) (((_c)->channelFlags & CHANNEL_5GHZ) != 0)
  462. #define IS_CHAN_2GHZ(_c) (((_c)->channelFlags & CHANNEL_2GHZ) != 0)
  463. #define IS_CHAN_PASSIVE(_c) (((_c)->channelFlags & CHANNEL_PASSIVE) != 0)
  464. #define IS_CHAN_HALF_RATE(_c) (((_c)->channelFlags & CHANNEL_HALF) != 0)
  465. #define IS_CHAN_QUARTER_RATE(_c) (((_c)->channelFlags & CHANNEL_QUARTER) != 0)
  466. /* These macros check chanmode and not channelFlags */
  467. #define IS_CHAN_HT20(_c) (((_c)->chanmode == CHANNEL_A_HT20) || \
  468. ((_c)->chanmode == CHANNEL_G_HT20))
  469. #define IS_CHAN_HT40(_c) (((_c)->chanmode == CHANNEL_A_HT40PLUS) || \
  470. ((_c)->chanmode == CHANNEL_A_HT40MINUS) || \
  471. ((_c)->chanmode == CHANNEL_G_HT40PLUS) || \
  472. ((_c)->chanmode == CHANNEL_G_HT40MINUS))
  473. #define IS_CHAN_HT(_c) (IS_CHAN_HT20((_c)) || IS_CHAN_HT40((_c)))
  474. #define IS_CHAN_IN_PUBLIC_SAFETY_BAND(_c) ((_c) > 4940 && (_c) < 4990)
  475. #define IS_CHAN_A_5MHZ_SPACED(_c) \
  476. ((((_c)->channelFlags & CHANNEL_5GHZ) != 0) && \
  477. (((_c)->channel % 20) != 0) && \
  478. (((_c)->channel % 10) != 0))
  479. struct ath9k_keyval {
  480. u8 kv_type;
  481. u8 kv_pad;
  482. u16 kv_len;
  483. u8 kv_val[16];
  484. u8 kv_mic[8];
  485. u8 kv_txmic[8];
  486. };
  487. enum ath9k_key_type {
  488. ATH9K_KEY_TYPE_CLEAR,
  489. ATH9K_KEY_TYPE_WEP,
  490. ATH9K_KEY_TYPE_AES,
  491. ATH9K_KEY_TYPE_TKIP,
  492. };
  493. enum ath9k_cipher {
  494. ATH9K_CIPHER_WEP = 0,
  495. ATH9K_CIPHER_AES_OCB = 1,
  496. ATH9K_CIPHER_AES_CCM = 2,
  497. ATH9K_CIPHER_CKIP = 3,
  498. ATH9K_CIPHER_TKIP = 4,
  499. ATH9K_CIPHER_CLR = 5,
  500. ATH9K_CIPHER_MIC = 127
  501. };
  502. #define AR_EEPROM_EEPCAP_COMPRESS_DIS 0x0001
  503. #define AR_EEPROM_EEPCAP_AES_DIS 0x0002
  504. #define AR_EEPROM_EEPCAP_FASTFRAME_DIS 0x0004
  505. #define AR_EEPROM_EEPCAP_BURST_DIS 0x0008
  506. #define AR_EEPROM_EEPCAP_MAXQCU 0x01F0
  507. #define AR_EEPROM_EEPCAP_MAXQCU_S 4
  508. #define AR_EEPROM_EEPCAP_HEAVY_CLIP_EN 0x0200
  509. #define AR_EEPROM_EEPCAP_KC_ENTRIES 0xF000
  510. #define AR_EEPROM_EEPCAP_KC_ENTRIES_S 12
  511. #define AR_EEPROM_EEREGCAP_EN_FCC_MIDBAND 0x0040
  512. #define AR_EEPROM_EEREGCAP_EN_KK_U1_EVEN 0x0080
  513. #define AR_EEPROM_EEREGCAP_EN_KK_U2 0x0100
  514. #define AR_EEPROM_EEREGCAP_EN_KK_MIDBAND 0x0200
  515. #define AR_EEPROM_EEREGCAP_EN_KK_U1_ODD 0x0400
  516. #define AR_EEPROM_EEREGCAP_EN_KK_NEW_11A 0x0800
  517. #define AR_EEPROM_EEREGCAP_EN_KK_U1_ODD_PRE4_0 0x4000
  518. #define AR_EEPROM_EEREGCAP_EN_KK_NEW_11A_PRE4_0 0x8000
  519. #define SD_NO_CTL 0xE0
  520. #define NO_CTL 0xff
  521. #define CTL_MODE_M 7
  522. #define CTL_11A 0
  523. #define CTL_11B 1
  524. #define CTL_11G 2
  525. #define CTL_2GHT20 5
  526. #define CTL_5GHT20 6
  527. #define CTL_2GHT40 7
  528. #define CTL_5GHT40 8
  529. #define AR_EEPROM_MAC(i) (0x1d+(i))
  530. #define AR_EEPROM_RFSILENT_GPIO_SEL 0x001c
  531. #define AR_EEPROM_RFSILENT_GPIO_SEL_S 2
  532. #define AR_EEPROM_RFSILENT_POLARITY 0x0002
  533. #define AR_EEPROM_RFSILENT_POLARITY_S 1
  534. #define CTRY_DEBUG 0x1ff
  535. #define CTRY_DEFAULT 0
  536. enum reg_ext_bitmap {
  537. REG_EXT_JAPAN_MIDBAND = 1,
  538. REG_EXT_FCC_DFS_HT40 = 2,
  539. REG_EXT_JAPAN_NONDFS_HT40 = 3,
  540. REG_EXT_JAPAN_DFS_HT40 = 4
  541. };
  542. struct ath9k_country_entry {
  543. u16 countryCode;
  544. u16 regDmnEnum;
  545. u16 regDmn5G;
  546. u16 regDmn2G;
  547. u8 isMultidomain;
  548. u8 iso[3];
  549. };
  550. #define REG_WRITE(_ah, _reg, _val) iowrite32(_val, _ah->ah_sh + _reg)
  551. #define REG_READ(_ah, _reg) ioread32(_ah->ah_sh + _reg)
  552. #define SM(_v, _f) (((_v) << _f##_S) & _f)
  553. #define MS(_v, _f) (((_v) & _f) >> _f##_S)
  554. #define REG_RMW(_a, _r, _set, _clr) \
  555. REG_WRITE(_a, _r, (REG_READ(_a, _r) & ~(_clr)) | (_set))
  556. #define REG_RMW_FIELD(_a, _r, _f, _v) \
  557. REG_WRITE(_a, _r, \
  558. (REG_READ(_a, _r) & ~_f) | (((_v) << _f##_S) & _f))
  559. #define REG_SET_BIT(_a, _r, _f) \
  560. REG_WRITE(_a, _r, REG_READ(_a, _r) | _f)
  561. #define REG_CLR_BIT(_a, _r, _f) \
  562. REG_WRITE(_a, _r, REG_READ(_a, _r) & ~_f)
  563. #define ATH9K_TXQ_USE_LOCKOUT_BKOFF_DIS 0x00000001
  564. #define INIT_AIFS 2
  565. #define INIT_CWMIN 15
  566. #define INIT_CWMIN_11B 31
  567. #define INIT_CWMAX 1023
  568. #define INIT_SH_RETRY 10
  569. #define INIT_LG_RETRY 10
  570. #define INIT_SSH_RETRY 32
  571. #define INIT_SLG_RETRY 32
  572. #define WLAN_CTRL_FRAME_SIZE (2+2+6+4)
  573. #define ATH_AMPDU_LIMIT_MAX (64 * 1024 - 1)
  574. #define ATH_AMPDU_LIMIT_DEFAULT ATH_AMPDU_LIMIT_MAX
  575. #define IEEE80211_WEP_IVLEN 3
  576. #define IEEE80211_WEP_KIDLEN 1
  577. #define IEEE80211_WEP_CRCLEN 4
  578. #define IEEE80211_MAX_MPDU_LEN (3840 + FCS_LEN + \
  579. (IEEE80211_WEP_IVLEN + \
  580. IEEE80211_WEP_KIDLEN + \
  581. IEEE80211_WEP_CRCLEN))
  582. #define MAX_RATE_POWER 63
  583. enum ath9k_power_mode {
  584. ATH9K_PM_AWAKE = 0,
  585. ATH9K_PM_FULL_SLEEP,
  586. ATH9K_PM_NETWORK_SLEEP,
  587. ATH9K_PM_UNDEFINED
  588. };
  589. struct ath9k_mib_stats {
  590. u32 ackrcv_bad;
  591. u32 rts_bad;
  592. u32 rts_good;
  593. u32 fcs_bad;
  594. u32 beacons;
  595. };
  596. enum ath9k_ant_setting {
  597. ATH9K_ANT_VARIABLE = 0,
  598. ATH9K_ANT_FIXED_A,
  599. ATH9K_ANT_FIXED_B
  600. };
  601. enum ath9k_opmode {
  602. ATH9K_M_STA = 1,
  603. ATH9K_M_IBSS = 0,
  604. ATH9K_M_HOSTAP = 6,
  605. ATH9K_M_MONITOR = 8
  606. };
  607. #define ATH9K_SLOT_TIME_6 6
  608. #define ATH9K_SLOT_TIME_9 9
  609. #define ATH9K_SLOT_TIME_20 20
  610. enum ath9k_ht_macmode {
  611. ATH9K_HT_MACMODE_20 = 0,
  612. ATH9K_HT_MACMODE_2040 = 1,
  613. };
  614. enum ath9k_ht_extprotspacing {
  615. ATH9K_HT_EXTPROTSPACING_20 = 0,
  616. ATH9K_HT_EXTPROTSPACING_25 = 1,
  617. };
  618. struct ath9k_ht_cwm {
  619. enum ath9k_ht_macmode ht_macmode;
  620. enum ath9k_ht_extprotspacing ht_extprotspacing;
  621. };
  622. enum ath9k_ani_cmd {
  623. ATH9K_ANI_PRESENT = 0x1,
  624. ATH9K_ANI_NOISE_IMMUNITY_LEVEL = 0x2,
  625. ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION = 0x4,
  626. ATH9K_ANI_CCK_WEAK_SIGNAL_THR = 0x8,
  627. ATH9K_ANI_FIRSTEP_LEVEL = 0x10,
  628. ATH9K_ANI_SPUR_IMMUNITY_LEVEL = 0x20,
  629. ATH9K_ANI_MODE = 0x40,
  630. ATH9K_ANI_PHYERR_RESET = 0x80,
  631. ATH9K_ANI_ALL = 0xff
  632. };
  633. enum phytype {
  634. PHY_DS,
  635. PHY_FH,
  636. PHY_OFDM,
  637. PHY_HT,
  638. };
  639. #define PHY_CCK PHY_DS
  640. enum ath9k_tp_scale {
  641. ATH9K_TP_SCALE_MAX = 0,
  642. ATH9K_TP_SCALE_50,
  643. ATH9K_TP_SCALE_25,
  644. ATH9K_TP_SCALE_12,
  645. ATH9K_TP_SCALE_MIN
  646. };
  647. enum ser_reg_mode {
  648. SER_REG_MODE_OFF = 0,
  649. SER_REG_MODE_ON = 1,
  650. SER_REG_MODE_AUTO = 2,
  651. };
  652. #define AR_PHY_CCA_MAX_GOOD_VALUE -85
  653. #define AR_PHY_CCA_MAX_HIGH_VALUE -62
  654. #define AR_PHY_CCA_MIN_BAD_VALUE -121
  655. #define AR_PHY_CCA_FILTERWINDOW_LENGTH_INIT 3
  656. #define AR_PHY_CCA_FILTERWINDOW_LENGTH 5
  657. #define ATH9K_NF_CAL_HIST_MAX 5
  658. #define NUM_NF_READINGS 6
  659. struct ath9k_nfcal_hist {
  660. int16_t nfCalBuffer[ATH9K_NF_CAL_HIST_MAX];
  661. u8 currIndex;
  662. int16_t privNF;
  663. u8 invalidNFcount;
  664. };
  665. struct ath9k_beacon_state {
  666. u32 bs_nexttbtt;
  667. u32 bs_nextdtim;
  668. u32 bs_intval;
  669. #define ATH9K_BEACON_PERIOD 0x0000ffff
  670. #define ATH9K_BEACON_ENA 0x00800000
  671. #define ATH9K_BEACON_RESET_TSF 0x01000000
  672. u32 bs_dtimperiod;
  673. u16 bs_cfpperiod;
  674. u16 bs_cfpmaxduration;
  675. u32 bs_cfpnext;
  676. u16 bs_timoffset;
  677. u16 bs_bmissthreshold;
  678. u32 bs_sleepduration;
  679. };
  680. struct ath9k_node_stats {
  681. u32 ns_avgbrssi;
  682. u32 ns_avgrssi;
  683. u32 ns_avgtxrssi;
  684. u32 ns_avgtxrate;
  685. };
  686. #define ATH9K_RSSI_EP_MULTIPLIER (1<<7)
  687. #define AR_GPIO_OUTPUT_MUX_AS_OUTPUT 0
  688. #define AR_GPIO_OUTPUT_MUX_AS_PCIE_ATTENTION_LED 1
  689. #define AR_GPIO_OUTPUT_MUX_AS_PCIE_POWER_LED 2
  690. #define AR_GPIO_OUTPUT_MUX_AS_MAC_NETWORK_LED 5
  691. #define AR_GPIO_OUTPUT_MUX_AS_MAC_POWER_LED 6
  692. enum {
  693. ATH9K_RESET_POWER_ON,
  694. ATH9K_RESET_WARM,
  695. ATH9K_RESET_COLD,
  696. };
  697. #define AH_USE_EEPROM 0x1
  698. struct ath_hal {
  699. u32 ah_magic;
  700. u16 ah_devid;
  701. u16 ah_subvendorid;
  702. u32 ah_macVersion;
  703. u16 ah_macRev;
  704. u16 ah_phyRev;
  705. u16 ah_analog5GhzRev;
  706. u16 ah_analog2GhzRev;
  707. void __iomem *ah_sh;
  708. struct ath_softc *ah_sc;
  709. enum ath9k_opmode ah_opmode;
  710. struct ath9k_ops_config ah_config;
  711. struct ath9k_hw_capabilities ah_caps;
  712. u16 ah_countryCode;
  713. u32 ah_flags;
  714. int16_t ah_powerLimit;
  715. u16 ah_maxPowerLevel;
  716. u32 ah_tpScale;
  717. u16 ah_currentRD;
  718. u16 ah_currentRDExt;
  719. u16 ah_currentRDInUse;
  720. u16 ah_currentRD5G;
  721. u16 ah_currentRD2G;
  722. char ah_iso[4];
  723. struct ath9k_channel ah_channels[150];
  724. struct ath9k_channel *ah_curchan;
  725. u32 ah_nchan;
  726. bool ah_isPciExpress;
  727. u16 ah_txTrigLevel;
  728. u16 ah_rfsilent;
  729. u32 ah_rfkill_gpio;
  730. u32 ah_rfkill_polarity;
  731. #ifndef ATH_NF_PER_CHAN
  732. struct ath9k_nfcal_hist nfCalHist[NUM_NF_READINGS];
  733. #endif
  734. };
  735. struct chan_centers {
  736. u16 synth_center;
  737. u16 ctl_center;
  738. u16 ext_center;
  739. };
  740. int ath_hal_getcapability(struct ath_hal *ah,
  741. enum ath9k_capability_type type,
  742. u32 capability,
  743. u32 *result);
  744. const struct ath9k_rate_table *ath9k_hw_getratetable(struct ath_hal *ah,
  745. u32 mode);
  746. void ath9k_hw_detach(struct ath_hal *ah);
  747. struct ath_hal *ath9k_hw_attach(u16 devid,
  748. struct ath_softc *sc,
  749. void __iomem *mem,
  750. int *error);
  751. bool ath9k_regd_init_channels(struct ath_hal *ah,
  752. u32 maxchans, u32 *nchans,
  753. u8 *regclassids,
  754. u32 maxregids, u32 *nregids,
  755. u16 cc,
  756. bool enableOutdoor,
  757. bool enableExtendedChannels);
  758. u32 ath9k_hw_mhz2ieee(struct ath_hal *ah, u32 freq, u32 flags);
  759. enum ath9k_int ath9k_hw_set_interrupts(struct ath_hal *ah,
  760. enum ath9k_int ints);
  761. bool ath9k_hw_reset(struct ath_hal *ah,
  762. struct ath9k_channel *chan,
  763. enum ath9k_ht_macmode macmode,
  764. u8 txchainmask, u8 rxchainmask,
  765. enum ath9k_ht_extprotspacing extprotspacing,
  766. bool bChannelChange,
  767. int *status);
  768. bool ath9k_hw_phy_disable(struct ath_hal *ah);
  769. void ath9k_hw_reset_calvalid(struct ath_hal *ah, struct ath9k_channel *chan,
  770. bool *isCalDone);
  771. void ath9k_hw_ani_monitor(struct ath_hal *ah,
  772. const struct ath9k_node_stats *stats,
  773. struct ath9k_channel *chan);
  774. bool ath9k_hw_calibrate(struct ath_hal *ah,
  775. struct ath9k_channel *chan,
  776. u8 rxchainmask,
  777. bool longcal,
  778. bool *isCalDone);
  779. s16 ath9k_hw_getchan_noise(struct ath_hal *ah,
  780. struct ath9k_channel *chan);
  781. void ath9k_hw_write_associd(struct ath_hal *ah, const u8 *bssid,
  782. u16 assocId);
  783. void ath9k_hw_setrxfilter(struct ath_hal *ah, u32 bits);
  784. void ath9k_hw_write_associd(struct ath_hal *ah, const u8 *bssid,
  785. u16 assocId);
  786. bool ath9k_hw_stoptxdma(struct ath_hal *ah, u32 q);
  787. void ath9k_hw_reset_tsf(struct ath_hal *ah);
  788. bool ath9k_hw_keyisvalid(struct ath_hal *ah, u16 entry);
  789. bool ath9k_hw_keysetmac(struct ath_hal *ah, u16 entry,
  790. const u8 *mac);
  791. bool ath9k_hw_set_keycache_entry(struct ath_hal *ah,
  792. u16 entry,
  793. const struct ath9k_keyval *k,
  794. const u8 *mac,
  795. int xorKey);
  796. bool ath9k_hw_set_tsfadjust(struct ath_hal *ah,
  797. u32 setting);
  798. void ath9k_hw_configpcipowersave(struct ath_hal *ah, int restore);
  799. bool ath9k_hw_intrpend(struct ath_hal *ah);
  800. bool ath9k_hw_getisr(struct ath_hal *ah, enum ath9k_int *masked);
  801. bool ath9k_hw_updatetxtriglevel(struct ath_hal *ah,
  802. bool bIncTrigLevel);
  803. void ath9k_hw_procmibevent(struct ath_hal *ah,
  804. const struct ath9k_node_stats *stats);
  805. bool ath9k_hw_setrxabort(struct ath_hal *ah, bool set);
  806. void ath9k_hw_set11nmac2040(struct ath_hal *ah, enum ath9k_ht_macmode mode);
  807. bool ath9k_hw_phycounters(struct ath_hal *ah);
  808. bool ath9k_hw_keyreset(struct ath_hal *ah, u16 entry);
  809. bool ath9k_hw_getcapability(struct ath_hal *ah,
  810. enum ath9k_capability_type type,
  811. u32 capability,
  812. u32 *result);
  813. bool ath9k_hw_setcapability(struct ath_hal *ah,
  814. enum ath9k_capability_type type,
  815. u32 capability,
  816. u32 setting,
  817. int *status);
  818. u32 ath9k_hw_getdefantenna(struct ath_hal *ah);
  819. void ath9k_hw_getmac(struct ath_hal *ah, u8 *mac);
  820. void ath9k_hw_getbssidmask(struct ath_hal *ah, u8 *mask);
  821. bool ath9k_hw_setbssidmask(struct ath_hal *ah,
  822. const u8 *mask);
  823. bool ath9k_hw_setpower(struct ath_hal *ah,
  824. enum ath9k_power_mode mode);
  825. enum ath9k_int ath9k_hw_intrget(struct ath_hal *ah);
  826. u64 ath9k_hw_gettsf64(struct ath_hal *ah);
  827. u32 ath9k_hw_getdefantenna(struct ath_hal *ah);
  828. bool ath9k_hw_setslottime(struct ath_hal *ah, u32 us);
  829. bool ath9k_hw_setantennaswitch(struct ath_hal *ah,
  830. enum ath9k_ant_setting settings,
  831. struct ath9k_channel *chan,
  832. u8 *tx_chainmask,
  833. u8 *rx_chainmask,
  834. u8 *antenna_cfgd);
  835. void ath9k_hw_setantenna(struct ath_hal *ah, u32 antenna);
  836. int ath9k_hw_select_antconfig(struct ath_hal *ah,
  837. u32 cfg);
  838. bool ath9k_hw_puttxbuf(struct ath_hal *ah, u32 q,
  839. u32 txdp);
  840. bool ath9k_hw_txstart(struct ath_hal *ah, u32 q);
  841. u16 ath9k_hw_computetxtime(struct ath_hal *ah,
  842. const struct ath9k_rate_table *rates,
  843. u32 frameLen, u16 rateix,
  844. bool shortPreamble);
  845. void ath9k_hw_set11n_ratescenario(struct ath_hal *ah, struct ath_desc *ds,
  846. struct ath_desc *lastds,
  847. u32 durUpdateEn, u32 rtsctsRate,
  848. u32 rtsctsDuration,
  849. struct ath9k_11n_rate_series series[],
  850. u32 nseries, u32 flags);
  851. void ath9k_hw_set11n_burstduration(struct ath_hal *ah,
  852. struct ath_desc *ds,
  853. u32 burstDuration);
  854. void ath9k_hw_cleartxdesc(struct ath_hal *ah, struct ath_desc *ds);
  855. u32 ath9k_hw_reverse_bits(u32 val, u32 n);
  856. bool ath9k_hw_resettxqueue(struct ath_hal *ah, u32 q);
  857. u32 ath9k_regd_get_ctl(struct ath_hal *ah, struct ath9k_channel *chan);
  858. u32 ath9k_regd_get_antenna_allowed(struct ath_hal *ah,
  859. struct ath9k_channel *chan);
  860. u32 ath9k_hw_mhz2ieee(struct ath_hal *ah, u32 freq, u32 flags);
  861. bool ath9k_hw_get_txq_props(struct ath_hal *ah, int q,
  862. struct ath9k_tx_queue_info *qinfo);
  863. bool ath9k_hw_set_txq_props(struct ath_hal *ah, int q,
  864. const struct ath9k_tx_queue_info *qinfo);
  865. struct ath9k_channel *ath9k_regd_check_channel(struct ath_hal *ah,
  866. const struct ath9k_channel *c);
  867. void ath9k_hw_set11n_txdesc(struct ath_hal *ah, struct ath_desc *ds,
  868. u32 pktLen, enum ath9k_pkt_type type,
  869. u32 txPower, u32 keyIx,
  870. enum ath9k_key_type keyType, u32 flags);
  871. bool ath9k_hw_filltxdesc(struct ath_hal *ah, struct ath_desc *ds,
  872. u32 segLen, bool firstSeg,
  873. bool lastSeg,
  874. const struct ath_desc *ds0);
  875. u32 ath9k_hw_GetMibCycleCountsPct(struct ath_hal *ah,
  876. u32 *rxc_pcnt,
  877. u32 *rxf_pcnt,
  878. u32 *txf_pcnt);
  879. void ath9k_hw_dmaRegDump(struct ath_hal *ah);
  880. void ath9k_hw_beaconinit(struct ath_hal *ah,
  881. u32 next_beacon, u32 beacon_period);
  882. void ath9k_hw_set_sta_beacon_timers(struct ath_hal *ah,
  883. const struct ath9k_beacon_state *bs);
  884. bool ath9k_hw_setuprxdesc(struct ath_hal *ah, struct ath_desc *ds,
  885. u32 size, u32 flags);
  886. void ath9k_hw_putrxbuf(struct ath_hal *ah, u32 rxdp);
  887. void ath9k_hw_rxena(struct ath_hal *ah);
  888. void ath9k_hw_setopmode(struct ath_hal *ah);
  889. bool ath9k_hw_setmac(struct ath_hal *ah, const u8 *mac);
  890. void ath9k_hw_setmcastfilter(struct ath_hal *ah, u32 filter0,
  891. u32 filter1);
  892. u32 ath9k_hw_getrxfilter(struct ath_hal *ah);
  893. void ath9k_hw_startpcureceive(struct ath_hal *ah);
  894. void ath9k_hw_stoppcurecv(struct ath_hal *ah);
  895. bool ath9k_hw_stopdmarecv(struct ath_hal *ah);
  896. int ath9k_hw_rxprocdesc(struct ath_hal *ah,
  897. struct ath_desc *ds, u32 pa,
  898. struct ath_desc *nds, u64 tsf);
  899. u32 ath9k_hw_gettxbuf(struct ath_hal *ah, u32 q);
  900. int ath9k_hw_txprocdesc(struct ath_hal *ah,
  901. struct ath_desc *ds);
  902. void ath9k_hw_set11n_aggr_middle(struct ath_hal *ah, struct ath_desc *ds,
  903. u32 numDelims);
  904. void ath9k_hw_set11n_aggr_first(struct ath_hal *ah, struct ath_desc *ds,
  905. u32 aggrLen);
  906. void ath9k_hw_set11n_aggr_last(struct ath_hal *ah, struct ath_desc *ds);
  907. bool ath9k_hw_releasetxqueue(struct ath_hal *ah, u32 q);
  908. void ath9k_hw_gettxintrtxqs(struct ath_hal *ah, u32 *txqs);
  909. void ath9k_hw_clr11n_aggr(struct ath_hal *ah, struct ath_desc *ds);
  910. void ath9k_hw_set11n_virtualmorefrag(struct ath_hal *ah,
  911. struct ath_desc *ds, u32 vmf);
  912. bool ath9k_hw_set_txpowerlimit(struct ath_hal *ah, u32 limit);
  913. bool ath9k_regd_is_public_safety_sku(struct ath_hal *ah);
  914. int ath9k_hw_setuptxqueue(struct ath_hal *ah, enum ath9k_tx_queue type,
  915. const struct ath9k_tx_queue_info *qinfo);
  916. u32 ath9k_hw_numtxpending(struct ath_hal *ah, u32 q);
  917. const char *ath9k_hw_probe(u16 vendorid, u16 devid);
  918. bool ath9k_hw_disable(struct ath_hal *ah);
  919. void ath9k_hw_rfdetach(struct ath_hal *ah);
  920. void ath9k_hw_get_channel_centers(struct ath_hal *ah,
  921. struct ath9k_channel *chan,
  922. struct chan_centers *centers);
  923. bool ath9k_get_channel_edges(struct ath_hal *ah,
  924. u16 flags, u16 *low,
  925. u16 *high);
  926. void ath9k_hw_cfg_output(struct ath_hal *ah, u32 gpio,
  927. u32 ah_signal_type);
  928. void ath9k_hw_set_gpio(struct ath_hal *ah, u32 gpio, u32 value);
  929. u32 ath9k_hw_gpio_get(struct ath_hal *ah, u32 gpio);
  930. void ath9k_hw_cfg_gpio_input(struct ath_hal *ah, u32 gpio);
  931. #endif