aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi
diff options
context:
space:
mode:
authorAbhijeet Kolekar <abhijeet.kolekar@intel.com>2008-12-18 21:37:28 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-01-29 15:59:13 -0500
commit4a8a43222db6f04c88def2160a95f978f704b515 (patch)
treec5b5666c735e4f78045688ece7f5879f9529b032 /drivers/net/wireless/iwlwifi
parentf2c7e52100545e54af064fe0345d141fdcf2d243 (diff)
iwl3945: replaces iwl3945_priv with iwl_priv
The patch replaces iwl3945_priv to iwl_priv. It adds 3945 specific data members to iwl_priv. Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com> Signed-off-by: Zhu Yi <yi.zhu@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945-io.h58
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945-led.c26
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945-led.h22
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945-rs.c24
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945.c98
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945.h333
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-dev.h51
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c400
8 files changed, 417 insertions, 595 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945-io.h b/drivers/net/wireless/iwlwifi/iwl-3945-io.h
index d49dfd1ff538..0b84815dd69b 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945-io.h
+++ b/drivers/net/wireless/iwlwifi/iwl-3945-io.h
@@ -61,7 +61,7 @@
61 61
62#define _iwl3945_write32(priv, ofs, val) iowrite32((val), (priv)->hw_base + (ofs)) 62#define _iwl3945_write32(priv, ofs, val) iowrite32((val), (priv)->hw_base + (ofs))
63#ifdef CONFIG_IWL3945_DEBUG 63#ifdef CONFIG_IWL3945_DEBUG
64static inline void __iwl3945_write32(const char *f, u32 l, struct iwl3945_priv *priv, 64static inline void __iwl3945_write32(const char *f, u32 l, struct iwl_priv *priv,
65 u32 ofs, u32 val) 65 u32 ofs, u32 val)
66{ 66{
67 IWL_DEBUG_IO("write32(0x%08X, 0x%08X) - %s %d\n", ofs, val, f, l); 67 IWL_DEBUG_IO("write32(0x%08X, 0x%08X) - %s %d\n", ofs, val, f, l);
@@ -75,7 +75,7 @@ static inline void __iwl3945_write32(const char *f, u32 l, struct iwl3945_priv *
75 75
76#define _iwl3945_read32(priv, ofs) ioread32((priv)->hw_base + (ofs)) 76#define _iwl3945_read32(priv, ofs) ioread32((priv)->hw_base + (ofs))
77#ifdef CONFIG_IWL3945_DEBUG 77#ifdef CONFIG_IWL3945_DEBUG
78static inline u32 __iwl3945_read32(char *f, u32 l, struct iwl3945_priv *priv, u32 ofs) 78static inline u32 __iwl3945_read32(char *f, u32 l, struct iwl_priv *priv, u32 ofs)
79{ 79{
80 IWL_DEBUG_IO("read_direct32(0x%08X) - %s %d\n", ofs, f, l); 80 IWL_DEBUG_IO("read_direct32(0x%08X) - %s %d\n", ofs, f, l);
81 return _iwl3945_read32(priv, ofs); 81 return _iwl3945_read32(priv, ofs);
@@ -85,7 +85,7 @@ static inline u32 __iwl3945_read32(char *f, u32 l, struct iwl3945_priv *priv, u3
85#define iwl3945_read32(p, o) _iwl3945_read32(p, o) 85#define iwl3945_read32(p, o) _iwl3945_read32(p, o)
86#endif 86#endif
87 87
88static inline int _iwl3945_poll_bit(struct iwl3945_priv *priv, u32 addr, 88static inline int _iwl3945_poll_bit(struct iwl_priv *priv, u32 addr,
89 u32 bits, u32 mask, int timeout) 89 u32 bits, u32 mask, int timeout)
90{ 90{
91 int i = 0; 91 int i = 0;
@@ -101,7 +101,7 @@ static inline int _iwl3945_poll_bit(struct iwl3945_priv *priv, u32 addr,
101} 101}
102#ifdef CONFIG_IWL3945_DEBUG 102#ifdef CONFIG_IWL3945_DEBUG
103static inline int __iwl3945_poll_bit(const char *f, u32 l, 103static inline int __iwl3945_poll_bit(const char *f, u32 l,
104 struct iwl3945_priv *priv, u32 addr, 104 struct iwl_priv *priv, u32 addr,
105 u32 bits, u32 mask, int timeout) 105 u32 bits, u32 mask, int timeout)
106{ 106{
107 int ret = _iwl3945_poll_bit(priv, addr, bits, mask, timeout); 107 int ret = _iwl3945_poll_bit(priv, addr, bits, mask, timeout);
@@ -116,13 +116,13 @@ static inline int __iwl3945_poll_bit(const char *f, u32 l,
116#define iwl3945_poll_bit(p, a, b, m, t) _iwl3945_poll_bit(p, a, b, m, t) 116#define iwl3945_poll_bit(p, a, b, m, t) _iwl3945_poll_bit(p, a, b, m, t)
117#endif 117#endif
118 118
119static inline void _iwl3945_set_bit(struct iwl3945_priv *priv, u32 reg, u32 mask) 119static inline void _iwl3945_set_bit(struct iwl_priv *priv, u32 reg, u32 mask)
120{ 120{
121 _iwl3945_write32(priv, reg, _iwl3945_read32(priv, reg) | mask); 121 _iwl3945_write32(priv, reg, _iwl3945_read32(priv, reg) | mask);
122} 122}
123#ifdef CONFIG_IWL3945_DEBUG 123#ifdef CONFIG_IWL3945_DEBUG
124static inline void __iwl3945_set_bit(const char *f, u32 l, 124static inline void __iwl3945_set_bit(const char *f, u32 l,
125 struct iwl3945_priv *priv, u32 reg, u32 mask) 125 struct iwl_priv *priv, u32 reg, u32 mask)
126{ 126{
127 u32 val = _iwl3945_read32(priv, reg) | mask; 127 u32 val = _iwl3945_read32(priv, reg) | mask;
128 IWL_DEBUG_IO("set_bit(0x%08X, 0x%08X) = 0x%08X\n", reg, mask, val); 128 IWL_DEBUG_IO("set_bit(0x%08X, 0x%08X) = 0x%08X\n", reg, mask, val);
@@ -133,13 +133,13 @@ static inline void __iwl3945_set_bit(const char *f, u32 l,
133#define iwl3945_set_bit(p, r, m) _iwl3945_set_bit(p, r, m) 133#define iwl3945_set_bit(p, r, m) _iwl3945_set_bit(p, r, m)
134#endif 134#endif
135 135
136static inline void _iwl3945_clear_bit(struct iwl3945_priv *priv, u32 reg, u32 mask) 136static inline void _iwl3945_clear_bit(struct iwl_priv *priv, u32 reg, u32 mask)
137{ 137{
138 _iwl3945_write32(priv, reg, _iwl3945_read32(priv, reg) & ~mask); 138 _iwl3945_write32(priv, reg, _iwl3945_read32(priv, reg) & ~mask);
139} 139}
140#ifdef CONFIG_IWL3945_DEBUG 140#ifdef CONFIG_IWL3945_DEBUG
141static inline void __iwl3945_clear_bit(const char *f, u32 l, 141static inline void __iwl3945_clear_bit(const char *f, u32 l,
142 struct iwl3945_priv *priv, u32 reg, u32 mask) 142 struct iwl_priv *priv, u32 reg, u32 mask)
143{ 143{
144 u32 val = _iwl3945_read32(priv, reg) & ~mask; 144 u32 val = _iwl3945_read32(priv, reg) & ~mask;
145 IWL_DEBUG_IO("clear_bit(0x%08X, 0x%08X) = 0x%08X\n", reg, mask, val); 145 IWL_DEBUG_IO("clear_bit(0x%08X, 0x%08X) = 0x%08X\n", reg, mask, val);
@@ -150,7 +150,7 @@ static inline void __iwl3945_clear_bit(const char *f, u32 l,
150#define iwl3945_clear_bit(p, r, m) _iwl3945_clear_bit(p, r, m) 150#define iwl3945_clear_bit(p, r, m) _iwl3945_clear_bit(p, r, m)
151#endif 151#endif
152 152
153static inline int _iwl3945_grab_nic_access(struct iwl3945_priv *priv) 153static inline int _iwl3945_grab_nic_access(struct iwl_priv *priv)
154{ 154{
155 int ret; 155 int ret;
156#ifdef CONFIG_IWL3945_DEBUG 156#ifdef CONFIG_IWL3945_DEBUG
@@ -176,7 +176,7 @@ static inline int _iwl3945_grab_nic_access(struct iwl3945_priv *priv)
176 176
177#ifdef CONFIG_IWL3945_DEBUG 177#ifdef CONFIG_IWL3945_DEBUG
178static inline int __iwl3945_grab_nic_access(const char *f, u32 l, 178static inline int __iwl3945_grab_nic_access(const char *f, u32 l,
179 struct iwl3945_priv *priv) 179 struct iwl_priv *priv)
180{ 180{
181 if (atomic_read(&priv->restrict_refcnt)) 181 if (atomic_read(&priv->restrict_refcnt))
182 IWL_DEBUG_INFO("Grabbing access while already held at " 182 IWL_DEBUG_INFO("Grabbing access while already held at "
@@ -192,7 +192,7 @@ static inline int __iwl3945_grab_nic_access(const char *f, u32 l,
192 _iwl3945_grab_nic_access(priv) 192 _iwl3945_grab_nic_access(priv)
193#endif 193#endif
194 194
195static inline void _iwl3945_release_nic_access(struct iwl3945_priv *priv) 195static inline void _iwl3945_release_nic_access(struct iwl_priv *priv)
196{ 196{
197#ifdef CONFIG_IWL3945_DEBUG 197#ifdef CONFIG_IWL3945_DEBUG
198 if (atomic_dec_and_test(&priv->restrict_refcnt)) 198 if (atomic_dec_and_test(&priv->restrict_refcnt))
@@ -202,7 +202,7 @@ static inline void _iwl3945_release_nic_access(struct iwl3945_priv *priv)
202} 202}
203#ifdef CONFIG_IWL3945_DEBUG 203#ifdef CONFIG_IWL3945_DEBUG
204static inline void __iwl3945_release_nic_access(const char *f, u32 l, 204static inline void __iwl3945_release_nic_access(const char *f, u32 l,
205 struct iwl3945_priv *priv) 205 struct iwl_priv *priv)
206{ 206{
207 if (atomic_read(&priv->restrict_refcnt) <= 0) 207 if (atomic_read(&priv->restrict_refcnt) <= 0)
208 IWL_ERROR("Release unheld nic access at line %d.\n", l); 208 IWL_ERROR("Release unheld nic access at line %d.\n", l);
@@ -217,13 +217,13 @@ static inline void __iwl3945_release_nic_access(const char *f, u32 l,
217 _iwl3945_release_nic_access(priv) 217 _iwl3945_release_nic_access(priv)
218#endif 218#endif
219 219
220static inline u32 _iwl3945_read_direct32(struct iwl3945_priv *priv, u32 reg) 220static inline u32 _iwl3945_read_direct32(struct iwl_priv *priv, u32 reg)
221{ 221{
222 return _iwl3945_read32(priv, reg); 222 return _iwl3945_read32(priv, reg);
223} 223}
224#ifdef CONFIG_IWL3945_DEBUG 224#ifdef CONFIG_IWL3945_DEBUG
225static inline u32 __iwl3945_read_direct32(const char *f, u32 l, 225static inline u32 __iwl3945_read_direct32(const char *f, u32 l,
226 struct iwl3945_priv *priv, u32 reg) 226 struct iwl_priv *priv, u32 reg)
227{ 227{
228 u32 value = _iwl3945_read_direct32(priv, reg); 228 u32 value = _iwl3945_read_direct32(priv, reg);
229 if (!atomic_read(&priv->restrict_refcnt)) 229 if (!atomic_read(&priv->restrict_refcnt))
@@ -238,14 +238,14 @@ static inline u32 __iwl3945_read_direct32(const char *f, u32 l,
238#define iwl3945_read_direct32 _iwl3945_read_direct32 238#define iwl3945_read_direct32 _iwl3945_read_direct32
239#endif 239#endif
240 240
241static inline void _iwl3945_write_direct32(struct iwl3945_priv *priv, 241static inline void _iwl3945_write_direct32(struct iwl_priv *priv,
242 u32 reg, u32 value) 242 u32 reg, u32 value)
243{ 243{
244 _iwl3945_write32(priv, reg, value); 244 _iwl3945_write32(priv, reg, value);
245} 245}
246#ifdef CONFIG_IWL3945_DEBUG 246#ifdef CONFIG_IWL3945_DEBUG
247static void __iwl3945_write_direct32(u32 line, 247static void __iwl3945_write_direct32(u32 line,
248 struct iwl3945_priv *priv, u32 reg, u32 value) 248 struct iwl_priv *priv, u32 reg, u32 value)
249{ 249{
250 if (!atomic_read(&priv->restrict_refcnt)) 250 if (!atomic_read(&priv->restrict_refcnt))
251 IWL_ERROR("Nic access not held from line %d\n", line); 251 IWL_ERROR("Nic access not held from line %d\n", line);
@@ -257,7 +257,7 @@ static void __iwl3945_write_direct32(u32 line,
257#define iwl3945_write_direct32 _iwl3945_write_direct32 257#define iwl3945_write_direct32 _iwl3945_write_direct32
258#endif 258#endif
259 259
260static inline void iwl3945_write_reg_buf(struct iwl3945_priv *priv, 260static inline void iwl3945_write_reg_buf(struct iwl_priv *priv,
261 u32 reg, u32 len, u32 *values) 261 u32 reg, u32 len, u32 *values)
262{ 262{
263 u32 count = sizeof(u32); 263 u32 count = sizeof(u32);
@@ -268,7 +268,7 @@ static inline void iwl3945_write_reg_buf(struct iwl3945_priv *priv,
268 } 268 }
269} 269}
270 270
271static inline int _iwl3945_poll_direct_bit(struct iwl3945_priv *priv, 271static inline int _iwl3945_poll_direct_bit(struct iwl_priv *priv,
272 u32 addr, u32 mask, int timeout) 272 u32 addr, u32 mask, int timeout)
273{ 273{
274 return _iwl3945_poll_bit(priv, addr, mask, mask, timeout); 274 return _iwl3945_poll_bit(priv, addr, mask, mask, timeout);
@@ -276,7 +276,7 @@ static inline int _iwl3945_poll_direct_bit(struct iwl3945_priv *priv,
276 276
277#ifdef CONFIG_IWL3945_DEBUG 277#ifdef CONFIG_IWL3945_DEBUG
278static inline int __iwl3945_poll_direct_bit(const char *f, u32 l, 278static inline int __iwl3945_poll_direct_bit(const char *f, u32 l,
279 struct iwl3945_priv *priv, 279 struct iwl_priv *priv,
280 u32 addr, u32 mask, int timeout) 280 u32 addr, u32 mask, int timeout)
281{ 281{
282 int ret = _iwl3945_poll_direct_bit(priv, addr, mask, timeout); 282 int ret = _iwl3945_poll_direct_bit(priv, addr, mask, timeout);
@@ -295,14 +295,14 @@ static inline int __iwl3945_poll_direct_bit(const char *f, u32 l,
295#define iwl3945_poll_direct_bit _iwl3945_poll_direct_bit 295#define iwl3945_poll_direct_bit _iwl3945_poll_direct_bit
296#endif 296#endif
297 297
298static inline u32 _iwl3945_read_prph(struct iwl3945_priv *priv, u32 reg) 298static inline u32 _iwl3945_read_prph(struct iwl_priv *priv, u32 reg)
299{ 299{
300 _iwl3945_write_direct32(priv, HBUS_TARG_PRPH_RADDR, reg | (3 << 24)); 300 _iwl3945_write_direct32(priv, HBUS_TARG_PRPH_RADDR, reg | (3 << 24));
301 rmb(); 301 rmb();
302 return _iwl3945_read_direct32(priv, HBUS_TARG_PRPH_RDAT); 302 return _iwl3945_read_direct32(priv, HBUS_TARG_PRPH_RDAT);
303} 303}
304#ifdef CONFIG_IWL3945_DEBUG 304#ifdef CONFIG_IWL3945_DEBUG
305static inline u32 __iwl3945_read_prph(u32 line, struct iwl3945_priv *priv, u32 reg) 305static inline u32 __iwl3945_read_prph(u32 line, struct iwl_priv *priv, u32 reg)
306{ 306{
307 if (!atomic_read(&priv->restrict_refcnt)) 307 if (!atomic_read(&priv->restrict_refcnt))
308 IWL_ERROR("Nic access not held from line %d\n", line); 308 IWL_ERROR("Nic access not held from line %d\n", line);
@@ -315,7 +315,7 @@ static inline u32 __iwl3945_read_prph(u32 line, struct iwl3945_priv *priv, u32 r
315#define iwl3945_read_prph _iwl3945_read_prph 315#define iwl3945_read_prph _iwl3945_read_prph
316#endif 316#endif
317 317
318static inline void _iwl3945_write_prph(struct iwl3945_priv *priv, 318static inline void _iwl3945_write_prph(struct iwl_priv *priv,
319 u32 addr, u32 val) 319 u32 addr, u32 val)
320{ 320{
321 _iwl3945_write_direct32(priv, HBUS_TARG_PRPH_WADDR, 321 _iwl3945_write_direct32(priv, HBUS_TARG_PRPH_WADDR,
@@ -324,7 +324,7 @@ static inline void _iwl3945_write_prph(struct iwl3945_priv *priv,
324 _iwl3945_write_direct32(priv, HBUS_TARG_PRPH_WDAT, val); 324 _iwl3945_write_direct32(priv, HBUS_TARG_PRPH_WDAT, val);
325} 325}
326#ifdef CONFIG_IWL3945_DEBUG 326#ifdef CONFIG_IWL3945_DEBUG
327static inline void __iwl3945_write_prph(u32 line, struct iwl3945_priv *priv, 327static inline void __iwl3945_write_prph(u32 line, struct iwl_priv *priv,
328 u32 addr, u32 val) 328 u32 addr, u32 val)
329{ 329{
330 if (!atomic_read(&priv->restrict_refcnt)) 330 if (!atomic_read(&priv->restrict_refcnt))
@@ -341,7 +341,7 @@ static inline void __iwl3945_write_prph(u32 line, struct iwl3945_priv *priv,
341#define _iwl3945_set_bits_prph(priv, reg, mask) \ 341#define _iwl3945_set_bits_prph(priv, reg, mask) \
342 _iwl3945_write_prph(priv, reg, (_iwl3945_read_prph(priv, reg) | mask)) 342 _iwl3945_write_prph(priv, reg, (_iwl3945_read_prph(priv, reg) | mask))
343#ifdef CONFIG_IWL3945_DEBUG 343#ifdef CONFIG_IWL3945_DEBUG
344static inline void __iwl3945_set_bits_prph(u32 line, struct iwl3945_priv *priv, 344static inline void __iwl3945_set_bits_prph(u32 line, struct iwl_priv *priv,
345 u32 reg, u32 mask) 345 u32 reg, u32 mask)
346{ 346{
347 if (!atomic_read(&priv->restrict_refcnt)) 347 if (!atomic_read(&priv->restrict_refcnt))
@@ -360,7 +360,7 @@ static inline void __iwl3945_set_bits_prph(u32 line, struct iwl3945_priv *priv,
360 360
361#ifdef CONFIG_IWL3945_DEBUG 361#ifdef CONFIG_IWL3945_DEBUG
362static inline void __iwl3945_set_bits_mask_prph(u32 line, 362static inline void __iwl3945_set_bits_mask_prph(u32 line,
363 struct iwl3945_priv *priv, u32 reg, u32 bits, u32 mask) 363 struct iwl_priv *priv, u32 reg, u32 bits, u32 mask)
364{ 364{
365 if (!atomic_read(&priv->restrict_refcnt)) 365 if (!atomic_read(&priv->restrict_refcnt))
366 IWL_ERROR("Nic access not held from line %d\n", line); 366 IWL_ERROR("Nic access not held from line %d\n", line);
@@ -372,28 +372,28 @@ static inline void __iwl3945_set_bits_mask_prph(u32 line,
372#define iwl3945_set_bits_mask_prph _iwl3945_set_bits_mask_prph 372#define iwl3945_set_bits_mask_prph _iwl3945_set_bits_mask_prph
373#endif 373#endif
374 374
375static inline void iwl3945_clear_bits_prph(struct iwl3945_priv 375static inline void iwl3945_clear_bits_prph(struct iwl_priv
376 *priv, u32 reg, u32 mask) 376 *priv, u32 reg, u32 mask)
377{ 377{
378 u32 val = _iwl3945_read_prph(priv, reg); 378 u32 val = _iwl3945_read_prph(priv, reg);
379 _iwl3945_write_prph(priv, reg, (val & ~mask)); 379 _iwl3945_write_prph(priv, reg, (val & ~mask));
380} 380}
381 381
382static inline u32 iwl3945_read_targ_mem(struct iwl3945_priv *priv, u32 addr) 382static inline u32 iwl3945_read_targ_mem(struct iwl_priv *priv, u32 addr)
383{ 383{
384 iwl3945_write_direct32(priv, HBUS_TARG_MEM_RADDR, addr); 384 iwl3945_write_direct32(priv, HBUS_TARG_MEM_RADDR, addr);
385 rmb(); 385 rmb();
386 return iwl3945_read_direct32(priv, HBUS_TARG_MEM_RDAT); 386 return iwl3945_read_direct32(priv, HBUS_TARG_MEM_RDAT);
387} 387}
388 388
389static inline void iwl3945_write_targ_mem(struct iwl3945_priv *priv, u32 addr, u32 val) 389static inline void iwl3945_write_targ_mem(struct iwl_priv *priv, u32 addr, u32 val)
390{ 390{
391 iwl3945_write_direct32(priv, HBUS_TARG_MEM_WADDR, addr); 391 iwl3945_write_direct32(priv, HBUS_TARG_MEM_WADDR, addr);
392 wmb(); 392 wmb();
393 iwl3945_write_direct32(priv, HBUS_TARG_MEM_WDAT, val); 393 iwl3945_write_direct32(priv, HBUS_TARG_MEM_WDAT, val);
394} 394}
395 395
396static inline void iwl3945_write_targ_mem_buf(struct iwl3945_priv *priv, u32 addr, 396static inline void iwl3945_write_targ_mem_buf(struct iwl_priv *priv, u32 addr,
397 u32 len, u32 *values) 397 u32 len, u32 *values)
398{ 398{
399 iwl3945_write_direct32(priv, HBUS_TARG_MEM_WADDR, addr); 399 iwl3945_write_direct32(priv, HBUS_TARG_MEM_WADDR, addr);
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945-led.c b/drivers/net/wireless/iwlwifi/iwl-3945-led.c
index 1ef21b6b3c4f..165da9e314d9 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945-led.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945-led.c
@@ -67,7 +67,7 @@ static const struct {
67#define IWL_MAX_BLINK_TBL (ARRAY_SIZE(blink_tbl) - 1) /*Exclude Solid on*/ 67#define IWL_MAX_BLINK_TBL (ARRAY_SIZE(blink_tbl) - 1) /*Exclude Solid on*/
68#define IWL_SOLID_BLINK_IDX (ARRAY_SIZE(blink_tbl) - 1) 68#define IWL_SOLID_BLINK_IDX (ARRAY_SIZE(blink_tbl) - 1)
69 69
70static int iwl3945_led_cmd_callback(struct iwl3945_priv *priv, 70static int iwl3945_led_cmd_callback(struct iwl_priv *priv,
71 struct iwl3945_cmd *cmd, 71 struct iwl3945_cmd *cmd,
72 struct sk_buff *skb) 72 struct sk_buff *skb)
73{ 73{
@@ -80,7 +80,7 @@ static inline int iwl3945_brightness_to_idx(enum led_brightness brightness)
80} 80}
81 81
82/* Send led command */ 82/* Send led command */
83static int iwl_send_led_cmd(struct iwl3945_priv *priv, 83static int iwl_send_led_cmd(struct iwl_priv *priv,
84 struct iwl_led_cmd *led_cmd) 84 struct iwl_led_cmd *led_cmd)
85{ 85{
86 struct iwl3945_host_cmd cmd = { 86 struct iwl3945_host_cmd cmd = {
@@ -97,7 +97,7 @@ static int iwl_send_led_cmd(struct iwl3945_priv *priv,
97 97
98 98
99/* Set led on command */ 99/* Set led on command */
100static int iwl3945_led_pattern(struct iwl3945_priv *priv, int led_id, 100static int iwl3945_led_pattern(struct iwl_priv *priv, int led_id,
101 unsigned int idx) 101 unsigned int idx)
102{ 102{
103 struct iwl_led_cmd led_cmd = { 103 struct iwl_led_cmd led_cmd = {
@@ -115,7 +115,7 @@ static int iwl3945_led_pattern(struct iwl3945_priv *priv, int led_id,
115 115
116 116
117/* Set led on command */ 117/* Set led on command */
118static int iwl3945_led_on(struct iwl3945_priv *priv, int led_id) 118static int iwl3945_led_on(struct iwl_priv *priv, int led_id)
119{ 119{
120 struct iwl_led_cmd led_cmd = { 120 struct iwl_led_cmd led_cmd = {
121 .id = led_id, 121 .id = led_id,
@@ -127,7 +127,7 @@ static int iwl3945_led_on(struct iwl3945_priv *priv, int led_id)
127} 127}
128 128
129/* Set led off command */ 129/* Set led off command */
130static int iwl3945_led_off(struct iwl3945_priv *priv, int led_id) 130static int iwl3945_led_off(struct iwl_priv *priv, int led_id)
131{ 131{
132 struct iwl_led_cmd led_cmd = { 132 struct iwl_led_cmd led_cmd = {
133 .id = led_id, 133 .id = led_id,
@@ -142,7 +142,7 @@ static int iwl3945_led_off(struct iwl3945_priv *priv, int led_id)
142/* 142/*
143 * brightness call back function for Tx/Rx LED 143 * brightness call back function for Tx/Rx LED
144 */ 144 */
145static int iwl3945_led_associated(struct iwl3945_priv *priv, int led_id) 145static int iwl3945_led_associated(struct iwl_priv *priv, int led_id)
146{ 146{
147 if (test_bit(STATUS_EXIT_PENDING, &priv->status) || 147 if (test_bit(STATUS_EXIT_PENDING, &priv->status) ||
148 !test_bit(STATUS_READY, &priv->status)) 148 !test_bit(STATUS_READY, &priv->status))
@@ -163,7 +163,7 @@ static void iwl3945_led_brightness_set(struct led_classdev *led_cdev,
163{ 163{
164 struct iwl3945_led *led = container_of(led_cdev, 164 struct iwl3945_led *led = container_of(led_cdev,
165 struct iwl3945_led, led_dev); 165 struct iwl3945_led, led_dev);
166 struct iwl3945_priv *priv = led->priv; 166 struct iwl_priv *priv = led->priv;
167 167
168 if (test_bit(STATUS_EXIT_PENDING, &priv->status)) 168 if (test_bit(STATUS_EXIT_PENDING, &priv->status))
169 return; 169 return;
@@ -199,7 +199,7 @@ static void iwl3945_led_brightness_set(struct led_classdev *led_cdev,
199/* 199/*
200 * Register led class with the system 200 * Register led class with the system
201 */ 201 */
202static int iwl3945_led_register_led(struct iwl3945_priv *priv, 202static int iwl3945_led_register_led(struct iwl_priv *priv,
203 struct iwl3945_led *led, 203 struct iwl3945_led *led,
204 enum led_type type, u8 set_led, 204 enum led_type type, u8 set_led,
205 char *trigger) 205 char *trigger)
@@ -231,7 +231,7 @@ static int iwl3945_led_register_led(struct iwl3945_priv *priv,
231/* 231/*
232 * calculate blink rate according to last 2 sec Tx/Rx activities 232 * calculate blink rate according to last 2 sec Tx/Rx activities
233 */ 233 */
234static inline u8 get_blink_rate(struct iwl3945_priv *priv) 234static inline u8 get_blink_rate(struct iwl_priv *priv)
235{ 235{
236 int index; 236 int index;
237 u64 current_tpt = priv->rxtxpackets; 237 u64 current_tpt = priv->rxtxpackets;
@@ -250,7 +250,7 @@ static inline u8 get_blink_rate(struct iwl3945_priv *priv)
250 return index; 250 return index;
251} 251}
252 252
253static inline int is_rf_kill(struct iwl3945_priv *priv) 253static inline int is_rf_kill(struct iwl_priv *priv)
254{ 254{
255 return test_bit(STATUS_RF_KILL_HW, &priv->status) || 255 return test_bit(STATUS_RF_KILL_HW, &priv->status) ||
256 test_bit(STATUS_RF_KILL_SW, &priv->status); 256 test_bit(STATUS_RF_KILL_SW, &priv->status);
@@ -261,7 +261,7 @@ static inline int is_rf_kill(struct iwl3945_priv *priv)
261 * happen very frequent we postpone led command to be called from 261 * happen very frequent we postpone led command to be called from
262 * REPLY handler so we know ucode is up 262 * REPLY handler so we know ucode is up
263 */ 263 */
264void iwl3945_led_background(struct iwl3945_priv *priv) 264void iwl3945_led_background(struct iwl_priv *priv)
265{ 265{
266 u8 blink_idx; 266 u8 blink_idx;
267 267
@@ -301,7 +301,7 @@ void iwl3945_led_background(struct iwl3945_priv *priv)
301 301
302 302
303/* Register all led handler */ 303/* Register all led handler */
304int iwl3945_led_register(struct iwl3945_priv *priv) 304int iwl3945_led_register(struct iwl_priv *priv)
305{ 305{
306 char *trigger; 306 char *trigger;
307 int ret; 307 int ret;
@@ -399,7 +399,7 @@ static void iwl3945_led_unregister_led(struct iwl3945_led *led, u8 set_led)
399} 399}
400 400
401/* Unregister all led handlers */ 401/* Unregister all led handlers */
402void iwl3945_led_unregister(struct iwl3945_priv *priv) 402void iwl3945_led_unregister(struct iwl_priv *priv)
403{ 403{
404 iwl3945_led_unregister_led(&priv->led39[IWL_LED_TRG_ASSOC], 0); 404 iwl3945_led_unregister_led(&priv->led39[IWL_LED_TRG_ASSOC], 0);
405 iwl3945_led_unregister_led(&priv->led39[IWL_LED_TRG_RX], 0); 405 iwl3945_led_unregister_led(&priv->led39[IWL_LED_TRG_RX], 0);
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945-led.h b/drivers/net/wireless/iwlwifi/iwl-3945-led.h
index b697c890f623..859bb9b1e1b2 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945-led.h
+++ b/drivers/net/wireless/iwlwifi/iwl-3945-led.h
@@ -27,34 +27,34 @@
27#ifndef IWL3945_LEDS_H 27#ifndef IWL3945_LEDS_H
28#define IWL3945_LEDS_H 28#define IWL3945_LEDS_H
29 29
30struct iwl3945_priv; 30struct iwl_priv;
31 31
32#ifdef CONFIG_IWL3945_LEDS 32#ifdef CONFIG_IWL3945_LEDS
33 33
34#include "iwl-led.h" 34#include "iwl-led.h"
35 35
36struct iwl3945_led { 36struct iwl3945_led {
37 struct iwl3945_priv *priv; 37 struct iwl_priv *priv;
38 struct led_classdev led_dev; 38 struct led_classdev led_dev;
39 char name[32]; 39 char name[32];
40 40
41 int (*led_on) (struct iwl3945_priv *priv, int led_id); 41 int (*led_on) (struct iwl_priv *priv, int led_id);
42 int (*led_off) (struct iwl3945_priv *priv, int led_id); 42 int (*led_off) (struct iwl_priv *priv, int led_id);
43 int (*led_pattern) (struct iwl3945_priv *priv, int led_id, 43 int (*led_pattern) (struct iwl_priv *priv, int led_id,
44 unsigned int idx); 44 unsigned int idx);
45 45
46 enum led_type type; 46 enum led_type type;
47 unsigned int registered; 47 unsigned int registered;
48}; 48};
49 49
50extern int iwl3945_led_register(struct iwl3945_priv *priv); 50extern int iwl3945_led_register(struct iwl_priv *priv);
51extern void iwl3945_led_unregister(struct iwl3945_priv *priv); 51extern void iwl3945_led_unregister(struct iwl_priv *priv);
52extern void iwl3945_led_background(struct iwl3945_priv *priv); 52extern void iwl3945_led_background(struct iwl_priv *priv);
53 53
54#else 54#else
55static inline int iwl3945_led_register(struct iwl3945_priv *priv) { return 0; } 55static inline int iwl3945_led_register(struct iwl_priv *priv) { return 0; }
56static inline void iwl3945_led_unregister(struct iwl3945_priv *priv) {} 56static inline void iwl3945_led_unregister(struct iwl_priv *priv) {}
57static inline void iwl3945_led_background(struct iwl3945_priv *priv) {} 57static inline void iwl3945_led_background(struct iwl_priv *priv) {}
58#endif /* CONFIG_IWL3945_LEDS */ 58#endif /* CONFIG_IWL3945_LEDS */
59 59
60#endif /* IWL3945_LEDS_H */ 60#endif /* IWL3945_LEDS_H */
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945-rs.c b/drivers/net/wireless/iwlwifi/iwl-3945-rs.c
index daaac3196ce1..52901ac74e5e 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945-rs.c
@@ -52,7 +52,7 @@ struct iwl3945_rate_scale_data {
52 52
53struct iwl3945_rs_sta { 53struct iwl3945_rs_sta {
54 spinlock_t lock; 54 spinlock_t lock;
55 struct iwl3945_priv *priv; 55 struct iwl_priv *priv;
56 s32 *expected_tpt; 56 s32 *expected_tpt;
57 unsigned long last_partial_flush; 57 unsigned long last_partial_flush;
58 unsigned long last_flush; 58 unsigned long last_flush;
@@ -183,7 +183,7 @@ static int iwl3945_rate_scale_flush_windows(struct iwl3945_rs_sta *rs_sta)
183 int unflushed = 0; 183 int unflushed = 0;
184 int i; 184 int i;
185 unsigned long flags; 185 unsigned long flags;
186 struct iwl3945_priv *priv = rs_sta->priv; 186 struct iwl_priv *priv = rs_sta->priv;
187 187
188 /* 188 /*
189 * For each rate, if we have collected data on that rate 189 * For each rate, if we have collected data on that rate
@@ -216,7 +216,7 @@ static int iwl3945_rate_scale_flush_windows(struct iwl3945_rs_sta *rs_sta)
216static void iwl3945_bg_rate_scale_flush(unsigned long data) 216static void iwl3945_bg_rate_scale_flush(unsigned long data)
217{ 217{
218 struct iwl3945_rs_sta *rs_sta = (void *)data; 218 struct iwl3945_rs_sta *rs_sta = (void *)data;
219 struct iwl3945_priv *priv = rs_sta->priv; 219 struct iwl_priv *priv = rs_sta->priv;
220 int unflushed = 0; 220 int unflushed = 0;
221 unsigned long flags; 221 unsigned long flags;
222 u32 packet_count, duration, pps; 222 u32 packet_count, duration, pps;
@@ -290,7 +290,7 @@ static void iwl3945_collect_tx_data(struct iwl3945_rs_sta *rs_sta,
290{ 290{
291 unsigned long flags; 291 unsigned long flags;
292 s32 fail_count; 292 s32 fail_count;
293 struct iwl3945_priv *priv = rs_sta->priv; 293 struct iwl_priv *priv = rs_sta->priv;
294 294
295 if (!retries) { 295 if (!retries) {
296 IWL_DEBUG_RATE("leave: retries == 0 -- should be at least 1\n"); 296 IWL_DEBUG_RATE("leave: retries == 0 -- should be at least 1\n");
@@ -344,7 +344,7 @@ static void rs_rate_init(void *priv_r, struct ieee80211_supported_band *sband,
344 struct ieee80211_sta *sta, void *priv_sta) 344 struct ieee80211_sta *sta, void *priv_sta)
345{ 345{
346 struct iwl3945_rs_sta *rs_sta = priv_sta; 346 struct iwl3945_rs_sta *rs_sta = priv_sta;
347 struct iwl3945_priv *priv = (struct iwl3945_priv *)priv_r; 347 struct iwl_priv *priv = (struct iwl_priv *)priv_r;
348 int i; 348 int i;
349 349
350 IWL_DEBUG_RATE("enter\n"); 350 IWL_DEBUG_RATE("enter\n");
@@ -388,7 +388,7 @@ static void *rs_alloc_sta(void *iwl_priv, struct ieee80211_sta *sta, gfp_t gfp)
388{ 388{
389 struct iwl3945_rs_sta *rs_sta; 389 struct iwl3945_rs_sta *rs_sta;
390 struct iwl3945_sta_priv *psta = (void *) sta->drv_priv; 390 struct iwl3945_sta_priv *psta = (void *) sta->drv_priv;
391 struct iwl3945_priv *priv = iwl_priv; 391 struct iwl_priv *priv = iwl_priv;
392 int i; 392 int i;
393 393
394 /* 394 /*
@@ -438,7 +438,7 @@ static void rs_free_sta(void *iwl_priv, struct ieee80211_sta *sta,
438{ 438{
439 struct iwl3945_sta_priv *psta = (void *) sta->drv_priv; 439 struct iwl3945_sta_priv *psta = (void *) sta->drv_priv;
440 struct iwl3945_rs_sta *rs_sta = priv_sta; 440 struct iwl3945_rs_sta *rs_sta = priv_sta;
441 struct iwl3945_priv *priv = rs_sta->priv; 441 struct iwl_priv *priv = rs_sta->priv;
442 442
443 psta->rs_sta = NULL; 443 psta->rs_sta = NULL;
444 444
@@ -452,7 +452,7 @@ static void rs_free_sta(void *iwl_priv, struct ieee80211_sta *sta,
452/** 452/**
453 * rs_tx_status - Update rate control values based on Tx results 453 * rs_tx_status - Update rate control values based on Tx results
454 * 454 *
455 * NOTE: Uses iwl3945_priv->retry_rate for the # of retries attempted by 455 * NOTE: Uses iwl_priv->retry_rate for the # of retries attempted by
456 * the hardware for each rate. 456 * the hardware for each rate.
457 */ 457 */
458static void rs_tx_status(void *priv_rate, struct ieee80211_supported_band *sband, 458static void rs_tx_status(void *priv_rate, struct ieee80211_supported_band *sband,
@@ -462,7 +462,7 @@ static void rs_tx_status(void *priv_rate, struct ieee80211_supported_band *sband
462 s8 retries = 0, current_count; 462 s8 retries = 0, current_count;
463 int scale_rate_index, first_index, last_index; 463 int scale_rate_index, first_index, last_index;
464 unsigned long flags; 464 unsigned long flags;
465 struct iwl3945_priv *priv = (struct iwl3945_priv *)priv_rate; 465 struct iwl_priv *priv = (struct iwl_priv *)priv_rate;
466 struct iwl3945_rs_sta *rs_sta = priv_sta; 466 struct iwl3945_rs_sta *rs_sta = priv_sta;
467 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); 467 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
468 468
@@ -556,7 +556,7 @@ static u16 iwl3945_get_adjacent_rate(struct iwl3945_rs_sta *rs_sta,
556{ 556{
557 u8 high = IWL_RATE_INVALID; 557 u8 high = IWL_RATE_INVALID;
558 u8 low = IWL_RATE_INVALID; 558 u8 low = IWL_RATE_INVALID;
559 struct iwl3945_priv *priv = rs_sta->priv; 559 struct iwl_priv *priv = rs_sta->priv;
560 560
561 /* 802.11A walks to the next literal adjacent rate in 561 /* 802.11A walks to the next literal adjacent rate in
562 * the rate table */ 562 * the rate table */
@@ -651,7 +651,7 @@ static void rs_get_rate(void *priv_r, struct ieee80211_sta *sta,
651 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; 651 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
652 u16 fc; 652 u16 fc;
653 u16 rate_mask = 0; 653 u16 rate_mask = 0;
654 struct iwl3945_priv *priv = (struct iwl3945_priv *)priv_r; 654 struct iwl_priv *priv = (struct iwl_priv *)priv_r;
655 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); 655 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
656 656
657 IWL_DEBUG_RATE("enter\n"); 657 IWL_DEBUG_RATE("enter\n");
@@ -890,7 +890,7 @@ static struct rate_control_ops rs_ops = {
890 890
891void iwl3945_rate_scale_init(struct ieee80211_hw *hw, s32 sta_id) 891void iwl3945_rate_scale_init(struct ieee80211_hw *hw, s32 sta_id)
892{ 892{
893 struct iwl3945_priv *priv = hw->priv; 893 struct iwl_priv *priv = hw->priv;
894 s32 rssi = 0; 894 s32 rssi = 0;
895 unsigned long flags; 895 unsigned long flags;
896 struct iwl3945_rs_sta *rs_sta; 896 struct iwl3945_rs_sta *rs_sta;
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c
index f480c437cd66..50e729ed0181 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945.c
@@ -93,7 +93,7 @@ const struct iwl3945_rate_info iwl3945_rates[IWL_RATE_COUNT_3945] = {
93 * Use for only special debugging. This function is just a placeholder as-is, 93 * Use for only special debugging. This function is just a placeholder as-is,
94 * you'll need to provide the special bits! ... 94 * you'll need to provide the special bits! ...
95 * ... and set IWL_EVT_DISABLE to 1. */ 95 * ... and set IWL_EVT_DISABLE to 1. */
96void iwl3945_disable_events(struct iwl3945_priv *priv) 96void iwl3945_disable_events(struct iwl_priv *priv)
97{ 97{
98 int ret; 98 int ret;
99 int i; 99 int i;
@@ -206,7 +206,7 @@ static int iwl3945_hwrate_to_plcp_idx(u8 plcp)
206 * IWL_ANTENNA_MAIN - Force MAIN antenna 206 * IWL_ANTENNA_MAIN - Force MAIN antenna
207 * IWL_ANTENNA_AUX - Force AUX antenna 207 * IWL_ANTENNA_AUX - Force AUX antenna
208 */ 208 */
209__le32 iwl3945_get_antenna_flags(const struct iwl3945_priv *priv) 209__le32 iwl3945_get_antenna_flags(const struct iwl_priv *priv)
210{ 210{
211 switch (priv->antenna) { 211 switch (priv->antenna) {
212 case IWL_ANTENNA_DIVERSITY: 212 case IWL_ANTENNA_DIVERSITY:
@@ -268,7 +268,7 @@ static inline const char *iwl3945_get_tx_fail_reason(u32 status)
268 * for A and B mode we need to overright prev 268 * for A and B mode we need to overright prev
269 * value 269 * value
270 */ 270 */
271int iwl3945_rs_next_rate(struct iwl3945_priv *priv, int rate) 271int iwl3945_rs_next_rate(struct iwl_priv *priv, int rate)
272{ 272{
273 int next_rate = iwl3945_get_prev_ieee_rate(rate); 273 int next_rate = iwl3945_get_prev_ieee_rate(rate);
274 274
@@ -302,7 +302,7 @@ int iwl3945_rs_next_rate(struct iwl3945_priv *priv, int rate)
302 * need to be reclaimed. As result, some free space forms. If there is 302 * need to be reclaimed. As result, some free space forms. If there is
303 * enough free space (> low mark), wake the stack that feeds us. 303 * enough free space (> low mark), wake the stack that feeds us.
304 */ 304 */
305static void iwl3945_tx_queue_reclaim(struct iwl3945_priv *priv, 305static void iwl3945_tx_queue_reclaim(struct iwl_priv *priv,
306 int txq_id, int index) 306 int txq_id, int index)
307{ 307{
308 struct iwl3945_tx_queue *txq = &priv->txq39[txq_id]; 308 struct iwl3945_tx_queue *txq = &priv->txq39[txq_id];
@@ -329,7 +329,7 @@ static void iwl3945_tx_queue_reclaim(struct iwl3945_priv *priv,
329/** 329/**
330 * iwl3945_rx_reply_tx - Handle Tx response 330 * iwl3945_rx_reply_tx - Handle Tx response
331 */ 331 */
332static void iwl3945_rx_reply_tx(struct iwl3945_priv *priv, 332static void iwl3945_rx_reply_tx(struct iwl_priv *priv,
333 struct iwl_rx_mem_buffer *rxb) 333 struct iwl_rx_mem_buffer *rxb)
334{ 334{
335 struct iwl_rx_packet *pkt = (void *)rxb->skb->data; 335 struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
@@ -389,7 +389,7 @@ static void iwl3945_rx_reply_tx(struct iwl3945_priv *priv,
389 * 389 *
390 *****************************************************************************/ 390 *****************************************************************************/
391 391
392void iwl3945_hw_rx_statistics(struct iwl3945_priv *priv, struct iwl_rx_mem_buffer *rxb) 392void iwl3945_hw_rx_statistics(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb)
393{ 393{
394 struct iwl_rx_packet *pkt = (void *)rxb->skb->data; 394 struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
395 IWL_DEBUG_RX("Statistics notification received (%d vs %d).\n", 395 IWL_DEBUG_RX("Statistics notification received (%d vs %d).\n",
@@ -417,7 +417,7 @@ void iwl3945_hw_rx_statistics(struct iwl3945_priv *priv, struct iwl_rx_mem_buffe
417 * including selective frame dumps. 417 * including selective frame dumps.
418 * group100 parameter selects whether to show 1 out of 100 good frames. 418 * group100 parameter selects whether to show 1 out of 100 good frames.
419 */ 419 */
420static void iwl3945_dbg_report_frame(struct iwl3945_priv *priv, 420static void iwl3945_dbg_report_frame(struct iwl_priv *priv,
421 struct iwl_rx_packet *pkt, 421 struct iwl_rx_packet *pkt,
422 struct ieee80211_hdr *header, int group100) 422 struct ieee80211_hdr *header, int group100)
423{ 423{
@@ -545,7 +545,7 @@ static void iwl3945_dbg_report_frame(struct iwl3945_priv *priv,
545 iwl_print_hex_dump(priv, IWL_DL_RX, data, length); 545 iwl_print_hex_dump(priv, IWL_DL_RX, data, length);
546} 546}
547#else 547#else
548static inline void iwl3945_dbg_report_frame(struct iwl3945_priv *priv, 548static inline void iwl3945_dbg_report_frame(struct iwl_priv *priv,
549 struct iwl_rx_packet *pkt, 549 struct iwl_rx_packet *pkt,
550 struct ieee80211_hdr *header, int group100) 550 struct ieee80211_hdr *header, int group100)
551{ 551{
@@ -553,7 +553,7 @@ static inline void iwl3945_dbg_report_frame(struct iwl3945_priv *priv,
553#endif 553#endif
554 554
555/* This is necessary only for a number of statistics, see the caller. */ 555/* This is necessary only for a number of statistics, see the caller. */
556static int iwl3945_is_network_packet(struct iwl3945_priv *priv, 556static int iwl3945_is_network_packet(struct iwl_priv *priv,
557 struct ieee80211_hdr *header) 557 struct ieee80211_hdr *header)
558{ 558{
559 /* Filter incoming packets to determine if they are targeted toward 559 /* Filter incoming packets to determine if they are targeted toward
@@ -570,7 +570,7 @@ static int iwl3945_is_network_packet(struct iwl3945_priv *priv,
570 } 570 }
571} 571}
572 572
573static void iwl3945_pass_packet_to_mac80211(struct iwl3945_priv *priv, 573static void iwl3945_pass_packet_to_mac80211(struct iwl_priv *priv,
574 struct iwl_rx_mem_buffer *rxb, 574 struct iwl_rx_mem_buffer *rxb,
575 struct ieee80211_rx_status *stats) 575 struct ieee80211_rx_status *stats)
576{ 576{
@@ -613,7 +613,7 @@ static void iwl3945_pass_packet_to_mac80211(struct iwl3945_priv *priv,
613 613
614#define IWL_DELAY_NEXT_SCAN_AFTER_ASSOC (HZ*6) 614#define IWL_DELAY_NEXT_SCAN_AFTER_ASSOC (HZ*6)
615 615
616static void iwl3945_rx_reply_rx(struct iwl3945_priv *priv, 616static void iwl3945_rx_reply_rx(struct iwl_priv *priv,
617 struct iwl_rx_mem_buffer *rxb) 617 struct iwl_rx_mem_buffer *rxb)
618{ 618{
619 struct ieee80211_hdr *header; 619 struct ieee80211_hdr *header;
@@ -723,7 +723,7 @@ static void iwl3945_rx_reply_rx(struct iwl3945_priv *priv,
723 iwl3945_pass_packet_to_mac80211(priv, rxb, &rx_status); 723 iwl3945_pass_packet_to_mac80211(priv, rxb, &rx_status);
724} 724}
725 725
726int iwl3945_hw_txq_attach_buf_to_tfd(struct iwl3945_priv *priv, void *ptr, 726int iwl3945_hw_txq_attach_buf_to_tfd(struct iwl_priv *priv, void *ptr,
727 dma_addr_t addr, u16 len) 727 dma_addr_t addr, u16 len)
728{ 728{
729 int count; 729 int count;
@@ -755,7 +755,7 @@ int iwl3945_hw_txq_attach_buf_to_tfd(struct iwl3945_priv *priv, void *ptr,
755 * 755 *
756 * Does NOT advance any indexes 756 * Does NOT advance any indexes
757 */ 757 */
758int iwl3945_hw_txq_free_tfd(struct iwl3945_priv *priv, struct iwl3945_tx_queue *txq) 758int iwl3945_hw_txq_free_tfd(struct iwl_priv *priv, struct iwl3945_tx_queue *txq)
759{ 759{
760 struct iwl3945_tfd_frame *bd_tmp = (struct iwl3945_tfd_frame *)&txq->bd[0]; 760 struct iwl3945_tfd_frame *bd_tmp = (struct iwl3945_tfd_frame *)&txq->bd[0];
761 struct iwl3945_tfd_frame *bd = &bd_tmp[txq->q.read_ptr]; 761 struct iwl3945_tfd_frame *bd = &bd_tmp[txq->q.read_ptr];
@@ -793,7 +793,7 @@ int iwl3945_hw_txq_free_tfd(struct iwl3945_priv *priv, struct iwl3945_tx_queue *
793 return 0; 793 return 0;
794} 794}
795 795
796u8 iwl3945_hw_find_station(struct iwl3945_priv *priv, const u8 *addr) 796u8 iwl3945_hw_find_station(struct iwl_priv *priv, const u8 *addr)
797{ 797{
798 int i, start = IWL_AP_ID; 798 int i, start = IWL_AP_ID;
799 int ret = IWL_INVALID_STATION; 799 int ret = IWL_INVALID_STATION;
@@ -826,7 +826,7 @@ u8 iwl3945_hw_find_station(struct iwl3945_priv *priv, const u8 *addr)
826 * iwl3945_hw_build_tx_cmd_rate - Add rate portion to TX_CMD: 826 * iwl3945_hw_build_tx_cmd_rate - Add rate portion to TX_CMD:
827 * 827 *
828*/ 828*/
829void iwl3945_hw_build_tx_cmd_rate(struct iwl3945_priv *priv, 829void iwl3945_hw_build_tx_cmd_rate(struct iwl_priv *priv,
830 struct iwl3945_cmd *cmd, 830 struct iwl3945_cmd *cmd,
831 struct ieee80211_tx_info *info, 831 struct ieee80211_tx_info *info,
832 struct ieee80211_hdr *hdr, int sta_id, int tx_id) 832 struct ieee80211_hdr *hdr, int sta_id, int tx_id)
@@ -896,7 +896,7 @@ void iwl3945_hw_build_tx_cmd_rate(struct iwl3945_priv *priv,
896 cmd->cmd.tx.supp_rates[1], cmd->cmd.tx.supp_rates[0]); 896 cmd->cmd.tx.supp_rates[1], cmd->cmd.tx.supp_rates[0]);
897} 897}
898 898
899u8 iwl3945_sync_sta(struct iwl3945_priv *priv, int sta_id, u16 tx_rate, u8 flags) 899u8 iwl3945_sync_sta(struct iwl_priv *priv, int sta_id, u16 tx_rate, u8 flags)
900{ 900{
901 unsigned long flags_spin; 901 unsigned long flags_spin;
902 struct iwl3945_station_entry *station; 902 struct iwl3945_station_entry *station;
@@ -919,7 +919,7 @@ u8 iwl3945_sync_sta(struct iwl3945_priv *priv, int sta_id, u16 tx_rate, u8 flags
919 return sta_id; 919 return sta_id;
920} 920}
921 921
922static int iwl3945_nic_set_pwr_src(struct iwl3945_priv *priv, int pwr_max) 922static int iwl3945_nic_set_pwr_src(struct iwl_priv *priv, int pwr_max)
923{ 923{
924 int rc; 924 int rc;
925 unsigned long flags; 925 unsigned long flags;
@@ -961,7 +961,7 @@ static int iwl3945_nic_set_pwr_src(struct iwl3945_priv *priv, int pwr_max)
961 return rc; 961 return rc;
962} 962}
963 963
964static int iwl3945_rx_init(struct iwl3945_priv *priv, struct iwl_rx_queue *rxq) 964static int iwl3945_rx_init(struct iwl_priv *priv, struct iwl_rx_queue *rxq)
965{ 965{
966 int rc; 966 int rc;
967 unsigned long flags; 967 unsigned long flags;
@@ -997,7 +997,7 @@ static int iwl3945_rx_init(struct iwl3945_priv *priv, struct iwl_rx_queue *rxq)
997 return 0; 997 return 0;
998} 998}
999 999
1000static int iwl3945_tx_reset(struct iwl3945_priv *priv) 1000static int iwl3945_tx_reset(struct iwl_priv *priv)
1001{ 1001{
1002 int rc; 1002 int rc;
1003 unsigned long flags; 1003 unsigned long flags;
@@ -1046,7 +1046,7 @@ static int iwl3945_tx_reset(struct iwl3945_priv *priv)
1046 * 1046 *
1047 * Destroys all DMA structures and initialize them again 1047 * Destroys all DMA structures and initialize them again
1048 */ 1048 */
1049static int iwl3945_txq_ctx_reset(struct iwl3945_priv *priv) 1049static int iwl3945_txq_ctx_reset(struct iwl_priv *priv)
1050{ 1050{
1051 int rc; 1051 int rc;
1052 int txq_id, slots_num; 1052 int txq_id, slots_num;
@@ -1077,7 +1077,7 @@ static int iwl3945_txq_ctx_reset(struct iwl3945_priv *priv)
1077 return rc; 1077 return rc;
1078} 1078}
1079 1079
1080int iwl3945_hw_nic_init(struct iwl3945_priv *priv) 1080int iwl3945_hw_nic_init(struct iwl_priv *priv)
1081{ 1081{
1082 u8 rev_id; 1082 u8 rev_id;
1083 int rc; 1083 int rc;
@@ -1218,7 +1218,7 @@ int iwl3945_hw_nic_init(struct iwl3945_priv *priv)
1218 * 1218 *
1219 * Destroy all TX DMA queues and structures 1219 * Destroy all TX DMA queues and structures
1220 */ 1220 */
1221void iwl3945_hw_txq_ctx_free(struct iwl3945_priv *priv) 1221void iwl3945_hw_txq_ctx_free(struct iwl_priv *priv)
1222{ 1222{
1223 int txq_id; 1223 int txq_id;
1224 1224
@@ -1227,7 +1227,7 @@ void iwl3945_hw_txq_ctx_free(struct iwl3945_priv *priv)
1227 iwl3945_tx_queue_free(priv, &priv->txq39[txq_id]); 1227 iwl3945_tx_queue_free(priv, &priv->txq39[txq_id]);
1228} 1228}
1229 1229
1230void iwl3945_hw_txq_ctx_stop(struct iwl3945_priv *priv) 1230void iwl3945_hw_txq_ctx_stop(struct iwl_priv *priv)
1231{ 1231{
1232 int txq_id; 1232 int txq_id;
1233 unsigned long flags; 1233 unsigned long flags;
@@ -1256,7 +1256,7 @@ void iwl3945_hw_txq_ctx_stop(struct iwl3945_priv *priv)
1256 iwl3945_hw_txq_ctx_free(priv); 1256 iwl3945_hw_txq_ctx_free(priv);
1257} 1257}
1258 1258
1259int iwl3945_hw_nic_stop_master(struct iwl3945_priv *priv) 1259int iwl3945_hw_nic_stop_master(struct iwl_priv *priv)
1260{ 1260{
1261 int rc = 0; 1261 int rc = 0;
1262 u32 reg_val; 1262 u32 reg_val;
@@ -1288,7 +1288,7 @@ int iwl3945_hw_nic_stop_master(struct iwl3945_priv *priv)
1288 return rc; 1288 return rc;
1289} 1289}
1290 1290
1291int iwl3945_hw_nic_reset(struct iwl3945_priv *priv) 1291int iwl3945_hw_nic_reset(struct iwl_priv *priv)
1292{ 1292{
1293 int rc; 1293 int rc;
1294 unsigned long flags; 1294 unsigned long flags;
@@ -1356,7 +1356,7 @@ static inline int iwl3945_hw_reg_temp_out_of_range(int temperature)
1356 return ((temperature < -260) || (temperature > 25)) ? 1 : 0; 1356 return ((temperature < -260) || (temperature > 25)) ? 1 : 0;
1357} 1357}
1358 1358
1359int iwl3945_hw_get_temperature(struct iwl3945_priv *priv) 1359int iwl3945_hw_get_temperature(struct iwl_priv *priv)
1360{ 1360{
1361 return iwl3945_read32(priv, CSR_UCODE_DRV_GP2); 1361 return iwl3945_read32(priv, CSR_UCODE_DRV_GP2);
1362} 1362}
@@ -1365,7 +1365,7 @@ int iwl3945_hw_get_temperature(struct iwl3945_priv *priv)
1365 * iwl3945_hw_reg_txpower_get_temperature 1365 * iwl3945_hw_reg_txpower_get_temperature
1366 * get the current temperature by reading from NIC 1366 * get the current temperature by reading from NIC
1367*/ 1367*/
1368static int iwl3945_hw_reg_txpower_get_temperature(struct iwl3945_priv *priv) 1368static int iwl3945_hw_reg_txpower_get_temperature(struct iwl_priv *priv)
1369{ 1369{
1370 int temperature; 1370 int temperature;
1371 1371
@@ -1401,7 +1401,7 @@ static int iwl3945_hw_reg_txpower_get_temperature(struct iwl3945_priv *priv)
1401 * records new temperature in tx_mgr->temperature. 1401 * records new temperature in tx_mgr->temperature.
1402 * replaces tx_mgr->last_temperature *only* if calib needed 1402 * replaces tx_mgr->last_temperature *only* if calib needed
1403 * (assumes caller will actually do the calibration!). */ 1403 * (assumes caller will actually do the calibration!). */
1404static int is_temp_calib_needed(struct iwl3945_priv *priv) 1404static int is_temp_calib_needed(struct iwl_priv *priv)
1405{ 1405{
1406 int temp_diff; 1406 int temp_diff;
1407 1407
@@ -1616,7 +1616,7 @@ static inline u8 iwl3945_hw_reg_fix_power_index(int index)
1616 * Set (in our channel info database) the direct scan Tx power for 1 Mbit (CCK) 1616 * Set (in our channel info database) the direct scan Tx power for 1 Mbit (CCK)
1617 * or 6 Mbit (OFDM) rates. 1617 * or 6 Mbit (OFDM) rates.
1618 */ 1618 */
1619static void iwl3945_hw_reg_set_scan_power(struct iwl3945_priv *priv, u32 scan_tbl_index, 1619static void iwl3945_hw_reg_set_scan_power(struct iwl_priv *priv, u32 scan_tbl_index,
1620 s32 rate_index, const s8 *clip_pwrs, 1620 s32 rate_index, const s8 *clip_pwrs,
1621 struct iwl_channel_info *ch_info, 1621 struct iwl_channel_info *ch_info,
1622 int band_index) 1622 int band_index)
@@ -1672,7 +1672,7 @@ static void iwl3945_hw_reg_set_scan_power(struct iwl3945_priv *priv, u32 scan_tb
1672 * Configures power settings for all rates for the current channel, 1672 * Configures power settings for all rates for the current channel,
1673 * using values from channel info struct, and send to NIC 1673 * using values from channel info struct, and send to NIC
1674 */ 1674 */
1675int iwl3945_hw_reg_send_txpower(struct iwl3945_priv *priv) 1675int iwl3945_hw_reg_send_txpower(struct iwl_priv *priv)
1676{ 1676{
1677 int rate_idx, i; 1677 int rate_idx, i;
1678 const struct iwl_channel_info *ch_info = NULL; 1678 const struct iwl_channel_info *ch_info = NULL;
@@ -1747,7 +1747,7 @@ int iwl3945_hw_reg_send_txpower(struct iwl3945_priv *priv)
1747 * properly fill out the scan powers, and actual h/w gain settings, 1747 * properly fill out the scan powers, and actual h/w gain settings,
1748 * and send changes to NIC 1748 * and send changes to NIC
1749 */ 1749 */
1750static int iwl3945_hw_reg_set_new_power(struct iwl3945_priv *priv, 1750static int iwl3945_hw_reg_set_new_power(struct iwl_priv *priv,
1751 struct iwl_channel_info *ch_info) 1751 struct iwl_channel_info *ch_info)
1752{ 1752{
1753 struct iwl3945_channel_power_info *power_info; 1753 struct iwl3945_channel_power_info *power_info;
@@ -1838,7 +1838,7 @@ static int iwl3945_hw_reg_get_ch_txpower_limit(struct iwl_channel_info *ch_info)
1838 * 1838 *
1839 * If RxOn is "associated", this sends the new Txpower to NIC! 1839 * If RxOn is "associated", this sends the new Txpower to NIC!
1840 */ 1840 */
1841static int iwl3945_hw_reg_comp_txpower_temp(struct iwl3945_priv *priv) 1841static int iwl3945_hw_reg_comp_txpower_temp(struct iwl_priv *priv)
1842{ 1842{
1843 struct iwl_channel_info *ch_info = NULL; 1843 struct iwl_channel_info *ch_info = NULL;
1844 int delta_index; 1844 int delta_index;
@@ -1899,7 +1899,7 @@ static int iwl3945_hw_reg_comp_txpower_temp(struct iwl3945_priv *priv)
1899 return iwl3945_hw_reg_send_txpower(priv); 1899 return iwl3945_hw_reg_send_txpower(priv);
1900} 1900}
1901 1901
1902int iwl3945_hw_reg_set_txpower(struct iwl3945_priv *priv, s8 power) 1902int iwl3945_hw_reg_set_txpower(struct iwl_priv *priv, s8 power)
1903{ 1903{
1904 struct iwl_channel_info *ch_info; 1904 struct iwl_channel_info *ch_info;
1905 s8 max_power; 1905 s8 max_power;
@@ -1942,7 +1942,7 @@ int iwl3945_hw_reg_set_txpower(struct iwl3945_priv *priv, s8 power)
1942} 1942}
1943 1943
1944/* will add 3945 channel switch cmd handling later */ 1944/* will add 3945 channel switch cmd handling later */
1945int iwl3945_hw_channel_switch(struct iwl3945_priv *priv, u16 channel) 1945int iwl3945_hw_channel_switch(struct iwl_priv *priv, u16 channel)
1946{ 1946{
1947 return 0; 1947 return 0;
1948} 1948}
@@ -1957,7 +1957,7 @@ int iwl3945_hw_channel_switch(struct iwl3945_priv *priv, u16 channel)
1957 * -- send new set of gain settings to NIC 1957 * -- send new set of gain settings to NIC
1958 * NOTE: This should continue working, even when we're not associated, 1958 * NOTE: This should continue working, even when we're not associated,
1959 * so we can keep our internal table of scan powers current. */ 1959 * so we can keep our internal table of scan powers current. */
1960void iwl3945_reg_txpower_periodic(struct iwl3945_priv *priv) 1960void iwl3945_reg_txpower_periodic(struct iwl_priv *priv)
1961{ 1961{
1962 /* This will kick in the "brute force" 1962 /* This will kick in the "brute force"
1963 * iwl3945_hw_reg_comp_txpower_temp() below */ 1963 * iwl3945_hw_reg_comp_txpower_temp() below */
@@ -1976,7 +1976,7 @@ void iwl3945_reg_txpower_periodic(struct iwl3945_priv *priv)
1976 1976
1977static void iwl3945_bg_reg_txpower_periodic(struct work_struct *work) 1977static void iwl3945_bg_reg_txpower_periodic(struct work_struct *work)
1978{ 1978{
1979 struct iwl3945_priv *priv = container_of(work, struct iwl3945_priv, 1979 struct iwl_priv *priv = container_of(work, struct iwl_priv,
1980 thermal_periodic.work); 1980 thermal_periodic.work);
1981 1981
1982 if (test_bit(STATUS_EXIT_PENDING, &priv->status)) 1982 if (test_bit(STATUS_EXIT_PENDING, &priv->status))
@@ -1998,7 +1998,7 @@ static void iwl3945_bg_reg_txpower_periodic(struct work_struct *work)
1998 * on A-band, EEPROM's "group frequency" entries represent the top 1998 * on A-band, EEPROM's "group frequency" entries represent the top
1999 * channel in each group 1-4. Group 5 All B/G channels are in group 0. 1999 * channel in each group 1-4. Group 5 All B/G channels are in group 0.
2000 */ 2000 */
2001static u16 iwl3945_hw_reg_get_ch_grp_index(struct iwl3945_priv *priv, 2001static u16 iwl3945_hw_reg_get_ch_grp_index(struct iwl_priv *priv,
2002 const struct iwl_channel_info *ch_info) 2002 const struct iwl_channel_info *ch_info)
2003{ 2003{
2004 struct iwl3945_eeprom_txpower_group *ch_grp = &priv->eeprom39.groups[0]; 2004 struct iwl3945_eeprom_txpower_group *ch_grp = &priv->eeprom39.groups[0];
@@ -2032,7 +2032,7 @@ static u16 iwl3945_hw_reg_get_ch_grp_index(struct iwl3945_priv *priv,
2032 * Interpolate to get nominal (i.e. at factory calibration temperature) index 2032 * Interpolate to get nominal (i.e. at factory calibration temperature) index
2033 * into radio/DSP gain settings table for requested power. 2033 * into radio/DSP gain settings table for requested power.
2034 */ 2034 */
2035static int iwl3945_hw_reg_get_matched_power_index(struct iwl3945_priv *priv, 2035static int iwl3945_hw_reg_get_matched_power_index(struct iwl_priv *priv,
2036 s8 requested_power, 2036 s8 requested_power,
2037 s32 setting_index, s32 *new_index) 2037 s32 setting_index, s32 *new_index)
2038{ 2038{
@@ -2080,7 +2080,7 @@ static int iwl3945_hw_reg_get_matched_power_index(struct iwl3945_priv *priv,
2080 return 0; 2080 return 0;
2081} 2081}
2082 2082
2083static void iwl3945_hw_reg_init_channel_groups(struct iwl3945_priv *priv) 2083static void iwl3945_hw_reg_init_channel_groups(struct iwl_priv *priv)
2084{ 2084{
2085 u32 i; 2085 u32 i;
2086 s32 rate_index; 2086 s32 rate_index;
@@ -2160,7 +2160,7 @@ static void iwl3945_hw_reg_init_channel_groups(struct iwl3945_priv *priv)
2160 * 2160 *
2161 * This does *not* write values to NIC, just sets up our internal table. 2161 * This does *not* write values to NIC, just sets up our internal table.
2162 */ 2162 */
2163int iwl3945_txpower_set_from_eeprom(struct iwl3945_priv *priv) 2163int iwl3945_txpower_set_from_eeprom(struct iwl_priv *priv)
2164{ 2164{
2165 struct iwl_channel_info *ch_info = NULL; 2165 struct iwl_channel_info *ch_info = NULL;
2166 struct iwl3945_channel_power_info *pwr_info; 2166 struct iwl3945_channel_power_info *pwr_info;
@@ -2284,7 +2284,7 @@ int iwl3945_txpower_set_from_eeprom(struct iwl3945_priv *priv)
2284 return 0; 2284 return 0;
2285} 2285}
2286 2286
2287int iwl3945_hw_rxq_stop(struct iwl3945_priv *priv) 2287int iwl3945_hw_rxq_stop(struct iwl_priv *priv)
2288{ 2288{
2289 int rc; 2289 int rc;
2290 unsigned long flags; 2290 unsigned long flags;
@@ -2308,7 +2308,7 @@ int iwl3945_hw_rxq_stop(struct iwl3945_priv *priv)
2308 return 0; 2308 return 0;
2309} 2309}
2310 2310
2311int iwl3945_hw_tx_queue_init(struct iwl3945_priv *priv, struct iwl3945_tx_queue *txq) 2311int iwl3945_hw_tx_queue_init(struct iwl_priv *priv, struct iwl3945_tx_queue *txq)
2312{ 2312{
2313 int rc; 2313 int rc;
2314 unsigned long flags; 2314 unsigned long flags;
@@ -2342,7 +2342,7 @@ int iwl3945_hw_tx_queue_init(struct iwl3945_priv *priv, struct iwl3945_tx_queue
2342 return 0; 2342 return 0;
2343} 2343}
2344 2344
2345int iwl3945_hw_get_rx_read(struct iwl3945_priv *priv) 2345int iwl3945_hw_get_rx_read(struct iwl_priv *priv)
2346{ 2346{
2347 struct iwl3945_shared *shared_data = priv->shared_virt; 2347 struct iwl3945_shared *shared_data = priv->shared_virt;
2348 2348
@@ -2352,7 +2352,7 @@ int iwl3945_hw_get_rx_read(struct iwl3945_priv *priv)
2352/** 2352/**
2353 * iwl3945_init_hw_rate_table - Initialize the hardware rate fallback table 2353 * iwl3945_init_hw_rate_table - Initialize the hardware rate fallback table
2354 */ 2354 */
2355int iwl3945_init_hw_rate_table(struct iwl3945_priv *priv) 2355int iwl3945_init_hw_rate_table(struct iwl_priv *priv)
2356{ 2356{
2357 int rc, i, index, prev_index; 2357 int rc, i, index, prev_index;
2358 struct iwl3945_rate_scaling_cmd rate_cmd = { 2358 struct iwl3945_rate_scaling_cmd rate_cmd = {
@@ -2429,7 +2429,7 @@ int iwl3945_init_hw_rate_table(struct iwl3945_priv *priv)
2429} 2429}
2430 2430
2431/* Called when initializing driver */ 2431/* Called when initializing driver */
2432int iwl3945_hw_set_hw_params(struct iwl3945_priv *priv) 2432int iwl3945_hw_set_hw_params(struct iwl_priv *priv)
2433{ 2433{
2434 memset((void *)&priv->hw_params, 0, 2434 memset((void *)&priv->hw_params, 0,
2435 sizeof(struct iwl_hw_params)); 2435 sizeof(struct iwl_hw_params));
@@ -2456,7 +2456,7 @@ int iwl3945_hw_set_hw_params(struct iwl3945_priv *priv)
2456 return 0; 2456 return 0;
2457} 2457}
2458 2458
2459unsigned int iwl3945_hw_get_beacon_cmd(struct iwl3945_priv *priv, 2459unsigned int iwl3945_hw_get_beacon_cmd(struct iwl_priv *priv,
2460 struct iwl3945_frame *frame, u8 rate) 2460 struct iwl3945_frame *frame, u8 rate)
2461{ 2461{
2462 struct iwl3945_tx_beacon_cmd *tx_beacon_cmd; 2462 struct iwl3945_tx_beacon_cmd *tx_beacon_cmd;
@@ -2489,19 +2489,19 @@ unsigned int iwl3945_hw_get_beacon_cmd(struct iwl3945_priv *priv,
2489 return sizeof(struct iwl3945_tx_beacon_cmd) + frame_size; 2489 return sizeof(struct iwl3945_tx_beacon_cmd) + frame_size;
2490} 2490}
2491 2491
2492void iwl3945_hw_rx_handler_setup(struct iwl3945_priv *priv) 2492void iwl3945_hw_rx_handler_setup(struct iwl_priv *priv)
2493{ 2493{
2494 priv->rx_handlers[REPLY_TX] = iwl3945_rx_reply_tx; 2494 priv->rx_handlers[REPLY_TX] = iwl3945_rx_reply_tx;
2495 priv->rx_handlers[REPLY_3945_RX] = iwl3945_rx_reply_rx; 2495 priv->rx_handlers[REPLY_3945_RX] = iwl3945_rx_reply_rx;
2496} 2496}
2497 2497
2498void iwl3945_hw_setup_deferred_work(struct iwl3945_priv *priv) 2498void iwl3945_hw_setup_deferred_work(struct iwl_priv *priv)
2499{ 2499{
2500 INIT_DELAYED_WORK(&priv->thermal_periodic, 2500 INIT_DELAYED_WORK(&priv->thermal_periodic,
2501 iwl3945_bg_reg_txpower_periodic); 2501 iwl3945_bg_reg_txpower_periodic);
2502} 2502}
2503 2503
2504void iwl3945_hw_cancel_deferred_work(struct iwl3945_priv *priv) 2504void iwl3945_hw_cancel_deferred_work(struct iwl_priv *priv)
2505{ 2505{
2506 cancel_delayed_work(&priv->thermal_periodic); 2506 cancel_delayed_work(&priv->thermal_periodic);
2507} 2507}
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.h b/drivers/net/wireless/iwlwifi/iwl-3945.h
index 788cd9cc4b13..098ac768ee26 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945.h
+++ b/drivers/net/wireless/iwlwifi/iwl-3945.h
@@ -148,13 +148,13 @@ struct iwl3945_frame {
148#define MAX_SN ((IEEE80211_SCTL_SEQ) >> 4) 148#define MAX_SN ((IEEE80211_SCTL_SEQ) >> 4)
149 149
150struct iwl3945_cmd; 150struct iwl3945_cmd;
151struct iwl3945_priv; 151struct iwl_priv;
152 152
153struct iwl3945_cmd_meta { 153struct iwl3945_cmd_meta {
154 struct iwl3945_cmd_meta *source; 154 struct iwl3945_cmd_meta *source;
155 union { 155 union {
156 struct sk_buff *skb; 156 struct sk_buff *skb;
157 int (*callback)(struct iwl3945_priv *priv, 157 int (*callback)(struct iwl_priv *priv,
158 struct iwl3945_cmd *cmd, struct sk_buff *skb); 158 struct iwl3945_cmd *cmd, struct sk_buff *skb);
159 } __attribute__ ((packed)) u; 159 } __attribute__ ((packed)) u;
160 160
@@ -270,31 +270,31 @@ struct iwl3945_ibss_seq {
270 * 270 *
271 *****************************************************************************/ 271 *****************************************************************************/
272struct iwl3945_addsta_cmd; 272struct iwl3945_addsta_cmd;
273extern int iwl3945_send_add_station(struct iwl3945_priv *priv, 273extern int iwl3945_send_add_station(struct iwl_priv *priv,
274 struct iwl3945_addsta_cmd *sta, u8 flags); 274 struct iwl3945_addsta_cmd *sta, u8 flags);
275extern u8 iwl3945_add_station(struct iwl3945_priv *priv, const u8 *bssid, 275extern u8 iwl3945_add_station(struct iwl_priv *priv, const u8 *bssid,
276 int is_ap, u8 flags); 276 int is_ap, u8 flags);
277extern int iwl3945_power_init_handle(struct iwl3945_priv *priv); 277extern int iwl3945_power_init_handle(struct iwl_priv *priv);
278extern int iwl3945_eeprom_init(struct iwl3945_priv *priv); 278extern int iwl3945_eeprom_init(struct iwl_priv *priv);
279extern int iwl3945_rx_queue_alloc(struct iwl3945_priv *priv); 279extern int iwl3945_rx_queue_alloc(struct iwl_priv *priv);
280extern void iwl3945_rx_queue_reset(struct iwl3945_priv *priv, 280extern void iwl3945_rx_queue_reset(struct iwl_priv *priv,
281 struct iwl_rx_queue *rxq); 281 struct iwl_rx_queue *rxq);
282extern int iwl3945_calc_db_from_ratio(int sig_ratio); 282extern int iwl3945_calc_db_from_ratio(int sig_ratio);
283extern int iwl3945_calc_sig_qual(int rssi_dbm, int noise_dbm); 283extern int iwl3945_calc_sig_qual(int rssi_dbm, int noise_dbm);
284extern int iwl3945_tx_queue_init(struct iwl3945_priv *priv, 284extern int iwl3945_tx_queue_init(struct iwl_priv *priv,
285 struct iwl3945_tx_queue *txq, int count, u32 id); 285 struct iwl3945_tx_queue *txq, int count, u32 id);
286extern void iwl3945_rx_replenish(void *data); 286extern void iwl3945_rx_replenish(void *data);
287extern void iwl3945_tx_queue_free(struct iwl3945_priv *priv, struct iwl3945_tx_queue *txq); 287extern void iwl3945_tx_queue_free(struct iwl_priv *priv, struct iwl3945_tx_queue *txq);
288extern int iwl3945_send_cmd_pdu(struct iwl3945_priv *priv, u8 id, u16 len, 288extern int iwl3945_send_cmd_pdu(struct iwl_priv *priv, u8 id, u16 len,
289 const void *data); 289 const void *data);
290extern int __must_check iwl3945_send_cmd(struct iwl3945_priv *priv, 290extern int __must_check iwl3945_send_cmd(struct iwl_priv *priv,
291 struct iwl3945_host_cmd *cmd); 291 struct iwl3945_host_cmd *cmd);
292extern unsigned int iwl3945_fill_beacon_frame(struct iwl3945_priv *priv, 292extern unsigned int iwl3945_fill_beacon_frame(struct iwl_priv *priv,
293 struct ieee80211_hdr *hdr,int left); 293 struct ieee80211_hdr *hdr,int left);
294extern int iwl3945_rx_queue_update_write_ptr(struct iwl3945_priv *priv, 294extern int iwl3945_rx_queue_update_write_ptr(struct iwl_priv *priv,
295 struct iwl_rx_queue *q); 295 struct iwl_rx_queue *q);
296extern int iwl3945_send_statistics_request(struct iwl3945_priv *priv); 296extern int iwl3945_send_statistics_request(struct iwl_priv *priv);
297extern void iwl3945_set_decrypted_flag(struct iwl3945_priv *priv, struct sk_buff *skb, 297extern void iwl3945_set_decrypted_flag(struct iwl_priv *priv, struct sk_buff *skb,
298 u32 decrypt_res, 298 u32 decrypt_res,
299 struct ieee80211_rx_status *stats); 299 struct ieee80211_rx_status *stats);
300 300
@@ -302,7 +302,7 @@ extern void iwl3945_set_decrypted_flag(struct iwl3945_priv *priv, struct sk_buff
302 * Currently used by iwl-3945-rs... look at restructuring so that it doesn't 302 * Currently used by iwl-3945-rs... look at restructuring so that it doesn't
303 * call this... todo... fix that. 303 * call this... todo... fix that.
304*/ 304*/
305extern u8 iwl3945_sync_station(struct iwl3945_priv *priv, int sta_id, 305extern u8 iwl3945_sync_station(struct iwl_priv *priv, int sta_id,
306 u16 tx_rate, u8 flags); 306 u16 tx_rate, u8 flags);
307 307
308/****************************************************************************** 308/******************************************************************************
@@ -321,36 +321,36 @@ extern u8 iwl3945_sync_station(struct iwl3945_priv *priv, int sta_id,
321 * iwl3945_mac_ <-- mac80211 callback 321 * iwl3945_mac_ <-- mac80211 callback
322 * 322 *
323 ****************************************************************************/ 323 ****************************************************************************/
324extern void iwl3945_hw_rx_handler_setup(struct iwl3945_priv *priv); 324extern void iwl3945_hw_rx_handler_setup(struct iwl_priv *priv);
325extern void iwl3945_hw_setup_deferred_work(struct iwl3945_priv *priv); 325extern void iwl3945_hw_setup_deferred_work(struct iwl_priv *priv);
326extern void iwl3945_hw_cancel_deferred_work(struct iwl3945_priv *priv); 326extern void iwl3945_hw_cancel_deferred_work(struct iwl_priv *priv);
327extern int iwl3945_hw_rxq_stop(struct iwl3945_priv *priv); 327extern int iwl3945_hw_rxq_stop(struct iwl_priv *priv);
328extern int iwl3945_hw_set_hw_params(struct iwl3945_priv *priv); 328extern int iwl3945_hw_set_hw_params(struct iwl_priv *priv);
329extern int iwl3945_hw_nic_init(struct iwl3945_priv *priv); 329extern int iwl3945_hw_nic_init(struct iwl_priv *priv);
330extern int iwl3945_hw_nic_stop_master(struct iwl3945_priv *priv); 330extern int iwl3945_hw_nic_stop_master(struct iwl_priv *priv);
331extern void iwl3945_hw_txq_ctx_free(struct iwl3945_priv *priv); 331extern void iwl3945_hw_txq_ctx_free(struct iwl_priv *priv);
332extern void iwl3945_hw_txq_ctx_stop(struct iwl3945_priv *priv); 332extern void iwl3945_hw_txq_ctx_stop(struct iwl_priv *priv);
333extern int iwl3945_hw_nic_reset(struct iwl3945_priv *priv); 333extern int iwl3945_hw_nic_reset(struct iwl_priv *priv);
334extern int iwl3945_hw_txq_attach_buf_to_tfd(struct iwl3945_priv *priv, void *tfd, 334extern int iwl3945_hw_txq_attach_buf_to_tfd(struct iwl_priv *priv, void *tfd,
335 dma_addr_t addr, u16 len); 335 dma_addr_t addr, u16 len);
336extern int iwl3945_hw_txq_free_tfd(struct iwl3945_priv *priv, struct iwl3945_tx_queue *txq); 336extern int iwl3945_hw_txq_free_tfd(struct iwl_priv *priv, struct iwl3945_tx_queue *txq);
337extern int iwl3945_hw_get_temperature(struct iwl3945_priv *priv); 337extern int iwl3945_hw_get_temperature(struct iwl_priv *priv);
338extern int iwl3945_hw_tx_queue_init(struct iwl3945_priv *priv, 338extern int iwl3945_hw_tx_queue_init(struct iwl_priv *priv,
339 struct iwl3945_tx_queue *txq); 339 struct iwl3945_tx_queue *txq);
340extern unsigned int iwl3945_hw_get_beacon_cmd(struct iwl3945_priv *priv, 340extern unsigned int iwl3945_hw_get_beacon_cmd(struct iwl_priv *priv,
341 struct iwl3945_frame *frame, u8 rate); 341 struct iwl3945_frame *frame, u8 rate);
342extern int iwl3945_hw_get_rx_read(struct iwl3945_priv *priv); 342extern int iwl3945_hw_get_rx_read(struct iwl_priv *priv);
343extern void iwl3945_hw_build_tx_cmd_rate(struct iwl3945_priv *priv, 343extern void iwl3945_hw_build_tx_cmd_rate(struct iwl_priv *priv,
344 struct iwl3945_cmd *cmd, 344 struct iwl3945_cmd *cmd,
345 struct ieee80211_tx_info *info, 345 struct ieee80211_tx_info *info,
346 struct ieee80211_hdr *hdr, 346 struct ieee80211_hdr *hdr,
347 int sta_id, int tx_id); 347 int sta_id, int tx_id);
348extern int iwl3945_hw_reg_send_txpower(struct iwl3945_priv *priv); 348extern int iwl3945_hw_reg_send_txpower(struct iwl_priv *priv);
349extern int iwl3945_hw_reg_set_txpower(struct iwl3945_priv *priv, s8 power); 349extern int iwl3945_hw_reg_set_txpower(struct iwl_priv *priv, s8 power);
350extern void iwl3945_hw_rx_statistics(struct iwl3945_priv *priv, 350extern void iwl3945_hw_rx_statistics(struct iwl_priv *priv,
351 struct iwl_rx_mem_buffer *rxb); 351 struct iwl_rx_mem_buffer *rxb);
352extern void iwl3945_disable_events(struct iwl3945_priv *priv); 352extern void iwl3945_disable_events(struct iwl_priv *priv);
353extern int iwl4965_get_temperature(const struct iwl3945_priv *priv); 353extern int iwl4965_get_temperature(const struct iwl_priv *priv);
354 354
355/** 355/**
356 * iwl3945_hw_find_station - Find station id for a given BSSID 356 * iwl3945_hw_find_station - Find station id for a given BSSID
@@ -360,262 +360,43 @@ extern int iwl4965_get_temperature(const struct iwl3945_priv *priv);
360 * not yet been merged into a single common layer for managing the 360 * not yet been merged into a single common layer for managing the
361 * station tables. 361 * station tables.
362 */ 362 */
363extern u8 iwl3945_hw_find_station(struct iwl3945_priv *priv, const u8 *bssid); 363extern u8 iwl3945_hw_find_station(struct iwl_priv *priv, const u8 *bssid);
364 364
365extern int iwl3945_hw_channel_switch(struct iwl3945_priv *priv, u16 channel); 365extern int iwl3945_hw_channel_switch(struct iwl_priv *priv, u16 channel);
366 366
367/* 367/*
368 * Forward declare iwl-3945.c functions for iwl-base.c 368 * Forward declare iwl-3945.c functions for iwl-base.c
369 */ 369 */
370extern __le32 iwl3945_get_antenna_flags(const struct iwl3945_priv *priv); 370extern __le32 iwl3945_get_antenna_flags(const struct iwl_priv *priv);
371extern int iwl3945_init_hw_rate_table(struct iwl3945_priv *priv); 371extern int iwl3945_init_hw_rate_table(struct iwl_priv *priv);
372extern void iwl3945_reg_txpower_periodic(struct iwl3945_priv *priv); 372extern void iwl3945_reg_txpower_periodic(struct iwl_priv *priv);
373extern int iwl3945_txpower_set_from_eeprom(struct iwl3945_priv *priv); 373extern int iwl3945_txpower_set_from_eeprom(struct iwl_priv *priv);
374extern u8 iwl3945_sync_sta(struct iwl3945_priv *priv, int sta_id, 374extern u8 iwl3945_sync_sta(struct iwl_priv *priv, int sta_id,
375 u16 tx_rate, u8 flags); 375 u16 tx_rate, u8 flags);
376 376
377#ifdef CONFIG_IWL3945_RFKILL 377#ifdef CONFIG_IWL3945_RFKILL
378struct iwl3945_priv; 378struct iwl_priv;
379 379
380void iwl3945_rfkill_set_hw_state(struct iwl3945_priv *priv); 380void iwl3945_rfkill_set_hw_state(struct iwl_priv *priv);
381void iwl3945_rfkill_unregister(struct iwl3945_priv *priv); 381void iwl3945_rfkill_unregister(struct iwl_priv *priv);
382int iwl3945_rfkill_init(struct iwl3945_priv *priv); 382int iwl3945_rfkill_init(struct iwl_priv *priv);
383#else 383#else
384static inline void iwl3945_rfkill_set_hw_state(struct iwl3945_priv *priv) {} 384static inline void iwl3945_rfkill_set_hw_state(struct iwl_priv *priv) {}
385static inline void iwl3945_rfkill_unregister(struct iwl3945_priv *priv) {} 385static inline void iwl3945_rfkill_unregister(struct iwl_priv *priv) {}
386static inline int iwl3945_rfkill_init(struct iwl3945_priv *priv) { return 0; } 386static inline int iwl3945_rfkill_init(struct iwl_priv *priv) { return 0; }
387#endif 387#endif
388 388
389 389static inline int iwl3945_is_associated(struct iwl_priv *priv)
390struct iwl3945_priv {
391
392 /* ieee device used by generic ieee processing code */
393 struct ieee80211_hw *hw;
394 struct ieee80211_channel *ieee_channels;
395 struct ieee80211_rate *ieee_rates;
396 struct iwl_cfg *cfg; /* device configuration */
397
398 /* temporary frame storage list */
399 struct list_head free_frames;
400 int frames_count;
401
402 enum ieee80211_band band;
403 int alloc_rxb_skb;
404
405 void (*rx_handlers[REPLY_MAX])(struct iwl3945_priv *priv,
406 struct iwl_rx_mem_buffer *rxb);
407
408 struct ieee80211_supported_band bands[IEEE80211_NUM_BANDS];
409
410#ifdef CONFIG_IWL3945_SPECTRUM_MEASUREMENT
411 /* spectrum measurement report caching */
412 struct iwl_spectrum_notification measure_report;
413 u8 measurement_status;
414#endif
415 /* ucode beacon time */
416 u32 ucode_beacon_time;
417
418 /* we allocate array of iwl3945_channel_info for NIC's valid channels.
419 * Access via channel # using indirect index array */
420 struct iwl_channel_info *channel_info; /* channel info array */
421 u8 channel_count; /* # of channels */
422
423 /* each calibration channel group in the EEPROM has a derived
424 * clip setting for each rate. */
425 const struct iwl3945_clip_group clip39_groups[5];
426
427 /* thermal calibration */
428 s32 temperature; /* degrees Kelvin */
429 s32 last_temperature;
430
431 /* Scan related variables */
432 unsigned long last_scan_jiffies;
433 unsigned long next_scan_jiffies;
434 unsigned long scan_start;
435 unsigned long scan_pass_start;
436 unsigned long scan_start_tsf;
437 int scan_bands;
438 int one_direct_scan;
439 u8 direct_ssid_len;
440 u8 direct_ssid[IW_ESSID_MAX_SIZE];
441 struct iwl3945_scan_cmd *scan39;
442
443 /* spinlock */
444 spinlock_t lock; /* protect general shared data */
445 spinlock_t hcmd_lock; /* protect hcmd */
446 struct mutex mutex;
447
448 /* basic pci-network driver stuff */
449 struct pci_dev *pci_dev;
450
451 /* pci hardware address support */
452 void __iomem *hw_base;
453
454 /* uCode images, save to reload in case of failure */
455 u32 ucode_ver; /* ucode version, copy of
456 iwl_ucode.ver */
457 struct fw_desc ucode_code; /* runtime inst */
458 struct fw_desc ucode_data; /* runtime data original */
459 struct fw_desc ucode_data_backup; /* runtime data save/restore */
460 struct fw_desc ucode_init; /* initialization inst */
461 struct fw_desc ucode_init_data; /* initialization data */
462 struct fw_desc ucode_boot; /* bootstrap inst */
463
464
465 struct iwl_rxon_time_cmd rxon_timing;
466
467 /* We declare this const so it can only be
468 * changed via explicit cast within the
469 * routines that actually update the physical
470 * hardware */
471 const struct iwl3945_rxon_cmd active39_rxon;
472 struct iwl3945_rxon_cmd staging39_rxon;
473
474 int error_recovering;
475 struct iwl3945_rxon_cmd recovery39_rxon;
476
477 /* 1st responses from initialize and runtime uCode images.
478 * 4965's initialize alive response contains some calibration data. */
479 /* FIXME: 4965 uses bigger structure for init */
480 struct iwl_alive_resp card_alive_init;
481 struct iwl_alive_resp card_alive;
482
483#ifdef CONFIG_IWL3945_RFKILL
484 struct rfkill *rfkill;
485#endif
486
487#ifdef CONFIG_IWL3945_LEDS
488 struct iwl3945_led led39[IWL_LED_TRG_MAX];
489 unsigned long last_blink_time;
490 u8 last_blink_rate;
491 u8 allow_blinking;
492 unsigned int rxtxpackets;
493 u64 led_tpt;
494#endif
495
496
497 u16 active_rate;
498 u16 active_rate_basic;
499
500 u32 sta_supp_rates;
501
502 u8 call_post_assoc_from_beacon;
503 /* Rate scaling data */
504 s8 data_retry_limit;
505 u8 retry_rate;
506
507 wait_queue_head_t wait_command_queue;
508
509 int activity_timer_active;
510
511 /* Rx and Tx DMA processing queues */
512 struct iwl_rx_queue rxq;
513 struct iwl3945_tx_queue txq39[IWL39_MAX_NUM_QUEUES];
514
515 unsigned long status;
516
517 int last_rx_rssi; /* From Rx packet statisitics */
518 int last_rx_noise; /* From beacon statistics */
519
520 struct iwl3945_power_mgr power_data_39;
521
522 struct iwl3945_notif_statistics statistics_39;
523 unsigned long last_statistics_time;
524
525 /* context information */
526 u16 rates_mask;
527
528 u32 power_mode;
529 u32 antenna;
530 u8 bssid[ETH_ALEN];
531 u16 rts_threshold;
532 u8 mac_addr[ETH_ALEN];
533
534 /*station table variables */
535 spinlock_t sta_lock;
536 int num_stations;
537 struct iwl3945_station_entry stations_39[IWL_STATION_COUNT];
538
539 /* Indication if ieee80211_ops->open has been called */
540 u8 is_open;
541
542 u8 mac80211_registered;
543
544 /* Rx'd packet timing information */
545 u32 last_beacon_time;
546 u64 last_tsf;
547
548 /* eeprom */
549 struct iwl3945_eeprom eeprom39;
550
551 enum nl80211_iftype iw_mode;
552
553 struct sk_buff *ibss_beacon;
554
555 /* Last Rx'd beacon timestamp */
556 u64 timestamp;
557 u16 beacon_int;
558 void *shared_virt;
559 dma_addr_t shared_phys;
560 struct iwl_hw_params hw_params;
561 struct ieee80211_vif *vif;
562
563 /* Current association information needed to configure the
564 * hardware */
565 u16 assoc_id;
566 u16 assoc_capability;
567 u8 ps_mode;
568
569 struct iwl_qos_info qos_data;
570
571 struct workqueue_struct *workqueue;
572
573 struct work_struct up;
574 struct work_struct restart;
575 struct work_struct calibrated_work;
576 struct work_struct scan_completed;
577 struct work_struct rx_replenish;
578 struct work_struct rf_kill;
579 struct work_struct abort_scan;
580 struct work_struct update_link_led;
581 struct work_struct auth_work;
582 struct work_struct report_work;
583 struct work_struct request_scan;
584 struct work_struct beacon_update;
585
586 struct tasklet_struct irq_tasklet;
587
588 struct delayed_work init_alive_start;
589 struct delayed_work alive_start;
590 struct delayed_work activity_timer;
591 struct delayed_work thermal_periodic;
592 struct delayed_work gather_stats;
593 struct delayed_work scan_check;
594
595#define IWL_DEFAULT_TX_POWER 0x0F
596 s8 user_txpower_limit;
597 s8 max_channel_txpower_limit;
598
599
600#ifdef CONFIG_IWL3945_DEBUG
601 /* debugging info */
602 u32 debug_level;
603 u32 framecnt_to_us;
604 atomic_t restrict_refcnt;
605#endif
606}; /*iwl3945_priv */
607
608static inline int iwl3945_is_associated(struct iwl3945_priv *priv)
609{ 390{
610 return (priv->active39_rxon.filter_flags & RXON_FILTER_ASSOC_MSK) ? 1 : 0; 391 return (priv->active39_rxon.filter_flags & RXON_FILTER_ASSOC_MSK) ? 1 : 0;
611} 392}
612 393
613extern const struct iwl_channel_info *iwl3945_get_channel_info( 394extern const struct iwl_channel_info *iwl3945_get_channel_info(
614 const struct iwl3945_priv *priv, enum ieee80211_band band, u16 channel); 395 const struct iwl_priv *priv, enum ieee80211_band band, u16 channel);
615 396
616extern int iwl3945_rs_next_rate(struct iwl3945_priv *priv, int rate); 397extern int iwl3945_rs_next_rate(struct iwl_priv *priv, int rate);
617 398
618/* Requires full declaration of iwl3945_priv before including */ 399/* Requires full declaration of iwl_priv before including */
619#include "iwl-3945-io.h" 400#include "iwl-3945-io.h"
620 401
621#endif 402#endif
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h
index 9904406ae368..5cc6c5e1865c 100644
--- a/drivers/net/wireless/iwlwifi/iwl-dev.h
+++ b/drivers/net/wireless/iwlwifi/iwl-dev.h
@@ -40,6 +40,7 @@
40#include "iwl-eeprom.h" 40#include "iwl-eeprom.h"
41#include "iwl-4965-hw.h" 41#include "iwl-4965-hw.h"
42#include "iwl-3945-hw.h" 42#include "iwl-3945-hw.h"
43#include "iwl-3945-led.h"
43#include "iwl-csr.h" 44#include "iwl-csr.h"
44#include "iwl-prph.h" 45#include "iwl-prph.h"
45#include "iwl-debug.h" 46#include "iwl-debug.h"
@@ -835,7 +836,7 @@ struct iwl_priv {
835 836
836 struct ieee80211_supported_band bands[IEEE80211_NUM_BANDS]; 837 struct ieee80211_supported_band bands[IEEE80211_NUM_BANDS];
837 838
838#ifdef CONFIG_IWLAGN_SPECTRUM_MEASUREMENT 839#if defined(CONFIG_IWLAGN_SPECTRUM_MEASUREMENT) || defined(CONFIG_IWL3945_SPECTRUM_MEASUREMENT)
839 /* spectrum measurement report caching */ 840 /* spectrum measurement report caching */
840 struct iwl_spectrum_notification measure_report; 841 struct iwl_spectrum_notification measure_report;
841 u8 measurement_status; 842 u8 measurement_status;
@@ -916,18 +917,25 @@ struct iwl_priv {
916 * 4965's initialize alive response contains some calibration data. */ 917 * 4965's initialize alive response contains some calibration data. */
917 struct iwl_init_alive_resp card_alive_init; 918 struct iwl_init_alive_resp card_alive_init;
918 struct iwl_alive_resp card_alive; 919 struct iwl_alive_resp card_alive;
919#ifdef CONFIG_IWLWIFI_RFKILL 920#if defined(CONFIG_IWLWIFI_RFKILL) || defined(CONFIG_IWL3945_RFKILL)
920 struct rfkill *rfkill; 921 struct rfkill *rfkill;
921#endif 922#endif
922 923
923#ifdef CONFIG_IWLWIFI_LEDS 924#if defined(CONFIG_IWLWIFI_LEDS) || defined(CONFIG_IWL3945_LEDS)
924 struct iwl_led led[IWL_LED_TRG_MAX];
925 unsigned long last_blink_time; 925 unsigned long last_blink_time;
926 u8 last_blink_rate; 926 u8 last_blink_rate;
927 u8 allow_blinking; 927 u8 allow_blinking;
928 u64 led_tpt; 928 u64 led_tpt;
929#endif 929#endif
930 930
931#ifdef CONFIG_IWLWIFI_LEDS
932 struct iwl_led led[IWL_LED_TRG_MAX];
933#endif
934
935#ifdef CONFIG_IWL3945_LEDS
936 struct iwl3945_led led39[IWL_LED_TRG_MAX];
937 unsigned int rxtxpackets;
938#endif
931 u16 active_rate; 939 u16 active_rate;
932 u16 active_rate_basic; 940 u16 active_rate_basic;
933 941
@@ -1048,12 +1056,16 @@ struct iwl_priv {
1048 struct delayed_work init_alive_start; 1056 struct delayed_work init_alive_start;
1049 struct delayed_work alive_start; 1057 struct delayed_work alive_start;
1050 struct delayed_work scan_check; 1058 struct delayed_work scan_check;
1059
1060 /*For 3945 only*/
1061 struct delayed_work thermal_periodic;
1062
1051 /* TX Power */ 1063 /* TX Power */
1052 s8 tx_power_user_lmt; 1064 s8 tx_power_user_lmt;
1053 s8 tx_power_channel_lmt; 1065 s8 tx_power_channel_lmt;
1054 1066
1055 1067
1056#ifdef CONFIG_IWLWIFI_DEBUG 1068#if defined(CONFIG_IWLWIFI_DEBUG) || defined(CONFIG_IWL3945_DEBUG)
1057 /* debugging info */ 1069 /* debugging info */
1058 u32 debug_level; 1070 u32 debug_level;
1059 u32 framecnt_to_us; 1071 u32 framecnt_to_us;
@@ -1070,6 +1082,35 @@ struct iwl_priv {
1070 u32 disable_tx_power_cal; 1082 u32 disable_tx_power_cal;
1071 struct work_struct run_time_calib_work; 1083 struct work_struct run_time_calib_work;
1072 struct timer_list statistics_periodic; 1084 struct timer_list statistics_periodic;
1085
1086 /*For 3945*/
1087#define IWL_DEFAULT_TX_POWER 0x0F
1088 s8 user_txpower_limit;
1089 s8 max_channel_txpower_limit;
1090
1091 struct iwl3945_scan_cmd *scan39;
1092
1093 /* We declare this const so it can only be
1094 * changed via explicit cast within the
1095 * routines that actually update the physical
1096 * hardware */
1097 const struct iwl3945_rxon_cmd active39_rxon;
1098 struct iwl3945_rxon_cmd staging39_rxon;
1099 struct iwl3945_rxon_cmd recovery39_rxon;
1100
1101 struct iwl3945_tx_queue txq39[IWL39_MAX_NUM_QUEUES];
1102
1103 struct iwl3945_power_mgr power_data_39;
1104 struct iwl3945_notif_statistics statistics_39;
1105
1106 struct iwl3945_station_entry stations_39[IWL_STATION_COUNT];
1107
1108 /* eeprom */
1109 struct iwl3945_eeprom eeprom39;
1110
1111 u32 sta_supp_rates;
1112 u8 call_post_assoc_from_beacon;
1113
1073}; /*iwl_priv */ 1114}; /*iwl_priv */
1074 1115
1075static inline void iwl_txq_ctx_activate(struct iwl_priv *priv, int txq_id) 1116static inline void iwl_txq_ctx_activate(struct iwl_priv *priv, int txq_id)
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 43af2595c694..f80294e6bd9b 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -55,7 +55,7 @@
55#include "iwl-core.h" 55#include "iwl-core.h"
56#include "iwl-dev.h" 56#include "iwl-dev.h"
57 57
58static int iwl3945_tx_queue_update_write_ptr(struct iwl3945_priv *priv, 58static int iwl3945_tx_queue_update_write_ptr(struct iwl_priv *priv,
59 struct iwl3945_tx_queue *txq); 59 struct iwl3945_tx_queue *txq);
60 60
61/****************************************************************************** 61/******************************************************************************
@@ -103,7 +103,7 @@ MODULE_AUTHOR(DRV_COPYRIGHT " " DRV_AUTHOR);
103MODULE_LICENSE("GPL"); 103MODULE_LICENSE("GPL");
104 104
105static const struct ieee80211_supported_band *iwl3945_get_band( 105static const struct ieee80211_supported_band *iwl3945_get_band(
106 struct iwl3945_priv *priv, enum ieee80211_band band) 106 struct iwl_priv *priv, enum ieee80211_band band)
107{ 107{
108 return priv->hw->wiphy->bands[band]; 108 return priv->hw->wiphy->bands[band];
109} 109}
@@ -143,7 +143,7 @@ int iwl3945_x2_queue_used(const struct iwl_queue *q, int i)
143/** 143/**
144 * iwl3945_queue_init - Initialize queue's high/low-water and read/write indexes 144 * iwl3945_queue_init - Initialize queue's high/low-water and read/write indexes
145 */ 145 */
146static int iwl3945_queue_init(struct iwl3945_priv *priv, struct iwl_queue *q, 146static int iwl3945_queue_init(struct iwl_priv *priv, struct iwl_queue *q,
147 int count, int slots_num, u32 id) 147 int count, int slots_num, u32 id)
148{ 148{
149 q->n_bd = count; 149 q->n_bd = count;
@@ -174,7 +174,7 @@ static int iwl3945_queue_init(struct iwl3945_priv *priv, struct iwl_queue *q,
174/** 174/**
175 * iwl3945_tx_queue_alloc - Alloc driver data and TFD CB for one Tx/cmd queue 175 * iwl3945_tx_queue_alloc - Alloc driver data and TFD CB for one Tx/cmd queue
176 */ 176 */
177static int iwl3945_tx_queue_alloc(struct iwl3945_priv *priv, 177static int iwl3945_tx_queue_alloc(struct iwl_priv *priv,
178 struct iwl3945_tx_queue *txq, u32 id) 178 struct iwl3945_tx_queue *txq, u32 id)
179{ 179{
180 struct pci_dev *dev = priv->pci_dev; 180 struct pci_dev *dev = priv->pci_dev;
@@ -217,7 +217,7 @@ static int iwl3945_tx_queue_alloc(struct iwl3945_priv *priv,
217/** 217/**
218 * iwl3945_tx_queue_init - Allocate and initialize one tx/cmd queue 218 * iwl3945_tx_queue_init - Allocate and initialize one tx/cmd queue
219 */ 219 */
220int iwl3945_tx_queue_init(struct iwl3945_priv *priv, 220int iwl3945_tx_queue_init(struct iwl_priv *priv,
221 struct iwl3945_tx_queue *txq, int slots_num, u32 txq_id) 221 struct iwl3945_tx_queue *txq, int slots_num, u32 txq_id)
222{ 222{
223 struct pci_dev *dev = priv->pci_dev; 223 struct pci_dev *dev = priv->pci_dev;
@@ -269,7 +269,7 @@ int iwl3945_tx_queue_init(struct iwl3945_priv *priv,
269 * Free all buffers. 269 * Free all buffers.
270 * 0-fill, but do not free "txq" descriptor structure. 270 * 0-fill, but do not free "txq" descriptor structure.
271 */ 271 */
272void iwl3945_tx_queue_free(struct iwl3945_priv *priv, struct iwl3945_tx_queue *txq) 272void iwl3945_tx_queue_free(struct iwl_priv *priv, struct iwl3945_tx_queue *txq)
273{ 273{
274 struct iwl_queue *q = &txq->q; 274 struct iwl_queue *q = &txq->q;
275 struct pci_dev *dev = priv->pci_dev; 275 struct pci_dev *dev = priv->pci_dev;
@@ -315,7 +315,7 @@ void iwl3945_tx_queue_free(struct iwl3945_priv *priv, struct iwl3945_tx_queue *t
315 * 315 *
316 * NOTE: This does not remove station from device's station table. 316 * NOTE: This does not remove station from device's station table.
317 */ 317 */
318static u8 iwl3945_remove_station(struct iwl3945_priv *priv, const u8 *addr, int is_ap) 318static u8 iwl3945_remove_station(struct iwl_priv *priv, const u8 *addr, int is_ap)
319{ 319{
320 int index = IWL_INVALID_STATION; 320 int index = IWL_INVALID_STATION;
321 int i; 321 int i;
@@ -357,7 +357,7 @@ out:
357 * 357 *
358 * NOTE: This does not clear or otherwise alter the device's station table. 358 * NOTE: This does not clear or otherwise alter the device's station table.
359 */ 359 */
360static void iwl3945_clear_stations_table(struct iwl3945_priv *priv) 360static void iwl3945_clear_stations_table(struct iwl_priv *priv)
361{ 361{
362 unsigned long flags; 362 unsigned long flags;
363 363
@@ -372,7 +372,7 @@ static void iwl3945_clear_stations_table(struct iwl3945_priv *priv)
372/** 372/**
373 * iwl3945_add_station - Add station to station tables in driver and device 373 * iwl3945_add_station - Add station to station tables in driver and device
374 */ 374 */
375u8 iwl3945_add_station(struct iwl3945_priv *priv, const u8 *addr, int is_ap, u8 flags) 375u8 iwl3945_add_station(struct iwl_priv *priv, const u8 *addr, int is_ap, u8 flags)
376{ 376{
377 int i; 377 int i;
378 int index = IWL_INVALID_STATION; 378 int index = IWL_INVALID_STATION;
@@ -442,7 +442,7 @@ u8 iwl3945_add_station(struct iwl3945_priv *priv, const u8 *addr, int is_ap, u8
442 442
443/*************** DRIVER STATUS FUNCTIONS *****/ 443/*************** DRIVER STATUS FUNCTIONS *****/
444 444
445static inline int iwl3945_is_ready(struct iwl3945_priv *priv) 445static inline int iwl3945_is_ready(struct iwl_priv *priv)
446{ 446{
447 /* The adapter is 'ready' if READY and GEO_CONFIGURED bits are 447 /* The adapter is 'ready' if READY and GEO_CONFIGURED bits are
448 * set but EXIT_PENDING is not */ 448 * set but EXIT_PENDING is not */
@@ -451,33 +451,33 @@ static inline int iwl3945_is_ready(struct iwl3945_priv *priv)
451 !test_bit(STATUS_EXIT_PENDING, &priv->status); 451 !test_bit(STATUS_EXIT_PENDING, &priv->status);
452} 452}
453 453
454static inline int iwl3945_is_alive(struct iwl3945_priv *priv) 454static inline int iwl3945_is_alive(struct iwl_priv *priv)
455{ 455{
456 return test_bit(STATUS_ALIVE, &priv->status); 456 return test_bit(STATUS_ALIVE, &priv->status);
457} 457}
458 458
459static inline int iwl3945_is_init(struct iwl3945_priv *priv) 459static inline int iwl3945_is_init(struct iwl_priv *priv)
460{ 460{
461 return test_bit(STATUS_INIT, &priv->status); 461 return test_bit(STATUS_INIT, &priv->status);
462} 462}
463 463
464static inline int iwl3945_is_rfkill_sw(struct iwl3945_priv *priv) 464static inline int iwl3945_is_rfkill_sw(struct iwl_priv *priv)
465{ 465{
466 return test_bit(STATUS_RF_KILL_SW, &priv->status); 466 return test_bit(STATUS_RF_KILL_SW, &priv->status);
467} 467}
468 468
469static inline int iwl3945_is_rfkill_hw(struct iwl3945_priv *priv) 469static inline int iwl3945_is_rfkill_hw(struct iwl_priv *priv)
470{ 470{
471 return test_bit(STATUS_RF_KILL_HW, &priv->status); 471 return test_bit(STATUS_RF_KILL_HW, &priv->status);
472} 472}
473 473
474static inline int iwl3945_is_rfkill(struct iwl3945_priv *priv) 474static inline int iwl3945_is_rfkill(struct iwl_priv *priv)
475{ 475{
476 return iwl3945_is_rfkill_hw(priv) || 476 return iwl3945_is_rfkill_hw(priv) ||
477 iwl3945_is_rfkill_sw(priv); 477 iwl3945_is_rfkill_sw(priv);
478} 478}
479 479
480static inline int iwl3945_is_ready_rf(struct iwl3945_priv *priv) 480static inline int iwl3945_is_ready_rf(struct iwl_priv *priv)
481{ 481{
482 482
483 if (iwl3945_is_rfkill(priv)) 483 if (iwl3945_is_rfkill(priv))
@@ -500,7 +500,7 @@ static inline int iwl3945_is_ready_rf(struct iwl3945_priv *priv)
500 * failed. On success, it turns the index (> 0) of command in the 500 * failed. On success, it turns the index (> 0) of command in the
501 * command queue. 501 * command queue.
502 */ 502 */
503static int iwl3945_enqueue_hcmd(struct iwl3945_priv *priv, struct iwl3945_host_cmd *cmd) 503static int iwl3945_enqueue_hcmd(struct iwl_priv *priv, struct iwl3945_host_cmd *cmd)
504{ 504{
505 struct iwl3945_tx_queue *txq = &priv->txq39[IWL_CMD_QUEUE_NUM]; 505 struct iwl3945_tx_queue *txq = &priv->txq39[IWL_CMD_QUEUE_NUM];
506 struct iwl_queue *q = &txq->q; 506 struct iwl_queue *q = &txq->q;
@@ -579,7 +579,7 @@ static int iwl3945_enqueue_hcmd(struct iwl3945_priv *priv, struct iwl3945_host_c
579 return ret ? ret : idx; 579 return ret ? ret : idx;
580} 580}
581 581
582static int iwl3945_send_cmd_async(struct iwl3945_priv *priv, struct iwl3945_host_cmd *cmd) 582static int iwl3945_send_cmd_async(struct iwl_priv *priv, struct iwl3945_host_cmd *cmd)
583{ 583{
584 int ret; 584 int ret;
585 585
@@ -603,7 +603,7 @@ static int iwl3945_send_cmd_async(struct iwl3945_priv *priv, struct iwl3945_host
603 return 0; 603 return 0;
604} 604}
605 605
606static int iwl3945_send_cmd_sync(struct iwl3945_priv *priv, struct iwl3945_host_cmd *cmd) 606static int iwl3945_send_cmd_sync(struct iwl_priv *priv, struct iwl3945_host_cmd *cmd)
607{ 607{
608 int cmd_idx; 608 int cmd_idx;
609 int ret; 609 int ret;
@@ -691,7 +691,7 @@ out:
691 return ret; 691 return ret;
692} 692}
693 693
694int iwl3945_send_cmd(struct iwl3945_priv *priv, struct iwl3945_host_cmd *cmd) 694int iwl3945_send_cmd(struct iwl_priv *priv, struct iwl3945_host_cmd *cmd)
695{ 695{
696 if (cmd->meta.flags & CMD_ASYNC) 696 if (cmd->meta.flags & CMD_ASYNC)
697 return iwl3945_send_cmd_async(priv, cmd); 697 return iwl3945_send_cmd_async(priv, cmd);
@@ -699,7 +699,7 @@ int iwl3945_send_cmd(struct iwl3945_priv *priv, struct iwl3945_host_cmd *cmd)
699 return iwl3945_send_cmd_sync(priv, cmd); 699 return iwl3945_send_cmd_sync(priv, cmd);
700} 700}
701 701
702int iwl3945_send_cmd_pdu(struct iwl3945_priv *priv, u8 id, u16 len, const void *data) 702int iwl3945_send_cmd_pdu(struct iwl_priv *priv, u8 id, u16 len, const void *data)
703{ 703{
704 struct iwl3945_host_cmd cmd = { 704 struct iwl3945_host_cmd cmd = {
705 .id = id, 705 .id = id,
@@ -710,7 +710,7 @@ int iwl3945_send_cmd_pdu(struct iwl3945_priv *priv, u8 id, u16 len, const void *
710 return iwl3945_send_cmd_sync(priv, &cmd); 710 return iwl3945_send_cmd_sync(priv, &cmd);
711} 711}
712 712
713static int __must_check iwl3945_send_cmd_u32(struct iwl3945_priv *priv, u8 id, u32 val) 713static int __must_check iwl3945_send_cmd_u32(struct iwl_priv *priv, u8 id, u32 val)
714{ 714{
715 struct iwl3945_host_cmd cmd = { 715 struct iwl3945_host_cmd cmd = {
716 .id = id, 716 .id = id,
@@ -721,7 +721,7 @@ static int __must_check iwl3945_send_cmd_u32(struct iwl3945_priv *priv, u8 id, u
721 return iwl3945_send_cmd_sync(priv, &cmd); 721 return iwl3945_send_cmd_sync(priv, &cmd);
722} 722}
723 723
724int iwl3945_send_statistics_request(struct iwl3945_priv *priv) 724int iwl3945_send_statistics_request(struct iwl_priv *priv)
725{ 725{
726 return iwl3945_send_cmd_u32(priv, REPLY_STATISTICS_CMD, 0); 726 return iwl3945_send_cmd_u32(priv, REPLY_STATISTICS_CMD, 0);
727} 727}
@@ -736,7 +736,7 @@ int iwl3945_send_statistics_request(struct iwl3945_priv *priv)
736 * NOTE: Does not commit to the hardware; it sets appropriate bit fields 736 * NOTE: Does not commit to the hardware; it sets appropriate bit fields
737 * in the staging RXON flag structure based on the band 737 * in the staging RXON flag structure based on the band
738 */ 738 */
739static int iwl3945_set_rxon_channel(struct iwl3945_priv *priv, 739static int iwl3945_set_rxon_channel(struct iwl_priv *priv,
740 enum ieee80211_band band, 740 enum ieee80211_band band,
741 u16 channel) 741 u16 channel)
742{ 742{
@@ -770,7 +770,7 @@ static int iwl3945_set_rxon_channel(struct iwl3945_priv *priv,
770 * be #ifdef'd out once the driver is stable and folks aren't actively 770 * be #ifdef'd out once the driver is stable and folks aren't actively
771 * making changes 771 * making changes
772 */ 772 */
773static int iwl3945_check_rxon_cmd(struct iwl3945_priv *priv) 773static int iwl3945_check_rxon_cmd(struct iwl_priv *priv)
774{ 774{
775 int error = 0; 775 int error = 0;
776 int counter = 1; 776 int counter = 1;
@@ -851,7 +851,7 @@ static int iwl3945_check_rxon_cmd(struct iwl3945_priv *priv)
851 * or is clearing the RXON_FILTER_ASSOC_MSK, then return 1 to indicate that 851 * or is clearing the RXON_FILTER_ASSOC_MSK, then return 1 to indicate that
852 * a new tune (full RXON command, rather than RXON_ASSOC cmd) is required. 852 * a new tune (full RXON command, rather than RXON_ASSOC cmd) is required.
853 */ 853 */
854static int iwl3945_full_rxon_required(struct iwl3945_priv *priv) 854static int iwl3945_full_rxon_required(struct iwl_priv *priv)
855{ 855{
856 856
857 /* These items are only settable from the full RXON command */ 857 /* These items are only settable from the full RXON command */
@@ -886,7 +886,7 @@ static int iwl3945_full_rxon_required(struct iwl3945_priv *priv)
886 return 0; 886 return 0;
887} 887}
888 888
889static int iwl3945_send_rxon_assoc(struct iwl3945_priv *priv) 889static int iwl3945_send_rxon_assoc(struct iwl_priv *priv)
890{ 890{
891 int rc = 0; 891 int rc = 0;
892 struct iwl_rx_packet *res = NULL; 892 struct iwl_rx_packet *res = NULL;
@@ -938,7 +938,7 @@ static int iwl3945_send_rxon_assoc(struct iwl3945_priv *priv)
938 * function correctly transitions out of the RXON_ASSOC_MSK state if 938 * function correctly transitions out of the RXON_ASSOC_MSK state if
939 * a HW tune is required based on the RXON structure changes. 939 * a HW tune is required based on the RXON structure changes.
940 */ 940 */
941static int iwl3945_commit_rxon(struct iwl3945_priv *priv) 941static int iwl3945_commit_rxon(struct iwl_priv *priv)
942{ 942{
943 /* cast away the const for active_rxon in this function */ 943 /* cast away the const for active_rxon in this function */
944 struct iwl3945_rxon_cmd *active_rxon = (void *)&priv->active39_rxon; 944 struct iwl3945_rxon_cmd *active_rxon = (void *)&priv->active39_rxon;
@@ -1056,7 +1056,7 @@ static int iwl3945_commit_rxon(struct iwl3945_priv *priv)
1056 return 0; 1056 return 0;
1057} 1057}
1058 1058
1059static int iwl3945_send_bt_config(struct iwl3945_priv *priv) 1059static int iwl3945_send_bt_config(struct iwl_priv *priv)
1060{ 1060{
1061 struct iwl_bt_cmd bt_cmd = { 1061 struct iwl_bt_cmd bt_cmd = {
1062 .flags = 3, 1062 .flags = 3,
@@ -1070,7 +1070,7 @@ static int iwl3945_send_bt_config(struct iwl3945_priv *priv)
1070 sizeof(bt_cmd), &bt_cmd); 1070 sizeof(bt_cmd), &bt_cmd);
1071} 1071}
1072 1072
1073static int iwl3945_send_scan_abort(struct iwl3945_priv *priv) 1073static int iwl3945_send_scan_abort(struct iwl_priv *priv)
1074{ 1074{
1075 int rc = 0; 1075 int rc = 0;
1076 struct iwl_rx_packet *res; 1076 struct iwl_rx_packet *res;
@@ -1111,7 +1111,7 @@ static int iwl3945_send_scan_abort(struct iwl3945_priv *priv)
1111 return rc; 1111 return rc;
1112} 1112}
1113 1113
1114static int iwl3945_card_state_sync_callback(struct iwl3945_priv *priv, 1114static int iwl3945_card_state_sync_callback(struct iwl_priv *priv,
1115 struct iwl3945_cmd *cmd, 1115 struct iwl3945_cmd *cmd,
1116 struct sk_buff *skb) 1116 struct sk_buff *skb)
1117{ 1117{
@@ -1128,7 +1128,7 @@ static int iwl3945_card_state_sync_callback(struct iwl3945_priv *priv,
1128 * When in the 'halt' state, the card is shut down and must be fully 1128 * When in the 'halt' state, the card is shut down and must be fully
1129 * restarted to come back on. 1129 * restarted to come back on.
1130 */ 1130 */
1131static int iwl3945_send_card_state(struct iwl3945_priv *priv, u32 flags, u8 meta_flag) 1131static int iwl3945_send_card_state(struct iwl_priv *priv, u32 flags, u8 meta_flag)
1132{ 1132{
1133 struct iwl3945_host_cmd cmd = { 1133 struct iwl3945_host_cmd cmd = {
1134 .id = REPLY_CARD_STATE_CMD, 1134 .id = REPLY_CARD_STATE_CMD,
@@ -1143,7 +1143,7 @@ static int iwl3945_send_card_state(struct iwl3945_priv *priv, u32 flags, u8 meta
1143 return iwl3945_send_cmd(priv, &cmd); 1143 return iwl3945_send_cmd(priv, &cmd);
1144} 1144}
1145 1145
1146static int iwl3945_add_sta_sync_callback(struct iwl3945_priv *priv, 1146static int iwl3945_add_sta_sync_callback(struct iwl_priv *priv,
1147 struct iwl3945_cmd *cmd, struct sk_buff *skb) 1147 struct iwl3945_cmd *cmd, struct sk_buff *skb)
1148{ 1148{
1149 struct iwl_rx_packet *res = NULL; 1149 struct iwl_rx_packet *res = NULL;
@@ -1171,7 +1171,7 @@ static int iwl3945_add_sta_sync_callback(struct iwl3945_priv *priv,
1171 return 1; 1171 return 1;
1172} 1172}
1173 1173
1174int iwl3945_send_add_station(struct iwl3945_priv *priv, 1174int iwl3945_send_add_station(struct iwl_priv *priv,
1175 struct iwl3945_addsta_cmd *sta, u8 flags) 1175 struct iwl3945_addsta_cmd *sta, u8 flags)
1176{ 1176{
1177 struct iwl_rx_packet *res = NULL; 1177 struct iwl_rx_packet *res = NULL;
@@ -1218,7 +1218,7 @@ int iwl3945_send_add_station(struct iwl3945_priv *priv,
1218 return rc; 1218 return rc;
1219} 1219}
1220 1220
1221static int iwl3945_update_sta_key_info(struct iwl3945_priv *priv, 1221static int iwl3945_update_sta_key_info(struct iwl_priv *priv,
1222 struct ieee80211_key_conf *keyconf, 1222 struct ieee80211_key_conf *keyconf,
1223 u8 sta_id) 1223 u8 sta_id)
1224{ 1224{
@@ -1256,7 +1256,7 @@ static int iwl3945_update_sta_key_info(struct iwl3945_priv *priv,
1256 return 0; 1256 return 0;
1257} 1257}
1258 1258
1259static int iwl3945_clear_sta_key_info(struct iwl3945_priv *priv, u8 sta_id) 1259static int iwl3945_clear_sta_key_info(struct iwl_priv *priv, u8 sta_id)
1260{ 1260{
1261 unsigned long flags; 1261 unsigned long flags;
1262 1262
@@ -1274,7 +1274,7 @@ static int iwl3945_clear_sta_key_info(struct iwl3945_priv *priv, u8 sta_id)
1274 return 0; 1274 return 0;
1275} 1275}
1276 1276
1277static void iwl3945_clear_free_frames(struct iwl3945_priv *priv) 1277static void iwl3945_clear_free_frames(struct iwl_priv *priv)
1278{ 1278{
1279 struct list_head *element; 1279 struct list_head *element;
1280 1280
@@ -1295,7 +1295,7 @@ static void iwl3945_clear_free_frames(struct iwl3945_priv *priv)
1295 } 1295 }
1296} 1296}
1297 1297
1298static struct iwl3945_frame *iwl3945_get_free_frame(struct iwl3945_priv *priv) 1298static struct iwl3945_frame *iwl3945_get_free_frame(struct iwl_priv *priv)
1299{ 1299{
1300 struct iwl3945_frame *frame; 1300 struct iwl3945_frame *frame;
1301 struct list_head *element; 1301 struct list_head *element;
@@ -1315,13 +1315,13 @@ static struct iwl3945_frame *iwl3945_get_free_frame(struct iwl3945_priv *priv)
1315 return list_entry(element, struct iwl3945_frame, list); 1315 return list_entry(element, struct iwl3945_frame, list);
1316} 1316}
1317 1317
1318static void iwl3945_free_frame(struct iwl3945_priv *priv, struct iwl3945_frame *frame) 1318static void iwl3945_free_frame(struct iwl_priv *priv, struct iwl3945_frame *frame)
1319{ 1319{
1320 memset(frame, 0, sizeof(*frame)); 1320 memset(frame, 0, sizeof(*frame));
1321 list_add(&frame->list, &priv->free_frames); 1321 list_add(&frame->list, &priv->free_frames);
1322} 1322}
1323 1323
1324unsigned int iwl3945_fill_beacon_frame(struct iwl3945_priv *priv, 1324unsigned int iwl3945_fill_beacon_frame(struct iwl_priv *priv,
1325 struct ieee80211_hdr *hdr, 1325 struct ieee80211_hdr *hdr,
1326 int left) 1326 int left)
1327{ 1327{
@@ -1339,7 +1339,7 @@ unsigned int iwl3945_fill_beacon_frame(struct iwl3945_priv *priv,
1339 return priv->ibss_beacon->len; 1339 return priv->ibss_beacon->len;
1340} 1340}
1341 1341
1342static u8 iwl3945_rate_get_lowest_plcp(struct iwl3945_priv *priv) 1342static u8 iwl3945_rate_get_lowest_plcp(struct iwl_priv *priv)
1343{ 1343{
1344 u8 i; 1344 u8 i;
1345 int rate_mask; 1345 int rate_mask;
@@ -1363,7 +1363,7 @@ static u8 iwl3945_rate_get_lowest_plcp(struct iwl3945_priv *priv)
1363 return IWL_RATE_6M_PLCP; 1363 return IWL_RATE_6M_PLCP;
1364} 1364}
1365 1365
1366static int iwl3945_send_beacon_cmd(struct iwl3945_priv *priv) 1366static int iwl3945_send_beacon_cmd(struct iwl_priv *priv)
1367{ 1367{
1368 struct iwl3945_frame *frame; 1368 struct iwl3945_frame *frame;
1369 unsigned int frame_size; 1369 unsigned int frame_size;
@@ -1396,7 +1396,7 @@ static int iwl3945_send_beacon_cmd(struct iwl3945_priv *priv)
1396 * 1396 *
1397 ******************************************************************************/ 1397 ******************************************************************************/
1398 1398
1399static void get_eeprom_mac(struct iwl3945_priv *priv, u8 *mac) 1399static void get_eeprom_mac(struct iwl_priv *priv, u8 *mac)
1400{ 1400{
1401 memcpy(mac, priv->eeprom39.mac_address, 6); 1401 memcpy(mac, priv->eeprom39.mac_address, 6);
1402} 1402}
@@ -1409,7 +1409,7 @@ static void get_eeprom_mac(struct iwl3945_priv *priv, u8 *mac)
1409 * simply claims ownership, which should be safe when this function is called 1409 * simply claims ownership, which should be safe when this function is called
1410 * (i.e. before loading uCode!). 1410 * (i.e. before loading uCode!).
1411 */ 1411 */
1412static inline int iwl3945_eeprom_acquire_semaphore(struct iwl3945_priv *priv) 1412static inline int iwl3945_eeprom_acquire_semaphore(struct iwl_priv *priv)
1413{ 1413{
1414 _iwl3945_clear_bit(priv, CSR_EEPROM_GP, CSR_EEPROM_GP_IF_OWNER_MSK); 1414 _iwl3945_clear_bit(priv, CSR_EEPROM_GP, CSR_EEPROM_GP_IF_OWNER_MSK);
1415 return 0; 1415 return 0;
@@ -1422,7 +1422,7 @@ static inline int iwl3945_eeprom_acquire_semaphore(struct iwl3945_priv *priv)
1422 * 1422 *
1423 * NOTE: This routine uses the non-debug IO access functions. 1423 * NOTE: This routine uses the non-debug IO access functions.
1424 */ 1424 */
1425int iwl3945_eeprom_init(struct iwl3945_priv *priv) 1425int iwl3945_eeprom_init(struct iwl_priv *priv)
1426{ 1426{
1427 u16 *e = (u16 *)&priv->eeprom39; 1427 u16 *e = (u16 *)&priv->eeprom39;
1428 u32 gp = iwl3945_read32(priv, CSR_EEPROM_GP); 1428 u32 gp = iwl3945_read32(priv, CSR_EEPROM_GP);
@@ -1470,7 +1470,7 @@ int iwl3945_eeprom_init(struct iwl3945_priv *priv)
1470 return 0; 1470 return 0;
1471} 1471}
1472 1472
1473static void iwl3945_unset_hw_params(struct iwl3945_priv *priv) 1473static void iwl3945_unset_hw_params(struct iwl_priv *priv)
1474{ 1474{
1475 if (priv->shared_virt) 1475 if (priv->shared_virt)
1476 pci_free_consistent(priv->pci_dev, 1476 pci_free_consistent(priv->pci_dev,
@@ -1511,7 +1511,7 @@ static u16 iwl3945_supported_rate_to_ie(u8 *ie, u16 supported_rate,
1511/** 1511/**
1512 * iwl3945_fill_probe_req - fill in all required fields and IE for probe request 1512 * iwl3945_fill_probe_req - fill in all required fields and IE for probe request
1513 */ 1513 */
1514static u16 iwl3945_fill_probe_req(struct iwl3945_priv *priv, 1514static u16 iwl3945_fill_probe_req(struct iwl_priv *priv,
1515 struct ieee80211_mgmt *frame, 1515 struct ieee80211_mgmt *frame,
1516 int left) 1516 int left)
1517{ 1517{
@@ -1591,7 +1591,7 @@ static u16 iwl3945_fill_probe_req(struct iwl3945_priv *priv,
1591/* 1591/*
1592 * QoS support 1592 * QoS support
1593*/ 1593*/
1594static int iwl3945_send_qos_params_command(struct iwl3945_priv *priv, 1594static int iwl3945_send_qos_params_command(struct iwl_priv *priv,
1595 struct iwl_qosparam_cmd *qos) 1595 struct iwl_qosparam_cmd *qos)
1596{ 1596{
1597 1597
@@ -1599,7 +1599,7 @@ static int iwl3945_send_qos_params_command(struct iwl3945_priv *priv,
1599 sizeof(struct iwl_qosparam_cmd), qos); 1599 sizeof(struct iwl_qosparam_cmd), qos);
1600} 1600}
1601 1601
1602static void iwl3945_reset_qos(struct iwl3945_priv *priv) 1602static void iwl3945_reset_qos(struct iwl_priv *priv)
1603{ 1603{
1604 u16 cw_min = 15; 1604 u16 cw_min = 15;
1605 u16 cw_max = 1023; 1605 u16 cw_max = 1023;
@@ -1690,7 +1690,7 @@ static void iwl3945_reset_qos(struct iwl3945_priv *priv)
1690 spin_unlock_irqrestore(&priv->lock, flags); 1690 spin_unlock_irqrestore(&priv->lock, flags);
1691} 1691}
1692 1692
1693static void iwl3945_activate_qos(struct iwl3945_priv *priv, u8 force) 1693static void iwl3945_activate_qos(struct iwl_priv *priv, u8 force)
1694{ 1694{
1695 unsigned long flags; 1695 unsigned long flags;
1696 1696
@@ -1760,7 +1760,7 @@ static struct iwl_power_vec_entry range_1[IWL39_POWER_AC] = {
1760 SLP_VEC(4, 7, 10, 10, 0xFF)}, 0} 1760 SLP_VEC(4, 7, 10, 10, 0xFF)}, 0}
1761}; 1761};
1762 1762
1763int iwl3945_power_init_handle(struct iwl3945_priv *priv) 1763int iwl3945_power_init_handle(struct iwl_priv *priv)
1764{ 1764{
1765 int rc = 0, i; 1765 int rc = 0, i;
1766 struct iwl3945_power_mgr *pow_data; 1766 struct iwl3945_power_mgr *pow_data;
@@ -1799,7 +1799,7 @@ int iwl3945_power_init_handle(struct iwl3945_priv *priv)
1799 return rc; 1799 return rc;
1800} 1800}
1801 1801
1802static int iwl3945_update_power_cmd(struct iwl3945_priv *priv, 1802static int iwl3945_update_power_cmd(struct iwl_priv *priv,
1803 struct iwl_powertable_cmd *cmd, u32 mode) 1803 struct iwl_powertable_cmd *cmd, u32 mode)
1804{ 1804{
1805 int rc = 0, i; 1805 int rc = 0, i;
@@ -1863,7 +1863,7 @@ static int iwl3945_update_power_cmd(struct iwl3945_priv *priv,
1863 return rc; 1863 return rc;
1864} 1864}
1865 1865
1866static int iwl3945_send_power_mode(struct iwl3945_priv *priv, u32 mode) 1866static int iwl3945_send_power_mode(struct iwl_priv *priv, u32 mode)
1867{ 1867{
1868 u32 uninitialized_var(final_mode); 1868 u32 uninitialized_var(final_mode);
1869 int rc; 1869 int rc;
@@ -1903,7 +1903,7 @@ static int iwl3945_send_power_mode(struct iwl3945_priv *priv, u32 mode)
1903 * 1903 *
1904 * NOTE: priv->mutex is not required before calling this function 1904 * NOTE: priv->mutex is not required before calling this function
1905 */ 1905 */
1906static int iwl3945_scan_cancel(struct iwl3945_priv *priv) 1906static int iwl3945_scan_cancel(struct iwl_priv *priv)
1907{ 1907{
1908 if (!test_bit(STATUS_SCAN_HW, &priv->status)) { 1908 if (!test_bit(STATUS_SCAN_HW, &priv->status)) {
1909 clear_bit(STATUS_SCANNING, &priv->status); 1909 clear_bit(STATUS_SCANNING, &priv->status);
@@ -1931,7 +1931,7 @@ static int iwl3945_scan_cancel(struct iwl3945_priv *priv)
1931 * 1931 *
1932 * NOTE: priv->mutex must be held before calling this function 1932 * NOTE: priv->mutex must be held before calling this function
1933 */ 1933 */
1934static int iwl3945_scan_cancel_timeout(struct iwl3945_priv *priv, unsigned long ms) 1934static int iwl3945_scan_cancel_timeout(struct iwl_priv *priv, unsigned long ms)
1935{ 1935{
1936 unsigned long now = jiffies; 1936 unsigned long now = jiffies;
1937 int ret; 1937 int ret;
@@ -1966,7 +1966,7 @@ static __le16 iwl3945_adjust_beacon_interval(u16 beacon_val)
1966 return cpu_to_le16(new_val); 1966 return cpu_to_le16(new_val);
1967} 1967}
1968 1968
1969static void iwl3945_setup_rxon_timing(struct iwl3945_priv *priv) 1969static void iwl3945_setup_rxon_timing(struct iwl_priv *priv)
1970{ 1970{
1971 u64 interval_tm_unit; 1971 u64 interval_tm_unit;
1972 u64 tsf, result; 1972 u64 tsf, result;
@@ -2019,7 +2019,7 @@ static void iwl3945_setup_rxon_timing(struct iwl3945_priv *priv)
2019 le16_to_cpu(priv->rxon_timing.atim_window)); 2019 le16_to_cpu(priv->rxon_timing.atim_window));
2020} 2020}
2021 2021
2022static int iwl3945_scan_initiate(struct iwl3945_priv *priv) 2022static int iwl3945_scan_initiate(struct iwl_priv *priv)
2023{ 2023{
2024 if (!iwl3945_is_ready_rf(priv)) { 2024 if (!iwl3945_is_ready_rf(priv)) {
2025 IWL_DEBUG_SCAN("Aborting scan due to not ready.\n"); 2025 IWL_DEBUG_SCAN("Aborting scan due to not ready.\n");
@@ -2051,7 +2051,7 @@ static int iwl3945_scan_initiate(struct iwl3945_priv *priv)
2051 return 0; 2051 return 0;
2052} 2052}
2053 2053
2054static int iwl3945_set_rxon_hwcrypto(struct iwl3945_priv *priv, int hw_decrypt) 2054static int iwl3945_set_rxon_hwcrypto(struct iwl_priv *priv, int hw_decrypt)
2055{ 2055{
2056 struct iwl3945_rxon_cmd *rxon = &priv->staging39_rxon; 2056 struct iwl3945_rxon_cmd *rxon = &priv->staging39_rxon;
2057 2057
@@ -2063,7 +2063,7 @@ static int iwl3945_set_rxon_hwcrypto(struct iwl3945_priv *priv, int hw_decrypt)
2063 return 0; 2063 return 0;
2064} 2064}
2065 2065
2066static void iwl3945_set_flags_for_phymode(struct iwl3945_priv *priv, 2066static void iwl3945_set_flags_for_phymode(struct iwl_priv *priv,
2067 enum ieee80211_band band) 2067 enum ieee80211_band band)
2068{ 2068{
2069 if (band == IEEE80211_BAND_5GHZ) { 2069 if (band == IEEE80211_BAND_5GHZ) {
@@ -2090,7 +2090,7 @@ static void iwl3945_set_flags_for_phymode(struct iwl3945_priv *priv,
2090/* 2090/*
2091 * initialize rxon structure with default values from eeprom 2091 * initialize rxon structure with default values from eeprom
2092 */ 2092 */
2093static void iwl3945_connection_init_rx_config(struct iwl3945_priv *priv, 2093static void iwl3945_connection_init_rx_config(struct iwl_priv *priv,
2094 int mode) 2094 int mode)
2095{ 2095{
2096 const struct iwl_channel_info *ch_info; 2096 const struct iwl_channel_info *ch_info;
@@ -2160,7 +2160,7 @@ static void iwl3945_connection_init_rx_config(struct iwl3945_priv *priv,
2160 (IWL_CCK_RATES_MASK >> IWL_FIRST_CCK_RATE) & 0xF; 2160 (IWL_CCK_RATES_MASK >> IWL_FIRST_CCK_RATE) & 0xF;
2161} 2161}
2162 2162
2163static int iwl3945_set_mode(struct iwl3945_priv *priv, int mode) 2163static int iwl3945_set_mode(struct iwl_priv *priv, int mode)
2164{ 2164{
2165 if (mode == NL80211_IFTYPE_ADHOC) { 2165 if (mode == NL80211_IFTYPE_ADHOC) {
2166 const struct iwl_channel_info *ch_info; 2166 const struct iwl_channel_info *ch_info;
@@ -2197,7 +2197,7 @@ static int iwl3945_set_mode(struct iwl3945_priv *priv, int mode)
2197 return 0; 2197 return 0;
2198} 2198}
2199 2199
2200static void iwl3945_build_tx_cmd_hwcrypto(struct iwl3945_priv *priv, 2200static void iwl3945_build_tx_cmd_hwcrypto(struct iwl_priv *priv,
2201 struct ieee80211_tx_info *info, 2201 struct ieee80211_tx_info *info,
2202 struct iwl3945_cmd *cmd, 2202 struct iwl3945_cmd *cmd,
2203 struct sk_buff *skb_frag, 2203 struct sk_buff *skb_frag,
@@ -2247,7 +2247,7 @@ static void iwl3945_build_tx_cmd_hwcrypto(struct iwl3945_priv *priv,
2247/* 2247/*
2248 * handle build REPLY_TX command notification. 2248 * handle build REPLY_TX command notification.
2249 */ 2249 */
2250static void iwl3945_build_tx_cmd_basic(struct iwl3945_priv *priv, 2250static void iwl3945_build_tx_cmd_basic(struct iwl_priv *priv,
2251 struct iwl3945_cmd *cmd, 2251 struct iwl3945_cmd *cmd,
2252 struct ieee80211_tx_info *info, 2252 struct ieee80211_tx_info *info,
2253 struct ieee80211_hdr *hdr, 2253 struct ieee80211_hdr *hdr,
@@ -2314,7 +2314,7 @@ static void iwl3945_build_tx_cmd_basic(struct iwl3945_priv *priv,
2314/** 2314/**
2315 * iwl3945_get_sta_id - Find station's index within station table 2315 * iwl3945_get_sta_id - Find station's index within station table
2316 */ 2316 */
2317static int iwl3945_get_sta_id(struct iwl3945_priv *priv, struct ieee80211_hdr *hdr) 2317static int iwl3945_get_sta_id(struct iwl_priv *priv, struct ieee80211_hdr *hdr)
2318{ 2318{
2319 int sta_id; 2319 int sta_id;
2320 u16 fc = le16_to_cpu(hdr->frame_control); 2320 u16 fc = le16_to_cpu(hdr->frame_control);
@@ -2371,7 +2371,7 @@ static int iwl3945_get_sta_id(struct iwl3945_priv *priv, struct ieee80211_hdr *h
2371/* 2371/*
2372 * start REPLY_TX command process 2372 * start REPLY_TX command process
2373 */ 2373 */
2374static int iwl3945_tx_skb(struct iwl3945_priv *priv, struct sk_buff *skb) 2374static int iwl3945_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
2375{ 2375{
2376 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; 2376 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
2377 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); 2377 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
@@ -2594,7 +2594,7 @@ drop:
2594 return -1; 2594 return -1;
2595} 2595}
2596 2596
2597static void iwl3945_set_rate(struct iwl3945_priv *priv) 2597static void iwl3945_set_rate(struct iwl_priv *priv)
2598{ 2598{
2599 const struct ieee80211_supported_band *sband = NULL; 2599 const struct ieee80211_supported_band *sband = NULL;
2600 struct ieee80211_rate *rate; 2600 struct ieee80211_rate *rate;
@@ -2648,7 +2648,7 @@ static void iwl3945_set_rate(struct iwl3945_priv *priv)
2648 (IWL_OFDM_BASIC_RATES_MASK >> IWL_FIRST_OFDM_RATE) & 0xFF; 2648 (IWL_OFDM_BASIC_RATES_MASK >> IWL_FIRST_OFDM_RATE) & 0xFF;
2649} 2649}
2650 2650
2651static void iwl3945_radio_kill_sw(struct iwl3945_priv *priv, int disable_radio) 2651static void iwl3945_radio_kill_sw(struct iwl_priv *priv, int disable_radio)
2652{ 2652{
2653 unsigned long flags; 2653 unsigned long flags;
2654 2654
@@ -2698,7 +2698,7 @@ static void iwl3945_radio_kill_sw(struct iwl3945_priv *priv, int disable_radio)
2698 return; 2698 return;
2699} 2699}
2700 2700
2701void iwl3945_set_decrypted_flag(struct iwl3945_priv *priv, struct sk_buff *skb, 2701void iwl3945_set_decrypted_flag(struct iwl_priv *priv, struct sk_buff *skb,
2702 u32 decrypt_res, struct ieee80211_rx_status *stats) 2702 u32 decrypt_res, struct ieee80211_rx_status *stats)
2703{ 2703{
2704 u16 fc = 2704 u16 fc =
@@ -2783,7 +2783,7 @@ static __le32 iwl3945_add_beacon_time(u32 base, u32 addon, u32 beacon_interval)
2783 return cpu_to_le32(res); 2783 return cpu_to_le32(res);
2784} 2784}
2785 2785
2786static int iwl3945_get_measurement(struct iwl3945_priv *priv, 2786static int iwl3945_get_measurement(struct iwl_priv *priv,
2787 struct ieee80211_measurement_params *params, 2787 struct ieee80211_measurement_params *params,
2788 u8 type) 2788 u8 type)
2789{ 2789{
@@ -2862,7 +2862,7 @@ static int iwl3945_get_measurement(struct iwl3945_priv *priv,
2862} 2862}
2863#endif 2863#endif
2864 2864
2865static void iwl3945_rx_reply_alive(struct iwl3945_priv *priv, 2865static void iwl3945_rx_reply_alive(struct iwl_priv *priv,
2866 struct iwl_rx_mem_buffer *rxb) 2866 struct iwl_rx_mem_buffer *rxb)
2867{ 2867{
2868 struct iwl_rx_packet *pkt = (void *)rxb->skb->data; 2868 struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
@@ -2898,7 +2898,7 @@ static void iwl3945_rx_reply_alive(struct iwl3945_priv *priv,
2898 IWL_WARNING("uCode did not respond OK.\n"); 2898 IWL_WARNING("uCode did not respond OK.\n");
2899} 2899}
2900 2900
2901static void iwl3945_rx_reply_add_sta(struct iwl3945_priv *priv, 2901static void iwl3945_rx_reply_add_sta(struct iwl_priv *priv,
2902 struct iwl_rx_mem_buffer *rxb) 2902 struct iwl_rx_mem_buffer *rxb)
2903{ 2903{
2904 struct iwl_rx_packet *pkt = (void *)rxb->skb->data; 2904 struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
@@ -2907,7 +2907,7 @@ static void iwl3945_rx_reply_add_sta(struct iwl3945_priv *priv,
2907 return; 2907 return;
2908} 2908}
2909 2909
2910static void iwl3945_rx_reply_error(struct iwl3945_priv *priv, 2910static void iwl3945_rx_reply_error(struct iwl_priv *priv,
2911 struct iwl_rx_mem_buffer *rxb) 2911 struct iwl_rx_mem_buffer *rxb)
2912{ 2912{
2913 struct iwl_rx_packet *pkt = (void *)rxb->skb->data; 2913 struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
@@ -2923,7 +2923,7 @@ static void iwl3945_rx_reply_error(struct iwl3945_priv *priv,
2923 2923
2924#define TX_STATUS_ENTRY(x) case TX_STATUS_FAIL_ ## x: return #x 2924#define TX_STATUS_ENTRY(x) case TX_STATUS_FAIL_ ## x: return #x
2925 2925
2926static void iwl3945_rx_csa(struct iwl3945_priv *priv, struct iwl_rx_mem_buffer *rxb) 2926static void iwl3945_rx_csa(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb)
2927{ 2927{
2928 struct iwl_rx_packet *pkt = (void *)rxb->skb->data; 2928 struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
2929 struct iwl3945_rxon_cmd *rxon = (void *)&priv->active39_rxon; 2929 struct iwl3945_rxon_cmd *rxon = (void *)&priv->active39_rxon;
@@ -2934,7 +2934,7 @@ static void iwl3945_rx_csa(struct iwl3945_priv *priv, struct iwl_rx_mem_buffer *
2934 priv->staging39_rxon.channel = csa->channel; 2934 priv->staging39_rxon.channel = csa->channel;
2935} 2935}
2936 2936
2937static void iwl3945_rx_spectrum_measure_notif(struct iwl3945_priv *priv, 2937static void iwl3945_rx_spectrum_measure_notif(struct iwl_priv *priv,
2938 struct iwl_rx_mem_buffer *rxb) 2938 struct iwl_rx_mem_buffer *rxb)
2939{ 2939{
2940#ifdef CONFIG_IWL3945_SPECTRUM_MEASUREMENT 2940#ifdef CONFIG_IWL3945_SPECTRUM_MEASUREMENT
@@ -2952,7 +2952,7 @@ static void iwl3945_rx_spectrum_measure_notif(struct iwl3945_priv *priv,
2952#endif 2952#endif
2953} 2953}
2954 2954
2955static void iwl3945_rx_pm_sleep_notif(struct iwl3945_priv *priv, 2955static void iwl3945_rx_pm_sleep_notif(struct iwl_priv *priv,
2956 struct iwl_rx_mem_buffer *rxb) 2956 struct iwl_rx_mem_buffer *rxb)
2957{ 2957{
2958#ifdef CONFIG_IWL3945_DEBUG 2958#ifdef CONFIG_IWL3945_DEBUG
@@ -2963,7 +2963,7 @@ static void iwl3945_rx_pm_sleep_notif(struct iwl3945_priv *priv,
2963#endif 2963#endif
2964} 2964}
2965 2965
2966static void iwl3945_rx_pm_debug_statistics_notif(struct iwl3945_priv *priv, 2966static void iwl3945_rx_pm_debug_statistics_notif(struct iwl_priv *priv,
2967 struct iwl_rx_mem_buffer *rxb) 2967 struct iwl_rx_mem_buffer *rxb)
2968{ 2968{
2969 struct iwl_rx_packet *pkt = (void *)rxb->skb->data; 2969 struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
@@ -2976,8 +2976,8 @@ static void iwl3945_rx_pm_debug_statistics_notif(struct iwl3945_priv *priv,
2976 2976
2977static void iwl3945_bg_beacon_update(struct work_struct *work) 2977static void iwl3945_bg_beacon_update(struct work_struct *work)
2978{ 2978{
2979 struct iwl3945_priv *priv = 2979 struct iwl_priv *priv =
2980 container_of(work, struct iwl3945_priv, beacon_update); 2980 container_of(work, struct iwl_priv, beacon_update);
2981 struct sk_buff *beacon; 2981 struct sk_buff *beacon;
2982 2982
2983 /* Pull updated AP beacon from mac80211. will fail if not in AP mode */ 2983 /* Pull updated AP beacon from mac80211. will fail if not in AP mode */
@@ -2999,7 +2999,7 @@ static void iwl3945_bg_beacon_update(struct work_struct *work)
2999 iwl3945_send_beacon_cmd(priv); 2999 iwl3945_send_beacon_cmd(priv);
3000} 3000}
3001 3001
3002static void iwl3945_rx_beacon_notif(struct iwl3945_priv *priv, 3002static void iwl3945_rx_beacon_notif(struct iwl_priv *priv,
3003 struct iwl_rx_mem_buffer *rxb) 3003 struct iwl_rx_mem_buffer *rxb)
3004{ 3004{
3005#ifdef CONFIG_IWL3945_DEBUG 3005#ifdef CONFIG_IWL3945_DEBUG
@@ -3022,7 +3022,7 @@ static void iwl3945_rx_beacon_notif(struct iwl3945_priv *priv,
3022} 3022}
3023 3023
3024/* Service response to REPLY_SCAN_CMD (0x80) */ 3024/* Service response to REPLY_SCAN_CMD (0x80) */
3025static void iwl3945_rx_reply_scan(struct iwl3945_priv *priv, 3025static void iwl3945_rx_reply_scan(struct iwl_priv *priv,
3026 struct iwl_rx_mem_buffer *rxb) 3026 struct iwl_rx_mem_buffer *rxb)
3027{ 3027{
3028#ifdef CONFIG_IWL3945_DEBUG 3028#ifdef CONFIG_IWL3945_DEBUG
@@ -3035,7 +3035,7 @@ static void iwl3945_rx_reply_scan(struct iwl3945_priv *priv,
3035} 3035}
3036 3036
3037/* Service SCAN_START_NOTIFICATION (0x82) */ 3037/* Service SCAN_START_NOTIFICATION (0x82) */
3038static void iwl3945_rx_scan_start_notif(struct iwl3945_priv *priv, 3038static void iwl3945_rx_scan_start_notif(struct iwl_priv *priv,
3039 struct iwl_rx_mem_buffer *rxb) 3039 struct iwl_rx_mem_buffer *rxb)
3040{ 3040{
3041 struct iwl_rx_packet *pkt = (void *)rxb->skb->data; 3041 struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
@@ -3052,7 +3052,7 @@ static void iwl3945_rx_scan_start_notif(struct iwl3945_priv *priv,
3052} 3052}
3053 3053
3054/* Service SCAN_RESULTS_NOTIFICATION (0x83) */ 3054/* Service SCAN_RESULTS_NOTIFICATION (0x83) */
3055static void iwl3945_rx_scan_results_notif(struct iwl3945_priv *priv, 3055static void iwl3945_rx_scan_results_notif(struct iwl_priv *priv,
3056 struct iwl_rx_mem_buffer *rxb) 3056 struct iwl_rx_mem_buffer *rxb)
3057{ 3057{
3058 struct iwl_rx_packet *pkt = (void *)rxb->skb->data; 3058 struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
@@ -3077,7 +3077,7 @@ static void iwl3945_rx_scan_results_notif(struct iwl3945_priv *priv,
3077} 3077}
3078 3078
3079/* Service SCAN_COMPLETE_NOTIFICATION (0x84) */ 3079/* Service SCAN_COMPLETE_NOTIFICATION (0x84) */
3080static void iwl3945_rx_scan_complete_notif(struct iwl3945_priv *priv, 3080static void iwl3945_rx_scan_complete_notif(struct iwl_priv *priv,
3081 struct iwl_rx_mem_buffer *rxb) 3081 struct iwl_rx_mem_buffer *rxb)
3082{ 3082{
3083 struct iwl_rx_packet *pkt = (void *)rxb->skb->data; 3083 struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
@@ -3140,7 +3140,7 @@ reschedule:
3140 3140
3141/* Handle notification from uCode that card's power state is changing 3141/* Handle notification from uCode that card's power state is changing
3142 * due to software, hardware, or critical temperature RFKILL */ 3142 * due to software, hardware, or critical temperature RFKILL */
3143static void iwl3945_rx_card_state_notif(struct iwl3945_priv *priv, 3143static void iwl3945_rx_card_state_notif(struct iwl_priv *priv,
3144 struct iwl_rx_mem_buffer *rxb) 3144 struct iwl_rx_mem_buffer *rxb)
3145{ 3145{
3146 struct iwl_rx_packet *pkt = (void *)rxb->skb->data; 3146 struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
@@ -3185,7 +3185,7 @@ static void iwl3945_rx_card_state_notif(struct iwl3945_priv *priv,
3185 * This function chains into the hardware specific files for them to setup 3185 * This function chains into the hardware specific files for them to setup
3186 * any hardware specific handlers as well. 3186 * any hardware specific handlers as well.
3187 */ 3187 */
3188static void iwl3945_setup_rx_handlers(struct iwl3945_priv *priv) 3188static void iwl3945_setup_rx_handlers(struct iwl_priv *priv)
3189{ 3189{
3190 priv->rx_handlers[REPLY_ALIVE] = iwl3945_rx_reply_alive; 3190 priv->rx_handlers[REPLY_ALIVE] = iwl3945_rx_reply_alive;
3191 priv->rx_handlers[REPLY_ADD_STA] = iwl3945_rx_reply_add_sta; 3191 priv->rx_handlers[REPLY_ADD_STA] = iwl3945_rx_reply_add_sta;
@@ -3223,7 +3223,7 @@ static void iwl3945_setup_rx_handlers(struct iwl3945_priv *priv)
3223 * When FW advances 'R' index, all entries between old and new 'R' index 3223 * When FW advances 'R' index, all entries between old and new 'R' index
3224 * need to be reclaimed. 3224 * need to be reclaimed.
3225 */ 3225 */
3226static void iwl3945_cmd_queue_reclaim(struct iwl3945_priv *priv, 3226static void iwl3945_cmd_queue_reclaim(struct iwl_priv *priv,
3227 int txq_id, int index) 3227 int txq_id, int index)
3228{ 3228{
3229 struct iwl3945_tx_queue *txq = &priv->txq39[txq_id]; 3229 struct iwl3945_tx_queue *txq = &priv->txq39[txq_id];
@@ -3258,7 +3258,7 @@ static void iwl3945_cmd_queue_reclaim(struct iwl3945_priv *priv,
3258 * will be executed. The attached skb (if present) will only be freed 3258 * will be executed. The attached skb (if present) will only be freed
3259 * if the callback returns 1 3259 * if the callback returns 1
3260 */ 3260 */
3261static void iwl3945_tx_cmd_complete(struct iwl3945_priv *priv, 3261static void iwl3945_tx_cmd_complete(struct iwl_priv *priv,
3262 struct iwl_rx_mem_buffer *rxb) 3262 struct iwl_rx_mem_buffer *rxb)
3263{ 3263{
3264 struct iwl_rx_packet *pkt = (struct iwl_rx_packet *)rxb->skb->data; 3264 struct iwl_rx_packet *pkt = (struct iwl_rx_packet *)rxb->skb->data;
@@ -3373,7 +3373,7 @@ static int iwl3945_rx_queue_space(const struct iwl_rx_queue *q)
3373/** 3373/**
3374 * iwl3945_rx_queue_update_write_ptr - Update the write pointer for the RX queue 3374 * iwl3945_rx_queue_update_write_ptr - Update the write pointer for the RX queue
3375 */ 3375 */
3376int iwl3945_rx_queue_update_write_ptr(struct iwl3945_priv *priv, struct iwl_rx_queue *q) 3376int iwl3945_rx_queue_update_write_ptr(struct iwl_priv *priv, struct iwl_rx_queue *q)
3377{ 3377{
3378 u32 reg = 0; 3378 u32 reg = 0;
3379 int rc = 0; 3379 int rc = 0;
@@ -3419,7 +3419,7 @@ int iwl3945_rx_queue_update_write_ptr(struct iwl3945_priv *priv, struct iwl_rx_q
3419/** 3419/**
3420 * iwl3945_dma_addr2rbd_ptr - convert a DMA address to a uCode read buffer ptr 3420 * iwl3945_dma_addr2rbd_ptr - convert a DMA address to a uCode read buffer ptr
3421 */ 3421 */
3422static inline __le32 iwl3945_dma_addr2rbd_ptr(struct iwl3945_priv *priv, 3422static inline __le32 iwl3945_dma_addr2rbd_ptr(struct iwl_priv *priv,
3423 dma_addr_t dma_addr) 3423 dma_addr_t dma_addr)
3424{ 3424{
3425 return cpu_to_le32((u32)dma_addr); 3425 return cpu_to_le32((u32)dma_addr);
@@ -3436,7 +3436,7 @@ static inline __le32 iwl3945_dma_addr2rbd_ptr(struct iwl3945_priv *priv,
3436 * also updates the memory address in the firmware to reference the new 3436 * also updates the memory address in the firmware to reference the new
3437 * target buffer. 3437 * target buffer.
3438 */ 3438 */
3439static int iwl3945_rx_queue_restock(struct iwl3945_priv *priv) 3439static int iwl3945_rx_queue_restock(struct iwl_priv *priv)
3440{ 3440{
3441 struct iwl_rx_queue *rxq = &priv->rxq; 3441 struct iwl_rx_queue *rxq = &priv->rxq;
3442 struct list_head *element; 3442 struct list_head *element;
@@ -3488,7 +3488,7 @@ static int iwl3945_rx_queue_restock(struct iwl3945_priv *priv)
3488 * Also restock the Rx queue via iwl3945_rx_queue_restock. 3488 * Also restock the Rx queue via iwl3945_rx_queue_restock.
3489 * This is called as a scheduled work item (except for during initialization) 3489 * This is called as a scheduled work item (except for during initialization)
3490 */ 3490 */
3491static void iwl3945_rx_allocate(struct iwl3945_priv *priv) 3491static void iwl3945_rx_allocate(struct iwl_priv *priv)
3492{ 3492{
3493 struct iwl_rx_queue *rxq = &priv->rxq; 3493 struct iwl_rx_queue *rxq = &priv->rxq;
3494 struct list_head *element; 3494 struct list_head *element;
@@ -3538,7 +3538,7 @@ static void iwl3945_rx_allocate(struct iwl3945_priv *priv)
3538 */ 3538 */
3539static void __iwl3945_rx_replenish(void *data) 3539static void __iwl3945_rx_replenish(void *data)
3540{ 3540{
3541 struct iwl3945_priv *priv = data; 3541 struct iwl_priv *priv = data;
3542 3542
3543 iwl3945_rx_allocate(priv); 3543 iwl3945_rx_allocate(priv);
3544 iwl3945_rx_queue_restock(priv); 3544 iwl3945_rx_queue_restock(priv);
@@ -3547,7 +3547,7 @@ static void __iwl3945_rx_replenish(void *data)
3547 3547
3548void iwl3945_rx_replenish(void *data) 3548void iwl3945_rx_replenish(void *data)
3549{ 3549{
3550 struct iwl3945_priv *priv = data; 3550 struct iwl_priv *priv = data;
3551 unsigned long flags; 3551 unsigned long flags;
3552 3552
3553 iwl3945_rx_allocate(priv); 3553 iwl3945_rx_allocate(priv);
@@ -3562,7 +3562,7 @@ void iwl3945_rx_replenish(void *data)
3562 * This free routine walks the list of POOL entries and if SKB is set to 3562 * This free routine walks the list of POOL entries and if SKB is set to
3563 * non NULL it is unmapped and freed 3563 * non NULL it is unmapped and freed
3564 */ 3564 */
3565static void iwl3945_rx_queue_free(struct iwl3945_priv *priv, struct iwl_rx_queue *rxq) 3565static void iwl3945_rx_queue_free(struct iwl_priv *priv, struct iwl_rx_queue *rxq)
3566{ 3566{
3567 int i; 3567 int i;
3568 for (i = 0; i < RX_QUEUE_SIZE + RX_FREE_BUFFERS; i++) { 3568 for (i = 0; i < RX_QUEUE_SIZE + RX_FREE_BUFFERS; i++) {
@@ -3579,7 +3579,7 @@ static void iwl3945_rx_queue_free(struct iwl3945_priv *priv, struct iwl_rx_queue
3579 rxq->bd = NULL; 3579 rxq->bd = NULL;
3580} 3580}
3581 3581
3582int iwl3945_rx_queue_alloc(struct iwl3945_priv *priv) 3582int iwl3945_rx_queue_alloc(struct iwl_priv *priv)
3583{ 3583{
3584 struct iwl_rx_queue *rxq = &priv->rxq; 3584 struct iwl_rx_queue *rxq = &priv->rxq;
3585 struct pci_dev *dev = priv->pci_dev; 3585 struct pci_dev *dev = priv->pci_dev;
@@ -3606,7 +3606,7 @@ int iwl3945_rx_queue_alloc(struct iwl3945_priv *priv)
3606 return 0; 3606 return 0;
3607} 3607}
3608 3608
3609void iwl3945_rx_queue_reset(struct iwl3945_priv *priv, struct iwl_rx_queue *rxq) 3609void iwl3945_rx_queue_reset(struct iwl_priv *priv, struct iwl_rx_queue *rxq)
3610{ 3610{
3611 unsigned long flags; 3611 unsigned long flags;
3612 int i; 3612 int i;
@@ -3720,7 +3720,7 @@ int iwl3945_calc_sig_qual(int rssi_dbm, int noise_dbm)
3720 * the appropriate handlers, including command responses, 3720 * the appropriate handlers, including command responses,
3721 * frame-received notifications, and other notifications. 3721 * frame-received notifications, and other notifications.
3722 */ 3722 */
3723static void iwl3945_rx_handle(struct iwl3945_priv *priv) 3723static void iwl3945_rx_handle(struct iwl_priv *priv)
3724{ 3724{
3725 struct iwl_rx_mem_buffer *rxb; 3725 struct iwl_rx_mem_buffer *rxb;
3726 struct iwl_rx_packet *pkt; 3726 struct iwl_rx_packet *pkt;
@@ -3828,7 +3828,7 @@ static void iwl3945_rx_handle(struct iwl3945_priv *priv)
3828/** 3828/**
3829 * iwl3945_tx_queue_update_write_ptr - Send new write index to hardware 3829 * iwl3945_tx_queue_update_write_ptr - Send new write index to hardware
3830 */ 3830 */
3831static int iwl3945_tx_queue_update_write_ptr(struct iwl3945_priv *priv, 3831static int iwl3945_tx_queue_update_write_ptr(struct iwl_priv *priv,
3832 struct iwl3945_tx_queue *txq) 3832 struct iwl3945_tx_queue *txq)
3833{ 3833{
3834 u32 reg = 0; 3834 u32 reg = 0;
@@ -3872,7 +3872,7 @@ static int iwl3945_tx_queue_update_write_ptr(struct iwl3945_priv *priv,
3872} 3872}
3873 3873
3874#ifdef CONFIG_IWL3945_DEBUG 3874#ifdef CONFIG_IWL3945_DEBUG
3875static void iwl3945_print_rx_config_cmd(struct iwl3945_priv *priv, 3875static void iwl3945_print_rx_config_cmd(struct iwl_priv *priv,
3876 struct iwl3945_rxon_cmd *rxon) 3876 struct iwl3945_rxon_cmd *rxon)
3877{ 3877{
3878 IWL_DEBUG_RADIO("RX CONFIG:\n"); 3878 IWL_DEBUG_RADIO("RX CONFIG:\n");
@@ -3891,7 +3891,7 @@ static void iwl3945_print_rx_config_cmd(struct iwl3945_priv *priv,
3891} 3891}
3892#endif 3892#endif
3893 3893
3894static void iwl3945_enable_interrupts(struct iwl3945_priv *priv) 3894static void iwl3945_enable_interrupts(struct iwl_priv *priv)
3895{ 3895{
3896 IWL_DEBUG_ISR("Enabling interrupts\n"); 3896 IWL_DEBUG_ISR("Enabling interrupts\n");
3897 set_bit(STATUS_INT_ENABLED, &priv->status); 3897 set_bit(STATUS_INT_ENABLED, &priv->status);
@@ -3900,7 +3900,7 @@ static void iwl3945_enable_interrupts(struct iwl3945_priv *priv)
3900 3900
3901 3901
3902/* call this function to flush any scheduled tasklet */ 3902/* call this function to flush any scheduled tasklet */
3903static inline void iwl_synchronize_irq(struct iwl3945_priv *priv) 3903static inline void iwl_synchronize_irq(struct iwl_priv *priv)
3904{ 3904{
3905 /* wait to make sure we flush pending tasklet*/ 3905 /* wait to make sure we flush pending tasklet*/
3906 synchronize_irq(priv->pci_dev->irq); 3906 synchronize_irq(priv->pci_dev->irq);
@@ -3908,7 +3908,7 @@ static inline void iwl_synchronize_irq(struct iwl3945_priv *priv)
3908} 3908}
3909 3909
3910 3910
3911static inline void iwl3945_disable_interrupts(struct iwl3945_priv *priv) 3911static inline void iwl3945_disable_interrupts(struct iwl_priv *priv)
3912{ 3912{
3913 clear_bit(STATUS_INT_ENABLED, &priv->status); 3913 clear_bit(STATUS_INT_ENABLED, &priv->status);
3914 3914
@@ -3945,7 +3945,7 @@ static const char *desc_lookup(int i)
3945#define ERROR_START_OFFSET (1 * sizeof(u32)) 3945#define ERROR_START_OFFSET (1 * sizeof(u32))
3946#define ERROR_ELEM_SIZE (7 * sizeof(u32)) 3946#define ERROR_ELEM_SIZE (7 * sizeof(u32))
3947 3947
3948static void iwl3945_dump_nic_error_log(struct iwl3945_priv *priv) 3948static void iwl3945_dump_nic_error_log(struct iwl_priv *priv)
3949{ 3949{
3950 u32 i; 3950 u32 i;
3951 u32 desc, time, count, base, data1; 3951 u32 desc, time, count, base, data1;
@@ -4008,7 +4008,7 @@ static void iwl3945_dump_nic_error_log(struct iwl3945_priv *priv)
4008 * 4008 *
4009 * NOTE: Must be called with iwl3945_grab_nic_access() already obtained! 4009 * NOTE: Must be called with iwl3945_grab_nic_access() already obtained!
4010 */ 4010 */
4011static void iwl3945_print_event_log(struct iwl3945_priv *priv, u32 start_idx, 4011static void iwl3945_print_event_log(struct iwl_priv *priv, u32 start_idx,
4012 u32 num_events, u32 mode) 4012 u32 num_events, u32 mode)
4013{ 4013{
4014 u32 i; 4014 u32 i;
@@ -4046,7 +4046,7 @@ static void iwl3945_print_event_log(struct iwl3945_priv *priv, u32 start_idx,
4046 } 4046 }
4047} 4047}
4048 4048
4049static void iwl3945_dump_nic_event_log(struct iwl3945_priv *priv) 4049static void iwl3945_dump_nic_event_log(struct iwl_priv *priv)
4050{ 4050{
4051 int rc; 4051 int rc;
4052 u32 base; /* SRAM byte address of event log header */ 4052 u32 base; /* SRAM byte address of event log header */
@@ -4101,7 +4101,7 @@ static void iwl3945_dump_nic_event_log(struct iwl3945_priv *priv)
4101/** 4101/**
4102 * iwl3945_irq_handle_error - called for HW or SW error interrupt from card 4102 * iwl3945_irq_handle_error - called for HW or SW error interrupt from card
4103 */ 4103 */
4104static void iwl3945_irq_handle_error(struct iwl3945_priv *priv) 4104static void iwl3945_irq_handle_error(struct iwl_priv *priv)
4105{ 4105{
4106 /* Set the FW error flag -- cleared on iwl3945_down */ 4106 /* Set the FW error flag -- cleared on iwl3945_down */
4107 set_bit(STATUS_FW_ERROR, &priv->status); 4107 set_bit(STATUS_FW_ERROR, &priv->status);
@@ -4136,7 +4136,7 @@ static void iwl3945_irq_handle_error(struct iwl3945_priv *priv)
4136 } 4136 }
4137} 4137}
4138 4138
4139static void iwl3945_error_recovery(struct iwl3945_priv *priv) 4139static void iwl3945_error_recovery(struct iwl_priv *priv)
4140{ 4140{
4141 unsigned long flags; 4141 unsigned long flags;
4142 4142
@@ -4153,7 +4153,7 @@ static void iwl3945_error_recovery(struct iwl3945_priv *priv)
4153 spin_unlock_irqrestore(&priv->lock, flags); 4153 spin_unlock_irqrestore(&priv->lock, flags);
4154} 4154}
4155 4155
4156static void iwl3945_irq_tasklet(struct iwl3945_priv *priv) 4156static void iwl3945_irq_tasklet(struct iwl_priv *priv)
4157{ 4157{
4158 u32 inta, handled = 0; 4158 u32 inta, handled = 0;
4159 u32 inta_fh; 4159 u32 inta_fh;
@@ -4295,7 +4295,7 @@ static void iwl3945_irq_tasklet(struct iwl3945_priv *priv)
4295 4295
4296static irqreturn_t iwl3945_isr(int irq, void *data) 4296static irqreturn_t iwl3945_isr(int irq, void *data)
4297{ 4297{
4298 struct iwl3945_priv *priv = data; 4298 struct iwl_priv *priv = data;
4299 u32 inta, inta_mask; 4299 u32 inta, inta_mask;
4300 u32 inta_fh; 4300 u32 inta_fh;
4301 if (!priv) 4301 if (!priv)
@@ -4403,7 +4403,7 @@ static const u8 iwl3945_eeprom_band_5[] = { /* 5725-5825MHz */
4403 145, 149, 153, 157, 161, 165 4403 145, 149, 153, 157, 161, 165
4404}; 4404};
4405 4405
4406static void iwl3945_init_band_reference(const struct iwl3945_priv *priv, int band, 4406static void iwl3945_init_band_reference(const struct iwl_priv *priv, int band,
4407 int *eeprom_ch_count, 4407 int *eeprom_ch_count,
4408 const struct iwl_eeprom_channel 4408 const struct iwl_eeprom_channel
4409 **eeprom_ch_info, 4409 **eeprom_ch_info,
@@ -4447,7 +4447,7 @@ static void iwl3945_init_band_reference(const struct iwl3945_priv *priv, int ban
4447 * Based on band and channel number. 4447 * Based on band and channel number.
4448 */ 4448 */
4449const struct iwl_channel_info * 4449const struct iwl_channel_info *
4450iwl3945_get_channel_info(const struct iwl3945_priv *priv, 4450iwl3945_get_channel_info(const struct iwl_priv *priv,
4451 enum ieee80211_band band, u16 channel) 4451 enum ieee80211_band band, u16 channel)
4452{ 4452{
4453 int i; 4453 int i;
@@ -4477,7 +4477,7 @@ iwl3945_get_channel_info(const struct iwl3945_priv *priv,
4477/** 4477/**
4478 * iwl3945_init_channel_map - Set up driver's info for all possible channels 4478 * iwl3945_init_channel_map - Set up driver's info for all possible channels
4479 */ 4479 */
4480static int iwl3945_init_channel_map(struct iwl3945_priv *priv) 4480static int iwl3945_init_channel_map(struct iwl_priv *priv)
4481{ 4481{
4482 int eeprom_ch_count = 0; 4482 int eeprom_ch_count = 0;
4483 const u8 *eeprom_ch_index = NULL; 4483 const u8 *eeprom_ch_index = NULL;
@@ -4596,7 +4596,7 @@ static int iwl3945_init_channel_map(struct iwl3945_priv *priv)
4596/* 4596/*
4597 * iwl3945_free_channel_map - undo allocations in iwl3945_init_channel_map 4597 * iwl3945_free_channel_map - undo allocations in iwl3945_init_channel_map
4598 */ 4598 */
4599static void iwl3945_free_channel_map(struct iwl3945_priv *priv) 4599static void iwl3945_free_channel_map(struct iwl_priv *priv)
4600{ 4600{
4601 kfree(priv->channel_info); 4601 kfree(priv->channel_info);
4602 priv->channel_count = 0; 4602 priv->channel_count = 0;
@@ -4630,7 +4630,7 @@ static void iwl3945_free_channel_map(struct iwl3945_priv *priv)
4630 4630
4631#define IWL_SCAN_PROBE_MASK(n) (BIT(n) | (BIT(n) - BIT(1))) 4631#define IWL_SCAN_PROBE_MASK(n) (BIT(n) | (BIT(n) - BIT(1)))
4632 4632
4633static inline u16 iwl3945_get_active_dwell_time(struct iwl3945_priv *priv, 4633static inline u16 iwl3945_get_active_dwell_time(struct iwl_priv *priv,
4634 enum ieee80211_band band, 4634 enum ieee80211_band band,
4635 u8 n_probes) 4635 u8 n_probes)
4636{ 4636{
@@ -4642,7 +4642,7 @@ static inline u16 iwl3945_get_active_dwell_time(struct iwl3945_priv *priv,
4642 IWL_ACTIVE_DWELL_FACTOR_24GHZ * (n_probes + 1); 4642 IWL_ACTIVE_DWELL_FACTOR_24GHZ * (n_probes + 1);
4643} 4643}
4644 4644
4645static u16 iwl3945_get_passive_dwell_time(struct iwl3945_priv *priv, 4645static u16 iwl3945_get_passive_dwell_time(struct iwl_priv *priv,
4646 enum ieee80211_band band) 4646 enum ieee80211_band band)
4647{ 4647{
4648 u16 passive = (band == IEEE80211_BAND_2GHZ) ? 4648 u16 passive = (band == IEEE80211_BAND_2GHZ) ?
@@ -4662,7 +4662,7 @@ static u16 iwl3945_get_passive_dwell_time(struct iwl3945_priv *priv,
4662 return passive; 4662 return passive;
4663} 4663}
4664 4664
4665static int iwl3945_get_channels_for_scan(struct iwl3945_priv *priv, 4665static int iwl3945_get_channels_for_scan(struct iwl_priv *priv,
4666 enum ieee80211_band band, 4666 enum ieee80211_band band,
4667 u8 is_active, u8 n_probes, 4667 u8 is_active, u8 n_probes,
4668 struct iwl3945_scan_channel *scan_ch) 4668 struct iwl3945_scan_channel *scan_ch)
@@ -4756,7 +4756,7 @@ static int iwl3945_get_channels_for_scan(struct iwl3945_priv *priv,
4756 return added; 4756 return added;
4757} 4757}
4758 4758
4759static void iwl3945_init_hw_rates(struct iwl3945_priv *priv, 4759static void iwl3945_init_hw_rates(struct iwl_priv *priv,
4760 struct ieee80211_rate *rates) 4760 struct ieee80211_rate *rates)
4761{ 4761{
4762 int i; 4762 int i;
@@ -4779,7 +4779,7 @@ static void iwl3945_init_hw_rates(struct iwl3945_priv *priv,
4779/** 4779/**
4780 * iwl3945_init_geos - Initialize mac80211's geo/channel info based from eeprom 4780 * iwl3945_init_geos - Initialize mac80211's geo/channel info based from eeprom
4781 */ 4781 */
4782static int iwl3945_init_geos(struct iwl3945_priv *priv) 4782static int iwl3945_init_geos(struct iwl_priv *priv)
4783{ 4783{
4784 struct iwl_channel_info *ch; 4784 struct iwl_channel_info *ch;
4785 struct ieee80211_supported_band *sband; 4785 struct ieee80211_supported_band *sband;
@@ -4901,7 +4901,7 @@ static int iwl3945_init_geos(struct iwl3945_priv *priv)
4901/* 4901/*
4902 * iwl3945_free_geos - undo allocations in iwl3945_init_geos 4902 * iwl3945_free_geos - undo allocations in iwl3945_init_geos
4903 */ 4903 */
4904static void iwl3945_free_geos(struct iwl3945_priv *priv) 4904static void iwl3945_free_geos(struct iwl_priv *priv)
4905{ 4905{
4906 kfree(priv->ieee_channels); 4906 kfree(priv->ieee_channels);
4907 kfree(priv->ieee_rates); 4907 kfree(priv->ieee_rates);
@@ -4914,7 +4914,7 @@ static void iwl3945_free_geos(struct iwl3945_priv *priv)
4914 * 4914 *
4915 ******************************************************************************/ 4915 ******************************************************************************/
4916 4916
4917static void iwl3945_dealloc_ucode_pci(struct iwl3945_priv *priv) 4917static void iwl3945_dealloc_ucode_pci(struct iwl_priv *priv)
4918{ 4918{
4919 iwl_free_fw_desc(priv->pci_dev, &priv->ucode_code); 4919 iwl_free_fw_desc(priv->pci_dev, &priv->ucode_code);
4920 iwl_free_fw_desc(priv->pci_dev, &priv->ucode_data); 4920 iwl_free_fw_desc(priv->pci_dev, &priv->ucode_data);
@@ -4928,7 +4928,7 @@ static void iwl3945_dealloc_ucode_pci(struct iwl3945_priv *priv)
4928 * iwl3945_verify_inst_full - verify runtime uCode image in card vs. host, 4928 * iwl3945_verify_inst_full - verify runtime uCode image in card vs. host,
4929 * looking at all data. 4929 * looking at all data.
4930 */ 4930 */
4931static int iwl3945_verify_inst_full(struct iwl3945_priv *priv, __le32 *image, u32 len) 4931static int iwl3945_verify_inst_full(struct iwl_priv *priv, __le32 *image, u32 len)
4932{ 4932{
4933 u32 val; 4933 u32 val;
4934 u32 save_len = len; 4934 u32 save_len = len;
@@ -4975,7 +4975,7 @@ static int iwl3945_verify_inst_full(struct iwl3945_priv *priv, __le32 *image, u3
4975 * using sample data 100 bytes apart. If these sample points are good, 4975 * using sample data 100 bytes apart. If these sample points are good,
4976 * it's a pretty good bet that everything between them is good, too. 4976 * it's a pretty good bet that everything between them is good, too.
4977 */ 4977 */
4978static int iwl3945_verify_inst_sparse(struct iwl3945_priv *priv, __le32 *image, u32 len) 4978static int iwl3945_verify_inst_sparse(struct iwl_priv *priv, __le32 *image, u32 len)
4979{ 4979{
4980 u32 val; 4980 u32 val;
4981 int rc = 0; 4981 int rc = 0;
@@ -5018,7 +5018,7 @@ static int iwl3945_verify_inst_sparse(struct iwl3945_priv *priv, __le32 *image,
5018 * iwl3945_verify_ucode - determine which instruction image is in SRAM, 5018 * iwl3945_verify_ucode - determine which instruction image is in SRAM,
5019 * and verify its contents 5019 * and verify its contents
5020 */ 5020 */
5021static int iwl3945_verify_ucode(struct iwl3945_priv *priv) 5021static int iwl3945_verify_ucode(struct iwl_priv *priv)
5022{ 5022{
5023 __le32 *image; 5023 __le32 *image;
5024 u32 len; 5024 u32 len;
@@ -5065,7 +5065,7 @@ static int iwl3945_verify_ucode(struct iwl3945_priv *priv)
5065 5065
5066 5066
5067/* check contents of special bootstrap uCode SRAM */ 5067/* check contents of special bootstrap uCode SRAM */
5068static int iwl3945_verify_bsm(struct iwl3945_priv *priv) 5068static int iwl3945_verify_bsm(struct iwl_priv *priv)
5069{ 5069{
5070 __le32 *image = priv->ucode_boot.v_addr; 5070 __le32 *image = priv->ucode_boot.v_addr;
5071 u32 len = priv->ucode_boot.len; 5071 u32 len = priv->ucode_boot.len;
@@ -5127,7 +5127,7 @@ static int iwl3945_verify_bsm(struct iwl3945_priv *priv)
5127 * the runtime uCode instructions and the backup data cache into SRAM, 5127 * the runtime uCode instructions and the backup data cache into SRAM,
5128 * and re-launches the runtime uCode from where it left off. 5128 * and re-launches the runtime uCode from where it left off.
5129 */ 5129 */
5130static int iwl3945_load_bsm(struct iwl3945_priv *priv) 5130static int iwl3945_load_bsm(struct iwl_priv *priv)
5131{ 5131{
5132 __le32 *image = priv->ucode_boot.v_addr; 5132 __le32 *image = priv->ucode_boot.v_addr;
5133 u32 len = priv->ucode_boot.len; 5133 u32 len = priv->ucode_boot.len;
@@ -5213,7 +5213,7 @@ static int iwl3945_load_bsm(struct iwl3945_priv *priv)
5213 return 0; 5213 return 0;
5214} 5214}
5215 5215
5216static void iwl3945_nic_start(struct iwl3945_priv *priv) 5216static void iwl3945_nic_start(struct iwl_priv *priv)
5217{ 5217{
5218 /* Remove all resets to allow NIC to operate */ 5218 /* Remove all resets to allow NIC to operate */
5219 iwl3945_write32(priv, CSR_RESET, 0); 5219 iwl3945_write32(priv, CSR_RESET, 0);
@@ -5224,7 +5224,7 @@ static void iwl3945_nic_start(struct iwl3945_priv *priv)
5224 * 5224 *
5225 * Copy into buffers for card to fetch via bus-mastering 5225 * Copy into buffers for card to fetch via bus-mastering
5226 */ 5226 */
5227static int iwl3945_read_ucode(struct iwl3945_priv *priv) 5227static int iwl3945_read_ucode(struct iwl_priv *priv)
5228{ 5228{
5229 struct iwl_ucode *ucode; 5229 struct iwl_ucode *ucode;
5230 int ret = -EINVAL, index; 5230 int ret = -EINVAL, index;
@@ -5465,7 +5465,7 @@ static int iwl3945_read_ucode(struct iwl3945_priv *priv)
5465 * We need to replace them to load runtime uCode inst and data, 5465 * We need to replace them to load runtime uCode inst and data,
5466 * and to save runtime data when powering down. 5466 * and to save runtime data when powering down.
5467 */ 5467 */
5468static int iwl3945_set_ucode_ptrs(struct iwl3945_priv *priv) 5468static int iwl3945_set_ucode_ptrs(struct iwl_priv *priv)
5469{ 5469{
5470 dma_addr_t pinst; 5470 dma_addr_t pinst;
5471 dma_addr_t pdata; 5471 dma_addr_t pdata;
@@ -5510,7 +5510,7 @@ static int iwl3945_set_ucode_ptrs(struct iwl3945_priv *priv)
5510 * 5510 *
5511 * Tell "initialize" uCode to go ahead and load the runtime uCode. 5511 * Tell "initialize" uCode to go ahead and load the runtime uCode.
5512 */ 5512 */
5513static void iwl3945_init_alive_start(struct iwl3945_priv *priv) 5513static void iwl3945_init_alive_start(struct iwl_priv *priv)
5514{ 5514{
5515 /* Check alive response for "valid" sign from uCode */ 5515 /* Check alive response for "valid" sign from uCode */
5516 if (priv->card_alive_init.is_valid != UCODE_VALID_OK) { 5516 if (priv->card_alive_init.is_valid != UCODE_VALID_OK) {
@@ -5556,7 +5556,7 @@ static int iwl3945_mac_beacon_update(struct ieee80211_hw *hw,
5556 * from protocol/runtime uCode (initialization uCode's 5556 * from protocol/runtime uCode (initialization uCode's
5557 * Alive gets handled by iwl3945_init_alive_start()). 5557 * Alive gets handled by iwl3945_init_alive_start()).
5558 */ 5558 */
5559static void iwl3945_alive_start(struct iwl3945_priv *priv) 5559static void iwl3945_alive_start(struct iwl_priv *priv)
5560{ 5560{
5561 int rc = 0; 5561 int rc = 0;
5562 int thermal_spin = 0; 5562 int thermal_spin = 0;
@@ -5668,9 +5668,9 @@ static void iwl3945_alive_start(struct iwl3945_priv *priv)
5668 queue_work(priv->workqueue, &priv->restart); 5668 queue_work(priv->workqueue, &priv->restart);
5669} 5669}
5670 5670
5671static void iwl3945_cancel_deferred_work(struct iwl3945_priv *priv); 5671static void iwl3945_cancel_deferred_work(struct iwl_priv *priv);
5672 5672
5673static void __iwl3945_down(struct iwl3945_priv *priv) 5673static void __iwl3945_down(struct iwl_priv *priv)
5674{ 5674{
5675 unsigned long flags; 5675 unsigned long flags;
5676 int exit_pending = test_bit(STATUS_EXIT_PENDING, &priv->status); 5676 int exit_pending = test_bit(STATUS_EXIT_PENDING, &priv->status);
@@ -5769,7 +5769,7 @@ static void __iwl3945_down(struct iwl3945_priv *priv)
5769 iwl3945_clear_free_frames(priv); 5769 iwl3945_clear_free_frames(priv);
5770} 5770}
5771 5771
5772static void iwl3945_down(struct iwl3945_priv *priv) 5772static void iwl3945_down(struct iwl_priv *priv)
5773{ 5773{
5774 mutex_lock(&priv->mutex); 5774 mutex_lock(&priv->mutex);
5775 __iwl3945_down(priv); 5775 __iwl3945_down(priv);
@@ -5780,7 +5780,7 @@ static void iwl3945_down(struct iwl3945_priv *priv)
5780 5780
5781#define MAX_HW_RESTARTS 5 5781#define MAX_HW_RESTARTS 5
5782 5782
5783static int __iwl3945_up(struct iwl3945_priv *priv) 5783static int __iwl3945_up(struct iwl_priv *priv)
5784{ 5784{
5785 int rc, i; 5785 int rc, i;
5786 5786
@@ -5884,8 +5884,8 @@ static int __iwl3945_up(struct iwl3945_priv *priv)
5884 5884
5885static void iwl3945_bg_init_alive_start(struct work_struct *data) 5885static void iwl3945_bg_init_alive_start(struct work_struct *data)
5886{ 5886{
5887 struct iwl3945_priv *priv = 5887 struct iwl_priv *priv =
5888 container_of(data, struct iwl3945_priv, init_alive_start.work); 5888 container_of(data, struct iwl_priv, init_alive_start.work);
5889 5889
5890 if (test_bit(STATUS_EXIT_PENDING, &priv->status)) 5890 if (test_bit(STATUS_EXIT_PENDING, &priv->status))
5891 return; 5891 return;
@@ -5897,8 +5897,8 @@ static void iwl3945_bg_init_alive_start(struct work_struct *data)
5897 5897
5898static void iwl3945_bg_alive_start(struct work_struct *data) 5898static void iwl3945_bg_alive_start(struct work_struct *data)
5899{ 5899{
5900 struct iwl3945_priv *priv = 5900 struct iwl_priv *priv =
5901 container_of(data, struct iwl3945_priv, alive_start.work); 5901 container_of(data, struct iwl_priv, alive_start.work);
5902 5902
5903 if (test_bit(STATUS_EXIT_PENDING, &priv->status)) 5903 if (test_bit(STATUS_EXIT_PENDING, &priv->status))
5904 return; 5904 return;
@@ -5910,7 +5910,7 @@ static void iwl3945_bg_alive_start(struct work_struct *data)
5910 5910
5911static void iwl3945_bg_rf_kill(struct work_struct *work) 5911static void iwl3945_bg_rf_kill(struct work_struct *work)
5912{ 5912{
5913 struct iwl3945_priv *priv = container_of(work, struct iwl3945_priv, rf_kill); 5913 struct iwl_priv *priv = container_of(work, struct iwl_priv, rf_kill);
5914 5914
5915 wake_up_interruptible(&priv->wait_command_queue); 5915 wake_up_interruptible(&priv->wait_command_queue);
5916 5916
@@ -5944,8 +5944,8 @@ static void iwl3945_bg_rf_kill(struct work_struct *work)
5944 5944
5945static void iwl3945_bg_scan_check(struct work_struct *data) 5945static void iwl3945_bg_scan_check(struct work_struct *data)
5946{ 5946{
5947 struct iwl3945_priv *priv = 5947 struct iwl_priv *priv =
5948 container_of(data, struct iwl3945_priv, scan_check.work); 5948 container_of(data, struct iwl_priv, scan_check.work);
5949 5949
5950 if (test_bit(STATUS_EXIT_PENDING, &priv->status)) 5950 if (test_bit(STATUS_EXIT_PENDING, &priv->status))
5951 return; 5951 return;
@@ -5965,8 +5965,8 @@ static void iwl3945_bg_scan_check(struct work_struct *data)
5965 5965
5966static void iwl3945_bg_request_scan(struct work_struct *data) 5966static void iwl3945_bg_request_scan(struct work_struct *data)
5967{ 5967{
5968 struct iwl3945_priv *priv = 5968 struct iwl_priv *priv =
5969 container_of(data, struct iwl3945_priv, request_scan); 5969 container_of(data, struct iwl_priv, request_scan);
5970 struct iwl3945_host_cmd cmd = { 5970 struct iwl3945_host_cmd cmd = {
5971 .id = REPLY_SCAN_CMD, 5971 .id = REPLY_SCAN_CMD,
5972 .len = sizeof(struct iwl3945_scan_cmd), 5972 .len = sizeof(struct iwl3945_scan_cmd),
@@ -6161,7 +6161,7 @@ static void iwl3945_bg_request_scan(struct work_struct *data)
6161 6161
6162static void iwl3945_bg_up(struct work_struct *data) 6162static void iwl3945_bg_up(struct work_struct *data)
6163{ 6163{
6164 struct iwl3945_priv *priv = container_of(data, struct iwl3945_priv, up); 6164 struct iwl_priv *priv = container_of(data, struct iwl_priv, up);
6165 6165
6166 if (test_bit(STATUS_EXIT_PENDING, &priv->status)) 6166 if (test_bit(STATUS_EXIT_PENDING, &priv->status))
6167 return; 6167 return;
@@ -6174,7 +6174,7 @@ static void iwl3945_bg_up(struct work_struct *data)
6174 6174
6175static void iwl3945_bg_restart(struct work_struct *data) 6175static void iwl3945_bg_restart(struct work_struct *data)
6176{ 6176{
6177 struct iwl3945_priv *priv = container_of(data, struct iwl3945_priv, restart); 6177 struct iwl_priv *priv = container_of(data, struct iwl_priv, restart);
6178 6178
6179 if (test_bit(STATUS_EXIT_PENDING, &priv->status)) 6179 if (test_bit(STATUS_EXIT_PENDING, &priv->status))
6180 return; 6180 return;
@@ -6185,8 +6185,8 @@ static void iwl3945_bg_restart(struct work_struct *data)
6185 6185
6186static void iwl3945_bg_rx_replenish(struct work_struct *data) 6186static void iwl3945_bg_rx_replenish(struct work_struct *data)
6187{ 6187{
6188 struct iwl3945_priv *priv = 6188 struct iwl_priv *priv =
6189 container_of(data, struct iwl3945_priv, rx_replenish); 6189 container_of(data, struct iwl_priv, rx_replenish);
6190 6190
6191 if (test_bit(STATUS_EXIT_PENDING, &priv->status)) 6191 if (test_bit(STATUS_EXIT_PENDING, &priv->status))
6192 return; 6192 return;
@@ -6198,7 +6198,7 @@ static void iwl3945_bg_rx_replenish(struct work_struct *data)
6198 6198
6199#define IWL_DELAY_NEXT_SCAN (HZ*2) 6199#define IWL_DELAY_NEXT_SCAN (HZ*2)
6200 6200
6201static void iwl3945_post_associate(struct iwl3945_priv *priv) 6201static void iwl3945_post_associate(struct iwl_priv *priv)
6202{ 6202{
6203 int rc = 0; 6203 int rc = 0;
6204 struct ieee80211_conf *conf = NULL; 6204 struct ieee80211_conf *conf = NULL;
@@ -6290,7 +6290,7 @@ static void iwl3945_post_associate(struct iwl3945_priv *priv)
6290 6290
6291static void iwl3945_bg_abort_scan(struct work_struct *work) 6291static void iwl3945_bg_abort_scan(struct work_struct *work)
6292{ 6292{
6293 struct iwl3945_priv *priv = container_of(work, struct iwl3945_priv, abort_scan); 6293 struct iwl_priv *priv = container_of(work, struct iwl_priv, abort_scan);
6294 6294
6295 if (!iwl3945_is_ready(priv)) 6295 if (!iwl3945_is_ready(priv))
6296 return; 6296 return;
@@ -6307,8 +6307,8 @@ static int iwl3945_mac_config(struct ieee80211_hw *hw, u32 changed);
6307 6307
6308static void iwl3945_bg_scan_completed(struct work_struct *work) 6308static void iwl3945_bg_scan_completed(struct work_struct *work)
6309{ 6309{
6310 struct iwl3945_priv *priv = 6310 struct iwl_priv *priv =
6311 container_of(work, struct iwl3945_priv, scan_completed); 6311 container_of(work, struct iwl_priv, scan_completed);
6312 6312
6313 IWL_DEBUG(IWL_DL_INFO | IWL_DL_SCAN, "SCAN complete scan\n"); 6313 IWL_DEBUG(IWL_DL_INFO | IWL_DL_SCAN, "SCAN complete scan\n");
6314 6314
@@ -6337,7 +6337,7 @@ static void iwl3945_bg_scan_completed(struct work_struct *work)
6337 6337
6338static int iwl3945_mac_start(struct ieee80211_hw *hw) 6338static int iwl3945_mac_start(struct ieee80211_hw *hw)
6339{ 6339{
6340 struct iwl3945_priv *priv = hw->priv; 6340 struct iwl_priv *priv = hw->priv;
6341 int ret; 6341 int ret;
6342 6342
6343 IWL_DEBUG_MAC80211("enter\n"); 6343 IWL_DEBUG_MAC80211("enter\n");
@@ -6416,7 +6416,7 @@ out_disable_msi:
6416 6416
6417static void iwl3945_mac_stop(struct ieee80211_hw *hw) 6417static void iwl3945_mac_stop(struct ieee80211_hw *hw)
6418{ 6418{
6419 struct iwl3945_priv *priv = hw->priv; 6419 struct iwl_priv *priv = hw->priv;
6420 6420
6421 IWL_DEBUG_MAC80211("enter\n"); 6421 IWL_DEBUG_MAC80211("enter\n");
6422 6422
@@ -6449,7 +6449,7 @@ static void iwl3945_mac_stop(struct ieee80211_hw *hw)
6449 6449
6450static int iwl3945_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb) 6450static int iwl3945_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
6451{ 6451{
6452 struct iwl3945_priv *priv = hw->priv; 6452 struct iwl_priv *priv = hw->priv;
6453 6453
6454 IWL_DEBUG_MAC80211("enter\n"); 6454 IWL_DEBUG_MAC80211("enter\n");
6455 6455
@@ -6466,7 +6466,7 @@ static int iwl3945_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
6466static int iwl3945_mac_add_interface(struct ieee80211_hw *hw, 6466static int iwl3945_mac_add_interface(struct ieee80211_hw *hw,
6467 struct ieee80211_if_init_conf *conf) 6467 struct ieee80211_if_init_conf *conf)
6468{ 6468{
6469 struct iwl3945_priv *priv = hw->priv; 6469 struct iwl_priv *priv = hw->priv;
6470 unsigned long flags; 6470 unsigned long flags;
6471 6471
6472 IWL_DEBUG_MAC80211("enter: type %d\n", conf->type); 6472 IWL_DEBUG_MAC80211("enter: type %d\n", conf->type);
@@ -6507,7 +6507,7 @@ static int iwl3945_mac_add_interface(struct ieee80211_hw *hw,
6507 */ 6507 */
6508static int iwl3945_mac_config(struct ieee80211_hw *hw, u32 changed) 6508static int iwl3945_mac_config(struct ieee80211_hw *hw, u32 changed)
6509{ 6509{
6510 struct iwl3945_priv *priv = hw->priv; 6510 struct iwl_priv *priv = hw->priv;
6511 const struct iwl_channel_info *ch_info; 6511 const struct iwl_channel_info *ch_info;
6512 struct ieee80211_conf *conf = &hw->conf; 6512 struct ieee80211_conf *conf = &hw->conf;
6513 unsigned long flags; 6513 unsigned long flags;
@@ -6590,7 +6590,7 @@ out:
6590 return ret; 6590 return ret;
6591} 6591}
6592 6592
6593static void iwl3945_config_ap(struct iwl3945_priv *priv) 6593static void iwl3945_config_ap(struct iwl_priv *priv)
6594{ 6594{
6595 int rc = 0; 6595 int rc = 0;
6596 6596
@@ -6649,9 +6649,9 @@ static void iwl3945_config_ap(struct iwl3945_priv *priv)
6649 6649
6650static int iwl3945_mac_config_interface(struct ieee80211_hw *hw, 6650static int iwl3945_mac_config_interface(struct ieee80211_hw *hw,
6651 struct ieee80211_vif *vif, 6651 struct ieee80211_vif *vif,
6652 struct ieee80211_if_conf *conf) 6652 struct ieee80211_if_conf *conf)
6653{ 6653{
6654 struct iwl3945_priv *priv = hw->priv; 6654 struct iwl_priv *priv = hw->priv;
6655 int rc; 6655 int rc;
6656 6656
6657 if (conf == NULL) 6657 if (conf == NULL)
@@ -6752,7 +6752,7 @@ static void iwl3945_configure_filter(struct ieee80211_hw *hw,
6752 unsigned int *total_flags, 6752 unsigned int *total_flags,
6753 int mc_count, struct dev_addr_list *mc_list) 6753 int mc_count, struct dev_addr_list *mc_list)
6754{ 6754{
6755 struct iwl3945_priv *priv = hw->priv; 6755 struct iwl_priv *priv = hw->priv;
6756 __le32 *filter_flags = &priv->staging39_rxon.filter_flags; 6756 __le32 *filter_flags = &priv->staging39_rxon.filter_flags;
6757 6757
6758 IWL_DEBUG_MAC80211("Enter: changed: 0x%x, total: 0x%x\n", 6758 IWL_DEBUG_MAC80211("Enter: changed: 0x%x, total: 0x%x\n",
@@ -6796,7 +6796,7 @@ static void iwl3945_configure_filter(struct ieee80211_hw *hw,
6796static void iwl3945_mac_remove_interface(struct ieee80211_hw *hw, 6796static void iwl3945_mac_remove_interface(struct ieee80211_hw *hw,
6797 struct ieee80211_if_init_conf *conf) 6797 struct ieee80211_if_init_conf *conf)
6798{ 6798{
6799 struct iwl3945_priv *priv = hw->priv; 6799 struct iwl_priv *priv = hw->priv;
6800 6800
6801 IWL_DEBUG_MAC80211("enter\n"); 6801 IWL_DEBUG_MAC80211("enter\n");
6802 6802
@@ -6823,7 +6823,7 @@ static void iwl3945_bss_info_changed(struct ieee80211_hw *hw,
6823 struct ieee80211_bss_conf *bss_conf, 6823 struct ieee80211_bss_conf *bss_conf,
6824 u32 changes) 6824 u32 changes)
6825{ 6825{
6826 struct iwl3945_priv *priv = hw->priv; 6826 struct iwl_priv *priv = hw->priv;
6827 6827
6828 IWL_DEBUG_MAC80211("changes = 0x%X\n", changes); 6828 IWL_DEBUG_MAC80211("changes = 0x%X\n", changes);
6829 6829
@@ -6875,7 +6875,7 @@ static int iwl3945_mac_hw_scan(struct ieee80211_hw *hw, u8 *ssid, size_t len)
6875{ 6875{
6876 int rc = 0; 6876 int rc = 0;
6877 unsigned long flags; 6877 unsigned long flags;
6878 struct iwl3945_priv *priv = hw->priv; 6878 struct iwl_priv *priv = hw->priv;
6879 DECLARE_SSID_BUF(ssid_buf); 6879 DECLARE_SSID_BUF(ssid_buf);
6880 6880
6881 IWL_DEBUG_MAC80211("enter\n"); 6881 IWL_DEBUG_MAC80211("enter\n");
@@ -6928,7 +6928,7 @@ static int iwl3945_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
6928 const u8 *local_addr, const u8 *addr, 6928 const u8 *local_addr, const u8 *addr,
6929 struct ieee80211_key_conf *key) 6929 struct ieee80211_key_conf *key)
6930{ 6930{
6931 struct iwl3945_priv *priv = hw->priv; 6931 struct iwl_priv *priv = hw->priv;
6932 int rc = 0; 6932 int rc = 0;
6933 u8 sta_id; 6933 u8 sta_id;
6934 6934
@@ -6986,7 +6986,7 @@ static int iwl3945_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
6986static int iwl3945_mac_conf_tx(struct ieee80211_hw *hw, u16 queue, 6986static int iwl3945_mac_conf_tx(struct ieee80211_hw *hw, u16 queue,
6987 const struct ieee80211_tx_queue_params *params) 6987 const struct ieee80211_tx_queue_params *params)
6988{ 6988{
6989 struct iwl3945_priv *priv = hw->priv; 6989 struct iwl_priv *priv = hw->priv;
6990 unsigned long flags; 6990 unsigned long flags;
6991 int q; 6991 int q;
6992 6992
@@ -7032,7 +7032,7 @@ static int iwl3945_mac_conf_tx(struct ieee80211_hw *hw, u16 queue,
7032static int iwl3945_mac_get_tx_stats(struct ieee80211_hw *hw, 7032static int iwl3945_mac_get_tx_stats(struct ieee80211_hw *hw,
7033 struct ieee80211_tx_queue_stats *stats) 7033 struct ieee80211_tx_queue_stats *stats)
7034{ 7034{
7035 struct iwl3945_priv *priv = hw->priv; 7035 struct iwl_priv *priv = hw->priv;
7036 int i, avail; 7036 int i, avail;
7037 struct iwl3945_tx_queue *txq; 7037 struct iwl3945_tx_queue *txq;
7038 struct iwl_queue *q; 7038 struct iwl_queue *q;
@@ -7066,7 +7066,7 @@ static int iwl3945_mac_get_tx_stats(struct ieee80211_hw *hw,
7066 7066
7067static void iwl3945_mac_reset_tsf(struct ieee80211_hw *hw) 7067static void iwl3945_mac_reset_tsf(struct ieee80211_hw *hw)
7068{ 7068{
7069 struct iwl3945_priv *priv = hw->priv; 7069 struct iwl_priv *priv = hw->priv;
7070 unsigned long flags; 7070 unsigned long flags;
7071 7071
7072 mutex_lock(&priv->mutex); 7072 mutex_lock(&priv->mutex);
@@ -7125,7 +7125,7 @@ static void iwl3945_mac_reset_tsf(struct ieee80211_hw *hw)
7125 7125
7126static int iwl3945_mac_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb) 7126static int iwl3945_mac_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb)
7127{ 7127{
7128 struct iwl3945_priv *priv = hw->priv; 7128 struct iwl_priv *priv = hw->priv;
7129 unsigned long flags; 7129 unsigned long flags;
7130 7130
7131 IWL_DEBUG_MAC80211("enter\n"); 7131 IWL_DEBUG_MAC80211("enter\n");
@@ -7178,7 +7178,7 @@ static int iwl3945_mac_beacon_update(struct ieee80211_hw *hw, struct sk_buff *sk
7178static ssize_t show_debug_level(struct device *d, 7178static ssize_t show_debug_level(struct device *d,
7179 struct device_attribute *attr, char *buf) 7179 struct device_attribute *attr, char *buf)
7180{ 7180{
7181 struct iwl3945_priv *priv = d->driver_data; 7181 struct iwl_priv *priv = d->driver_data;
7182 7182
7183 return sprintf(buf, "0x%08X\n", priv->debug_level); 7183 return sprintf(buf, "0x%08X\n", priv->debug_level);
7184} 7184}
@@ -7186,7 +7186,7 @@ static ssize_t store_debug_level(struct device *d,
7186 struct device_attribute *attr, 7186 struct device_attribute *attr,
7187 const char *buf, size_t count) 7187 const char *buf, size_t count)
7188{ 7188{
7189 struct iwl3945_priv *priv = d->driver_data; 7189 struct iwl_priv *priv = d->driver_data;
7190 unsigned long val; 7190 unsigned long val;
7191 int ret; 7191 int ret;
7192 7192
@@ -7208,7 +7208,7 @@ static DEVICE_ATTR(debug_level, S_IWUSR | S_IRUGO,
7208static ssize_t show_temperature(struct device *d, 7208static ssize_t show_temperature(struct device *d,
7209 struct device_attribute *attr, char *buf) 7209 struct device_attribute *attr, char *buf)
7210{ 7210{
7211 struct iwl3945_priv *priv = (struct iwl3945_priv *)d->driver_data; 7211 struct iwl_priv *priv = (struct iwl_priv *)d->driver_data;
7212 7212
7213 if (!iwl3945_is_alive(priv)) 7213 if (!iwl3945_is_alive(priv))
7214 return -EAGAIN; 7214 return -EAGAIN;
@@ -7221,7 +7221,7 @@ static DEVICE_ATTR(temperature, S_IRUGO, show_temperature, NULL);
7221static ssize_t show_tx_power(struct device *d, 7221static ssize_t show_tx_power(struct device *d,
7222 struct device_attribute *attr, char *buf) 7222 struct device_attribute *attr, char *buf)
7223{ 7223{
7224 struct iwl3945_priv *priv = (struct iwl3945_priv *)d->driver_data; 7224 struct iwl_priv *priv = (struct iwl_priv *)d->driver_data;
7225 return sprintf(buf, "%d\n", priv->user_txpower_limit); 7225 return sprintf(buf, "%d\n", priv->user_txpower_limit);
7226} 7226}
7227 7227
@@ -7229,7 +7229,7 @@ static ssize_t store_tx_power(struct device *d,
7229 struct device_attribute *attr, 7229 struct device_attribute *attr,
7230 const char *buf, size_t count) 7230 const char *buf, size_t count)
7231{ 7231{
7232 struct iwl3945_priv *priv = (struct iwl3945_priv *)d->driver_data; 7232 struct iwl_priv *priv = (struct iwl_priv *)d->driver_data;
7233 char *p = (char *)buf; 7233 char *p = (char *)buf;
7234 u32 val; 7234 u32 val;
7235 7235
@@ -7248,7 +7248,7 @@ static DEVICE_ATTR(tx_power, S_IWUSR | S_IRUGO, show_tx_power, store_tx_power);
7248static ssize_t show_flags(struct device *d, 7248static ssize_t show_flags(struct device *d,
7249 struct device_attribute *attr, char *buf) 7249 struct device_attribute *attr, char *buf)
7250{ 7250{
7251 struct iwl3945_priv *priv = (struct iwl3945_priv *)d->driver_data; 7251 struct iwl_priv *priv = (struct iwl_priv *)d->driver_data;
7252 7252
7253 return sprintf(buf, "0x%04X\n", priv->active39_rxon.flags); 7253 return sprintf(buf, "0x%04X\n", priv->active39_rxon.flags);
7254} 7254}
@@ -7257,7 +7257,7 @@ static ssize_t store_flags(struct device *d,
7257 struct device_attribute *attr, 7257 struct device_attribute *attr,
7258 const char *buf, size_t count) 7258 const char *buf, size_t count)
7259{ 7259{
7260 struct iwl3945_priv *priv = (struct iwl3945_priv *)d->driver_data; 7260 struct iwl_priv *priv = (struct iwl_priv *)d->driver_data;
7261 u32 flags = simple_strtoul(buf, NULL, 0); 7261 u32 flags = simple_strtoul(buf, NULL, 0);
7262 7262
7263 mutex_lock(&priv->mutex); 7263 mutex_lock(&priv->mutex);
@@ -7282,7 +7282,7 @@ static DEVICE_ATTR(flags, S_IWUSR | S_IRUGO, show_flags, store_flags);
7282static ssize_t show_filter_flags(struct device *d, 7282static ssize_t show_filter_flags(struct device *d,
7283 struct device_attribute *attr, char *buf) 7283 struct device_attribute *attr, char *buf)
7284{ 7284{
7285 struct iwl3945_priv *priv = (struct iwl3945_priv *)d->driver_data; 7285 struct iwl_priv *priv = (struct iwl_priv *)d->driver_data;
7286 7286
7287 return sprintf(buf, "0x%04X\n", 7287 return sprintf(buf, "0x%04X\n",
7288 le32_to_cpu(priv->active39_rxon.filter_flags)); 7288 le32_to_cpu(priv->active39_rxon.filter_flags));
@@ -7292,7 +7292,7 @@ static ssize_t store_filter_flags(struct device *d,
7292 struct device_attribute *attr, 7292 struct device_attribute *attr,
7293 const char *buf, size_t count) 7293 const char *buf, size_t count)
7294{ 7294{
7295 struct iwl3945_priv *priv = (struct iwl3945_priv *)d->driver_data; 7295 struct iwl_priv *priv = (struct iwl_priv *)d->driver_data;
7296 u32 filter_flags = simple_strtoul(buf, NULL, 0); 7296 u32 filter_flags = simple_strtoul(buf, NULL, 0);
7297 7297
7298 mutex_lock(&priv->mutex); 7298 mutex_lock(&priv->mutex);
@@ -7321,7 +7321,7 @@ static DEVICE_ATTR(filter_flags, S_IWUSR | S_IRUGO, show_filter_flags,
7321static ssize_t show_measurement(struct device *d, 7321static ssize_t show_measurement(struct device *d,
7322 struct device_attribute *attr, char *buf) 7322 struct device_attribute *attr, char *buf)
7323{ 7323{
7324 struct iwl3945_priv *priv = dev_get_drvdata(d); 7324 struct iwl_priv *priv = dev_get_drvdata(d);
7325 struct iwl_spectrum_notification measure_report; 7325 struct iwl_spectrum_notification measure_report;
7326 u32 size = sizeof(measure_report), len = 0, ofs = 0; 7326 u32 size = sizeof(measure_report), len = 0, ofs = 0;
7327 u8 *data = (u8 *)&measure_report; 7327 u8 *data = (u8 *)&measure_report;
@@ -7354,7 +7354,7 @@ static ssize_t store_measurement(struct device *d,
7354 struct device_attribute *attr, 7354 struct device_attribute *attr,
7355 const char *buf, size_t count) 7355 const char *buf, size_t count)
7356{ 7356{
7357 struct iwl3945_priv *priv = dev_get_drvdata(d); 7357 struct iwl_priv *priv = dev_get_drvdata(d);
7358 struct ieee80211_measurement_params params = { 7358 struct ieee80211_measurement_params params = {
7359 .channel = le16_to_cpu(priv->active39_rxon.channel), 7359 .channel = le16_to_cpu(priv->active39_rxon.channel),
7360 .start_time = cpu_to_le64(priv->last_tsf), 7360 .start_time = cpu_to_le64(priv->last_tsf),
@@ -7393,7 +7393,7 @@ static ssize_t store_retry_rate(struct device *d,
7393 struct device_attribute *attr, 7393 struct device_attribute *attr,
7394 const char *buf, size_t count) 7394 const char *buf, size_t count)
7395{ 7395{
7396 struct iwl3945_priv *priv = dev_get_drvdata(d); 7396 struct iwl_priv *priv = dev_get_drvdata(d);
7397 7397
7398 priv->retry_rate = simple_strtoul(buf, NULL, 0); 7398 priv->retry_rate = simple_strtoul(buf, NULL, 0);
7399 if (priv->retry_rate <= 0) 7399 if (priv->retry_rate <= 0)
@@ -7405,7 +7405,7 @@ static ssize_t store_retry_rate(struct device *d,
7405static ssize_t show_retry_rate(struct device *d, 7405static ssize_t show_retry_rate(struct device *d,
7406 struct device_attribute *attr, char *buf) 7406 struct device_attribute *attr, char *buf)
7407{ 7407{
7408 struct iwl3945_priv *priv = dev_get_drvdata(d); 7408 struct iwl_priv *priv = dev_get_drvdata(d);
7409 return sprintf(buf, "%d", priv->retry_rate); 7409 return sprintf(buf, "%d", priv->retry_rate);
7410} 7410}
7411 7411
@@ -7416,7 +7416,7 @@ static ssize_t store_power_level(struct device *d,
7416 struct device_attribute *attr, 7416 struct device_attribute *attr,
7417 const char *buf, size_t count) 7417 const char *buf, size_t count)
7418{ 7418{
7419 struct iwl3945_priv *priv = dev_get_drvdata(d); 7419 struct iwl_priv *priv = dev_get_drvdata(d);
7420 int rc; 7420 int rc;
7421 int mode; 7421 int mode;
7422 7422
@@ -7471,7 +7471,7 @@ static const s32 period_duration[] = {
7471static ssize_t show_power_level(struct device *d, 7471static ssize_t show_power_level(struct device *d,
7472 struct device_attribute *attr, char *buf) 7472 struct device_attribute *attr, char *buf)
7473{ 7473{
7474 struct iwl3945_priv *priv = dev_get_drvdata(d); 7474 struct iwl_priv *priv = dev_get_drvdata(d);
7475 int level = IWL_POWER_LEVEL(priv->power_mode); 7475 int level = IWL_POWER_LEVEL(priv->power_mode);
7476 char *p = buf; 7476 char *p = buf;
7477 7477
@@ -7515,7 +7515,7 @@ static DEVICE_ATTR(channels, S_IRUSR, show_channels, NULL);
7515static ssize_t show_statistics(struct device *d, 7515static ssize_t show_statistics(struct device *d,
7516 struct device_attribute *attr, char *buf) 7516 struct device_attribute *attr, char *buf)
7517{ 7517{
7518 struct iwl3945_priv *priv = dev_get_drvdata(d); 7518 struct iwl_priv *priv = dev_get_drvdata(d);
7519 u32 size = sizeof(struct iwl3945_notif_statistics); 7519 u32 size = sizeof(struct iwl3945_notif_statistics);
7520 u32 len = 0, ofs = 0; 7520 u32 len = 0, ofs = 0;
7521 u8 *data = (u8 *)&priv->statistics_39; 7521 u8 *data = (u8 *)&priv->statistics_39;
@@ -7553,7 +7553,7 @@ static DEVICE_ATTR(statistics, S_IRUGO, show_statistics, NULL);
7553static ssize_t show_antenna(struct device *d, 7553static ssize_t show_antenna(struct device *d,
7554 struct device_attribute *attr, char *buf) 7554 struct device_attribute *attr, char *buf)
7555{ 7555{
7556 struct iwl3945_priv *priv = dev_get_drvdata(d); 7556 struct iwl_priv *priv = dev_get_drvdata(d);
7557 7557
7558 if (!iwl3945_is_alive(priv)) 7558 if (!iwl3945_is_alive(priv))
7559 return -EAGAIN; 7559 return -EAGAIN;
@@ -7566,7 +7566,7 @@ static ssize_t store_antenna(struct device *d,
7566 const char *buf, size_t count) 7566 const char *buf, size_t count)
7567{ 7567{
7568 int ant; 7568 int ant;
7569 struct iwl3945_priv *priv = dev_get_drvdata(d); 7569 struct iwl_priv *priv = dev_get_drvdata(d);
7570 7570
7571 if (count == 0) 7571 if (count == 0)
7572 return 0; 7572 return 0;
@@ -7591,7 +7591,7 @@ static DEVICE_ATTR(antenna, S_IWUSR | S_IRUGO, show_antenna, store_antenna);
7591static ssize_t show_status(struct device *d, 7591static ssize_t show_status(struct device *d,
7592 struct device_attribute *attr, char *buf) 7592 struct device_attribute *attr, char *buf)
7593{ 7593{
7594 struct iwl3945_priv *priv = (struct iwl3945_priv *)d->driver_data; 7594 struct iwl_priv *priv = (struct iwl_priv *)d->driver_data;
7595 if (!iwl3945_is_alive(priv)) 7595 if (!iwl3945_is_alive(priv))
7596 return -EAGAIN; 7596 return -EAGAIN;
7597 return sprintf(buf, "0x%08x\n", (int)priv->status); 7597 return sprintf(buf, "0x%08x\n", (int)priv->status);
@@ -7606,7 +7606,7 @@ static ssize_t dump_error_log(struct device *d,
7606 char *p = (char *)buf; 7606 char *p = (char *)buf;
7607 7607
7608 if (p[0] == '1') 7608 if (p[0] == '1')
7609 iwl3945_dump_nic_error_log((struct iwl3945_priv *)d->driver_data); 7609 iwl3945_dump_nic_error_log((struct iwl_priv *)d->driver_data);
7610 7610
7611 return strnlen(buf, count); 7611 return strnlen(buf, count);
7612} 7612}
@@ -7620,7 +7620,7 @@ static ssize_t dump_event_log(struct device *d,
7620 char *p = (char *)buf; 7620 char *p = (char *)buf;
7621 7621
7622 if (p[0] == '1') 7622 if (p[0] == '1')
7623 iwl3945_dump_nic_event_log((struct iwl3945_priv *)d->driver_data); 7623 iwl3945_dump_nic_event_log((struct iwl_priv *)d->driver_data);
7624 7624
7625 return strnlen(buf, count); 7625 return strnlen(buf, count);
7626} 7626}
@@ -7633,7 +7633,7 @@ static DEVICE_ATTR(dump_events, S_IWUSR, NULL, dump_event_log);
7633 * 7633 *
7634 *****************************************************************************/ 7634 *****************************************************************************/
7635 7635
7636static void iwl3945_setup_deferred_work(struct iwl3945_priv *priv) 7636static void iwl3945_setup_deferred_work(struct iwl_priv *priv)
7637{ 7637{
7638 priv->workqueue = create_workqueue(DRV_NAME); 7638 priv->workqueue = create_workqueue(DRV_NAME);
7639 7639
@@ -7657,7 +7657,7 @@ static void iwl3945_setup_deferred_work(struct iwl3945_priv *priv)
7657 iwl3945_irq_tasklet, (unsigned long)priv); 7657 iwl3945_irq_tasklet, (unsigned long)priv);
7658} 7658}
7659 7659
7660static void iwl3945_cancel_deferred_work(struct iwl3945_priv *priv) 7660static void iwl3945_cancel_deferred_work(struct iwl_priv *priv)
7661{ 7661{
7662 iwl3945_hw_cancel_deferred_work(priv); 7662 iwl3945_hw_cancel_deferred_work(priv);
7663 7663
@@ -7714,7 +7714,7 @@ static struct ieee80211_ops iwl3945_hw_ops = {
7714static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) 7714static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
7715{ 7715{
7716 int err = 0; 7716 int err = 0;
7717 struct iwl3945_priv *priv; 7717 struct iwl_priv *priv;
7718 struct ieee80211_hw *hw; 7718 struct ieee80211_hw *hw;
7719 struct iwl_cfg *cfg = (struct iwl_cfg *)(ent->driver_data); 7719 struct iwl_cfg *cfg = (struct iwl_cfg *)(ent->driver_data);
7720 unsigned long flags; 7720 unsigned long flags;
@@ -7725,7 +7725,7 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
7725 7725
7726 /* mac80211 allocates memory for this device instance, including 7726 /* mac80211 allocates memory for this device instance, including
7727 * space for this driver's private structure */ 7727 * space for this driver's private structure */
7728 hw = ieee80211_alloc_hw(sizeof(struct iwl3945_priv), &iwl3945_hw_ops); 7728 hw = ieee80211_alloc_hw(sizeof(struct iwl_priv), &iwl3945_hw_ops);
7729 if (hw == NULL) { 7729 if (hw == NULL) {
7730 printk(KERN_ERR DRV_NAME "Can not allocate network device\n"); 7730 printk(KERN_ERR DRV_NAME "Can not allocate network device\n");
7731 err = -ENOMEM; 7731 err = -ENOMEM;
@@ -7988,7 +7988,7 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
7988 7988
7989static void __devexit iwl3945_pci_remove(struct pci_dev *pdev) 7989static void __devexit iwl3945_pci_remove(struct pci_dev *pdev)
7990{ 7990{
7991 struct iwl3945_priv *priv = pci_get_drvdata(pdev); 7991 struct iwl_priv *priv = pci_get_drvdata(pdev);
7992 unsigned long flags; 7992 unsigned long flags;
7993 7993
7994 if (!priv) 7994 if (!priv)
@@ -8051,7 +8051,7 @@ static void __devexit iwl3945_pci_remove(struct pci_dev *pdev)
8051 8051
8052static int iwl3945_pci_suspend(struct pci_dev *pdev, pm_message_t state) 8052static int iwl3945_pci_suspend(struct pci_dev *pdev, pm_message_t state)
8053{ 8053{
8054 struct iwl3945_priv *priv = pci_get_drvdata(pdev); 8054 struct iwl_priv *priv = pci_get_drvdata(pdev);
8055 8055
8056 if (priv->is_open) { 8056 if (priv->is_open) {
8057 set_bit(STATUS_IN_SUSPEND, &priv->status); 8057 set_bit(STATUS_IN_SUSPEND, &priv->status);
@@ -8066,7 +8066,7 @@ static int iwl3945_pci_suspend(struct pci_dev *pdev, pm_message_t state)
8066 8066
8067static int iwl3945_pci_resume(struct pci_dev *pdev) 8067static int iwl3945_pci_resume(struct pci_dev *pdev)
8068{ 8068{
8069 struct iwl3945_priv *priv = pci_get_drvdata(pdev); 8069 struct iwl_priv *priv = pci_get_drvdata(pdev);
8070 8070
8071 pci_set_power_state(pdev, PCI_D0); 8071 pci_set_power_state(pdev, PCI_D0);
8072 8072
@@ -8084,7 +8084,7 @@ static int iwl3945_pci_resume(struct pci_dev *pdev)
8084/* software rf-kill from user */ 8084/* software rf-kill from user */
8085static int iwl3945_rfkill_soft_rf_kill(void *data, enum rfkill_state state) 8085static int iwl3945_rfkill_soft_rf_kill(void *data, enum rfkill_state state)
8086{ 8086{
8087 struct iwl3945_priv *priv = data; 8087 struct iwl_priv *priv = data;
8088 int err = 0; 8088 int err = 0;
8089 8089
8090 if (!priv->rfkill) 8090 if (!priv->rfkill)
@@ -8117,7 +8117,7 @@ out_unlock:
8117 return err; 8117 return err;
8118} 8118}
8119 8119
8120int iwl3945_rfkill_init(struct iwl3945_priv *priv) 8120int iwl3945_rfkill_init(struct iwl_priv *priv)
8121{ 8121{
8122 struct device *device = wiphy_dev(priv->hw->wiphy); 8122 struct device *device = wiphy_dev(priv->hw->wiphy);
8123 int ret = 0; 8123 int ret = 0;
@@ -8160,7 +8160,7 @@ error:
8160 return ret; 8160 return ret;
8161} 8161}
8162 8162
8163void iwl3945_rfkill_unregister(struct iwl3945_priv *priv) 8163void iwl3945_rfkill_unregister(struct iwl_priv *priv)
8164{ 8164{
8165 if (priv->rfkill) 8165 if (priv->rfkill)
8166 rfkill_unregister(priv->rfkill); 8166 rfkill_unregister(priv->rfkill);
@@ -8169,7 +8169,7 @@ void iwl3945_rfkill_unregister(struct iwl3945_priv *priv)
8169} 8169}
8170 8170
8171/* set rf-kill to the right state. */ 8171/* set rf-kill to the right state. */
8172void iwl3945_rfkill_set_hw_state(struct iwl3945_priv *priv) 8172void iwl3945_rfkill_set_hw_state(struct iwl_priv *priv)
8173{ 8173{
8174 8174
8175 if (!priv->rfkill) 8175 if (!priv->rfkill)