aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-4965-io.h
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2008-03-12 19:58:50 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-03-25 16:41:47 -0400
commitc79dd5b5bc5a65822cdc9d571032c469ad7577d5 (patch)
tree9056b3470264641eb6d4f25fedef5cde5f1c069d /drivers/net/wireless/iwlwifi/iwl-4965-io.h
parent0a6857e70d577237bb1cd1c991e68e7d3b6f7c90 (diff)
iwlwifi: rename struct iwl4965_priv to struct iwl_priv
This patch renames iwl4965_priv to iwl_priv. iwl_priv will be shared by more hw. Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-4965-io.h')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965-io.h58
1 files changed, 29 insertions, 29 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-io.h b/drivers/net/wireless/iwlwifi/iwl-4965-io.h
index 3accdfb33e56..fba7d03d4291 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965-io.h
+++ b/drivers/net/wireless/iwlwifi/iwl-4965-io.h
@@ -61,7 +61,7 @@
61 61
62#define _iwl4965_write32(priv, ofs, val) writel((val), (priv)->hw_base + (ofs)) 62#define _iwl4965_write32(priv, ofs, val) writel((val), (priv)->hw_base + (ofs))
63#ifdef CONFIG_IWLWIFI_DEBUG 63#ifdef CONFIG_IWLWIFI_DEBUG
64static inline void __iwl4965_write32(const char *f, u32 l, struct iwl4965_priv *priv, 64static inline void __iwl4965_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 __iwl4965_write32(const char *f, u32 l, struct iwl4965_priv *
75 75
76#define _iwl4965_read32(priv, ofs) readl((priv)->hw_base + (ofs)) 76#define _iwl4965_read32(priv, ofs) readl((priv)->hw_base + (ofs))
77#ifdef CONFIG_IWLWIFI_DEBUG 77#ifdef CONFIG_IWLWIFI_DEBUG
78static inline u32 __iwl4965_read32(char *f, u32 l, struct iwl4965_priv *priv, u32 ofs) 78static inline u32 __iwl4965_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 _iwl4965_read32(priv, ofs); 81 return _iwl4965_read32(priv, ofs);
@@ -85,7 +85,7 @@ static inline u32 __iwl4965_read32(char *f, u32 l, struct iwl4965_priv *priv, u3
85#define iwl4965_read32(p, o) _iwl4965_read32(p, o) 85#define iwl4965_read32(p, o) _iwl4965_read32(p, o)
86#endif 86#endif
87 87
88static inline int _iwl4965_poll_bit(struct iwl4965_priv *priv, u32 addr, 88static inline int _iwl4965_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 _iwl4965_poll_bit(struct iwl4965_priv *priv, u32 addr,
101} 101}
102#ifdef CONFIG_IWLWIFI_DEBUG 102#ifdef CONFIG_IWLWIFI_DEBUG
103static inline int __iwl4965_poll_bit(const char *f, u32 l, 103static inline int __iwl4965_poll_bit(const char *f, u32 l,
104 struct iwl4965_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 = _iwl4965_poll_bit(priv, addr, bits, mask, timeout); 107 int ret = _iwl4965_poll_bit(priv, addr, bits, mask, timeout);
@@ -116,13 +116,13 @@ static inline int __iwl4965_poll_bit(const char *f, u32 l,
116#define iwl4965_poll_bit(p, a, b, m, t) _iwl4965_poll_bit(p, a, b, m, t) 116#define iwl4965_poll_bit(p, a, b, m, t) _iwl4965_poll_bit(p, a, b, m, t)
117#endif 117#endif
118 118
119static inline void _iwl4965_set_bit(struct iwl4965_priv *priv, u32 reg, u32 mask) 119static inline void _iwl4965_set_bit(struct iwl_priv *priv, u32 reg, u32 mask)
120{ 120{
121 _iwl4965_write32(priv, reg, _iwl4965_read32(priv, reg) | mask); 121 _iwl4965_write32(priv, reg, _iwl4965_read32(priv, reg) | mask);
122} 122}
123#ifdef CONFIG_IWLWIFI_DEBUG 123#ifdef CONFIG_IWLWIFI_DEBUG
124static inline void __iwl4965_set_bit(const char *f, u32 l, 124static inline void __iwl4965_set_bit(const char *f, u32 l,
125 struct iwl4965_priv *priv, u32 reg, u32 mask) 125 struct iwl_priv *priv, u32 reg, u32 mask)
126{ 126{
127 u32 val = _iwl4965_read32(priv, reg) | mask; 127 u32 val = _iwl4965_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 __iwl4965_set_bit(const char *f, u32 l,
133#define iwl4965_set_bit(p, r, m) _iwl4965_set_bit(p, r, m) 133#define iwl4965_set_bit(p, r, m) _iwl4965_set_bit(p, r, m)
134#endif 134#endif
135 135
136static inline void _iwl4965_clear_bit(struct iwl4965_priv *priv, u32 reg, u32 mask) 136static inline void _iwl4965_clear_bit(struct iwl_priv *priv, u32 reg, u32 mask)
137{ 137{
138 _iwl4965_write32(priv, reg, _iwl4965_read32(priv, reg) & ~mask); 138 _iwl4965_write32(priv, reg, _iwl4965_read32(priv, reg) & ~mask);
139} 139}
140#ifdef CONFIG_IWLWIFI_DEBUG 140#ifdef CONFIG_IWLWIFI_DEBUG
141static inline void __iwl4965_clear_bit(const char *f, u32 l, 141static inline void __iwl4965_clear_bit(const char *f, u32 l,
142 struct iwl4965_priv *priv, u32 reg, u32 mask) 142 struct iwl_priv *priv, u32 reg, u32 mask)
143{ 143{
144 u32 val = _iwl4965_read32(priv, reg) & ~mask; 144 u32 val = _iwl4965_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 __iwl4965_clear_bit(const char *f, u32 l,
150#define iwl4965_clear_bit(p, r, m) _iwl4965_clear_bit(p, r, m) 150#define iwl4965_clear_bit(p, r, m) _iwl4965_clear_bit(p, r, m)
151#endif 151#endif
152 152
153static inline int _iwl4965_grab_nic_access(struct iwl4965_priv *priv) 153static inline int _iwl4965_grab_nic_access(struct iwl_priv *priv)
154{ 154{
155 int ret; 155 int ret;
156 u32 gp_ctl; 156 u32 gp_ctl;
@@ -194,7 +194,7 @@ static inline int _iwl4965_grab_nic_access(struct iwl4965_priv *priv)
194 194
195#ifdef CONFIG_IWLWIFI_DEBUG 195#ifdef CONFIG_IWLWIFI_DEBUG
196static inline int __iwl4965_grab_nic_access(const char *f, u32 l, 196static inline int __iwl4965_grab_nic_access(const char *f, u32 l,
197 struct iwl4965_priv *priv) 197 struct iwl_priv *priv)
198{ 198{
199 if (atomic_read(&priv->restrict_refcnt)) 199 if (atomic_read(&priv->restrict_refcnt))
200 IWL_DEBUG_INFO("Grabbing access while already held at " 200 IWL_DEBUG_INFO("Grabbing access while already held at "
@@ -210,7 +210,7 @@ static inline int __iwl4965_grab_nic_access(const char *f, u32 l,
210 _iwl4965_grab_nic_access(priv) 210 _iwl4965_grab_nic_access(priv)
211#endif 211#endif
212 212
213static inline void _iwl4965_release_nic_access(struct iwl4965_priv *priv) 213static inline void _iwl4965_release_nic_access(struct iwl_priv *priv)
214{ 214{
215#ifdef CONFIG_IWLWIFI_DEBUG 215#ifdef CONFIG_IWLWIFI_DEBUG
216 if (atomic_dec_and_test(&priv->restrict_refcnt)) 216 if (atomic_dec_and_test(&priv->restrict_refcnt))
@@ -220,7 +220,7 @@ static inline void _iwl4965_release_nic_access(struct iwl4965_priv *priv)
220} 220}
221#ifdef CONFIG_IWLWIFI_DEBUG 221#ifdef CONFIG_IWLWIFI_DEBUG
222static inline void __iwl4965_release_nic_access(const char *f, u32 l, 222static inline void __iwl4965_release_nic_access(const char *f, u32 l,
223 struct iwl4965_priv *priv) 223 struct iwl_priv *priv)
224{ 224{
225 if (atomic_read(&priv->restrict_refcnt) <= 0) 225 if (atomic_read(&priv->restrict_refcnt) <= 0)
226 IWL_ERROR("Release unheld nic access at line %d.\n", l); 226 IWL_ERROR("Release unheld nic access at line %d.\n", l);
@@ -235,13 +235,13 @@ static inline void __iwl4965_release_nic_access(const char *f, u32 l,
235 _iwl4965_release_nic_access(priv) 235 _iwl4965_release_nic_access(priv)
236#endif 236#endif
237 237
238static inline u32 _iwl4965_read_direct32(struct iwl4965_priv *priv, u32 reg) 238static inline u32 _iwl4965_read_direct32(struct iwl_priv *priv, u32 reg)
239{ 239{
240 return _iwl4965_read32(priv, reg); 240 return _iwl4965_read32(priv, reg);
241} 241}
242#ifdef CONFIG_IWLWIFI_DEBUG 242#ifdef CONFIG_IWLWIFI_DEBUG
243static inline u32 __iwl4965_read_direct32(const char *f, u32 l, 243static inline u32 __iwl4965_read_direct32(const char *f, u32 l,
244 struct iwl4965_priv *priv, u32 reg) 244 struct iwl_priv *priv, u32 reg)
245{ 245{
246 u32 value = _iwl4965_read_direct32(priv, reg); 246 u32 value = _iwl4965_read_direct32(priv, reg);
247 if (!atomic_read(&priv->restrict_refcnt)) 247 if (!atomic_read(&priv->restrict_refcnt))
@@ -256,14 +256,14 @@ static inline u32 __iwl4965_read_direct32(const char *f, u32 l,
256#define iwl4965_read_direct32 _iwl4965_read_direct32 256#define iwl4965_read_direct32 _iwl4965_read_direct32
257#endif 257#endif
258 258
259static inline void _iwl4965_write_direct32(struct iwl4965_priv *priv, 259static inline void _iwl4965_write_direct32(struct iwl_priv *priv,
260 u32 reg, u32 value) 260 u32 reg, u32 value)
261{ 261{
262 _iwl4965_write32(priv, reg, value); 262 _iwl4965_write32(priv, reg, value);
263} 263}
264#ifdef CONFIG_IWLWIFI_DEBUG 264#ifdef CONFIG_IWLWIFI_DEBUG
265static void __iwl4965_write_direct32(u32 line, 265static void __iwl4965_write_direct32(u32 line,
266 struct iwl4965_priv *priv, u32 reg, u32 value) 266 struct iwl_priv *priv, u32 reg, u32 value)
267{ 267{
268 if (!atomic_read(&priv->restrict_refcnt)) 268 if (!atomic_read(&priv->restrict_refcnt))
269 IWL_ERROR("Nic access not held from line %d\n", line); 269 IWL_ERROR("Nic access not held from line %d\n", line);
@@ -275,7 +275,7 @@ static void __iwl4965_write_direct32(u32 line,
275#define iwl4965_write_direct32 _iwl4965_write_direct32 275#define iwl4965_write_direct32 _iwl4965_write_direct32
276#endif 276#endif
277 277
278static inline void iwl4965_write_reg_buf(struct iwl4965_priv *priv, 278static inline void iwl4965_write_reg_buf(struct iwl_priv *priv,
279 u32 reg, u32 len, u32 *values) 279 u32 reg, u32 len, u32 *values)
280{ 280{
281 u32 count = sizeof(u32); 281 u32 count = sizeof(u32);
@@ -286,7 +286,7 @@ static inline void iwl4965_write_reg_buf(struct iwl4965_priv *priv,
286 } 286 }
287} 287}
288 288
289static inline int _iwl4965_poll_direct_bit(struct iwl4965_priv *priv, 289static inline int _iwl4965_poll_direct_bit(struct iwl_priv *priv,
290 u32 addr, u32 mask, int timeout) 290 u32 addr, u32 mask, int timeout)
291{ 291{
292 int i = 0; 292 int i = 0;
@@ -303,7 +303,7 @@ static inline int _iwl4965_poll_direct_bit(struct iwl4965_priv *priv,
303 303
304#ifdef CONFIG_IWLWIFI_DEBUG 304#ifdef CONFIG_IWLWIFI_DEBUG
305static inline int __iwl4965_poll_direct_bit(const char *f, u32 l, 305static inline int __iwl4965_poll_direct_bit(const char *f, u32 l,
306 struct iwl4965_priv *priv, 306 struct iwl_priv *priv,
307 u32 addr, u32 mask, int timeout) 307 u32 addr, u32 mask, int timeout)
308{ 308{
309 int ret = _iwl4965_poll_direct_bit(priv, addr, mask, timeout); 309 int ret = _iwl4965_poll_direct_bit(priv, addr, mask, timeout);
@@ -322,13 +322,13 @@ static inline int __iwl4965_poll_direct_bit(const char *f, u32 l,
322#define iwl4965_poll_direct_bit _iwl4965_poll_direct_bit 322#define iwl4965_poll_direct_bit _iwl4965_poll_direct_bit
323#endif 323#endif
324 324
325static inline u32 _iwl4965_read_prph(struct iwl4965_priv *priv, u32 reg) 325static inline u32 _iwl4965_read_prph(struct iwl_priv *priv, u32 reg)
326{ 326{
327 _iwl4965_write_direct32(priv, HBUS_TARG_PRPH_RADDR, reg | (3 << 24)); 327 _iwl4965_write_direct32(priv, HBUS_TARG_PRPH_RADDR, reg | (3 << 24));
328 return _iwl4965_read_direct32(priv, HBUS_TARG_PRPH_RDAT); 328 return _iwl4965_read_direct32(priv, HBUS_TARG_PRPH_RDAT);
329} 329}
330#ifdef CONFIG_IWLWIFI_DEBUG 330#ifdef CONFIG_IWLWIFI_DEBUG
331static inline u32 __iwl4965_read_prph(u32 line, struct iwl4965_priv *priv, u32 reg) 331static inline u32 __iwl4965_read_prph(u32 line, struct iwl_priv *priv, u32 reg)
332{ 332{
333 if (!atomic_read(&priv->restrict_refcnt)) 333 if (!atomic_read(&priv->restrict_refcnt))
334 IWL_ERROR("Nic access not held from line %d\n", line); 334 IWL_ERROR("Nic access not held from line %d\n", line);
@@ -341,7 +341,7 @@ static inline u32 __iwl4965_read_prph(u32 line, struct iwl4965_priv *priv, u32 r
341#define iwl4965_read_prph _iwl4965_read_prph 341#define iwl4965_read_prph _iwl4965_read_prph
342#endif 342#endif
343 343
344static inline void _iwl4965_write_prph(struct iwl4965_priv *priv, 344static inline void _iwl4965_write_prph(struct iwl_priv *priv,
345 u32 addr, u32 val) 345 u32 addr, u32 val)
346{ 346{
347 _iwl4965_write_direct32(priv, HBUS_TARG_PRPH_WADDR, 347 _iwl4965_write_direct32(priv, HBUS_TARG_PRPH_WADDR,
@@ -349,7 +349,7 @@ static inline void _iwl4965_write_prph(struct iwl4965_priv *priv,
349 _iwl4965_write_direct32(priv, HBUS_TARG_PRPH_WDAT, val); 349 _iwl4965_write_direct32(priv, HBUS_TARG_PRPH_WDAT, val);
350} 350}
351#ifdef CONFIG_IWLWIFI_DEBUG 351#ifdef CONFIG_IWLWIFI_DEBUG
352static inline void __iwl4965_write_prph(u32 line, struct iwl4965_priv *priv, 352static inline void __iwl4965_write_prph(u32 line, struct iwl_priv *priv,
353 u32 addr, u32 val) 353 u32 addr, u32 val)
354{ 354{
355 if (!atomic_read(&priv->restrict_refcnt)) 355 if (!atomic_read(&priv->restrict_refcnt))
@@ -366,7 +366,7 @@ static inline void __iwl4965_write_prph(u32 line, struct iwl4965_priv *priv,
366#define _iwl4965_set_bits_prph(priv, reg, mask) \ 366#define _iwl4965_set_bits_prph(priv, reg, mask) \
367 _iwl4965_write_prph(priv, reg, (_iwl4965_read_prph(priv, reg) | mask)) 367 _iwl4965_write_prph(priv, reg, (_iwl4965_read_prph(priv, reg) | mask))
368#ifdef CONFIG_IWLWIFI_DEBUG 368#ifdef CONFIG_IWLWIFI_DEBUG
369static inline void __iwl4965_set_bits_prph(u32 line, struct iwl4965_priv *priv, 369static inline void __iwl4965_set_bits_prph(u32 line, struct iwl_priv *priv,
370 u32 reg, u32 mask) 370 u32 reg, u32 mask)
371{ 371{
372 if (!atomic_read(&priv->restrict_refcnt)) 372 if (!atomic_read(&priv->restrict_refcnt))
@@ -385,7 +385,7 @@ static inline void __iwl4965_set_bits_prph(u32 line, struct iwl4965_priv *priv,
385 385
386#ifdef CONFIG_IWLWIFI_DEBUG 386#ifdef CONFIG_IWLWIFI_DEBUG
387static inline void __iwl4965_set_bits_mask_prph(u32 line, 387static inline void __iwl4965_set_bits_mask_prph(u32 line,
388 struct iwl4965_priv *priv, u32 reg, u32 bits, u32 mask) 388 struct iwl_priv *priv, u32 reg, u32 bits, u32 mask)
389{ 389{
390 if (!atomic_read(&priv->restrict_refcnt)) 390 if (!atomic_read(&priv->restrict_refcnt))
391 IWL_ERROR("Nic access not held from line %d\n", line); 391 IWL_ERROR("Nic access not held from line %d\n", line);
@@ -397,26 +397,26 @@ static inline void __iwl4965_set_bits_mask_prph(u32 line,
397#define iwl4965_set_bits_mask_prph _iwl4965_set_bits_mask_prph 397#define iwl4965_set_bits_mask_prph _iwl4965_set_bits_mask_prph
398#endif 398#endif
399 399
400static inline void iwl4965_clear_bits_prph(struct iwl4965_priv 400static inline void iwl4965_clear_bits_prph(struct iwl_priv
401 *priv, u32 reg, u32 mask) 401 *priv, u32 reg, u32 mask)
402{ 402{
403 u32 val = _iwl4965_read_prph(priv, reg); 403 u32 val = _iwl4965_read_prph(priv, reg);
404 _iwl4965_write_prph(priv, reg, (val & ~mask)); 404 _iwl4965_write_prph(priv, reg, (val & ~mask));
405} 405}
406 406
407static inline u32 iwl4965_read_targ_mem(struct iwl4965_priv *priv, u32 addr) 407static inline u32 iwl4965_read_targ_mem(struct iwl_priv *priv, u32 addr)
408{ 408{
409 iwl4965_write_direct32(priv, HBUS_TARG_MEM_RADDR, addr); 409 iwl4965_write_direct32(priv, HBUS_TARG_MEM_RADDR, addr);
410 return iwl4965_read_direct32(priv, HBUS_TARG_MEM_RDAT); 410 return iwl4965_read_direct32(priv, HBUS_TARG_MEM_RDAT);
411} 411}
412 412
413static inline void iwl4965_write_targ_mem(struct iwl4965_priv *priv, u32 addr, u32 val) 413static inline void iwl4965_write_targ_mem(struct iwl_priv *priv, u32 addr, u32 val)
414{ 414{
415 iwl4965_write_direct32(priv, HBUS_TARG_MEM_WADDR, addr); 415 iwl4965_write_direct32(priv, HBUS_TARG_MEM_WADDR, addr);
416 iwl4965_write_direct32(priv, HBUS_TARG_MEM_WDAT, val); 416 iwl4965_write_direct32(priv, HBUS_TARG_MEM_WDAT, val);
417} 417}
418 418
419static inline void iwl4965_write_targ_mem_buf(struct iwl4965_priv *priv, u32 addr, 419static inline void iwl4965_write_targ_mem_buf(struct iwl_priv *priv, u32 addr,
420 u32 len, u32 *values) 420 u32 len, u32 *values)
421{ 421{
422 iwl4965_write_direct32(priv, HBUS_TARG_MEM_WADDR, addr); 422 iwl4965_write_direct32(priv, HBUS_TARG_MEM_WADDR, addr);