diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-3945-io.h')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-3945-io.h | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945-io.h b/drivers/net/wireless/iwlwifi/iwl-3945-io.h index 0b9475114618..b3fe48de3ae7 100644 --- a/drivers/net/wireless/iwlwifi/iwl-3945-io.h +++ b/drivers/net/wireless/iwlwifi/iwl-3945-io.h | |||
@@ -59,7 +59,7 @@ | |||
59 | * | 59 | * |
60 | */ | 60 | */ |
61 | 61 | ||
62 | #define _iwl3945_write32(priv, ofs, val) writel((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 |
64 | static inline void __iwl3945_write32(const char *f, u32 l, struct iwl3945_priv *priv, | 64 | static inline void __iwl3945_write32(const char *f, u32 l, struct iwl3945_priv *priv, |
65 | u32 ofs, u32 val) | 65 | u32 ofs, u32 val) |
@@ -73,14 +73,14 @@ static inline void __iwl3945_write32(const char *f, u32 l, struct iwl3945_priv * | |||
73 | #define iwl3945_write32(priv, ofs, val) _iwl3945_write32(priv, ofs, val) | 73 | #define iwl3945_write32(priv, ofs, val) _iwl3945_write32(priv, ofs, val) |
74 | #endif | 74 | #endif |
75 | 75 | ||
76 | #define _iwl3945_read32(priv, ofs) readl((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 |
78 | static inline u32 __iwl3945_read32(char *f, u32 l, struct iwl3945_priv *priv, u32 ofs) | 78 | static inline u32 __iwl3945_read32(char *f, u32 l, struct iwl3945_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); |
82 | } | 82 | } |
83 | #define iwl3945_read32(priv, ofs) __iwl3945_read32(__FILE__, __LINE__, priv, ofs) | 83 | #define iwl3945_read32(priv, ofs)__iwl3945_read32(__FILE__, __LINE__, priv, ofs) |
84 | #else | 84 | #else |
85 | #define iwl3945_read32(p, o) _iwl3945_read32(p, o) | 85 | #define iwl3945_read32(p, o) _iwl3945_read32(p, o) |
86 | #endif | 86 | #endif |
@@ -153,28 +153,10 @@ static inline void __iwl3945_clear_bit(const char *f, u32 l, | |||
153 | static inline int _iwl3945_grab_nic_access(struct iwl3945_priv *priv) | 153 | static inline int _iwl3945_grab_nic_access(struct iwl3945_priv *priv) |
154 | { | 154 | { |
155 | int ret; | 155 | int ret; |
156 | u32 gp_ctl; | ||
157 | |||
158 | #ifdef CONFIG_IWL3945_DEBUG | 156 | #ifdef CONFIG_IWL3945_DEBUG |
159 | if (atomic_read(&priv->restrict_refcnt)) | 157 | if (atomic_read(&priv->restrict_refcnt)) |
160 | return 0; | 158 | return 0; |
161 | #endif | 159 | #endif |
162 | if (test_bit(STATUS_RF_KILL_HW, &priv->status) || | ||
163 | test_bit(STATUS_RF_KILL_SW, &priv->status)) { | ||
164 | IWL_WARNING("WARNING: Requesting MAC access during RFKILL " | ||
165 | "wakes up NIC\n"); | ||
166 | |||
167 | /* 10 msec allows time for NIC to complete its data save */ | ||
168 | gp_ctl = _iwl3945_read32(priv, CSR_GP_CNTRL); | ||
169 | if (gp_ctl & CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY) { | ||
170 | IWL_DEBUG_RF_KILL("Wait for complete power-down, " | ||
171 | "gpctl = 0x%08x\n", gp_ctl); | ||
172 | mdelay(10); | ||
173 | } else | ||
174 | IWL_DEBUG_RF_KILL("power-down complete, " | ||
175 | "gpctl = 0x%08x\n", gp_ctl); | ||
176 | } | ||
177 | |||
178 | /* this bit wakes up the NIC */ | 160 | /* this bit wakes up the NIC */ |
179 | _iwl3945_set_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ); | 161 | _iwl3945_set_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ); |
180 | ret = _iwl3945_poll_bit(priv, CSR_GP_CNTRL, | 162 | ret = _iwl3945_poll_bit(priv, CSR_GP_CNTRL, |