aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-4965.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2008-01-27 19:41:47 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:04:35 -0500
commitbb8c093bdea62f2ae371b98ebff81b0407852faf (patch)
tree7937a70c333356a85b344f883608eeaf93dd3d2b /drivers/net/wireless/iwlwifi/iwl-4965.h
parent403ab56b1c2786b0e1d58c27f5ce667b529c7faa (diff)
iwlwifi: cleanup namespace
Prefix all symbols with iwl3945_ or iwl4965_ and thus allow building the driver into the kernel. Also remove all the useless default statements in Kconfig while we're at it. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Zhu Yi <yi.zhu@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-4965.h')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965.h452
1 files changed, 225 insertions, 227 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.h b/drivers/net/wireless/iwlwifi/iwl-4965.h
index d61cf0e26e81..5944b4b9828b 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.h
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.h
@@ -30,10 +30,10 @@
30#include <linux/kernel.h> 30#include <linux/kernel.h>
31#include <net/ieee80211_radiotap.h> 31#include <net/ieee80211_radiotap.h>
32 32
33struct iwl_priv; 33struct iwl4965_priv;
34 34
35/* Hardware specific file defines the PCI IDs table for that hardware module */ 35/* Hardware specific file defines the PCI IDs table for that hardware module */
36extern struct pci_device_id iwl_hw_card_ids[]; 36extern struct pci_device_id iwl4965_hw_card_ids[];
37 37
38#define DRV_NAME "iwl4965" 38#define DRV_NAME "iwl4965"
39#include "iwl-4965-hw.h" 39#include "iwl-4965-hw.h"
@@ -54,10 +54,10 @@ extern struct pci_device_id iwl_hw_card_ids[];
54#define IWL_NOISE_MEAS_NOT_AVAILABLE (-127) 54#define IWL_NOISE_MEAS_NOT_AVAILABLE (-127)
55 55
56/* Module parameters accessible from iwl-*.c */ 56/* Module parameters accessible from iwl-*.c */
57extern int iwl_param_hwcrypto; 57extern int iwl4965_param_hwcrypto;
58extern int iwl_param_queues_num; 58extern int iwl4965_param_queues_num;
59 59
60enum iwl_antenna { 60enum iwl4965_antenna {
61 IWL_ANTENNA_DIVERSITY, 61 IWL_ANTENNA_DIVERSITY,
62 IWL_ANTENNA_MAIN, 62 IWL_ANTENNA_MAIN,
63 IWL_ANTENNA_AUX 63 IWL_ANTENNA_AUX
@@ -80,13 +80,13 @@ enum iwl_antenna {
80#define DEFAULT_SHORT_RETRY_LIMIT 7U 80#define DEFAULT_SHORT_RETRY_LIMIT 7U
81#define DEFAULT_LONG_RETRY_LIMIT 4U 81#define DEFAULT_LONG_RETRY_LIMIT 4U
82 82
83struct iwl_rx_mem_buffer { 83struct iwl4965_rx_mem_buffer {
84 dma_addr_t dma_addr; 84 dma_addr_t dma_addr;
85 struct sk_buff *skb; 85 struct sk_buff *skb;
86 struct list_head list; 86 struct list_head list;
87}; 87};
88 88
89struct iwl_rt_rx_hdr { 89struct iwl4965_rt_rx_hdr {
90 struct ieee80211_radiotap_header rt_hdr; 90 struct ieee80211_radiotap_header rt_hdr;
91 __le64 rt_tsf; /* TSF */ 91 __le64 rt_tsf; /* TSF */
92 u8 rt_flags; /* radiotap packet flags */ 92 u8 rt_flags; /* radiotap packet flags */
@@ -99,7 +99,7 @@ struct iwl_rt_rx_hdr {
99 u8 payload[0]; /* payload... */ 99 u8 payload[0]; /* payload... */
100} __attribute__ ((packed)); 100} __attribute__ ((packed));
101 101
102struct iwl_rt_tx_hdr { 102struct iwl4965_rt_tx_hdr {
103 struct ieee80211_radiotap_header rt_hdr; 103 struct ieee80211_radiotap_header rt_hdr;
104 u8 rt_rate; /* rate in 500kb/s */ 104 u8 rt_rate; /* rate in 500kb/s */
105 __le16 rt_channel; /* channel in mHz */ 105 __le16 rt_channel; /* channel in mHz */
@@ -114,7 +114,7 @@ struct iwl_rt_tx_hdr {
114 * 114 *
115 * Contains common data for Rx and Tx queues 115 * Contains common data for Rx and Tx queues
116 */ 116 */
117struct iwl_queue { 117struct iwl4965_queue {
118 int n_bd; /* number of BDs in this queue */ 118 int n_bd; /* number of BDs in this queue */
119 int write_ptr; /* 1-st empty entry (index) host_w*/ 119 int write_ptr; /* 1-st empty entry (index) host_w*/
120 int read_ptr; /* last used entry (index) host_r*/ 120 int read_ptr; /* last used entry (index) host_r*/
@@ -129,24 +129,24 @@ struct iwl_queue {
129 129
130#define MAX_NUM_OF_TBS (20) 130#define MAX_NUM_OF_TBS (20)
131 131
132struct iwl_tx_info { 132struct iwl4965_tx_info {
133 struct ieee80211_tx_status status; 133 struct ieee80211_tx_status status;
134 struct sk_buff *skb[MAX_NUM_OF_TBS]; 134 struct sk_buff *skb[MAX_NUM_OF_TBS];
135}; 135};
136 136
137/** 137/**
138 * struct iwl_tx_queue - Tx Queue for DMA 138 * struct iwl4965_tx_queue - Tx Queue for DMA
139 * @need_update: need to update read/write index 139 * @need_update: need to update read/write index
140 * @shed_retry: queue is HT AGG enabled 140 * @shed_retry: queue is HT AGG enabled
141 * 141 *
142 * Queue consists of circular buffer of BD's and required locking structures. 142 * Queue consists of circular buffer of BD's and required locking structures.
143 */ 143 */
144struct iwl_tx_queue { 144struct iwl4965_tx_queue {
145 struct iwl_queue q; 145 struct iwl4965_queue q;
146 struct iwl_tfd_frame *bd; 146 struct iwl4965_tfd_frame *bd;
147 struct iwl_cmd *cmd; 147 struct iwl4965_cmd *cmd;
148 dma_addr_t dma_addr_cmd; 148 dma_addr_t dma_addr_cmd;
149 struct iwl_tx_info *txb; 149 struct iwl4965_tx_info *txb;
150 int need_update; 150 int need_update;
151 int sched_retry; 151 int sched_retry;
152 int active; 152 int active;
@@ -154,12 +154,12 @@ struct iwl_tx_queue {
154 154
155#define IWL_NUM_SCAN_RATES (2) 155#define IWL_NUM_SCAN_RATES (2)
156 156
157struct iwl_channel_tgd_info { 157struct iwl4965_channel_tgd_info {
158 u8 type; 158 u8 type;
159 s8 max_power; 159 s8 max_power;
160}; 160};
161 161
162struct iwl_channel_tgh_info { 162struct iwl4965_channel_tgh_info {
163 s64 last_radar_time; 163 s64 last_radar_time;
164}; 164};
165 165
@@ -170,8 +170,8 @@ struct iwl_channel_tgh_info {
170 * -- spectrum management 170 * -- spectrum management
171 * -- user preference (e.g. iwconfig) 171 * -- user preference (e.g. iwconfig)
172 * when requested power is set, base power index must also be set. */ 172 * when requested power is set, base power index must also be set. */
173struct iwl_channel_power_info { 173struct iwl4965_channel_power_info {
174 struct iwl_tx_power tpc; /* actual radio and DSP gain settings */ 174 struct iwl4965_tx_power tpc; /* actual radio and DSP gain settings */
175 s8 power_table_index; /* actual (compenst'd) index into gain table */ 175 s8 power_table_index; /* actual (compenst'd) index into gain table */
176 s8 base_power_index; /* gain index for power at factory temp. */ 176 s8 base_power_index; /* gain index for power at factory temp. */
177 s8 requested_power; /* power (dBm) requested for this chnl/rate */ 177 s8 requested_power; /* power (dBm) requested for this chnl/rate */
@@ -179,8 +179,8 @@ struct iwl_channel_power_info {
179 179
180/* current scan Tx power values to use, one for each scan rate for each 180/* current scan Tx power values to use, one for each scan rate for each
181 * channel. */ 181 * channel. */
182struct iwl_scan_power_info { 182struct iwl4965_scan_power_info {
183 struct iwl_tx_power tpc; /* actual radio and DSP gain settings */ 183 struct iwl4965_tx_power tpc; /* actual radio and DSP gain settings */
184 s8 power_table_index; /* actual (compenst'd) index into gain table */ 184 s8 power_table_index; /* actual (compenst'd) index into gain table */
185 s8 requested_power; /* scan pwr (dBm) requested for chnl/rate */ 185 s8 requested_power; /* scan pwr (dBm) requested for chnl/rate */
186}; 186};
@@ -200,11 +200,11 @@ struct iwl_scan_power_info {
200 */ 200 */
201#define IWL4965_MAX_RATE (33) 201#define IWL4965_MAX_RATE (33)
202 202
203struct iwl_channel_info { 203struct iwl4965_channel_info {
204 struct iwl_channel_tgd_info tgd; 204 struct iwl4965_channel_tgd_info tgd;
205 struct iwl_channel_tgh_info tgh; 205 struct iwl4965_channel_tgh_info tgh;
206 struct iwl_eeprom_channel eeprom; /* EEPROM regulatory limit */ 206 struct iwl4965_eeprom_channel eeprom; /* EEPROM regulatory limit */
207 struct iwl_eeprom_channel fat_eeprom; /* EEPROM regulatory limit for 207 struct iwl4965_eeprom_channel fat_eeprom; /* EEPROM regulatory limit for
208 * FAT channel */ 208 * FAT channel */
209 209
210 u8 channel; /* channel number */ 210 u8 channel; /* channel number */
@@ -221,7 +221,7 @@ struct iwl_channel_info {
221 /* Radio/DSP gain settings for each "normal" data Tx rate. 221 /* Radio/DSP gain settings for each "normal" data Tx rate.
222 * These include, in addition to RF and DSP gain, a few fields for 222 * These include, in addition to RF and DSP gain, a few fields for
223 * remembering/modifying gain settings (indexes). */ 223 * remembering/modifying gain settings (indexes). */
224 struct iwl_channel_power_info power_info[IWL4965_MAX_RATE]; 224 struct iwl4965_channel_power_info power_info[IWL4965_MAX_RATE];
225 225
226 /* FAT channel info */ 226 /* FAT channel info */
227 s8 fat_max_power_avg; /* (dBm) regul. eeprom, normal Tx, any rate */ 227 s8 fat_max_power_avg; /* (dBm) regul. eeprom, normal Tx, any rate */
@@ -232,10 +232,10 @@ struct iwl_channel_info {
232 u8 fat_extension_channel; 232 u8 fat_extension_channel;
233 233
234 /* Radio/DSP gain settings for each scan rate, for directed scans. */ 234 /* Radio/DSP gain settings for each scan rate, for directed scans. */
235 struct iwl_scan_power_info scan_pwr_info[IWL_NUM_SCAN_RATES]; 235 struct iwl4965_scan_power_info scan_pwr_info[IWL_NUM_SCAN_RATES];
236}; 236};
237 237
238struct iwl_clip_group { 238struct iwl4965_clip_group {
239 /* maximum power level to prevent clipping for each rate, derived by 239 /* maximum power level to prevent clipping for each rate, derived by
240 * us from this band's saturation power in EEPROM */ 240 * us from this band's saturation power in EEPROM */
241 const s8 clip_powers[IWL_MAX_RATES]; 241 const s8 clip_powers[IWL_MAX_RATES];
@@ -256,8 +256,8 @@ struct iwl_clip_group {
256 256
257/* Power management (not Tx power) structures */ 257/* Power management (not Tx power) structures */
258 258
259struct iwl_power_vec_entry { 259struct iwl4965_power_vec_entry {
260 struct iwl_powertable_cmd cmd; 260 struct iwl4965_powertable_cmd cmd;
261 u8 no_dtim; 261 u8 no_dtim;
262}; 262};
263#define IWL_POWER_RANGE_0 (0) 263#define IWL_POWER_RANGE_0 (0)
@@ -273,10 +273,10 @@ struct iwl_power_vec_entry {
273#define IWL_POWER_ENABLED 0x10 273#define IWL_POWER_ENABLED 0x10
274#define IWL_POWER_LEVEL(x) ((x) & IWL_POWER_MASK) 274#define IWL_POWER_LEVEL(x) ((x) & IWL_POWER_MASK)
275 275
276struct iwl_power_mgr { 276struct iwl4965_power_mgr {
277 spinlock_t lock; 277 spinlock_t lock;
278 struct iwl_power_vec_entry pwr_range_0[IWL_POWER_AC]; 278 struct iwl4965_power_vec_entry pwr_range_0[IWL_POWER_AC];
279 struct iwl_power_vec_entry pwr_range_1[IWL_POWER_AC]; 279 struct iwl4965_power_vec_entry pwr_range_1[IWL_POWER_AC];
280 u8 active_index; 280 u8 active_index;
281 u32 dtim_val; 281 u32 dtim_val;
282}; 282};
@@ -286,10 +286,10 @@ struct iwl_power_mgr {
286#define IEEE80211_HLEN (IEEE80211_4ADDR_LEN) 286#define IEEE80211_HLEN (IEEE80211_4ADDR_LEN)
287#define IEEE80211_FRAME_LEN (IEEE80211_DATA_LEN + IEEE80211_HLEN) 287#define IEEE80211_FRAME_LEN (IEEE80211_DATA_LEN + IEEE80211_HLEN)
288 288
289struct iwl_frame { 289struct iwl4965_frame {
290 union { 290 union {
291 struct ieee80211_hdr frame; 291 struct ieee80211_hdr frame;
292 struct iwl_tx_beacon_cmd beacon; 292 struct iwl4965_tx_beacon_cmd beacon;
293 u8 raw[IEEE80211_FRAME_LEN]; 293 u8 raw[IEEE80211_FRAME_LEN];
294 u8 cmd[360]; 294 u8 cmd[360];
295 } u; 295 } u;
@@ -315,15 +315,15 @@ enum {
315 CMD_WANT_SKB = (1 << 2), 315 CMD_WANT_SKB = (1 << 2),
316}; 316};
317 317
318struct iwl_cmd; 318struct iwl4965_cmd;
319struct iwl_priv; 319struct iwl4965_priv;
320 320
321struct iwl_cmd_meta { 321struct iwl4965_cmd_meta {
322 struct iwl_cmd_meta *source; 322 struct iwl4965_cmd_meta *source;
323 union { 323 union {
324 struct sk_buff *skb; 324 struct sk_buff *skb;
325 int (*callback)(struct iwl_priv *priv, 325 int (*callback)(struct iwl4965_priv *priv,
326 struct iwl_cmd *cmd, struct sk_buff *skb); 326 struct iwl4965_cmd *cmd, struct sk_buff *skb);
327 } __attribute__ ((packed)) u; 327 } __attribute__ ((packed)) u;
328 328
329 /* The CMD_SIZE_HUGE flag bit indicates that the command 329 /* The CMD_SIZE_HUGE flag bit indicates that the command
@@ -332,37 +332,37 @@ struct iwl_cmd_meta {
332 332
333} __attribute__ ((packed)); 333} __attribute__ ((packed));
334 334
335struct iwl_cmd { 335struct iwl4965_cmd {
336 struct iwl_cmd_meta meta; 336 struct iwl4965_cmd_meta meta;
337 struct iwl_cmd_header hdr; 337 struct iwl4965_cmd_header hdr;
338 union { 338 union {
339 struct iwl_addsta_cmd addsta; 339 struct iwl4965_addsta_cmd addsta;
340 struct iwl_led_cmd led; 340 struct iwl4965_led_cmd led;
341 u32 flags; 341 u32 flags;
342 u8 val8; 342 u8 val8;
343 u16 val16; 343 u16 val16;
344 u32 val32; 344 u32 val32;
345 struct iwl_bt_cmd bt; 345 struct iwl4965_bt_cmd bt;
346 struct iwl_rxon_time_cmd rxon_time; 346 struct iwl4965_rxon_time_cmd rxon_time;
347 struct iwl_powertable_cmd powertable; 347 struct iwl4965_powertable_cmd powertable;
348 struct iwl_qosparam_cmd qosparam; 348 struct iwl4965_qosparam_cmd qosparam;
349 struct iwl_tx_cmd tx; 349 struct iwl4965_tx_cmd tx;
350 struct iwl_tx_beacon_cmd tx_beacon; 350 struct iwl4965_tx_beacon_cmd tx_beacon;
351 struct iwl_rxon_assoc_cmd rxon_assoc; 351 struct iwl4965_rxon_assoc_cmd rxon_assoc;
352 u8 *indirect; 352 u8 *indirect;
353 u8 payload[360]; 353 u8 payload[360];
354 } __attribute__ ((packed)) cmd; 354 } __attribute__ ((packed)) cmd;
355} __attribute__ ((packed)); 355} __attribute__ ((packed));
356 356
357struct iwl_host_cmd { 357struct iwl4965_host_cmd {
358 u8 id; 358 u8 id;
359 u16 len; 359 u16 len;
360 struct iwl_cmd_meta meta; 360 struct iwl4965_cmd_meta meta;
361 const void *data; 361 const void *data;
362}; 362};
363 363
364#define TFD_MAX_PAYLOAD_SIZE (sizeof(struct iwl_cmd) - \ 364#define TFD_MAX_PAYLOAD_SIZE (sizeof(struct iwl4965_cmd) - \
365 sizeof(struct iwl_cmd_meta)) 365 sizeof(struct iwl4965_cmd_meta))
366 366
367/* 367/*
368 * RX related structures and functions 368 * RX related structures and functions
@@ -375,7 +375,7 @@ struct iwl_host_cmd {
375#define SUP_RATE_11G_MAX_NUM_CHANNELS 12 375#define SUP_RATE_11G_MAX_NUM_CHANNELS 12
376 376
377/** 377/**
378 * struct iwl_rx_queue - Rx queue 378 * struct iwl4965_rx_queue - Rx queue
379 * @processed: Internal index to last handled Rx packet 379 * @processed: Internal index to last handled Rx packet
380 * @read: Shared index to newest available Rx buffer 380 * @read: Shared index to newest available Rx buffer
381 * @write: Shared index to oldest written Rx packet 381 * @write: Shared index to oldest written Rx packet
@@ -384,13 +384,13 @@ struct iwl_host_cmd {
384 * @rx_used: List of Rx buffers with no SKB 384 * @rx_used: List of Rx buffers with no SKB
385 * @need_update: flag to indicate we need to update read/write index 385 * @need_update: flag to indicate we need to update read/write index
386 * 386 *
387 * NOTE: rx_free and rx_used are used as a FIFO for iwl_rx_mem_buffers 387 * NOTE: rx_free and rx_used are used as a FIFO for iwl4965_rx_mem_buffers
388 */ 388 */
389struct iwl_rx_queue { 389struct iwl4965_rx_queue {
390 __le32 *bd; 390 __le32 *bd;
391 dma_addr_t dma_addr; 391 dma_addr_t dma_addr;
392 struct iwl_rx_mem_buffer pool[RX_QUEUE_SIZE + RX_FREE_BUFFERS]; 392 struct iwl4965_rx_mem_buffer pool[RX_QUEUE_SIZE + RX_FREE_BUFFERS];
393 struct iwl_rx_mem_buffer *queue[RX_QUEUE_SIZE]; 393 struct iwl4965_rx_mem_buffer *queue[RX_QUEUE_SIZE];
394 u32 processed; 394 u32 processed;
395 u32 read; 395 u32 read;
396 u32 write; 396 u32 write;
@@ -436,7 +436,7 @@ struct iwl_rx_queue {
436 436
437#ifdef CONFIG_IWL4965_HT 437#ifdef CONFIG_IWL4965_HT
438#ifdef CONFIG_IWL4965_HT_AGG 438#ifdef CONFIG_IWL4965_HT_AGG
439struct iwl_ht_agg { 439struct iwl4965_ht_agg {
440 u16 txq_id; 440 u16 txq_id;
441 u16 frame_count; 441 u16 frame_count;
442 u16 wait_for_ba; 442 u16 wait_for_ba;
@@ -448,22 +448,22 @@ struct iwl_ht_agg {
448#endif /* CONFIG_IWL4965_HT_AGG */ 448#endif /* CONFIG_IWL4965_HT_AGG */
449#endif /* CONFIG_IWL4965_HT */ 449#endif /* CONFIG_IWL4965_HT */
450 450
451struct iwl_tid_data { 451struct iwl4965_tid_data {
452 u16 seq_number; 452 u16 seq_number;
453#ifdef CONFIG_IWL4965_HT 453#ifdef CONFIG_IWL4965_HT
454#ifdef CONFIG_IWL4965_HT_AGG 454#ifdef CONFIG_IWL4965_HT_AGG
455 struct iwl_ht_agg agg; 455 struct iwl4965_ht_agg agg;
456#endif /* CONFIG_IWL4965_HT_AGG */ 456#endif /* CONFIG_IWL4965_HT_AGG */
457#endif /* CONFIG_IWL4965_HT */ 457#endif /* CONFIG_IWL4965_HT */
458}; 458};
459 459
460struct iwl_hw_key { 460struct iwl4965_hw_key {
461 enum ieee80211_key_alg alg; 461 enum ieee80211_key_alg alg;
462 int keylen; 462 int keylen;
463 u8 key[32]; 463 u8 key[32];
464}; 464};
465 465
466union iwl_ht_rate_supp { 466union iwl4965_ht_rate_supp {
467 u16 rates; 467 u16 rates;
468 struct { 468 struct {
469 u8 siso_rate; 469 u8 siso_rate;
@@ -498,7 +498,7 @@ struct sta_ht_info {
498 498
499#ifdef CONFIG_IWL4965_QOS 499#ifdef CONFIG_IWL4965_QOS
500 500
501union iwl_qos_capabity { 501union iwl4965_qos_capabity {
502 struct { 502 struct {
503 u8 edca_count:4; /* bit 0-3 */ 503 u8 edca_count:4; /* bit 0-3 */
504 u8 q_ack:1; /* bit 4 */ 504 u8 q_ack:1; /* bit 4 */
@@ -519,23 +519,23 @@ union iwl_qos_capabity {
519}; 519};
520 520
521/* QoS structures */ 521/* QoS structures */
522struct iwl_qos_info { 522struct iwl4965_qos_info {
523 int qos_enable; 523 int qos_enable;
524 int qos_active; 524 int qos_active;
525 union iwl_qos_capabity qos_cap; 525 union iwl4965_qos_capabity qos_cap;
526 struct iwl_qosparam_cmd def_qos_parm; 526 struct iwl4965_qosparam_cmd def_qos_parm;
527}; 527};
528#endif /*CONFIG_IWL4965_QOS */ 528#endif /*CONFIG_IWL4965_QOS */
529 529
530#define STA_PS_STATUS_WAKE 0 530#define STA_PS_STATUS_WAKE 0
531#define STA_PS_STATUS_SLEEP 1 531#define STA_PS_STATUS_SLEEP 1
532 532
533struct iwl_station_entry { 533struct iwl4965_station_entry {
534 struct iwl_addsta_cmd sta; 534 struct iwl4965_addsta_cmd sta;
535 struct iwl_tid_data tid[MAX_TID_COUNT]; 535 struct iwl4965_tid_data tid[MAX_TID_COUNT];
536 u8 used; 536 u8 used;
537 u8 ps_status; 537 u8 ps_status;
538 struct iwl_hw_key keyinfo; 538 struct iwl4965_hw_key keyinfo;
539}; 539};
540 540
541/* one for each uCode image (inst/data, boot/init/runtime) */ 541/* one for each uCode image (inst/data, boot/init/runtime) */
@@ -546,7 +546,7 @@ struct fw_desc {
546}; 546};
547 547
548/* uCode file layout */ 548/* uCode file layout */
549struct iwl_ucode { 549struct iwl4965_ucode {
550 __le32 ver; /* major/minor/subminor */ 550 __le32 ver; /* major/minor/subminor */
551 __le32 inst_size; /* bytes of runtime instructions */ 551 __le32 inst_size; /* bytes of runtime instructions */
552 __le32 data_size; /* bytes of runtime data */ 552 __le32 data_size; /* bytes of runtime data */
@@ -558,7 +558,7 @@ struct iwl_ucode {
558 558
559#define IWL_IBSS_MAC_HASH_SIZE 32 559#define IWL_IBSS_MAC_HASH_SIZE 32
560 560
561struct iwl_ibss_seq { 561struct iwl4965_ibss_seq {
562 u8 mac[ETH_ALEN]; 562 u8 mac[ETH_ALEN];
563 u16 seq_num; 563 u16 seq_num;
564 u16 frag_num; 564 u16 frag_num;
@@ -566,7 +566,7 @@ struct iwl_ibss_seq {
566 struct list_head list; 566 struct list_head list;
567}; 567};
568 568
569struct iwl_driver_hw_info { 569struct iwl4965_driver_hw_info {
570 u16 max_txq_num; 570 u16 max_txq_num;
571 u16 ac_queue_count; 571 u16 ac_queue_count;
572 u16 tx_cmd_len; 572 u16 tx_cmd_len;
@@ -592,10 +592,10 @@ struct iwl_driver_hw_info {
592#define HT_SHORT_GI_40MHZ_ONLY (1 << 1) 592#define HT_SHORT_GI_40MHZ_ONLY (1 << 1)
593 593
594 594
595#define IWL_RX_HDR(x) ((struct iwl_rx_frame_hdr *)(\ 595#define IWL_RX_HDR(x) ((struct iwl4965_rx_frame_hdr *)(\
596 x->u.rx_frame.stats.payload + \ 596 x->u.rx_frame.stats.payload + \
597 x->u.rx_frame.stats.phy_count)) 597 x->u.rx_frame.stats.phy_count))
598#define IWL_RX_END(x) ((struct iwl_rx_frame_end *)(\ 598#define IWL_RX_END(x) ((struct iwl4965_rx_frame_end *)(\
599 IWL_RX_HDR(x)->payload + \ 599 IWL_RX_HDR(x)->payload + \
600 le16_to_cpu(IWL_RX_HDR(x)->len))) 600 le16_to_cpu(IWL_RX_HDR(x)->len)))
601#define IWL_RX_STATS(x) (&x->u.rx_frame.stats) 601#define IWL_RX_STATS(x) (&x->u.rx_frame.stats)
@@ -608,63 +608,63 @@ struct iwl_driver_hw_info {
608 * for use by iwl-*.c 608 * for use by iwl-*.c
609 * 609 *
610 *****************************************************************************/ 610 *****************************************************************************/
611struct iwl_addsta_cmd; 611struct iwl4965_addsta_cmd;
612extern int iwl_send_add_station(struct iwl_priv *priv, 612extern int iwl4965_send_add_station(struct iwl4965_priv *priv,
613 struct iwl_addsta_cmd *sta, u8 flags); 613 struct iwl4965_addsta_cmd *sta, u8 flags);
614extern u8 iwl_add_station(struct iwl_priv *priv, const u8 *bssid, 614extern u8 iwl4965_add_station_flags(struct iwl4965_priv *priv, const u8 *bssid,
615 int is_ap, u8 flags); 615 int is_ap, u8 flags);
616extern int iwl_is_network_packet(struct iwl_priv *priv, 616extern int iwl4965_is_network_packet(struct iwl4965_priv *priv,
617 struct ieee80211_hdr *header); 617 struct ieee80211_hdr *header);
618extern int iwl_power_init_handle(struct iwl_priv *priv); 618extern int iwl4965_power_init_handle(struct iwl4965_priv *priv);
619extern int iwl_eeprom_init(struct iwl_priv *priv); 619extern int iwl4965_eeprom_init(struct iwl4965_priv *priv);
620#ifdef CONFIG_IWL4965_DEBUG 620#ifdef CONFIG_IWL4965_DEBUG
621extern void iwl_report_frame(struct iwl_priv *priv, 621extern void iwl4965_report_frame(struct iwl4965_priv *priv,
622 struct iwl_rx_packet *pkt, 622 struct iwl4965_rx_packet *pkt,
623 struct ieee80211_hdr *header, int group100); 623 struct ieee80211_hdr *header, int group100);
624#else 624#else
625static inline void iwl_report_frame(struct iwl_priv *priv, 625static inline void iwl4965_report_frame(struct iwl4965_priv *priv,
626 struct iwl_rx_packet *pkt, 626 struct iwl4965_rx_packet *pkt,
627 struct ieee80211_hdr *header, 627 struct ieee80211_hdr *header,
628 int group100) {} 628 int group100) {}
629#endif 629#endif
630extern void iwl_handle_data_packet_monitor(struct iwl_priv *priv, 630extern void iwl4965_handle_data_packet_monitor(struct iwl4965_priv *priv,
631 struct iwl_rx_mem_buffer *rxb, 631 struct iwl4965_rx_mem_buffer *rxb,
632 void *data, short len, 632 void *data, short len,
633 struct ieee80211_rx_status *stats, 633 struct ieee80211_rx_status *stats,
634 u16 phy_flags); 634 u16 phy_flags);
635extern int is_duplicate_packet(struct iwl_priv *priv, struct ieee80211_hdr 635extern int iwl4965_is_duplicate_packet(struct iwl4965_priv *priv,
636 *header); 636 struct ieee80211_hdr *header);
637extern int iwl_rx_queue_alloc(struct iwl_priv *priv); 637extern int iwl4965_rx_queue_alloc(struct iwl4965_priv *priv);
638extern void iwl_rx_queue_reset(struct iwl_priv *priv, 638extern void iwl4965_rx_queue_reset(struct iwl4965_priv *priv,
639 struct iwl_rx_queue *rxq); 639 struct iwl4965_rx_queue *rxq);
640extern int iwl_calc_db_from_ratio(int sig_ratio); 640extern int iwl4965_calc_db_from_ratio(int sig_ratio);
641extern int iwl_calc_sig_qual(int rssi_dbm, int noise_dbm); 641extern int iwl4965_calc_sig_qual(int rssi_dbm, int noise_dbm);
642extern int iwl_tx_queue_init(struct iwl_priv *priv, 642extern int iwl4965_tx_queue_init(struct iwl4965_priv *priv,
643 struct iwl_tx_queue *txq, int count, u32 id); 643 struct iwl4965_tx_queue *txq, int count, u32 id);
644extern void iwl_rx_replenish(void *data); 644extern void iwl4965_rx_replenish(void *data);
645extern void iwl_tx_queue_free(struct iwl_priv *priv, struct iwl_tx_queue *txq); 645extern void iwl4965_tx_queue_free(struct iwl4965_priv *priv, struct iwl4965_tx_queue *txq);
646extern int iwl_send_cmd_pdu(struct iwl_priv *priv, u8 id, u16 len, 646extern int iwl4965_send_cmd_pdu(struct iwl4965_priv *priv, u8 id, u16 len,
647 const void *data); 647 const void *data);
648extern int __must_check iwl_send_cmd(struct iwl_priv *priv, 648extern int __must_check iwl4965_send_cmd(struct iwl4965_priv *priv,
649 struct iwl_host_cmd *cmd); 649 struct iwl4965_host_cmd *cmd);
650extern unsigned int iwl_fill_beacon_frame(struct iwl_priv *priv, 650extern unsigned int iwl4965_fill_beacon_frame(struct iwl4965_priv *priv,
651 struct ieee80211_hdr *hdr, 651 struct ieee80211_hdr *hdr,
652 const u8 *dest, int left); 652 const u8 *dest, int left);
653extern int iwl_rx_queue_update_write_ptr(struct iwl_priv *priv, 653extern int iwl4965_rx_queue_update_write_ptr(struct iwl4965_priv *priv,
654 struct iwl_rx_queue *q); 654 struct iwl4965_rx_queue *q);
655extern int iwl_send_statistics_request(struct iwl_priv *priv); 655extern int iwl4965_send_statistics_request(struct iwl4965_priv *priv);
656extern void iwl_set_decrypted_flag(struct iwl_priv *priv, struct sk_buff *skb, 656extern void iwl4965_set_decrypted_flag(struct iwl4965_priv *priv, struct sk_buff *skb,
657 u32 decrypt_res, 657 u32 decrypt_res,
658 struct ieee80211_rx_status *stats); 658 struct ieee80211_rx_status *stats);
659extern __le16 *ieee80211_get_qos_ctrl(struct ieee80211_hdr *hdr); 659extern __le16 *ieee80211_get_qos_ctrl(struct ieee80211_hdr *hdr);
660 660
661extern const u8 BROADCAST_ADDR[ETH_ALEN]; 661extern const u8 iwl4965_broadcast_addr[ETH_ALEN];
662 662
663/* 663/*
664 * Currently used by iwl-3945-rs... look at restructuring so that it doesn't 664 * Currently used by iwl-3945-rs... look at restructuring so that it doesn't
665 * call this... todo... fix that. 665 * call this... todo... fix that.
666*/ 666*/
667extern u8 iwl_sync_station(struct iwl_priv *priv, int sta_id, 667extern u8 iwl4965_sync_station(struct iwl4965_priv *priv, int sta_id,
668 u16 tx_rate, u8 flags); 668 u16 tx_rate, u8 flags);
669 669
670/****************************************************************************** 670/******************************************************************************
@@ -676,112 +676,110 @@ extern u8 iwl_sync_station(struct iwl_priv *priv, int sta_id,
676 * which is why they are in the hardware specific files (vs. iwl-base.c) 676 * which is why they are in the hardware specific files (vs. iwl-base.c)
677 * 677 *
678 * Naming convention -- 678 * Naming convention --
679 * iwl_ <-- Its part of iwlwifi (should be changed to iwl_) 679 * iwl4965_ <-- Its part of iwlwifi (should be changed to iwl4965_)
680 * iwl_hw_ <-- Hardware specific (implemented in iwl-XXXX.c by all HW) 680 * iwl4965_hw_ <-- Hardware specific (implemented in iwl-XXXX.c by all HW)
681 * iwlXXXX_ <-- Hardware specific (implemented in iwl-XXXX.c for XXXX) 681 * iwlXXXX_ <-- Hardware specific (implemented in iwl-XXXX.c for XXXX)
682 * iwl_bg_ <-- Called from work queue context 682 * iwl4965_bg_ <-- Called from work queue context
683 * iwl_mac_ <-- mac80211 callback 683 * iwl4965_mac_ <-- mac80211 callback
684 * 684 *
685 ****************************************************************************/ 685 ****************************************************************************/
686extern void iwl_hw_rx_handler_setup(struct iwl_priv *priv); 686extern void iwl4965_hw_rx_handler_setup(struct iwl4965_priv *priv);
687extern void iwl_hw_setup_deferred_work(struct iwl_priv *priv); 687extern void iwl4965_hw_setup_deferred_work(struct iwl4965_priv *priv);
688extern void iwl_hw_cancel_deferred_work(struct iwl_priv *priv); 688extern void iwl4965_hw_cancel_deferred_work(struct iwl4965_priv *priv);
689extern int iwl_hw_rxq_stop(struct iwl_priv *priv); 689extern int iwl4965_hw_rxq_stop(struct iwl4965_priv *priv);
690extern int iwl_hw_set_hw_setting(struct iwl_priv *priv); 690extern int iwl4965_hw_set_hw_setting(struct iwl4965_priv *priv);
691extern int iwl_hw_nic_init(struct iwl_priv *priv); 691extern int iwl4965_hw_nic_init(struct iwl4965_priv *priv);
692extern int iwl_hw_nic_stop_master(struct iwl_priv *priv); 692extern int iwl4965_hw_nic_stop_master(struct iwl4965_priv *priv);
693extern void iwl_hw_txq_ctx_free(struct iwl_priv *priv); 693extern void iwl4965_hw_txq_ctx_free(struct iwl4965_priv *priv);
694extern void iwl_hw_txq_ctx_stop(struct iwl_priv *priv); 694extern void iwl4965_hw_txq_ctx_stop(struct iwl4965_priv *priv);
695extern int iwl_hw_nic_reset(struct iwl_priv *priv); 695extern int iwl4965_hw_nic_reset(struct iwl4965_priv *priv);
696extern int iwl_hw_txq_attach_buf_to_tfd(struct iwl_priv *priv, void *tfd, 696extern int iwl4965_hw_txq_attach_buf_to_tfd(struct iwl4965_priv *priv, void *tfd,
697 dma_addr_t addr, u16 len); 697 dma_addr_t addr, u16 len);
698extern int iwl_hw_txq_free_tfd(struct iwl_priv *priv, struct iwl_tx_queue *txq); 698extern int iwl4965_hw_txq_free_tfd(struct iwl4965_priv *priv, struct iwl4965_tx_queue *txq);
699extern int iwl_hw_get_temperature(struct iwl_priv *priv); 699extern int iwl4965_hw_get_temperature(struct iwl4965_priv *priv);
700extern int iwl_hw_tx_queue_init(struct iwl_priv *priv, 700extern int iwl4965_hw_tx_queue_init(struct iwl4965_priv *priv,
701 struct iwl_tx_queue *txq); 701 struct iwl4965_tx_queue *txq);
702extern unsigned int iwl_hw_get_beacon_cmd(struct iwl_priv *priv, 702extern unsigned int iwl4965_hw_get_beacon_cmd(struct iwl4965_priv *priv,
703 struct iwl_frame *frame, u8 rate); 703 struct iwl4965_frame *frame, u8 rate);
704extern int iwl_hw_get_rx_read(struct iwl_priv *priv); 704extern int iwl4965_hw_get_rx_read(struct iwl4965_priv *priv);
705extern void iwl_hw_build_tx_cmd_rate(struct iwl_priv *priv, 705extern void iwl4965_hw_build_tx_cmd_rate(struct iwl4965_priv *priv,
706 struct iwl_cmd *cmd, 706 struct iwl4965_cmd *cmd,
707 struct ieee80211_tx_control *ctrl, 707 struct ieee80211_tx_control *ctrl,
708 struct ieee80211_hdr *hdr, 708 struct ieee80211_hdr *hdr,
709 int sta_id, int tx_id); 709 int sta_id, int tx_id);
710extern int iwl_hw_reg_send_txpower(struct iwl_priv *priv); 710extern int iwl4965_hw_reg_send_txpower(struct iwl4965_priv *priv);
711extern int iwl_hw_reg_set_txpower(struct iwl_priv *priv, s8 power); 711extern int iwl4965_hw_reg_set_txpower(struct iwl4965_priv *priv, s8 power);
712extern void iwl_hw_rx_statistics(struct iwl_priv *priv, 712extern void iwl4965_hw_rx_statistics(struct iwl4965_priv *priv,
713 struct iwl_rx_mem_buffer *rxb); 713 struct iwl4965_rx_mem_buffer *rxb);
714extern void iwl_disable_events(struct iwl_priv *priv); 714extern void iwl4965_disable_events(struct iwl4965_priv *priv);
715extern int iwl4965_get_temperature(const struct iwl_priv *priv); 715extern int iwl4965_get_temperature(const struct iwl4965_priv *priv);
716 716
717/** 717/**
718 * iwl_hw_find_station - Find station id for a given BSSID 718 * iwl4965_hw_find_station - Find station id for a given BSSID
719 * @bssid: MAC address of station ID to find 719 * @bssid: MAC address of station ID to find
720 * 720 *
721 * NOTE: This should not be hardware specific but the code has 721 * NOTE: This should not be hardware specific but the code has
722 * not yet been merged into a single common layer for managing the 722 * not yet been merged into a single common layer for managing the
723 * station tables. 723 * station tables.
724 */ 724 */
725extern u8 iwl_hw_find_station(struct iwl_priv *priv, const u8 *bssid); 725extern u8 iwl4965_hw_find_station(struct iwl4965_priv *priv, const u8 *bssid);
726 726
727extern int iwl_hw_channel_switch(struct iwl_priv *priv, u16 channel); 727extern int iwl4965_hw_channel_switch(struct iwl4965_priv *priv, u16 channel);
728extern int iwl_tx_queue_reclaim(struct iwl_priv *priv, int txq_id, int index); 728extern int iwl4965_tx_queue_reclaim(struct iwl4965_priv *priv, int txq_id, int index);
729 729
730struct iwl_priv; 730struct iwl4965_priv;
731struct sta_ht_info; 731struct sta_ht_info;
732 732
733/* 733/*
734 * Forward declare iwl-4965.c functions for iwl-base.c 734 * Forward declare iwl-4965.c functions for iwl-base.c
735 */ 735 */
736extern int iwl_eeprom_acquire_semaphore(struct iwl_priv *priv); 736extern int iwl4965_eeprom_acquire_semaphore(struct iwl4965_priv *priv);
737extern void iwl_eeprom_release_semaphore(struct iwl_priv *priv); 737extern void iwl4965_eeprom_release_semaphore(struct iwl4965_priv *priv);
738 738
739extern int iwl4965_tx_queue_update_wr_ptr(struct iwl_priv *priv, 739extern int iwl4965_tx_queue_update_wr_ptr(struct iwl4965_priv *priv,
740 struct iwl_tx_queue *txq, 740 struct iwl4965_tx_queue *txq,
741 u16 byte_cnt); 741 u16 byte_cnt);
742extern void iwl4965_add_station(struct iwl_priv *priv, const u8 *addr, 742extern void iwl4965_add_station(struct iwl4965_priv *priv, const u8 *addr,
743 int is_ap); 743 int is_ap);
744extern void iwl4965_set_rxon_ht(struct iwl_priv *priv, 744extern void iwl4965_set_rxon_ht(struct iwl4965_priv *priv,
745 struct sta_ht_info *ht_info); 745 struct sta_ht_info *ht_info);
746 746
747extern void iwl4965_set_rxon_chain(struct iwl_priv *priv); 747extern void iwl4965_set_rxon_chain(struct iwl4965_priv *priv);
748extern int iwl4965_tx_cmd(struct iwl_priv *priv, struct iwl_cmd *out_cmd, 748extern int iwl4965_tx_cmd(struct iwl4965_priv *priv, struct iwl4965_cmd *out_cmd,
749 u8 sta_id, dma_addr_t txcmd_phys, 749 u8 sta_id, dma_addr_t txcmd_phys,
750 struct ieee80211_hdr *hdr, u8 hdr_len, 750 struct ieee80211_hdr *hdr, u8 hdr_len,
751 struct ieee80211_tx_control *ctrl, void *sta_in); 751 struct ieee80211_tx_control *ctrl, void *sta_in);
752extern int iwl4965_init_hw_rates(struct iwl_priv *priv, 752extern int iwl4965_alive_notify(struct iwl4965_priv *priv);
753 struct ieee80211_rate *rates); 753extern void iwl4965_update_rate_scaling(struct iwl4965_priv *priv, u8 mode);
754extern int iwl4965_alive_notify(struct iwl_priv *priv); 754extern void iwl4965_set_ht_add_station(struct iwl4965_priv *priv, u8 index);
755extern void iwl4965_update_rate_scaling(struct iwl_priv *priv, u8 mode); 755
756extern void iwl4965_set_ht_add_station(struct iwl_priv *priv, u8 index); 756extern void iwl4965_chain_noise_reset(struct iwl4965_priv *priv);
757 757extern void iwl4965_init_sensitivity(struct iwl4965_priv *priv, u8 flags,
758extern void iwl4965_chain_noise_reset(struct iwl_priv *priv);
759extern void iwl4965_init_sensitivity(struct iwl_priv *priv, u8 flags,
760 u8 force); 758 u8 force);
761extern int iwl4965_set_fat_chan_info(struct iwl_priv *priv, int phymode, 759extern int iwl4965_set_fat_chan_info(struct iwl4965_priv *priv, int phymode,
762 u16 channel, 760 u16 channel,
763 const struct iwl_eeprom_channel *eeprom_ch, 761 const struct iwl4965_eeprom_channel *eeprom_ch,
764 u8 fat_extension_channel); 762 u8 fat_extension_channel);
765extern void iwl4965_rf_kill_ct_config(struct iwl_priv *priv); 763extern void iwl4965_rf_kill_ct_config(struct iwl4965_priv *priv);
766 764
767#ifdef CONFIG_IWL4965_HT 765#ifdef CONFIG_IWL4965_HT
768#ifdef CONFIG_IWL4965_HT_AGG 766#ifdef CONFIG_IWL4965_HT_AGG
769extern int iwl_mac_ht_tx_agg_start(struct ieee80211_hw *hw, u8 *da, 767extern int iwl4965_mac_ht_tx_agg_start(struct ieee80211_hw *hw, u8 *da,
770 u16 tid, u16 *start_seq_num); 768 u16 tid, u16 *start_seq_num);
771extern int iwl_mac_ht_rx_agg_start(struct ieee80211_hw *hw, u8 *da, 769extern int iwl4965_mac_ht_rx_agg_start(struct ieee80211_hw *hw, u8 *da,
772 u16 tid, u16 start_seq_num); 770 u16 tid, u16 start_seq_num);
773extern int iwl_mac_ht_rx_agg_stop(struct ieee80211_hw *hw, u8 *da, 771extern int iwl4965_mac_ht_rx_agg_stop(struct ieee80211_hw *hw, u8 *da,
774 u16 tid, int generator); 772 u16 tid, int generator);
775extern int iwl_mac_ht_tx_agg_stop(struct ieee80211_hw *hw, u8 *da, 773extern int iwl4965_mac_ht_tx_agg_stop(struct ieee80211_hw *hw, u8 *da,
776 u16 tid, int generator); 774 u16 tid, int generator);
777extern void iwl4965_turn_off_agg(struct iwl_priv *priv, u8 tid); 775extern void iwl4965_turn_off_agg(struct iwl4965_priv *priv, u8 tid);
778#endif /* CONFIG_IWL4965_HT_AGG */ 776#endif /* CONFIG_IWL4965_HT_AGG */
779#endif /*CONFIG_IWL4965_HT */ 777#endif /*CONFIG_IWL4965_HT */
780/* Structures, enum, and defines specific to the 4965 */ 778/* Structures, enum, and defines specific to the 4965 */
781 779
782#define IWL4965_KW_SIZE 0x1000 /*4k */ 780#define IWL4965_KW_SIZE 0x1000 /*4k */
783 781
784struct iwl_kw { 782struct iwl4965_kw {
785 dma_addr_t dma_addr; 783 dma_addr_t dma_addr;
786 void *v_addr; 784 void *v_addr;
787 size_t size; 785 size_t size;
@@ -835,7 +833,7 @@ struct iwl_kw {
835#define IWL_TX_POWER_CCK_COMPENSATION_B_STEP (9) 833#define IWL_TX_POWER_CCK_COMPENSATION_B_STEP (9)
836#define IWL_TX_POWER_CCK_COMPENSATION_C_STEP (5) 834#define IWL_TX_POWER_CCK_COMPENSATION_C_STEP (5)
837 835
838struct iwl_traffic_load { 836struct iwl4965_traffic_load {
839 unsigned long time_stamp; 837 unsigned long time_stamp;
840 u32 packet_count[TID_QUEUE_MAX_SIZE]; 838 u32 packet_count[TID_QUEUE_MAX_SIZE];
841 u8 queue_count; 839 u8 queue_count;
@@ -844,7 +842,7 @@ struct iwl_traffic_load {
844}; 842};
845 843
846#ifdef CONFIG_IWL4965_HT_AGG 844#ifdef CONFIG_IWL4965_HT_AGG
847struct iwl_agg_control { 845struct iwl4965_agg_control {
848 unsigned long next_retry; 846 unsigned long next_retry;
849 u32 wait_for_agg_status; 847 u32 wait_for_agg_status;
850 u32 tid_retry; 848 u32 tid_retry;
@@ -853,13 +851,13 @@ struct iwl_agg_control {
853 u8 auto_agg; 851 u8 auto_agg;
854 u32 tid_traffic_load_threshold; 852 u32 tid_traffic_load_threshold;
855 u32 ba_timeout; 853 u32 ba_timeout;
856 struct iwl_traffic_load traffic_load[TID_MAX_LOAD_COUNT]; 854 struct iwl4965_traffic_load traffic_load[TID_MAX_LOAD_COUNT];
857}; 855};
858#endif /*CONFIG_IWL4965_HT_AGG */ 856#endif /*CONFIG_IWL4965_HT_AGG */
859 857
860struct iwl_lq_mngr { 858struct iwl4965_lq_mngr {
861#ifdef CONFIG_IWL4965_HT_AGG 859#ifdef CONFIG_IWL4965_HT_AGG
862 struct iwl_agg_control agg_ctrl; 860 struct iwl4965_agg_control agg_ctrl;
863#endif 861#endif
864 spinlock_t lock; 862 spinlock_t lock;
865 s32 max_window_size; 863 s32 max_window_size;
@@ -940,24 +938,24 @@ struct iwl_lq_mngr {
940#define IN_BAND_FILTER 0xFF 938#define IN_BAND_FILTER 0xFF
941#define MIN_AVERAGE_NOISE_MAX_VALUE 0xFFFFFFFF 939#define MIN_AVERAGE_NOISE_MAX_VALUE 0xFFFFFFFF
942 940
943enum iwl_false_alarm_state { 941enum iwl4965_false_alarm_state {
944 IWL_FA_TOO_MANY = 0, 942 IWL_FA_TOO_MANY = 0,
945 IWL_FA_TOO_FEW = 1, 943 IWL_FA_TOO_FEW = 1,
946 IWL_FA_GOOD_RANGE = 2, 944 IWL_FA_GOOD_RANGE = 2,
947}; 945};
948 946
949enum iwl_chain_noise_state { 947enum iwl4965_chain_noise_state {
950 IWL_CHAIN_NOISE_ALIVE = 0, /* must be 0 */ 948 IWL_CHAIN_NOISE_ALIVE = 0, /* must be 0 */
951 IWL_CHAIN_NOISE_ACCUMULATE = 1, 949 IWL_CHAIN_NOISE_ACCUMULATE = 1,
952 IWL_CHAIN_NOISE_CALIBRATED = 2, 950 IWL_CHAIN_NOISE_CALIBRATED = 2,
953}; 951};
954 952
955enum iwl_sensitivity_state { 953enum iwl4965_sensitivity_state {
956 IWL_SENS_CALIB_ALLOWED = 0, 954 IWL_SENS_CALIB_ALLOWED = 0,
957 IWL_SENS_CALIB_NEED_REINIT = 1, 955 IWL_SENS_CALIB_NEED_REINIT = 1,
958}; 956};
959 957
960enum iwl_calib_enabled_state { 958enum iwl4965_calib_enabled_state {
961 IWL_CALIB_DISABLED = 0, /* must be 0 */ 959 IWL_CALIB_DISABLED = 0, /* must be 0 */
962 IWL_CALIB_ENABLED = 1, 960 IWL_CALIB_ENABLED = 1,
963}; 961};
@@ -972,7 +970,7 @@ struct statistics_general_data {
972}; 970};
973 971
974/* Sensitivity calib data */ 972/* Sensitivity calib data */
975struct iwl_sensitivity_data { 973struct iwl4965_sensitivity_data {
976 u32 auto_corr_ofdm; 974 u32 auto_corr_ofdm;
977 u32 auto_corr_ofdm_mrc; 975 u32 auto_corr_ofdm_mrc;
978 u32 auto_corr_ofdm_x1; 976 u32 auto_corr_ofdm_x1;
@@ -1001,7 +999,7 @@ struct iwl_sensitivity_data {
1001}; 999};
1002 1000
1003/* Chain noise (differential Rx gain) calib data */ 1001/* Chain noise (differential Rx gain) calib data */
1004struct iwl_chain_noise_data { 1002struct iwl4965_chain_noise_data {
1005 u8 state; 1003 u8 state;
1006 u16 beacon_count; 1004 u16 beacon_count;
1007 u32 chain_noise_a; 1005 u32 chain_noise_a;
@@ -1049,7 +1047,7 @@ enum {
1049 1047
1050#endif 1048#endif
1051 1049
1052struct iwl_priv { 1050struct iwl4965_priv {
1053 1051
1054 /* ieee device used by generic ieee processing code */ 1052 /* ieee device used by generic ieee processing code */
1055 struct ieee80211_hw *hw; 1053 struct ieee80211_hw *hw;
@@ -1063,27 +1061,27 @@ struct iwl_priv {
1063 u8 phymode; 1061 u8 phymode;
1064 int alloc_rxb_skb; 1062 int alloc_rxb_skb;
1065 1063
1066 void (*rx_handlers[REPLY_MAX])(struct iwl_priv *priv, 1064 void (*rx_handlers[REPLY_MAX])(struct iwl4965_priv *priv,
1067 struct iwl_rx_mem_buffer *rxb); 1065 struct iwl4965_rx_mem_buffer *rxb);
1068 1066
1069 const struct ieee80211_hw_mode *modes; 1067 const struct ieee80211_hw_mode *modes;
1070 1068
1071#ifdef CONFIG_IWL4965_SPECTRUM_MEASUREMENT 1069#ifdef CONFIG_IWL4965_SPECTRUM_MEASUREMENT
1072 /* spectrum measurement report caching */ 1070 /* spectrum measurement report caching */
1073 struct iwl_spectrum_notification measure_report; 1071 struct iwl4965_spectrum_notification measure_report;
1074 u8 measurement_status; 1072 u8 measurement_status;
1075#endif 1073#endif
1076 /* ucode beacon time */ 1074 /* ucode beacon time */
1077 u32 ucode_beacon_time; 1075 u32 ucode_beacon_time;
1078 1076
1079 /* we allocate array of iwl_channel_info for NIC's valid channels. 1077 /* we allocate array of iwl4965_channel_info for NIC's valid channels.
1080 * Access via channel # using indirect index array */ 1078 * Access via channel # using indirect index array */
1081 struct iwl_channel_info *channel_info; /* channel info array */ 1079 struct iwl4965_channel_info *channel_info; /* channel info array */
1082 u8 channel_count; /* # of channels */ 1080 u8 channel_count; /* # of channels */
1083 1081
1084 /* each calibration channel group in the EEPROM has a derived 1082 /* each calibration channel group in the EEPROM has a derived
1085 * clip setting for each rate. */ 1083 * clip setting for each rate. */
1086 const struct iwl_clip_group clip_groups[5]; 1084 const struct iwl4965_clip_group clip_groups[5];
1087 1085
1088 /* thermal calibration */ 1086 /* thermal calibration */
1089 s32 temperature; /* degrees Kelvin */ 1087 s32 temperature; /* degrees Kelvin */
@@ -1098,7 +1096,7 @@ struct iwl_priv {
1098 int one_direct_scan; 1096 int one_direct_scan;
1099 u8 direct_ssid_len; 1097 u8 direct_ssid_len;
1100 u8 direct_ssid[IW_ESSID_MAX_SIZE]; 1098 u8 direct_ssid[IW_ESSID_MAX_SIZE];
1101 struct iwl_scan_cmd *scan; 1099 struct iwl4965_scan_cmd *scan;
1102 u8 only_active_channel; 1100 u8 only_active_channel;
1103 1101
1104 /* spinlock */ 1102 /* spinlock */
@@ -1121,26 +1119,26 @@ struct iwl_priv {
1121 struct fw_desc ucode_boot; /* bootstrap inst */ 1119 struct fw_desc ucode_boot; /* bootstrap inst */
1122 1120
1123 1121
1124 struct iwl_rxon_time_cmd rxon_timing; 1122 struct iwl4965_rxon_time_cmd rxon_timing;
1125 1123
1126 /* We declare this const so it can only be 1124 /* We declare this const so it can only be
1127 * changed via explicit cast within the 1125 * changed via explicit cast within the
1128 * routines that actually update the physical 1126 * routines that actually update the physical
1129 * hardware */ 1127 * hardware */
1130 const struct iwl_rxon_cmd active_rxon; 1128 const struct iwl4965_rxon_cmd active_rxon;
1131 struct iwl_rxon_cmd staging_rxon; 1129 struct iwl4965_rxon_cmd staging_rxon;
1132 1130
1133 int error_recovering; 1131 int error_recovering;
1134 struct iwl_rxon_cmd recovery_rxon; 1132 struct iwl4965_rxon_cmd recovery_rxon;
1135 1133
1136 /* 1st responses from initialize and runtime uCode images. 1134 /* 1st responses from initialize and runtime uCode images.
1137 * 4965's initialize alive response contains some calibration data. */ 1135 * 4965's initialize alive response contains some calibration data. */
1138 struct iwl_init_alive_resp card_alive_init; 1136 struct iwl4965_init_alive_resp card_alive_init;
1139 struct iwl_alive_resp card_alive; 1137 struct iwl4965_alive_resp card_alive;
1140 1138
1141#ifdef LED 1139#ifdef LED
1142 /* LED related variables */ 1140 /* LED related variables */
1143 struct iwl_activity_blink activity; 1141 struct iwl4965_activity_blink activity;
1144 unsigned long led_packets; 1142 unsigned long led_packets;
1145 int led_state; 1143 int led_state;
1146#endif 1144#endif
@@ -1158,8 +1156,8 @@ struct iwl_priv {
1158 u8 current_channel_width; 1156 u8 current_channel_width;
1159 u8 valid_antenna; /* Bit mask of antennas actually connected */ 1157 u8 valid_antenna; /* Bit mask of antennas actually connected */
1160#ifdef CONFIG_IWL4965_SENSITIVITY 1158#ifdef CONFIG_IWL4965_SENSITIVITY
1161 struct iwl_sensitivity_data sensitivity_data; 1159 struct iwl4965_sensitivity_data sensitivity_data;
1162 struct iwl_chain_noise_data chain_noise_data; 1160 struct iwl4965_chain_noise_data chain_noise_data;
1163 u8 start_calib; 1161 u8 start_calib;
1164 __le16 sensitivity_tbl[HD_TABLE_SIZE]; 1162 __le16 sensitivity_tbl[HD_TABLE_SIZE];
1165#endif /*CONFIG_IWL4965_SENSITIVITY*/ 1163#endif /*CONFIG_IWL4965_SENSITIVITY*/
@@ -1171,7 +1169,7 @@ struct iwl_priv {
1171 u8 last_phy_res[100]; 1169 u8 last_phy_res[100];
1172 1170
1173 /* Rate scaling data */ 1171 /* Rate scaling data */
1174 struct iwl_lq_mngr lq_mngr; 1172 struct iwl4965_lq_mngr lq_mngr;
1175 1173
1176 /* Rate scaling data */ 1174 /* Rate scaling data */
1177 s8 data_retry_limit; 1175 s8 data_retry_limit;
@@ -1182,10 +1180,10 @@ struct iwl_priv {
1182 int activity_timer_active; 1180 int activity_timer_active;
1183 1181
1184 /* Rx and Tx DMA processing queues */ 1182 /* Rx and Tx DMA processing queues */
1185 struct iwl_rx_queue rxq; 1183 struct iwl4965_rx_queue rxq;
1186 struct iwl_tx_queue txq[IWL_MAX_NUM_QUEUES]; 1184 struct iwl4965_tx_queue txq[IWL_MAX_NUM_QUEUES];
1187 unsigned long txq_ctx_active_msk; 1185 unsigned long txq_ctx_active_msk;
1188 struct iwl_kw kw; /* keep warm address */ 1186 struct iwl4965_kw kw; /* keep warm address */
1189 u32 scd_base_addr; /* scheduler sram base address */ 1187 u32 scd_base_addr; /* scheduler sram base address */
1190 1188
1191 unsigned long status; 1189 unsigned long status;
@@ -1194,9 +1192,9 @@ struct iwl_priv {
1194 int last_rx_rssi; /* From Rx packet statisitics */ 1192 int last_rx_rssi; /* From Rx packet statisitics */
1195 int last_rx_noise; /* From beacon statistics */ 1193 int last_rx_noise; /* From beacon statistics */
1196 1194
1197 struct iwl_power_mgr power_data; 1195 struct iwl4965_power_mgr power_data;
1198 1196
1199 struct iwl_notif_statistics statistics; 1197 struct iwl4965_notif_statistics statistics;
1200 unsigned long last_statistics_time; 1198 unsigned long last_statistics_time;
1201 1199
1202 /* context information */ 1200 /* context information */
@@ -1213,7 +1211,7 @@ struct iwl_priv {
1213 /*station table variables */ 1211 /*station table variables */
1214 spinlock_t sta_lock; 1212 spinlock_t sta_lock;
1215 int num_stations; 1213 int num_stations;
1216 struct iwl_station_entry stations[IWL_STATION_COUNT]; 1214 struct iwl4965_station_entry stations[IWL_STATION_COUNT];
1217 1215
1218 /* Indication if ieee80211_ops->open has been called */ 1216 /* Indication if ieee80211_ops->open has been called */
1219 int is_open; 1217 int is_open;
@@ -1234,7 +1232,7 @@ struct iwl_priv {
1234 struct list_head ibss_mac_hash[IWL_IBSS_MAC_HASH_SIZE]; 1232 struct list_head ibss_mac_hash[IWL_IBSS_MAC_HASH_SIZE];
1235 1233
1236 /* eeprom */ 1234 /* eeprom */
1237 struct iwl_eeprom eeprom; 1235 struct iwl4965_eeprom eeprom;
1238 1236
1239 int iw_mode; 1237 int iw_mode;
1240 1238
@@ -1244,7 +1242,7 @@ struct iwl_priv {
1244 u32 timestamp0; 1242 u32 timestamp0;
1245 u32 timestamp1; 1243 u32 timestamp1;
1246 u16 beacon_int; 1244 u16 beacon_int;
1247 struct iwl_driver_hw_info hw_setting; 1245 struct iwl4965_driver_hw_info hw_setting;
1248 int interface_id; 1246 int interface_id;
1249 1247
1250 /* Current association information needed to configure the 1248 /* Current association information needed to configure the
@@ -1254,7 +1252,7 @@ struct iwl_priv {
1254 u8 ps_mode; 1252 u8 ps_mode;
1255 1253
1256#ifdef CONFIG_IWL4965_QOS 1254#ifdef CONFIG_IWL4965_QOS
1257 struct iwl_qos_info qos_data; 1255 struct iwl4965_qos_info qos_data;
1258#endif /*CONFIG_IWL4965_QOS */ 1256#endif /*CONFIG_IWL4965_QOS */
1259 1257
1260 struct workqueue_struct *workqueue; 1258 struct workqueue_struct *workqueue;
@@ -1306,55 +1304,55 @@ struct iwl_priv {
1306#ifdef CONFIG_IWL4965_HT_AGG 1304#ifdef CONFIG_IWL4965_HT_AGG
1307 struct work_struct agg_work; 1305 struct work_struct agg_work;
1308#endif 1306#endif
1309}; /*iwl_priv */ 1307}; /*iwl4965_priv */
1310 1308
1311static inline int iwl_is_associated(struct iwl_priv *priv) 1309static inline int iwl4965_is_associated(struct iwl4965_priv *priv)
1312{ 1310{
1313 return (priv->active_rxon.filter_flags & RXON_FILTER_ASSOC_MSK) ? 1 : 0; 1311 return (priv->active_rxon.filter_flags & RXON_FILTER_ASSOC_MSK) ? 1 : 0;
1314} 1312}
1315 1313
1316static inline int is_channel_valid(const struct iwl_channel_info *ch_info) 1314static inline int is_channel_valid(const struct iwl4965_channel_info *ch_info)
1317{ 1315{
1318 if (ch_info == NULL) 1316 if (ch_info == NULL)
1319 return 0; 1317 return 0;
1320 return (ch_info->flags & EEPROM_CHANNEL_VALID) ? 1 : 0; 1318 return (ch_info->flags & EEPROM_CHANNEL_VALID) ? 1 : 0;
1321} 1319}
1322 1320
1323static inline int is_channel_narrow(const struct iwl_channel_info *ch_info) 1321static inline int is_channel_narrow(const struct iwl4965_channel_info *ch_info)
1324{ 1322{
1325 return (ch_info->flags & EEPROM_CHANNEL_NARROW) ? 1 : 0; 1323 return (ch_info->flags & EEPROM_CHANNEL_NARROW) ? 1 : 0;
1326} 1324}
1327 1325
1328static inline int is_channel_radar(const struct iwl_channel_info *ch_info) 1326static inline int is_channel_radar(const struct iwl4965_channel_info *ch_info)
1329{ 1327{
1330 return (ch_info->flags & EEPROM_CHANNEL_RADAR) ? 1 : 0; 1328 return (ch_info->flags & EEPROM_CHANNEL_RADAR) ? 1 : 0;
1331} 1329}
1332 1330
1333static inline u8 is_channel_a_band(const struct iwl_channel_info *ch_info) 1331static inline u8 is_channel_a_band(const struct iwl4965_channel_info *ch_info)
1334{ 1332{
1335 return ch_info->phymode == MODE_IEEE80211A; 1333 return ch_info->phymode == MODE_IEEE80211A;
1336} 1334}
1337 1335
1338static inline u8 is_channel_bg_band(const struct iwl_channel_info *ch_info) 1336static inline u8 is_channel_bg_band(const struct iwl4965_channel_info *ch_info)
1339{ 1337{
1340 return ((ch_info->phymode == MODE_IEEE80211B) || 1338 return ((ch_info->phymode == MODE_IEEE80211B) ||
1341 (ch_info->phymode == MODE_IEEE80211G)); 1339 (ch_info->phymode == MODE_IEEE80211G));
1342} 1340}
1343 1341
1344static inline int is_channel_passive(const struct iwl_channel_info *ch) 1342static inline int is_channel_passive(const struct iwl4965_channel_info *ch)
1345{ 1343{
1346 return (!(ch->flags & EEPROM_CHANNEL_ACTIVE)) ? 1 : 0; 1344 return (!(ch->flags & EEPROM_CHANNEL_ACTIVE)) ? 1 : 0;
1347} 1345}
1348 1346
1349static inline int is_channel_ibss(const struct iwl_channel_info *ch) 1347static inline int is_channel_ibss(const struct iwl4965_channel_info *ch)
1350{ 1348{
1351 return ((ch->flags & EEPROM_CHANNEL_IBSS)) ? 1 : 0; 1349 return ((ch->flags & EEPROM_CHANNEL_IBSS)) ? 1 : 0;
1352} 1350}
1353 1351
1354extern const struct iwl_channel_info *iwl_get_channel_info( 1352extern const struct iwl4965_channel_info *iwl4965_get_channel_info(
1355 const struct iwl_priv *priv, int phymode, u16 channel); 1353 const struct iwl4965_priv *priv, int phymode, u16 channel);
1356 1354
1357/* Requires full declaration of iwl_priv before including */ 1355/* Requires full declaration of iwl4965_priv before including */
1358#include "iwl-4965-io.h" 1356#include "iwl-4965-io.h"
1359 1357
1360#endif /* __iwl_4965_h__ */ 1358#endif /* __iwl4965_4965_h__ */