iwl-dev.h 31 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181
  1. /******************************************************************************
  2. *
  3. * Copyright(c) 2003 - 2008 Intel Corporation. All rights reserved.
  4. *
  5. * This program is free software; you can redistribute it and/or modify it
  6. * under the terms of version 2 of the GNU General Public License as
  7. * published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope that it will be useful, but WITHOUT
  10. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  12. * more details.
  13. *
  14. * You should have received a copy of the GNU General Public License along with
  15. * this program; if not, write to the Free Software Foundation, Inc.,
  16. * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
  17. *
  18. * The full GNU General Public License is included in this distribution in the
  19. * file called LICENSE.
  20. *
  21. * Contact Information:
  22. * James P. Ketrenos <ipw2100-admin@linux.intel.com>
  23. * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
  24. *
  25. *****************************************************************************/
  26. /*
  27. * Please use this file (iwl-dev.h) for driver implementation definitions.
  28. * Please use iwl-commands.h for uCode API definitions.
  29. * Please use iwl-4965-hw.h for hardware-related definitions.
  30. */
  31. #ifndef __iwl_dev_h__
  32. #define __iwl_dev_h__
  33. #include <linux/pci.h> /* for struct pci_device_id */
  34. #include <linux/kernel.h>
  35. #include <net/ieee80211_radiotap.h>
  36. #define DRV_NAME "iwl4965"
  37. #include "iwl-rfkill.h"
  38. #include "iwl-eeprom.h"
  39. #include "iwl-4965-hw.h"
  40. #include "iwl-csr.h"
  41. #include "iwl-prph.h"
  42. #include "iwl-debug.h"
  43. #include "iwl-led.h"
  44. #include "iwl-power.h"
  45. /* configuration for the iwl4965 */
  46. extern struct iwl_cfg iwl4965_agn_cfg;
  47. extern struct iwl_cfg iwl5300_agn_cfg;
  48. extern struct iwl_cfg iwl5100_agn_cfg;
  49. extern struct iwl_cfg iwl5350_agn_cfg;
  50. extern struct iwl_cfg iwl5100_bg_cfg;
  51. extern struct iwl_cfg iwl5100_abg_cfg;
  52. /* Change firmware file name, using "-" and incrementing number,
  53. * *only* when uCode interface or architecture changes so that it
  54. * is not compatible with earlier drivers.
  55. * This number will also appear in << 8 position of 1st dword of uCode file */
  56. #define IWL4965_UCODE_API "-1"
  57. /* CT-KILL constants */
  58. #define CT_KILL_THRESHOLD 110 /* in Celsius */
  59. /* Default noise level to report when noise measurement is not available.
  60. * This may be because we're:
  61. * 1) Not associated (4965, no beacon statistics being sent to driver)
  62. * 2) Scanning (noise measurement does not apply to associated channel)
  63. * 3) Receiving CCK (3945 delivers noise info only for OFDM frames)
  64. * Use default noise value of -127 ... this is below the range of measurable
  65. * Rx dBm for either 3945 or 4965, so it can indicate "unmeasurable" to user.
  66. * Also, -127 works better than 0 when averaging frames with/without
  67. * noise info (e.g. averaging might be done in app); measured dBm values are
  68. * always negative ... using a negative value as the default keeps all
  69. * averages within an s8's (used in some apps) range of negative values. */
  70. #define IWL_NOISE_MEAS_NOT_AVAILABLE (-127)
  71. /*
  72. * RTS threshold here is total size [2347] minus 4 FCS bytes
  73. * Per spec:
  74. * a value of 0 means RTS on all data/management packets
  75. * a value > max MSDU size means no RTS
  76. * else RTS for data/management frames where MPDU is larger
  77. * than RTS value.
  78. */
  79. #define DEFAULT_RTS_THRESHOLD 2347U
  80. #define MIN_RTS_THRESHOLD 0U
  81. #define MAX_RTS_THRESHOLD 2347U
  82. #define MAX_MSDU_SIZE 2304U
  83. #define MAX_MPDU_SIZE 2346U
  84. #define DEFAULT_BEACON_INTERVAL 100U
  85. #define DEFAULT_SHORT_RETRY_LIMIT 7U
  86. #define DEFAULT_LONG_RETRY_LIMIT 4U
  87. struct iwl_rx_mem_buffer {
  88. dma_addr_t dma_addr;
  89. struct sk_buff *skb;
  90. struct list_head list;
  91. };
  92. /*
  93. * Generic queue structure
  94. *
  95. * Contains common data for Rx and Tx queues
  96. */
  97. struct iwl_queue {
  98. int n_bd; /* number of BDs in this queue */
  99. int write_ptr; /* 1-st empty entry (index) host_w*/
  100. int read_ptr; /* last used entry (index) host_r*/
  101. dma_addr_t dma_addr; /* physical addr for BD's */
  102. int n_window; /* safe queue window */
  103. u32 id;
  104. int low_mark; /* low watermark, resume queue if free
  105. * space more than this */
  106. int high_mark; /* high watermark, stop queue if free
  107. * space less than this */
  108. } __attribute__ ((packed));
  109. #define MAX_NUM_OF_TBS (20)
  110. /* One for each TFD */
  111. struct iwl_tx_info {
  112. struct sk_buff *skb[MAX_NUM_OF_TBS];
  113. };
  114. /**
  115. * struct iwl_tx_queue - Tx Queue for DMA
  116. * @q: generic Rx/Tx queue descriptor
  117. * @bd: base of circular buffer of TFDs
  118. * @cmd: array of command/Tx buffers
  119. * @dma_addr_cmd: physical address of cmd/tx buffer array
  120. * @txb: array of per-TFD driver data
  121. * @need_update: indicates need to update read/write index
  122. * @sched_retry: indicates queue is high-throughput aggregation (HT AGG) enabled
  123. *
  124. * A Tx queue consists of circular buffer of BDs (a.k.a. TFDs, transmit frame
  125. * descriptors) and required locking structures.
  126. */
  127. struct iwl_tx_queue {
  128. struct iwl_queue q;
  129. struct iwl_tfd_frame *bd;
  130. struct iwl_cmd *cmd;
  131. dma_addr_t dma_addr_cmd;
  132. struct iwl_tx_info *txb;
  133. int need_update;
  134. int sched_retry;
  135. int active;
  136. };
  137. #define IWL_NUM_SCAN_RATES (2)
  138. struct iwl4965_channel_tgd_info {
  139. u8 type;
  140. s8 max_power;
  141. };
  142. struct iwl4965_channel_tgh_info {
  143. s64 last_radar_time;
  144. };
  145. /*
  146. * One for each channel, holds all channel setup data
  147. * Some of the fields (e.g. eeprom and flags/max_power_avg) are redundant
  148. * with one another!
  149. */
  150. struct iwl_channel_info {
  151. struct iwl4965_channel_tgd_info tgd;
  152. struct iwl4965_channel_tgh_info tgh;
  153. struct iwl_eeprom_channel eeprom; /* EEPROM regulatory limit */
  154. struct iwl_eeprom_channel fat_eeprom; /* EEPROM regulatory limit for
  155. * FAT channel */
  156. u8 channel; /* channel number */
  157. u8 flags; /* flags copied from EEPROM */
  158. s8 max_power_avg; /* (dBm) regul. eeprom, normal Tx, any rate */
  159. s8 curr_txpow; /* (dBm) regulatory/spectrum/user (not h/w) limit */
  160. s8 min_power; /* always 0 */
  161. s8 scan_power; /* (dBm) regul. eeprom, direct scans, any rate */
  162. u8 group_index; /* 0-4, maps channel to group1/2/3/4/5 */
  163. u8 band_index; /* 0-4, maps channel to band1/2/3/4/5 */
  164. enum ieee80211_band band;
  165. /* FAT channel info */
  166. s8 fat_max_power_avg; /* (dBm) regul. eeprom, normal Tx, any rate */
  167. s8 fat_curr_txpow; /* (dBm) regulatory/spectrum/user (not h/w) */
  168. s8 fat_min_power; /* always 0 */
  169. s8 fat_scan_power; /* (dBm) eeprom, direct scans, any rate */
  170. u8 fat_flags; /* flags copied from EEPROM */
  171. u8 fat_extension_channel; /* HT_IE_EXT_CHANNEL_* */
  172. };
  173. struct iwl4965_clip_group {
  174. /* maximum power level to prevent clipping for each rate, derived by
  175. * us from this band's saturation power in EEPROM */
  176. const s8 clip_powers[IWL_MAX_RATES];
  177. };
  178. #include "iwl-4965-rs.h"
  179. #define IWL_TX_FIFO_AC0 0
  180. #define IWL_TX_FIFO_AC1 1
  181. #define IWL_TX_FIFO_AC2 2
  182. #define IWL_TX_FIFO_AC3 3
  183. #define IWL_TX_FIFO_HCCA_1 5
  184. #define IWL_TX_FIFO_HCCA_2 6
  185. #define IWL_TX_FIFO_NONE 7
  186. /* Minimum number of queues. MAX_NUM is defined in hw specific files */
  187. #define IWL_MIN_NUM_QUEUES 4
  188. /* Power management (not Tx power) structures */
  189. enum iwl_pwr_src {
  190. IWL_PWR_SRC_VMAIN,
  191. IWL_PWR_SRC_VAUX,
  192. };
  193. #define IEEE80211_DATA_LEN 2304
  194. #define IEEE80211_4ADDR_LEN 30
  195. #define IEEE80211_HLEN (IEEE80211_4ADDR_LEN)
  196. #define IEEE80211_FRAME_LEN (IEEE80211_DATA_LEN + IEEE80211_HLEN)
  197. struct iwl_frame {
  198. union {
  199. struct ieee80211_hdr frame;
  200. struct iwl4965_tx_beacon_cmd beacon;
  201. u8 raw[IEEE80211_FRAME_LEN];
  202. u8 cmd[360];
  203. } u;
  204. struct list_head list;
  205. };
  206. #define SEQ_TO_QUEUE(x) ((x >> 8) & 0xbf)
  207. #define QUEUE_TO_SEQ(x) ((x & 0xbf) << 8)
  208. #define SEQ_TO_INDEX(x) ((u8)(x & 0xff))
  209. #define INDEX_TO_SEQ(x) ((u8)(x & 0xff))
  210. #define SEQ_HUGE_FRAME (0x4000)
  211. #define SEQ_RX_FRAME __constant_cpu_to_le16(0x8000)
  212. #define SEQ_TO_SN(seq) (((seq) & IEEE80211_SCTL_SEQ) >> 4)
  213. #define SN_TO_SEQ(ssn) (((ssn) << 4) & IEEE80211_SCTL_SEQ)
  214. #define MAX_SN ((IEEE80211_SCTL_SEQ) >> 4)
  215. enum {
  216. /* CMD_SIZE_NORMAL = 0, */
  217. CMD_SIZE_HUGE = (1 << 0),
  218. /* CMD_SYNC = 0, */
  219. CMD_ASYNC = (1 << 1),
  220. /* CMD_NO_SKB = 0, */
  221. CMD_WANT_SKB = (1 << 2),
  222. };
  223. struct iwl_cmd;
  224. struct iwl_priv;
  225. struct iwl_cmd_meta {
  226. struct iwl_cmd_meta *source;
  227. union {
  228. struct sk_buff *skb;
  229. int (*callback)(struct iwl_priv *priv,
  230. struct iwl_cmd *cmd, struct sk_buff *skb);
  231. } __attribute__ ((packed)) u;
  232. /* The CMD_SIZE_HUGE flag bit indicates that the command
  233. * structure is stored at the end of the shared queue memory. */
  234. u32 flags;
  235. } __attribute__ ((packed));
  236. #define IWL_CMD_MAX_PAYLOAD 320
  237. /**
  238. * struct iwl_cmd
  239. *
  240. * For allocation of the command and tx queues, this establishes the overall
  241. * size of the largest command we send to uCode, except for a scan command
  242. * (which is relatively huge; space is allocated separately).
  243. */
  244. struct iwl_cmd {
  245. struct iwl_cmd_meta meta; /* driver data */
  246. struct iwl_cmd_header hdr; /* uCode API */
  247. union {
  248. struct iwl_addsta_cmd addsta;
  249. struct iwl4965_led_cmd led;
  250. u32 flags;
  251. u8 val8;
  252. u16 val16;
  253. u32 val32;
  254. struct iwl4965_bt_cmd bt;
  255. struct iwl4965_rxon_time_cmd rxon_time;
  256. struct iwl4965_powertable_cmd powertable;
  257. struct iwl_qosparam_cmd qosparam;
  258. struct iwl_tx_cmd tx;
  259. struct iwl4965_tx_beacon_cmd tx_beacon;
  260. struct iwl4965_rxon_assoc_cmd rxon_assoc;
  261. struct iwl_rem_sta_cmd rm_sta;
  262. u8 *indirect;
  263. u8 payload[IWL_CMD_MAX_PAYLOAD];
  264. } __attribute__ ((packed)) cmd;
  265. } __attribute__ ((packed));
  266. struct iwl_host_cmd {
  267. u8 id;
  268. u16 len;
  269. struct iwl_cmd_meta meta;
  270. const void *data;
  271. };
  272. #define TFD_MAX_PAYLOAD_SIZE (sizeof(struct iwl_cmd) - \
  273. sizeof(struct iwl_cmd_meta))
  274. /*
  275. * RX related structures and functions
  276. */
  277. #define RX_FREE_BUFFERS 64
  278. #define RX_LOW_WATERMARK 8
  279. #define SUP_RATE_11A_MAX_NUM_CHANNELS 8
  280. #define SUP_RATE_11B_MAX_NUM_CHANNELS 4
  281. #define SUP_RATE_11G_MAX_NUM_CHANNELS 12
  282. /**
  283. * struct iwl_rx_queue - Rx queue
  284. * @processed: Internal index to last handled Rx packet
  285. * @read: Shared index to newest available Rx buffer
  286. * @write: Shared index to oldest written Rx packet
  287. * @free_count: Number of pre-allocated buffers in rx_free
  288. * @rx_free: list of free SKBs for use
  289. * @rx_used: List of Rx buffers with no SKB
  290. * @need_update: flag to indicate we need to update read/write index
  291. *
  292. * NOTE: rx_free and rx_used are used as a FIFO for iwl_rx_mem_buffers
  293. */
  294. struct iwl_rx_queue {
  295. __le32 *bd;
  296. dma_addr_t dma_addr;
  297. struct iwl_rx_mem_buffer pool[RX_QUEUE_SIZE + RX_FREE_BUFFERS];
  298. struct iwl_rx_mem_buffer *queue[RX_QUEUE_SIZE];
  299. u32 processed;
  300. u32 read;
  301. u32 write;
  302. u32 free_count;
  303. struct list_head rx_free;
  304. struct list_head rx_used;
  305. int need_update;
  306. spinlock_t lock;
  307. };
  308. #define IWL_SUPPORTED_RATES_IE_LEN 8
  309. #define SCAN_INTERVAL 100
  310. #define MAX_A_CHANNELS 252
  311. #define MIN_A_CHANNELS 7
  312. #define MAX_B_CHANNELS 14
  313. #define MIN_B_CHANNELS 1
  314. #define MAX_TID_COUNT 9
  315. #define IWL_INVALID_RATE 0xFF
  316. #define IWL_INVALID_VALUE -1
  317. /**
  318. * struct iwl_ht_agg -- aggregation status while waiting for block-ack
  319. * @txq_id: Tx queue used for Tx attempt
  320. * @frame_count: # frames attempted by Tx command
  321. * @wait_for_ba: Expect block-ack before next Tx reply
  322. * @start_idx: Index of 1st Transmit Frame Descriptor (TFD) in Tx window
  323. * @bitmap0: Low order bitmap, one bit for each frame pending ACK in Tx window
  324. * @bitmap1: High order, one bit for each frame pending ACK in Tx window
  325. * @rate_n_flags: Rate at which Tx was attempted
  326. *
  327. * If REPLY_TX indicates that aggregation was attempted, driver must wait
  328. * for block ack (REPLY_COMPRESSED_BA). This struct stores tx reply info
  329. * until block ack arrives.
  330. */
  331. struct iwl_ht_agg {
  332. u16 txq_id;
  333. u16 frame_count;
  334. u16 wait_for_ba;
  335. u16 start_idx;
  336. u64 bitmap;
  337. u32 rate_n_flags;
  338. #define IWL_AGG_OFF 0
  339. #define IWL_AGG_ON 1
  340. #define IWL_EMPTYING_HW_QUEUE_ADDBA 2
  341. #define IWL_EMPTYING_HW_QUEUE_DELBA 3
  342. u8 state;
  343. };
  344. struct iwl_tid_data {
  345. u16 seq_number;
  346. u16 tfds_in_queue;
  347. struct iwl_ht_agg agg;
  348. };
  349. struct iwl_hw_key {
  350. enum ieee80211_key_alg alg;
  351. int keylen;
  352. u8 keyidx;
  353. u8 key[32];
  354. };
  355. union iwl4965_ht_rate_supp {
  356. u16 rates;
  357. struct {
  358. u8 siso_rate;
  359. u8 mimo_rate;
  360. };
  361. };
  362. #define CFG_HT_RX_AMPDU_FACTOR_DEF (0x3)
  363. #define CFG_HT_MPDU_DENSITY_2USEC (0x5)
  364. #define CFG_HT_MPDU_DENSITY_DEF CFG_HT_MPDU_DENSITY_2USEC
  365. struct iwl_ht_info {
  366. /* self configuration data */
  367. u8 is_ht;
  368. u8 supported_chan_width;
  369. u16 tx_mimo_ps_mode;
  370. u8 is_green_field;
  371. u8 sgf; /* HT_SHORT_GI_* short guard interval */
  372. u8 max_amsdu_size;
  373. u8 ampdu_factor;
  374. u8 mpdu_density;
  375. u8 supp_mcs_set[16];
  376. /* BSS related data */
  377. u8 control_channel;
  378. u8 extension_chan_offset;
  379. u8 tx_chan_width;
  380. u8 ht_protection;
  381. u8 non_GF_STA_present;
  382. };
  383. union iwl_qos_capabity {
  384. struct {
  385. u8 edca_count:4; /* bit 0-3 */
  386. u8 q_ack:1; /* bit 4 */
  387. u8 queue_request:1; /* bit 5 */
  388. u8 txop_request:1; /* bit 6 */
  389. u8 reserved:1; /* bit 7 */
  390. } q_AP;
  391. struct {
  392. u8 acvo_APSD:1; /* bit 0 */
  393. u8 acvi_APSD:1; /* bit 1 */
  394. u8 ac_bk_APSD:1; /* bit 2 */
  395. u8 ac_be_APSD:1; /* bit 3 */
  396. u8 q_ack:1; /* bit 4 */
  397. u8 max_len:2; /* bit 5-6 */
  398. u8 more_data_ack:1; /* bit 7 */
  399. } q_STA;
  400. u8 val;
  401. };
  402. /* QoS structures */
  403. struct iwl_qos_info {
  404. int qos_enable;
  405. int qos_active;
  406. union iwl_qos_capabity qos_cap;
  407. struct iwl_qosparam_cmd def_qos_parm;
  408. };
  409. #define STA_PS_STATUS_WAKE 0
  410. #define STA_PS_STATUS_SLEEP 1
  411. struct iwl_station_entry {
  412. struct iwl_addsta_cmd sta;
  413. struct iwl_tid_data tid[MAX_TID_COUNT];
  414. u8 used;
  415. u8 ps_status;
  416. struct iwl_hw_key keyinfo;
  417. };
  418. /* one for each uCode image (inst/data, boot/init/runtime) */
  419. struct fw_desc {
  420. void *v_addr; /* access by driver */
  421. dma_addr_t p_addr; /* access by card's busmaster DMA */
  422. u32 len; /* bytes */
  423. };
  424. /* uCode file layout */
  425. struct iwl_ucode {
  426. __le32 ver; /* major/minor/subminor */
  427. __le32 inst_size; /* bytes of runtime instructions */
  428. __le32 data_size; /* bytes of runtime data */
  429. __le32 init_size; /* bytes of initialization instructions */
  430. __le32 init_data_size; /* bytes of initialization data */
  431. __le32 boot_size; /* bytes of bootstrap instructions */
  432. u8 data[0]; /* data in same order as "size" elements */
  433. };
  434. struct iwl4965_ibss_seq {
  435. u8 mac[ETH_ALEN];
  436. u16 seq_num;
  437. u16 frag_num;
  438. unsigned long packet_time;
  439. struct list_head list;
  440. };
  441. struct iwl_sensitivity_ranges {
  442. u16 min_nrg_cck;
  443. u16 max_nrg_cck;
  444. u16 nrg_th_cck;
  445. u16 nrg_th_ofdm;
  446. u16 auto_corr_min_ofdm;
  447. u16 auto_corr_min_ofdm_mrc;
  448. u16 auto_corr_min_ofdm_x1;
  449. u16 auto_corr_min_ofdm_mrc_x1;
  450. u16 auto_corr_max_ofdm;
  451. u16 auto_corr_max_ofdm_mrc;
  452. u16 auto_corr_max_ofdm_x1;
  453. u16 auto_corr_max_ofdm_mrc_x1;
  454. u16 auto_corr_max_cck;
  455. u16 auto_corr_max_cck_mrc;
  456. u16 auto_corr_min_cck;
  457. u16 auto_corr_min_cck_mrc;
  458. };
  459. #define IWL_FAT_CHANNEL_52 BIT(IEEE80211_BAND_5GHZ)
  460. /**
  461. * struct iwl_hw_params
  462. * @max_txq_num: Max # Tx queues supported
  463. * @tx/rx_chains_num: Number of TX/RX chains
  464. * @valid_tx/rx_ant: usable antennas
  465. * @max_rxq_size: Max # Rx frames in Rx queue (must be power-of-2)
  466. * @max_rxq_log: Log-base-2 of max_rxq_size
  467. * @rx_buf_size: Rx buffer size
  468. * @max_stations:
  469. * @bcast_sta_id:
  470. * @fat_channel: is 40MHz width possible in band 2.4
  471. * BIT(IEEE80211_BAND_5GHZ) BIT(IEEE80211_BAND_5GHZ)
  472. * @sw_crypto: 0 for hw, 1 for sw
  473. * @max_xxx_size: for ucode uses
  474. * @ct_kill_threshold: temperature threshold
  475. * @struct iwl_sensitivity_ranges: range of sensitivity values
  476. * @first_ampdu_q: first HW queue available for ampdu
  477. */
  478. struct iwl_hw_params {
  479. u16 max_txq_num;
  480. u8 tx_chains_num;
  481. u8 rx_chains_num;
  482. u8 valid_tx_ant;
  483. u8 valid_rx_ant;
  484. u16 max_rxq_size;
  485. u16 max_rxq_log;
  486. u32 rx_buf_size;
  487. u32 max_pkt_size;
  488. u8 max_stations;
  489. u8 bcast_sta_id;
  490. u8 fat_channel;
  491. u8 sw_crypto;
  492. u32 max_inst_size;
  493. u32 max_data_size;
  494. u32 max_bsm_size;
  495. u32 ct_kill_threshold; /* value in hw-dependent units */
  496. const struct iwl_sensitivity_ranges *sens;
  497. u8 first_ampdu_q;
  498. };
  499. #define HT_SHORT_GI_20MHZ (1 << 0)
  500. #define HT_SHORT_GI_40MHZ (1 << 1)
  501. #define IWL_RX_HDR(x) ((struct iwl4965_rx_frame_hdr *)(\
  502. x->u.rx_frame.stats.payload + \
  503. x->u.rx_frame.stats.phy_count))
  504. #define IWL_RX_END(x) ((struct iwl4965_rx_frame_end *)(\
  505. IWL_RX_HDR(x)->payload + \
  506. le16_to_cpu(IWL_RX_HDR(x)->len)))
  507. #define IWL_RX_STATS(x) (&x->u.rx_frame.stats)
  508. #define IWL_RX_DATA(x) (IWL_RX_HDR(x)->payload)
  509. /******************************************************************************
  510. *
  511. * Functions implemented in iwl-base.c which are forward declared here
  512. * for use by iwl-*.c
  513. *
  514. *****************************************************************************/
  515. struct iwl_addsta_cmd;
  516. extern int iwl_send_add_sta(struct iwl_priv *priv,
  517. struct iwl_addsta_cmd *sta, u8 flags);
  518. u8 iwl_add_station_flags(struct iwl_priv *priv, const u8 *addr, int is_ap,
  519. u8 flags, struct ieee80211_ht_info *ht_info);
  520. extern unsigned int iwl4965_fill_beacon_frame(struct iwl_priv *priv,
  521. struct ieee80211_hdr *hdr,
  522. const u8 *dest, int left);
  523. extern void iwl4965_update_chain_flags(struct iwl_priv *priv);
  524. int iwl4965_set_pwr_src(struct iwl_priv *priv, enum iwl_pwr_src src);
  525. extern const u8 iwl_bcast_addr[ETH_ALEN];
  526. /******************************************************************************
  527. *
  528. * Functions implemented in iwl-[34]*.c which are forward declared here
  529. * for use by iwl-base.c
  530. *
  531. * NOTE: The implementation of these functions are hardware specific
  532. * which is why they are in the hardware specific files (vs. iwl-base.c)
  533. *
  534. * Naming convention --
  535. * iwl4965_ <-- Its part of iwlwifi (should be changed to iwl4965_)
  536. * iwl4965_hw_ <-- Hardware specific (implemented in iwl-XXXX.c by all HW)
  537. * iwlXXXX_ <-- Hardware specific (implemented in iwl-XXXX.c for XXXX)
  538. * iwl4965_bg_ <-- Called from work queue context
  539. * iwl4965_mac_ <-- mac80211 callback
  540. *
  541. ****************************************************************************/
  542. extern int iwl_rxq_stop(struct iwl_priv *priv);
  543. extern void iwl_txq_ctx_stop(struct iwl_priv *priv);
  544. extern unsigned int iwl4965_hw_get_beacon_cmd(struct iwl_priv *priv,
  545. struct iwl_frame *frame, u8 rate);
  546. extern void iwl4965_disable_events(struct iwl_priv *priv);
  547. extern int iwl4965_hw_channel_switch(struct iwl_priv *priv, u16 channel);
  548. extern int iwl_queue_space(const struct iwl_queue *q);
  549. static inline int iwl_queue_used(const struct iwl_queue *q, int i)
  550. {
  551. return q->write_ptr > q->read_ptr ?
  552. (i >= q->read_ptr && i < q->write_ptr) :
  553. !(i < q->read_ptr && i >= q->write_ptr);
  554. }
  555. static inline u8 get_cmd_index(struct iwl_queue *q, u32 index, int is_huge)
  556. {
  557. /* This is for scan command, the big buffer at end of command array */
  558. if (is_huge)
  559. return q->n_window; /* must be power of 2 */
  560. /* Otherwise, use normal size buffers */
  561. return index & (q->n_window - 1);
  562. }
  563. struct iwl_priv;
  564. /*
  565. * Forward declare iwl-4965.c functions for iwl-base.c
  566. */
  567. extern void iwl4965_rf_kill_ct_config(struct iwl_priv *priv);
  568. int iwl4965_mac_ampdu_action(struct ieee80211_hw *hw,
  569. enum ieee80211_ampdu_mlme_action action,
  570. const u8 *addr, u16 tid, u16 *ssn);
  571. int iwl4965_check_empty_hw_queue(struct iwl_priv *priv, int sta_id,
  572. u8 tid, int txq_id);
  573. /* Structures, enum, and defines specific to the 4965 */
  574. #define IWL_KW_SIZE 0x1000 /*4k */
  575. struct iwl_kw {
  576. dma_addr_t dma_addr;
  577. void *v_addr;
  578. size_t size;
  579. };
  580. #define IWL_CHANNEL_WIDTH_20MHZ 0
  581. #define IWL_CHANNEL_WIDTH_40MHZ 1
  582. #define IWL_MIMO_PS_STATIC 0
  583. #define IWL_MIMO_PS_NONE 3
  584. #define IWL_MIMO_PS_DYNAMIC 1
  585. #define IWL_MIMO_PS_INVALID 2
  586. #define IWL_OPERATION_MODE_AUTO 0
  587. #define IWL_OPERATION_MODE_HT_ONLY 1
  588. #define IWL_OPERATION_MODE_MIXED 2
  589. #define IWL_OPERATION_MODE_20MHZ 3
  590. #define IWL_TX_CRC_SIZE 4
  591. #define IWL_TX_DELIMITER_SIZE 4
  592. #define TX_POWER_IWL_ILLEGAL_VOLTAGE -10000
  593. struct iwl4965_lq_mngr {
  594. spinlock_t lock;
  595. s32 max_window_size;
  596. s32 *expected_tpt;
  597. u8 *next_higher_rate;
  598. u8 *next_lower_rate;
  599. unsigned long stamp;
  600. unsigned long stamp_last;
  601. u32 flush_time;
  602. u32 tx_packets;
  603. };
  604. /* Sensitivity and chain noise calibration */
  605. #define INTERFERENCE_DATA_AVAILABLE __constant_cpu_to_le32(1)
  606. #define INITIALIZATION_VALUE 0xFFFF
  607. #define CAL_NUM_OF_BEACONS 20
  608. #define MAXIMUM_ALLOWED_PATHLOSS 15
  609. #define CHAIN_NOISE_MAX_DELTA_GAIN_CODE 3
  610. #define MAX_FA_OFDM 50
  611. #define MIN_FA_OFDM 5
  612. #define MAX_FA_CCK 50
  613. #define MIN_FA_CCK 5
  614. #define AUTO_CORR_STEP_OFDM 1
  615. #define AUTO_CORR_STEP_CCK 3
  616. #define AUTO_CORR_MAX_TH_CCK 160
  617. #define NRG_DIFF 2
  618. #define NRG_STEP_CCK 2
  619. #define NRG_MARGIN 8
  620. #define MAX_NUMBER_CCK_NO_FA 100
  621. #define AUTO_CORR_CCK_MIN_VAL_DEF (125)
  622. #define CHAIN_A 0
  623. #define CHAIN_B 1
  624. #define CHAIN_C 2
  625. #define CHAIN_NOISE_DELTA_GAIN_INIT_VAL 4
  626. #define ALL_BAND_FILTER 0xFF00
  627. #define IN_BAND_FILTER 0xFF
  628. #define MIN_AVERAGE_NOISE_MAX_VALUE 0xFFFFFFFF
  629. #define NRG_NUM_PREV_STAT_L 20
  630. #define NUM_RX_CHAINS 3
  631. enum iwl4965_false_alarm_state {
  632. IWL_FA_TOO_MANY = 0,
  633. IWL_FA_TOO_FEW = 1,
  634. IWL_FA_GOOD_RANGE = 2,
  635. };
  636. enum iwl4965_chain_noise_state {
  637. IWL_CHAIN_NOISE_ALIVE = 0, /* must be 0 */
  638. IWL_CHAIN_NOISE_ACCUMULATE = 1,
  639. IWL_CHAIN_NOISE_CALIBRATED = 2,
  640. };
  641. enum iwl4965_calib_enabled_state {
  642. IWL_CALIB_DISABLED = 0, /* must be 0 */
  643. IWL_CALIB_ENABLED = 1,
  644. };
  645. struct statistics_general_data {
  646. u32 beacon_silence_rssi_a;
  647. u32 beacon_silence_rssi_b;
  648. u32 beacon_silence_rssi_c;
  649. u32 beacon_energy_a;
  650. u32 beacon_energy_b;
  651. u32 beacon_energy_c;
  652. };
  653. struct iwl_calib_results {
  654. void *tx_iq_res;
  655. void *tx_iq_perd_res;
  656. void *lo_res;
  657. u32 tx_iq_res_len;
  658. u32 tx_iq_perd_res_len;
  659. u32 lo_res_len;
  660. };
  661. enum ucode_type {
  662. UCODE_NONE = 0,
  663. UCODE_INIT,
  664. UCODE_RT
  665. };
  666. /* Sensitivity calib data */
  667. struct iwl_sensitivity_data {
  668. u32 auto_corr_ofdm;
  669. u32 auto_corr_ofdm_mrc;
  670. u32 auto_corr_ofdm_x1;
  671. u32 auto_corr_ofdm_mrc_x1;
  672. u32 auto_corr_cck;
  673. u32 auto_corr_cck_mrc;
  674. u32 last_bad_plcp_cnt_ofdm;
  675. u32 last_fa_cnt_ofdm;
  676. u32 last_bad_plcp_cnt_cck;
  677. u32 last_fa_cnt_cck;
  678. u32 nrg_curr_state;
  679. u32 nrg_prev_state;
  680. u32 nrg_value[10];
  681. u8 nrg_silence_rssi[NRG_NUM_PREV_STAT_L];
  682. u32 nrg_silence_ref;
  683. u32 nrg_energy_idx;
  684. u32 nrg_silence_idx;
  685. u32 nrg_th_cck;
  686. s32 nrg_auto_corr_silence_diff;
  687. u32 num_in_cck_no_fa;
  688. u32 nrg_th_ofdm;
  689. };
  690. /* Chain noise (differential Rx gain) calib data */
  691. struct iwl_chain_noise_data {
  692. u8 state;
  693. u16 beacon_count;
  694. u32 chain_noise_a;
  695. u32 chain_noise_b;
  696. u32 chain_noise_c;
  697. u32 chain_signal_a;
  698. u32 chain_signal_b;
  699. u32 chain_signal_c;
  700. u8 disconn_array[NUM_RX_CHAINS];
  701. u8 delta_gain_code[NUM_RX_CHAINS];
  702. u8 radio_write;
  703. };
  704. #define EEPROM_SEM_TIMEOUT 10 /* milliseconds */
  705. #define EEPROM_SEM_RETRY_LIMIT 1000 /* number of attempts (not time) */
  706. #ifdef CONFIG_IWL4965_SPECTRUM_MEASUREMENT
  707. enum {
  708. MEASUREMENT_READY = (1 << 0),
  709. MEASUREMENT_ACTIVE = (1 << 1),
  710. };
  711. #endif
  712. #define IWL_MAX_NUM_QUEUES 20 /* FIXME: do dynamic allocation */
  713. struct iwl_priv {
  714. /* ieee device used by generic ieee processing code */
  715. struct ieee80211_hw *hw;
  716. struct ieee80211_channel *ieee_channels;
  717. struct ieee80211_rate *ieee_rates;
  718. struct iwl_cfg *cfg;
  719. /* temporary frame storage list */
  720. struct list_head free_frames;
  721. int frames_count;
  722. enum ieee80211_band band;
  723. int alloc_rxb_skb;
  724. bool add_radiotap;
  725. void (*rx_handlers[REPLY_MAX])(struct iwl_priv *priv,
  726. struct iwl_rx_mem_buffer *rxb);
  727. struct ieee80211_supported_band bands[IEEE80211_NUM_BANDS];
  728. #ifdef CONFIG_IWL4965_SPECTRUM_MEASUREMENT
  729. /* spectrum measurement report caching */
  730. struct iwl4965_spectrum_notification measure_report;
  731. u8 measurement_status;
  732. #endif
  733. /* ucode beacon time */
  734. u32 ucode_beacon_time;
  735. /* we allocate array of iwl4965_channel_info for NIC's valid channels.
  736. * Access via channel # using indirect index array */
  737. struct iwl_channel_info *channel_info; /* channel info array */
  738. u8 channel_count; /* # of channels */
  739. /* each calibration channel group in the EEPROM has a derived
  740. * clip setting for each rate. */
  741. const struct iwl4965_clip_group clip_groups[5];
  742. /* thermal calibration */
  743. s32 temperature; /* degrees Kelvin */
  744. s32 last_temperature;
  745. /* init calibration results */
  746. struct iwl_calib_results calib_results;
  747. /* Scan related variables */
  748. unsigned long last_scan_jiffies;
  749. unsigned long next_scan_jiffies;
  750. unsigned long scan_start;
  751. unsigned long scan_pass_start;
  752. unsigned long scan_start_tsf;
  753. int scan_bands;
  754. int one_direct_scan;
  755. u8 direct_ssid_len;
  756. u8 direct_ssid[IW_ESSID_MAX_SIZE];
  757. struct iwl_scan_cmd *scan;
  758. u32 scan_tx_ant[IEEE80211_NUM_BANDS];
  759. /* spinlock */
  760. spinlock_t lock; /* protect general shared data */
  761. spinlock_t hcmd_lock; /* protect hcmd */
  762. struct mutex mutex;
  763. /* basic pci-network driver stuff */
  764. struct pci_dev *pci_dev;
  765. /* pci hardware address support */
  766. void __iomem *hw_base;
  767. u32 hw_rev;
  768. u32 hw_wa_rev;
  769. u8 rev_id;
  770. /* uCode images, save to reload in case of failure */
  771. struct fw_desc ucode_code; /* runtime inst */
  772. struct fw_desc ucode_data; /* runtime data original */
  773. struct fw_desc ucode_data_backup; /* runtime data save/restore */
  774. struct fw_desc ucode_init; /* initialization inst */
  775. struct fw_desc ucode_init_data; /* initialization data */
  776. struct fw_desc ucode_boot; /* bootstrap inst */
  777. enum ucode_type ucode_type;
  778. u8 ucode_write_complete; /* the image write is complete */
  779. struct iwl4965_rxon_time_cmd rxon_timing;
  780. /* We declare this const so it can only be
  781. * changed via explicit cast within the
  782. * routines that actually update the physical
  783. * hardware */
  784. const struct iwl_rxon_cmd active_rxon;
  785. struct iwl_rxon_cmd staging_rxon;
  786. int error_recovering;
  787. struct iwl_rxon_cmd recovery_rxon;
  788. /* 1st responses from initialize and runtime uCode images.
  789. * 4965's initialize alive response contains some calibration data. */
  790. struct iwl_init_alive_resp card_alive_init;
  791. struct iwl_alive_resp card_alive;
  792. #ifdef CONFIG_IWLWIFI_RFKILL
  793. struct rfkill *rfkill;
  794. #endif
  795. #ifdef CONFIG_IWLWIFI_LEDS
  796. struct iwl_led led[IWL_LED_TRG_MAX];
  797. unsigned long last_blink_time;
  798. u8 last_blink_rate;
  799. u8 allow_blinking;
  800. u64 led_tpt;
  801. #endif
  802. u16 active_rate;
  803. u16 active_rate_basic;
  804. u8 assoc_station_added;
  805. u8 use_ant_b_for_management_frame; /* Tx antenna selection */
  806. u8 start_calib;
  807. struct iwl_sensitivity_data sensitivity_data;
  808. struct iwl_chain_noise_data chain_noise_data;
  809. __le16 sensitivity_tbl[HD_TABLE_SIZE];
  810. struct iwl_ht_info current_ht_config;
  811. u8 last_phy_res[100];
  812. /* Rate scaling data */
  813. struct iwl4965_lq_mngr lq_mngr;
  814. /* Rate scaling data */
  815. s8 data_retry_limit;
  816. u8 retry_rate;
  817. wait_queue_head_t wait_command_queue;
  818. int activity_timer_active;
  819. /* Rx and Tx DMA processing queues */
  820. struct iwl_rx_queue rxq;
  821. struct iwl_tx_queue txq[IWL_MAX_NUM_QUEUES];
  822. unsigned long txq_ctx_active_msk;
  823. struct iwl_kw kw; /* keep warm address */
  824. u32 scd_base_addr; /* scheduler sram base address */
  825. unsigned long status;
  826. int last_rx_rssi; /* From Rx packet statisitics */
  827. int last_rx_noise; /* From beacon statistics */
  828. /* counts mgmt, ctl, and data packets */
  829. struct traffic_stats {
  830. u32 cnt;
  831. u64 bytes;
  832. } tx_stats[3], rx_stats[3];
  833. struct iwl_power_mgr power_data;
  834. struct iwl_notif_statistics statistics;
  835. unsigned long last_statistics_time;
  836. /* context information */
  837. u8 essid[IW_ESSID_MAX_SIZE];
  838. u8 essid_len;
  839. u16 rates_mask;
  840. u32 power_mode;
  841. u32 antenna;
  842. u8 bssid[ETH_ALEN];
  843. u16 rts_threshold;
  844. u8 mac_addr[ETH_ALEN];
  845. /*station table variables */
  846. spinlock_t sta_lock;
  847. int num_stations;
  848. struct iwl_station_entry stations[IWL_STATION_COUNT];
  849. struct iwl_wep_key wep_keys[WEP_KEYS_MAX];
  850. u8 default_wep_key;
  851. u8 key_mapping_key;
  852. unsigned long ucode_key_table;
  853. /* Indication if ieee80211_ops->open has been called */
  854. u8 is_open;
  855. u8 mac80211_registered;
  856. /* Rx'd packet timing information */
  857. u32 last_beacon_time;
  858. u64 last_tsf;
  859. /* eeprom */
  860. u8 *eeprom;
  861. struct iwl_eeprom_calib_info *calib_info;
  862. enum ieee80211_if_types iw_mode;
  863. struct sk_buff *ibss_beacon;
  864. /* Last Rx'd beacon timestamp */
  865. u64 timestamp;
  866. u16 beacon_int;
  867. struct ieee80211_vif *vif;
  868. struct iwl_hw_params hw_params;
  869. /* driver/uCode shared Tx Byte Counts and Rx status */
  870. void *shared_virt;
  871. int rb_closed_offset;
  872. /* Physical Pointer to Tx Byte Counts and Rx status */
  873. dma_addr_t shared_phys;
  874. /* Current association information needed to configure the
  875. * hardware */
  876. u16 assoc_id;
  877. u16 assoc_capability;
  878. u8 ps_mode;
  879. struct iwl_qos_info qos_data;
  880. struct workqueue_struct *workqueue;
  881. struct work_struct up;
  882. struct work_struct restart;
  883. struct work_struct calibrated_work;
  884. struct work_struct scan_completed;
  885. struct work_struct rx_replenish;
  886. struct work_struct rf_kill;
  887. struct work_struct abort_scan;
  888. struct work_struct update_link_led;
  889. struct work_struct auth_work;
  890. struct work_struct report_work;
  891. struct work_struct request_scan;
  892. struct work_struct beacon_update;
  893. struct work_struct set_monitor;
  894. struct tasklet_struct irq_tasklet;
  895. struct delayed_work init_alive_start;
  896. struct delayed_work alive_start;
  897. struct delayed_work scan_check;
  898. /* TX Power */
  899. s8 tx_power_user_lmt;
  900. s8 tx_power_channel_lmt;
  901. #ifdef CONFIG_PM
  902. u32 pm_state[16];
  903. #endif
  904. #ifdef CONFIG_IWLWIFI_DEBUG
  905. /* debugging info */
  906. u32 debug_level;
  907. u32 framecnt_to_us;
  908. atomic_t restrict_refcnt;
  909. #ifdef CONFIG_IWLWIFI_DEBUGFS
  910. /* debugfs */
  911. struct iwl_debugfs *dbgfs;
  912. #endif /* CONFIG_IWLWIFI_DEBUGFS */
  913. #endif /* CONFIG_IWLWIFI_DEBUG */
  914. struct work_struct txpower_work;
  915. u32 disable_sens_cal;
  916. u32 disable_chain_noise_cal;
  917. u32 disable_tx_power_cal;
  918. struct work_struct run_time_calib_work;
  919. struct timer_list statistics_periodic;
  920. }; /*iwl_priv */
  921. static inline void iwl_txq_ctx_activate(struct iwl_priv *priv, int txq_id)
  922. {
  923. set_bit(txq_id, &priv->txq_ctx_active_msk);
  924. }
  925. static inline void iwl_txq_ctx_deactivate(struct iwl_priv *priv, int txq_id)
  926. {
  927. clear_bit(txq_id, &priv->txq_ctx_active_msk);
  928. }
  929. #ifdef CONFIG_IWLWIFI_DEBUG
  930. const char *iwl_get_tx_fail_reason(u32 status);
  931. #else
  932. static inline const char *iwl_get_tx_fail_reason(u32 status) { return ""; }
  933. #endif
  934. static inline struct ieee80211_hdr *iwl_tx_queue_get_hdr(struct iwl_priv *priv,
  935. int txq_id, int idx)
  936. {
  937. if (priv->txq[txq_id].txb[idx].skb[0])
  938. return (struct ieee80211_hdr *)priv->txq[txq_id].
  939. txb[idx].skb[0]->data;
  940. return NULL;
  941. }
  942. static inline int iwl_is_associated(struct iwl_priv *priv)
  943. {
  944. return (priv->active_rxon.filter_flags & RXON_FILTER_ASSOC_MSK) ? 1 : 0;
  945. }
  946. static inline int is_channel_valid(const struct iwl_channel_info *ch_info)
  947. {
  948. if (ch_info == NULL)
  949. return 0;
  950. return (ch_info->flags & EEPROM_CHANNEL_VALID) ? 1 : 0;
  951. }
  952. static inline int is_channel_radar(const struct iwl_channel_info *ch_info)
  953. {
  954. return (ch_info->flags & EEPROM_CHANNEL_RADAR) ? 1 : 0;
  955. }
  956. static inline u8 is_channel_a_band(const struct iwl_channel_info *ch_info)
  957. {
  958. return ch_info->band == IEEE80211_BAND_5GHZ;
  959. }
  960. static inline u8 is_channel_bg_band(const struct iwl_channel_info *ch_info)
  961. {
  962. return ch_info->band == IEEE80211_BAND_2GHZ;
  963. }
  964. static inline int is_channel_passive(const struct iwl_channel_info *ch)
  965. {
  966. return (!(ch->flags & EEPROM_CHANNEL_ACTIVE)) ? 1 : 0;
  967. }
  968. static inline int is_channel_ibss(const struct iwl_channel_info *ch)
  969. {
  970. return ((ch->flags & EEPROM_CHANNEL_IBSS)) ? 1 : 0;
  971. }
  972. #ifdef CONFIG_IWLWIFI_DEBUG
  973. static inline void iwl_print_hex_dump(struct iwl_priv *priv, int level,
  974. void *p, u32 len)
  975. {
  976. if (!(priv->debug_level & level))
  977. return;
  978. print_hex_dump(KERN_DEBUG, "iwl data: ", DUMP_PREFIX_OFFSET, 16, 1,
  979. p, len, 1);
  980. }
  981. #else
  982. static inline void iwl_print_hex_dump(struct iwl_priv *priv, int level,
  983. void *p, u32 len)
  984. {
  985. }
  986. #endif
  987. extern const struct iwl_channel_info *iwl_get_channel_info(
  988. const struct iwl_priv *priv, enum ieee80211_band band, u16 channel);
  989. /* Requires full declaration of iwl_priv before including */
  990. #endif /* __iwl_dev_h__ */