iwl-dev.h 31 KB

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