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. 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 iwl4965_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 iwl4965_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 iwl4965_qos_info {
  404. int qos_enable;
  405. int qos_active;
  406. union iwl4965_qos_capabity qos_cap;
  407. struct iwl4965_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 iwl4965_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 iwl4965_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. struct delayed_work post_associate;
  899. /* TX Power */
  900. s8 tx_power_user_lmt;
  901. s8 tx_power_channel_lmt;
  902. #ifdef CONFIG_PM
  903. u32 pm_state[16];
  904. #endif
  905. #ifdef CONFIG_IWLWIFI_DEBUG
  906. /* debugging info */
  907. u32 debug_level;
  908. u32 framecnt_to_us;
  909. atomic_t restrict_refcnt;
  910. #ifdef CONFIG_IWLWIFI_DEBUGFS
  911. /* debugfs */
  912. struct iwl_debugfs *dbgfs;
  913. #endif /* CONFIG_IWLWIFI_DEBUGFS */
  914. #endif /* CONFIG_IWLWIFI_DEBUG */
  915. struct work_struct txpower_work;
  916. u32 disable_sens_cal;
  917. u32 disable_chain_noise_cal;
  918. u32 disable_tx_power_cal;
  919. struct work_struct run_time_calib_work;
  920. struct timer_list statistics_periodic;
  921. }; /*iwl_priv */
  922. static inline void iwl_txq_ctx_activate(struct iwl_priv *priv, int txq_id)
  923. {
  924. set_bit(txq_id, &priv->txq_ctx_active_msk);
  925. }
  926. static inline void iwl_txq_ctx_deactivate(struct iwl_priv *priv, int txq_id)
  927. {
  928. clear_bit(txq_id, &priv->txq_ctx_active_msk);
  929. }
  930. #ifdef CONFIG_IWLWIFI_DEBUG
  931. const char *iwl_get_tx_fail_reason(u32 status);
  932. #else
  933. static inline const char *iwl_get_tx_fail_reason(u32 status) { return ""; }
  934. #endif
  935. static inline struct ieee80211_hdr *iwl_tx_queue_get_hdr(struct iwl_priv *priv,
  936. int txq_id, int idx)
  937. {
  938. if (priv->txq[txq_id].txb[idx].skb[0])
  939. return (struct ieee80211_hdr *)priv->txq[txq_id].
  940. txb[idx].skb[0]->data;
  941. return NULL;
  942. }
  943. static inline int iwl_is_associated(struct iwl_priv *priv)
  944. {
  945. return (priv->active_rxon.filter_flags & RXON_FILTER_ASSOC_MSK) ? 1 : 0;
  946. }
  947. static inline int is_channel_valid(const struct iwl_channel_info *ch_info)
  948. {
  949. if (ch_info == NULL)
  950. return 0;
  951. return (ch_info->flags & EEPROM_CHANNEL_VALID) ? 1 : 0;
  952. }
  953. static inline int is_channel_radar(const struct iwl_channel_info *ch_info)
  954. {
  955. return (ch_info->flags & EEPROM_CHANNEL_RADAR) ? 1 : 0;
  956. }
  957. static inline u8 is_channel_a_band(const struct iwl_channel_info *ch_info)
  958. {
  959. return ch_info->band == IEEE80211_BAND_5GHZ;
  960. }
  961. static inline u8 is_channel_bg_band(const struct iwl_channel_info *ch_info)
  962. {
  963. return ch_info->band == IEEE80211_BAND_2GHZ;
  964. }
  965. static inline int is_channel_passive(const struct iwl_channel_info *ch)
  966. {
  967. return (!(ch->flags & EEPROM_CHANNEL_ACTIVE)) ? 1 : 0;
  968. }
  969. static inline int is_channel_ibss(const struct iwl_channel_info *ch)
  970. {
  971. return ((ch->flags & EEPROM_CHANNEL_IBSS)) ? 1 : 0;
  972. }
  973. #ifdef CONFIG_IWLWIFI_DEBUG
  974. static inline void iwl_print_hex_dump(struct iwl_priv *priv, int level,
  975. void *p, u32 len)
  976. {
  977. if (!(priv->debug_level & level))
  978. return;
  979. print_hex_dump(KERN_DEBUG, "iwl data: ", DUMP_PREFIX_OFFSET, 16, 1,
  980. p, len, 1);
  981. }
  982. #else
  983. static inline void iwl_print_hex_dump(struct iwl_priv *priv, int level,
  984. void *p, u32 len)
  985. {
  986. }
  987. #endif
  988. extern const struct iwl_channel_info *iwl_get_channel_info(
  989. const struct iwl_priv *priv, enum ieee80211_band band, u16 channel);
  990. /* Requires full declaration of iwl_priv before including */
  991. #endif /* __iwl_dev_h__ */