diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2007-10-25 05:15:37 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:03:17 -0500 |
commit | ac17a947a4f47b642097d6814d6dcc60c297eb17 (patch) | |
tree | ca77e4c90f23631433548fb8a5a9a57611315b04 /drivers/net/wireless/iwlwifi/iwl-io.h | |
parent | af7cca2a441f6e2ebeb2a920ef5af1bec8df96e8 (diff) |
iwlwifi: replacing wording restricted to nic access in iwl-io
This patch replaces wording 'restricted' with more appropriate 'nic access'
NIC access is grabbed to prevent NIC entering power save mode
General cleanup of iwl-io.h
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-io.h')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-io.h | 146 |
1 files changed, 72 insertions, 74 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-io.h b/drivers/net/wireless/iwlwifi/iwl-io.h index 5cdcfc43fa14..43afcda6f73e 100644 --- a/drivers/net/wireless/iwlwifi/iwl-io.h +++ b/drivers/net/wireless/iwlwifi/iwl-io.h | |||
@@ -42,15 +42,14 @@ | |||
42 | * check or debug information is printed when that function is called. | 42 | * check or debug information is printed when that function is called. |
43 | * | 43 | * |
44 | * A double __ prefix before an access function means that state is checked | 44 | * A double __ prefix before an access function means that state is checked |
45 | * (in the case of *restricted calls) and the current line number is printed | 45 | * and the current line number is printed in addition to any other debug output. |
46 | * in addition to any other debug output. | ||
47 | * | 46 | * |
48 | * The non-prefixed name is the #define that maps the caller into a | 47 | * The non-prefixed name is the #define that maps the caller into a |
49 | * #define that provides the caller's __LINE__ to the double prefix version. | 48 | * #define that provides the caller's __LINE__ to the double prefix version. |
50 | * | 49 | * |
51 | * If you wish to call the function without any debug or state checking, | 50 | * If you wish to call the function without any debug or state checking, |
52 | * you should use the single _ prefix version (as is used by dependent IO | 51 | * you should use the single _ prefix version (as is used by dependent IO |
53 | * routines, for example _iwl_read_restricted calls the non-check version of | 52 | * routines, for example _iwl_read_direct32 calls the non-check version of |
54 | * _iwl_read32.) | 53 | * _iwl_read32.) |
55 | * | 54 | * |
56 | * These declarations are *extremely* useful in quickly isolating code deltas | 55 | * These declarations are *extremely* useful in quickly isolating code deltas |
@@ -65,8 +64,7 @@ | |||
65 | static inline void __iwl_write32(const char *f, u32 l, struct iwl_priv *iwl, | 64 | static inline void __iwl_write32(const char *f, u32 l, struct iwl_priv *iwl, |
66 | u32 ofs, u32 val) | 65 | u32 ofs, u32 val) |
67 | { | 66 | { |
68 | IWL_DEBUG_IO("write_direct32(0x%08X, 0x%08X) - %s %d\n", | 67 | IWL_DEBUG_IO("write32(0x%08X, 0x%08X) - %s %d\n", ofs, val, f, l); |
69 | (u32) (ofs), (u32) (val), f, l); | ||
70 | _iwl_write32(iwl, ofs, val); | 68 | _iwl_write32(iwl, ofs, val); |
71 | } | 69 | } |
72 | #define iwl_write32(iwl, ofs, val) \ | 70 | #define iwl_write32(iwl, ofs, val) \ |
@@ -106,16 +104,16 @@ static inline int __iwl_poll_bit(const char *f, u32 l, | |||
106 | struct iwl_priv *priv, u32 addr, | 104 | struct iwl_priv *priv, u32 addr, |
107 | u32 bits, u32 mask, int timeout) | 105 | u32 bits, u32 mask, int timeout) |
108 | { | 106 | { |
109 | int rc = _iwl_poll_bit(priv, addr, bits, mask, timeout); | 107 | int ret = _iwl_poll_bit(priv, addr, bits, mask, timeout); |
110 | if (unlikely(rc == -ETIMEDOUT)) | 108 | if (unlikely(ret == -ETIMEDOUT)) |
111 | IWL_DEBUG_IO | 109 | IWL_DEBUG_IO |
112 | ("poll_bit(0x%08X, 0x%08X, 0x%08X) - timedout - %s %d\n", | 110 | ("poll_bit(0x%08X, 0x%08X, 0x%08X) - timedout - %s %d\n", |
113 | addr, bits, mask, f, l); | 111 | addr, bits, mask, f, l); |
114 | else | 112 | else |
115 | IWL_DEBUG_IO | 113 | IWL_DEBUG_IO |
116 | ("poll_bit(0x%08X, 0x%08X, 0x%08X) = 0x%08X - %s %d\n", | 114 | ("poll_bit(0x%08X, 0x%08X, 0x%08X) = 0x%08X - %s %d\n", |
117 | addr, bits, mask, rc, f, l); | 115 | addr, bits, mask, ret, f, l); |
118 | return rc; | 116 | return ret; |
119 | } | 117 | } |
120 | #define iwl_poll_bit(iwl, addr, bits, mask, timeout) \ | 118 | #define iwl_poll_bit(iwl, addr, bits, mask, timeout) \ |
121 | __iwl_poll_bit(__FILE__, __LINE__, iwl, addr, bits, mask, timeout) | 119 | __iwl_poll_bit(__FILE__, __LINE__, iwl, addr, bits, mask, timeout) |
@@ -157,9 +155,9 @@ static inline void __iwl_clear_bit(const char *f, u32 l, | |||
157 | #define iwl_clear_bit(p, r, m) _iwl_clear_bit(p, r, m) | 155 | #define iwl_clear_bit(p, r, m) _iwl_clear_bit(p, r, m) |
158 | #endif | 156 | #endif |
159 | 157 | ||
160 | static inline int _iwl_grab_restricted_access(struct iwl_priv *priv) | 158 | static inline int _iwl_grab_nic_access(struct iwl_priv *priv) |
161 | { | 159 | { |
162 | int rc; | 160 | int ret; |
163 | u32 gp_ctl; | 161 | u32 gp_ctl; |
164 | 162 | ||
165 | #ifdef CONFIG_IWLWIFI_DEBUG | 163 | #ifdef CONFIG_IWLWIFI_DEBUG |
@@ -184,11 +182,11 @@ static inline int _iwl_grab_restricted_access(struct iwl_priv *priv) | |||
184 | 182 | ||
185 | /* this bit wakes up the NIC */ | 183 | /* this bit wakes up the NIC */ |
186 | _iwl_set_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ); | 184 | _iwl_set_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ); |
187 | rc = _iwl_poll_bit(priv, CSR_GP_CNTRL, | 185 | ret = _iwl_poll_bit(priv, CSR_GP_CNTRL, |
188 | CSR_GP_CNTRL_REG_VAL_MAC_ACCESS_EN, | 186 | CSR_GP_CNTRL_REG_VAL_MAC_ACCESS_EN, |
189 | (CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY | | 187 | (CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY | |
190 | CSR_GP_CNTRL_REG_FLAG_GOING_TO_SLEEP), 50); | 188 | CSR_GP_CNTRL_REG_FLAG_GOING_TO_SLEEP), 50); |
191 | if (rc < 0) { | 189 | if (ret < 0) { |
192 | IWL_ERROR("MAC is in deep sleep!\n"); | 190 | IWL_ERROR("MAC is in deep sleep!\n"); |
193 | return -EIO; | 191 | return -EIO; |
194 | } | 192 | } |
@@ -200,25 +198,24 @@ static inline int _iwl_grab_restricted_access(struct iwl_priv *priv) | |||
200 | } | 198 | } |
201 | 199 | ||
202 | #ifdef CONFIG_IWLWIFI_DEBUG | 200 | #ifdef CONFIG_IWLWIFI_DEBUG |
203 | static inline int __iwl_grab_restricted_access(const char *f, u32 l, | 201 | static inline int __iwl_grab_nic_access(const char *f, u32 l, |
204 | struct iwl_priv *priv) | 202 | struct iwl_priv *priv) |
205 | { | 203 | { |
206 | if (atomic_read(&priv->restrict_refcnt)) | 204 | if (atomic_read(&priv->restrict_refcnt)) |
207 | IWL_DEBUG_INFO("Grabbing access while already held at " | 205 | IWL_DEBUG_INFO("Grabbing access while already held at " |
208 | "line %d.\n", l); | 206 | "line %d.\n", l); |
209 | 207 | ||
210 | IWL_DEBUG_IO("grabbing restricted access - %s %d\n", f, l); | 208 | IWL_DEBUG_IO("grabbing nic access - %s %d\n", f, l); |
211 | 209 | return _iwl_grab_nic_access(priv); | |
212 | return _iwl_grab_restricted_access(priv); | ||
213 | } | 210 | } |
214 | #define iwl_grab_restricted_access(priv) \ | 211 | #define iwl_grab_nic_access(priv) \ |
215 | __iwl_grab_restricted_access(__FILE__, __LINE__, priv) | 212 | __iwl_grab_nic_access(__FILE__, __LINE__, priv) |
216 | #else | 213 | #else |
217 | #define iwl_grab_restricted_access(priv) \ | 214 | #define iwl_grab_nic_access(priv) \ |
218 | _iwl_grab_restricted_access(priv) | 215 | _iwl_grab_nic_access(priv) |
219 | #endif | 216 | #endif |
220 | 217 | ||
221 | static inline void _iwl_release_restricted_access(struct iwl_priv *priv) | 218 | static inline void _iwl_release_nic_access(struct iwl_priv *priv) |
222 | { | 219 | { |
223 | #ifdef CONFIG_IWLWIFI_DEBUG | 220 | #ifdef CONFIG_IWLWIFI_DEBUG |
224 | if (atomic_dec_and_test(&priv->restrict_refcnt)) | 221 | if (atomic_dec_and_test(&priv->restrict_refcnt)) |
@@ -227,80 +224,80 @@ static inline void _iwl_release_restricted_access(struct iwl_priv *priv) | |||
227 | CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ); | 224 | CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ); |
228 | } | 225 | } |
229 | #ifdef CONFIG_IWLWIFI_DEBUG | 226 | #ifdef CONFIG_IWLWIFI_DEBUG |
230 | static inline void __iwl_release_restricted_access(const char *f, u32 l, | 227 | static inline void __iwl_release_nic_access(const char *f, u32 l, |
231 | struct iwl_priv *priv) | 228 | struct iwl_priv *priv) |
232 | { | 229 | { |
233 | if (atomic_read(&priv->restrict_refcnt) <= 0) | 230 | if (atomic_read(&priv->restrict_refcnt) <= 0) |
234 | IWL_ERROR("Release unheld restricted access at line %d.\n", l); | 231 | IWL_ERROR("Release unheld nic access at line %d.\n", l); |
235 | 232 | ||
236 | IWL_DEBUG_IO("releasing restricted access - %s %d\n", f, l); | 233 | IWL_DEBUG_IO("releasing nic access - %s %d\n", f, l); |
237 | _iwl_release_restricted_access(priv); | 234 | _iwl_release_nic_access(priv); |
238 | } | 235 | } |
239 | #define iwl_release_restricted_access(priv) \ | 236 | #define iwl_release_nic_access(priv) \ |
240 | __iwl_release_restricted_access(__FILE__, __LINE__, priv) | 237 | __iwl_release_nic_access(__FILE__, __LINE__, priv) |
241 | #else | 238 | #else |
242 | #define iwl_release_restricted_access(priv) \ | 239 | #define iwl_release_nic_access(priv) \ |
243 | _iwl_release_restricted_access(priv) | 240 | _iwl_release_nic_access(priv) |
244 | #endif | 241 | #endif |
245 | 242 | ||
246 | static inline u32 _iwl_read_restricted(struct iwl_priv *priv, u32 reg) | 243 | static inline u32 _iwl_read_direct32(struct iwl_priv *priv, u32 reg) |
247 | { | 244 | { |
248 | return _iwl_read32(priv, reg); | 245 | return _iwl_read32(priv, reg); |
249 | } | 246 | } |
250 | #ifdef CONFIG_IWLWIFI_DEBUG | 247 | #ifdef CONFIG_IWLWIFI_DEBUG |
251 | static inline u32 __iwl_read_restricted(const char *f, u32 l, | 248 | static inline u32 __iwl_read_direct32(const char *f, u32 l, |
252 | struct iwl_priv *priv, u32 reg) | 249 | struct iwl_priv *priv, u32 reg) |
253 | { | 250 | { |
254 | u32 value = _iwl_read_restricted(priv, reg); | 251 | u32 value = _iwl_read_direct32(priv, reg); |
255 | if (!atomic_read(&priv->restrict_refcnt)) | 252 | if (!atomic_read(&priv->restrict_refcnt)) |
256 | IWL_ERROR("Unrestricted access from %s %d\n", f, l); | 253 | IWL_ERROR("Nic access not held from %s %d\n", f, l); |
257 | IWL_DEBUG_IO("read_restricted(0x%4X) = 0x%08x - %s %d \n", reg, value, | 254 | IWL_DEBUG_IO("read_direct32(0x%4X) = 0x%08x - %s %d \n", reg, value, |
258 | f, l); | 255 | f, l); |
259 | return value; | 256 | return value; |
260 | } | 257 | } |
261 | #define iwl_read_restricted(priv, reg) \ | 258 | #define iwl_read_direct32(priv, reg) \ |
262 | __iwl_read_restricted(__FILE__, __LINE__, priv, reg) | 259 | __iwl_read_direct32(__FILE__, __LINE__, priv, reg) |
263 | #else | 260 | #else |
264 | #define iwl_read_restricted _iwl_read_restricted | 261 | #define iwl_read_direct32 _iwl_read_direct32 |
265 | #endif | 262 | #endif |
266 | 263 | ||
267 | static inline void _iwl_write_restricted(struct iwl_priv *priv, | 264 | static inline void _iwl_write_direct32(struct iwl_priv *priv, |
268 | u32 reg, u32 value) | 265 | u32 reg, u32 value) |
269 | { | 266 | { |
270 | _iwl_write32(priv, reg, value); | 267 | _iwl_write32(priv, reg, value); |
271 | } | 268 | } |
272 | #ifdef CONFIG_IWLWIFI_DEBUG | 269 | #ifdef CONFIG_IWLWIFI_DEBUG |
273 | static void __iwl_write_restricted(u32 line, | 270 | static void __iwl_write_direct32(u32 line, |
274 | struct iwl_priv *priv, u32 reg, u32 value) | 271 | struct iwl_priv *priv, u32 reg, u32 value) |
275 | { | 272 | { |
276 | if (!atomic_read(&priv->restrict_refcnt)) | 273 | if (!atomic_read(&priv->restrict_refcnt)) |
277 | IWL_ERROR("Unrestricted access from line %d\n", line); | 274 | IWL_ERROR("Nic access not held from line %d\n", line); |
278 | _iwl_write_restricted(priv, reg, value); | 275 | _iwl_write_direct32(priv, reg, value); |
279 | } | 276 | } |
280 | #define iwl_write_restricted(priv, reg, value) \ | 277 | #define iwl_write_direct32(priv, reg, value) \ |
281 | __iwl_write_restricted(__LINE__, priv, reg, value) | 278 | __iwl_write_direct32(__LINE__, priv, reg, value) |
282 | #else | 279 | #else |
283 | #define iwl_write_restricted _iwl_write_restricted | 280 | #define iwl_write_direct32 _iwl_write_direct32 |
284 | #endif | 281 | #endif |
285 | 282 | ||
286 | static inline void iwl_write_buffer_restricted(struct iwl_priv *priv, | 283 | static inline void iwl_write_reg_buf(struct iwl_priv *priv, |
287 | u32 reg, u32 len, u32 *values) | 284 | u32 reg, u32 len, u32 *values) |
288 | { | 285 | { |
289 | u32 count = sizeof(u32); | 286 | u32 count = sizeof(u32); |
290 | 287 | ||
291 | if ((priv != NULL) && (values != NULL)) { | 288 | if ((priv != NULL) && (values != NULL)) { |
292 | for (; 0 < len; len -= count, reg += count, values++) | 289 | for (; 0 < len; len -= count, reg += count, values++) |
293 | _iwl_write_restricted(priv, reg, *values); | 290 | _iwl_write_direct32(priv, reg, *values); |
294 | } | 291 | } |
295 | } | 292 | } |
296 | 293 | ||
297 | static inline int _iwl_poll_restricted_bit(struct iwl_priv *priv, | 294 | static inline int _iwl_poll_direct_bit(struct iwl_priv *priv, |
298 | u32 addr, u32 mask, int timeout) | 295 | u32 addr, u32 mask, int timeout) |
299 | { | 296 | { |
300 | int i = 0; | 297 | int i = 0; |
301 | 298 | ||
302 | do { | 299 | do { |
303 | if ((_iwl_read_restricted(priv, addr) & mask) == mask) | 300 | if ((_iwl_read_direct32(priv, addr) & mask) == mask) |
304 | return i; | 301 | return i; |
305 | mdelay(10); | 302 | mdelay(10); |
306 | i += 10; | 303 | i += 10; |
@@ -310,36 +307,36 @@ static inline int _iwl_poll_restricted_bit(struct iwl_priv *priv, | |||
310 | } | 307 | } |
311 | 308 | ||
312 | #ifdef CONFIG_IWLWIFI_DEBUG | 309 | #ifdef CONFIG_IWLWIFI_DEBUG |
313 | static inline int __iwl_poll_restricted_bit(const char *f, u32 l, | 310 | static inline int __iwl_poll_direct_bit(const char *f, u32 l, |
314 | struct iwl_priv *priv, | 311 | struct iwl_priv *priv, |
315 | u32 addr, u32 mask, int timeout) | 312 | u32 addr, u32 mask, int timeout) |
316 | { | 313 | { |
317 | int rc = _iwl_poll_restricted_bit(priv, addr, mask, timeout); | 314 | int ret = _iwl_poll_direct_bit(priv, addr, mask, timeout); |
318 | 315 | ||
319 | if (unlikely(rc == -ETIMEDOUT)) | 316 | if (unlikely(ret == -ETIMEDOUT)) |
320 | IWL_DEBUG_IO("poll_restricted_bit(0x%08X, 0x%08X) - " | 317 | IWL_DEBUG_IO("poll_direct_bit(0x%08X, 0x%08X) - " |
321 | "timedout - %s %d\n", addr, mask, f, l); | 318 | "timedout - %s %d\n", addr, mask, f, l); |
322 | else | 319 | else |
323 | IWL_DEBUG_IO("poll_restricted_bit(0x%08X, 0x%08X) = 0x%08X " | 320 | IWL_DEBUG_IO("poll_direct_bit(0x%08X, 0x%08X) = 0x%08X " |
324 | "- %s %d\n", addr, mask, rc, f, l); | 321 | "- %s %d\n", addr, mask, ret, f, l); |
325 | return rc; | 322 | return ret; |
326 | } | 323 | } |
327 | #define iwl_poll_restricted_bit(iwl, addr, mask, timeout) \ | 324 | #define iwl_poll_direct_bit(iwl, addr, mask, timeout) \ |
328 | __iwl_poll_restricted_bit(__FILE__, __LINE__, iwl, addr, mask, timeout) | 325 | __iwl_poll_direct_bit(__FILE__, __LINE__, iwl, addr, mask, timeout) |
329 | #else | 326 | #else |
330 | #define iwl_poll_restricted_bit _iwl_poll_restricted_bit | 327 | #define iwl_poll_direct_bit _iwl_poll_direct_bit |
331 | #endif | 328 | #endif |
332 | 329 | ||
333 | static inline u32 _iwl_read_prph(struct iwl_priv *priv, u32 reg) | 330 | static inline u32 _iwl_read_prph(struct iwl_priv *priv, u32 reg) |
334 | { | 331 | { |
335 | _iwl_write_restricted(priv, HBUS_TARG_PRPH_RADDR, reg | (3 << 24)); | 332 | _iwl_write_direct32(priv, HBUS_TARG_PRPH_RADDR, reg | (3 << 24)); |
336 | return _iwl_read_restricted(priv, HBUS_TARG_PRPH_RDAT); | 333 | return _iwl_read_direct32(priv, HBUS_TARG_PRPH_RDAT); |
337 | } | 334 | } |
338 | #ifdef CONFIG_IWLWIFI_DEBUG | 335 | #ifdef CONFIG_IWLWIFI_DEBUG |
339 | static inline u32 __iwl_read_prph(u32 line, struct iwl_priv *priv, u32 reg) | 336 | static inline u32 __iwl_read_prph(u32 line, struct iwl_priv *priv, u32 reg) |
340 | { | 337 | { |
341 | if (!atomic_read(&priv->restrict_refcnt)) | 338 | if (!atomic_read(&priv->restrict_refcnt)) |
342 | IWL_ERROR("Unrestricted access from line %d\n", line); | 339 | IWL_ERROR("Nic access not held from line %d\n", line); |
343 | return _iwl_read_prph(priv, reg); | 340 | return _iwl_read_prph(priv, reg); |
344 | } | 341 | } |
345 | 342 | ||
@@ -352,16 +349,16 @@ static inline u32 __iwl_read_prph(u32 line, struct iwl_priv *priv, u32 reg) | |||
352 | static inline void _iwl_write_prph(struct iwl_priv *priv, | 349 | static inline void _iwl_write_prph(struct iwl_priv *priv, |
353 | u32 addr, u32 val) | 350 | u32 addr, u32 val) |
354 | { | 351 | { |
355 | _iwl_write_restricted(priv, HBUS_TARG_PRPH_WADDR, | 352 | _iwl_write_direct32(priv, HBUS_TARG_PRPH_WADDR, |
356 | ((addr & 0x0000FFFF) | (3 << 24))); | 353 | ((addr & 0x0000FFFF) | (3 << 24))); |
357 | _iwl_write_restricted(priv, HBUS_TARG_PRPH_WDAT, val); | 354 | _iwl_write_direct32(priv, HBUS_TARG_PRPH_WDAT, val); |
358 | } | 355 | } |
359 | #ifdef CONFIG_IWLWIFI_DEBUG | 356 | #ifdef CONFIG_IWLWIFI_DEBUG |
360 | static inline void __iwl_write_prph(u32 line, struct iwl_priv *priv, | 357 | static inline void __iwl_write_prph(u32 line, struct iwl_priv *priv, |
361 | u32 addr, u32 val) | 358 | u32 addr, u32 val) |
362 | { | 359 | { |
363 | if (!atomic_read(&priv->restrict_refcnt)) | 360 | if (!atomic_read(&priv->restrict_refcnt)) |
364 | IWL_ERROR("Unrestricted access from line %d\n", line); | 361 | IWL_ERROR("Nic access from line %d\n", line); |
365 | _iwl_write_prph(priv, addr, val); | 362 | _iwl_write_prph(priv, addr, val); |
366 | } | 363 | } |
367 | 364 | ||
@@ -378,7 +375,8 @@ static inline void __iwl_set_bits_prph(u32 line, struct iwl_priv *priv, | |||
378 | u32 reg, u32 mask) | 375 | u32 reg, u32 mask) |
379 | { | 376 | { |
380 | if (!atomic_read(&priv->restrict_refcnt)) | 377 | if (!atomic_read(&priv->restrict_refcnt)) |
381 | IWL_ERROR("Unrestricted access from line %d\n", line); | 378 | IWL_ERROR("Nic access not held from line %d\n", line); |
379 | |||
382 | _iwl_set_bits_prph(priv, reg, mask); | 380 | _iwl_set_bits_prph(priv, reg, mask); |
383 | } | 381 | } |
384 | #define iwl_set_bits_prph(priv, reg, mask) \ | 382 | #define iwl_set_bits_prph(priv, reg, mask) \ |
@@ -395,7 +393,7 @@ static inline void __iwl_set_bits_mask_prph(u32 line, | |||
395 | struct iwl_priv *priv, u32 reg, u32 bits, u32 mask) | 393 | struct iwl_priv *priv, u32 reg, u32 bits, u32 mask) |
396 | { | 394 | { |
397 | if (!atomic_read(&priv->restrict_refcnt)) | 395 | if (!atomic_read(&priv->restrict_refcnt)) |
398 | IWL_ERROR("Unrestricted access from line %d\n", line); | 396 | IWL_ERROR("Nic access not held from line %d\n", line); |
399 | _iwl_set_bits_mask_prph(priv, reg, bits, mask); | 397 | _iwl_set_bits_mask_prph(priv, reg, bits, mask); |
400 | } | 398 | } |
401 | #define iwl_set_bits_mask_prph(priv, reg, bits, mask) \ | 399 | #define iwl_set_bits_mask_prph(priv, reg, bits, mask) \ |
@@ -413,21 +411,21 @@ static inline void iwl_clear_bits_prph(struct iwl_priv | |||
413 | 411 | ||
414 | static inline u32 iwl_read_targ_mem(struct iwl_priv *priv, u32 addr) | 412 | static inline u32 iwl_read_targ_mem(struct iwl_priv *priv, u32 addr) |
415 | { | 413 | { |
416 | iwl_write_restricted(priv, HBUS_TARG_MEM_RADDR, addr); | 414 | iwl_write_direct32(priv, HBUS_TARG_MEM_RADDR, addr); |
417 | return iwl_read_restricted(priv, HBUS_TARG_MEM_RDAT); | 415 | return iwl_read_direct32(priv, HBUS_TARG_MEM_RDAT); |
418 | } | 416 | } |
419 | 417 | ||
420 | static inline void iwl_write_targ_mem(struct iwl_priv *priv, u32 addr, u32 val) | 418 | static inline void iwl_write_targ_mem(struct iwl_priv *priv, u32 addr, u32 val) |
421 | { | 419 | { |
422 | iwl_write_restricted(priv, HBUS_TARG_MEM_WADDR, addr); | 420 | iwl_write_direct32(priv, HBUS_TARG_MEM_WADDR, addr); |
423 | iwl_write_restricted(priv, HBUS_TARG_MEM_WDAT, val); | 421 | iwl_write_direct32(priv, HBUS_TARG_MEM_WDAT, val); |
424 | } | 422 | } |
425 | 423 | ||
426 | static inline void iwl_write_targ_mem_buf(struct iwl_priv *priv, u32 addr, | 424 | static inline void iwl_write_targ_mem_buf(struct iwl_priv *priv, u32 addr, |
427 | u32 len, u32 *values) | 425 | u32 len, u32 *values) |
428 | { | 426 | { |
429 | iwl_write_restricted(priv, HBUS_TARG_MEM_WADDR, addr); | 427 | iwl_write_direct32(priv, HBUS_TARG_MEM_WADDR, addr); |
430 | for (; 0 < len; len -= sizeof(u32), values++) | 428 | for (; 0 < len; len -= sizeof(u32), values++) |
431 | iwl_write_restricted(priv, HBUS_TARG_MEM_WDAT, *values); | 429 | iwl_write_direct32(priv, HBUS_TARG_MEM_WDAT, *values); |
432 | } | 430 | } |
433 | #endif | 431 | #endif |