diff options
author | Stanislaw Gruszka <sgruszka@redhat.com> | 2011-08-24 09:46:03 -0400 |
---|---|---|
committer | Stanislaw Gruszka <sgruszka@redhat.com> | 2011-11-15 05:22:42 -0500 |
commit | 1c8cae575b14ffad6af9c80927a08aa783f0ed78 (patch) | |
tree | d53cb3be8c14564b31452ca427899dfb2fc91459 /drivers/net/wireless/iwlegacy | |
parent | 138822698fc16bd4c5b509da28a9b08faac4367b (diff) |
iwlegacy: remove _il_{read,write}_direct32
Use _il_{rd,wr} instead of another name of these operations.
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Diffstat (limited to 'drivers/net/wireless/iwlegacy')
-rw-r--r-- | drivers/net/wireless/iwlegacy/iwl-4965-ucode.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/iwlegacy/iwl-eeprom.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlegacy/iwl-io.h | 34 | ||||
-rw-r--r-- | drivers/net/wireless/iwlegacy/iwl3945-base.c | 4 |
4 files changed, 17 insertions, 27 deletions
diff --git a/drivers/net/wireless/iwlegacy/iwl-4965-ucode.c b/drivers/net/wireless/iwlegacy/iwl-4965-ucode.c index 3fa939e490cf..4f0e6fe5be50 100644 --- a/drivers/net/wireless/iwlegacy/iwl-4965-ucode.c +++ b/drivers/net/wireless/iwlegacy/iwl-4965-ucode.c | |||
@@ -63,7 +63,7 @@ il4965_verify_inst_sparse(struct il_priv *il, __le32 *image, u32 len) | |||
63 | * if IL_DL_IO is set */ | 63 | * if IL_DL_IO is set */ |
64 | il_write_direct32(il, HBUS_TARG_MEM_RADDR, | 64 | il_write_direct32(il, HBUS_TARG_MEM_RADDR, |
65 | i + IWL4965_RTC_INST_LOWER_BOUND); | 65 | i + IWL4965_RTC_INST_LOWER_BOUND); |
66 | val = _il_read_direct32(il, HBUS_TARG_MEM_RDAT); | 66 | val = _il_rd(il, HBUS_TARG_MEM_RDAT); |
67 | if (val != le32_to_cpu(*image)) { | 67 | if (val != le32_to_cpu(*image)) { |
68 | ret = -EIO; | 68 | ret = -EIO; |
69 | errcnt++; | 69 | errcnt++; |
@@ -97,7 +97,7 @@ static int il4965_verify_inst_full(struct il_priv *il, __le32 *image, | |||
97 | /* read data comes through single port, auto-incr addr */ | 97 | /* read data comes through single port, auto-incr addr */ |
98 | /* NOTE: Use the debugless read so we don't flood kernel log | 98 | /* NOTE: Use the debugless read so we don't flood kernel log |
99 | * if IL_DL_IO is set */ | 99 | * if IL_DL_IO is set */ |
100 | val = _il_read_direct32(il, HBUS_TARG_MEM_RDAT); | 100 | val = _il_rd(il, HBUS_TARG_MEM_RDAT); |
101 | if (val != le32_to_cpu(*image)) { | 101 | if (val != le32_to_cpu(*image)) { |
102 | IL_ERR("uCode INST section is invalid at " | 102 | IL_ERR("uCode INST section is invalid at " |
103 | "offset 0x%x, is 0x%x, s/b 0x%x\n", | 103 | "offset 0x%x, is 0x%x, s/b 0x%x\n", |
diff --git a/drivers/net/wireless/iwlegacy/iwl-eeprom.c b/drivers/net/wireless/iwlegacy/iwl-eeprom.c index ba2be7b9e379..5786abd7c0bb 100644 --- a/drivers/net/wireless/iwlegacy/iwl-eeprom.c +++ b/drivers/net/wireless/iwlegacy/iwl-eeprom.c | |||
@@ -235,7 +235,7 @@ int il_eeprom_init(struct il_priv *il) | |||
235 | addr); | 235 | addr); |
236 | goto done; | 236 | goto done; |
237 | } | 237 | } |
238 | r = _il_read_direct32(il, CSR_EEPROM_REG); | 238 | r = _il_rd(il, CSR_EEPROM_REG); |
239 | e[addr / 2] = cpu_to_le16(r >> 16); | 239 | e[addr / 2] = cpu_to_le16(r >> 16); |
240 | } | 240 | } |
241 | 241 | ||
diff --git a/drivers/net/wireless/iwlegacy/iwl-io.h b/drivers/net/wireless/iwlegacy/iwl-io.h index c2e32ed27349..ecf799d9d22b 100644 --- a/drivers/net/wireless/iwlegacy/iwl-io.h +++ b/drivers/net/wireless/iwlegacy/iwl-io.h | |||
@@ -144,11 +144,6 @@ static inline void _il_release_nic_access(struct il_priv *il) | |||
144 | CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ); | 144 | CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ); |
145 | } | 145 | } |
146 | 146 | ||
147 | static inline u32 _il_read_direct32(struct il_priv *il, u32 reg) | ||
148 | { | ||
149 | return _il_rd(il, reg); | ||
150 | } | ||
151 | |||
152 | static inline u32 il_read_direct32(struct il_priv *il, u32 reg) | 147 | static inline u32 il_read_direct32(struct il_priv *il, u32 reg) |
153 | { | 148 | { |
154 | u32 value; | 149 | u32 value; |
@@ -156,18 +151,13 @@ static inline u32 il_read_direct32(struct il_priv *il, u32 reg) | |||
156 | 151 | ||
157 | spin_lock_irqsave(&il->reg_lock, reg_flags); | 152 | spin_lock_irqsave(&il->reg_lock, reg_flags); |
158 | _il_grab_nic_access(il); | 153 | _il_grab_nic_access(il); |
159 | value = _il_read_direct32(il, reg); | 154 | value = _il_rd(il, reg); |
160 | _il_release_nic_access(il); | 155 | _il_release_nic_access(il); |
161 | spin_unlock_irqrestore(&il->reg_lock, reg_flags); | 156 | spin_unlock_irqrestore(&il->reg_lock, reg_flags); |
162 | return value; | 157 | return value; |
163 | 158 | ||
164 | } | 159 | } |
165 | 160 | ||
166 | static inline void _il_write_direct32(struct il_priv *il, | ||
167 | u32 reg, u32 value) | ||
168 | { | ||
169 | _il_wr(il, reg, value); | ||
170 | } | ||
171 | static inline void | 161 | static inline void |
172 | il_write_direct32(struct il_priv *il, u32 reg, u32 value) | 162 | il_write_direct32(struct il_priv *il, u32 reg, u32 value) |
173 | { | 163 | { |
@@ -175,7 +165,7 @@ il_write_direct32(struct il_priv *il, u32 reg, u32 value) | |||
175 | 165 | ||
176 | spin_lock_irqsave(&il->reg_lock, reg_flags); | 166 | spin_lock_irqsave(&il->reg_lock, reg_flags); |
177 | if (!_il_grab_nic_access(il)) { | 167 | if (!_il_grab_nic_access(il)) { |
178 | _il_write_direct32(il, reg, value); | 168 | _il_wr(il, reg, value); |
179 | _il_release_nic_access(il); | 169 | _il_release_nic_access(il); |
180 | } | 170 | } |
181 | spin_unlock_irqrestore(&il->reg_lock, reg_flags); | 171 | spin_unlock_irqrestore(&il->reg_lock, reg_flags); |
@@ -210,9 +200,9 @@ static inline int _il_poll_direct_bit(struct il_priv *il, u32 addr, | |||
210 | 200 | ||
211 | static inline u32 _il_read_prph(struct il_priv *il, u32 reg) | 201 | static inline u32 _il_read_prph(struct il_priv *il, u32 reg) |
212 | { | 202 | { |
213 | _il_write_direct32(il, HBUS_TARG_PRPH_RADDR, reg | (3 << 24)); | 203 | _il_wr(il, HBUS_TARG_PRPH_RADDR, reg | (3 << 24)); |
214 | rmb(); | 204 | rmb(); |
215 | return _il_read_direct32(il, HBUS_TARG_PRPH_RDAT); | 205 | return _il_rd(il, HBUS_TARG_PRPH_RDAT); |
216 | } | 206 | } |
217 | static inline u32 il_read_prph(struct il_priv *il, u32 reg) | 207 | static inline u32 il_read_prph(struct il_priv *il, u32 reg) |
218 | { | 208 | { |
@@ -230,10 +220,10 @@ static inline u32 il_read_prph(struct il_priv *il, u32 reg) | |||
230 | static inline void _il_write_prph(struct il_priv *il, | 220 | static inline void _il_write_prph(struct il_priv *il, |
231 | u32 addr, u32 val) | 221 | u32 addr, u32 val) |
232 | { | 222 | { |
233 | _il_write_direct32(il, HBUS_TARG_PRPH_WADDR, | 223 | _il_wr(il, HBUS_TARG_PRPH_WADDR, |
234 | ((addr & 0x0000FFFF) | (3 << 24))); | 224 | ((addr & 0x0000FFFF) | (3 << 24))); |
235 | wmb(); | 225 | wmb(); |
236 | _il_write_direct32(il, HBUS_TARG_PRPH_WDAT, val); | 226 | _il_wr(il, HBUS_TARG_PRPH_WDAT, val); |
237 | } | 227 | } |
238 | 228 | ||
239 | static inline void | 229 | static inline void |
@@ -302,9 +292,9 @@ static inline u32 il_read_targ_mem(struct il_priv *il, u32 addr) | |||
302 | spin_lock_irqsave(&il->reg_lock, reg_flags); | 292 | spin_lock_irqsave(&il->reg_lock, reg_flags); |
303 | _il_grab_nic_access(il); | 293 | _il_grab_nic_access(il); |
304 | 294 | ||
305 | _il_write_direct32(il, HBUS_TARG_MEM_RADDR, addr); | 295 | _il_wr(il, HBUS_TARG_MEM_RADDR, addr); |
306 | rmb(); | 296 | rmb(); |
307 | value = _il_read_direct32(il, HBUS_TARG_MEM_RDAT); | 297 | value = _il_rd(il, HBUS_TARG_MEM_RDAT); |
308 | 298 | ||
309 | _il_release_nic_access(il); | 299 | _il_release_nic_access(il); |
310 | spin_unlock_irqrestore(&il->reg_lock, reg_flags); | 300 | spin_unlock_irqrestore(&il->reg_lock, reg_flags); |
@@ -318,9 +308,9 @@ il_write_targ_mem(struct il_priv *il, u32 addr, u32 val) | |||
318 | 308 | ||
319 | spin_lock_irqsave(&il->reg_lock, reg_flags); | 309 | spin_lock_irqsave(&il->reg_lock, reg_flags); |
320 | if (!_il_grab_nic_access(il)) { | 310 | if (!_il_grab_nic_access(il)) { |
321 | _il_write_direct32(il, HBUS_TARG_MEM_WADDR, addr); | 311 | _il_wr(il, HBUS_TARG_MEM_WADDR, addr); |
322 | wmb(); | 312 | wmb(); |
323 | _il_write_direct32(il, HBUS_TARG_MEM_WDAT, val); | 313 | _il_wr(il, HBUS_TARG_MEM_WDAT, val); |
324 | _il_release_nic_access(il); | 314 | _il_release_nic_access(il); |
325 | } | 315 | } |
326 | spin_unlock_irqrestore(&il->reg_lock, reg_flags); | 316 | spin_unlock_irqrestore(&il->reg_lock, reg_flags); |
@@ -334,10 +324,10 @@ il_write_targ_mem_buf(struct il_priv *il, u32 addr, | |||
334 | 324 | ||
335 | spin_lock_irqsave(&il->reg_lock, reg_flags); | 325 | spin_lock_irqsave(&il->reg_lock, reg_flags); |
336 | if (!_il_grab_nic_access(il)) { | 326 | if (!_il_grab_nic_access(il)) { |
337 | _il_write_direct32(il, HBUS_TARG_MEM_WADDR, addr); | 327 | _il_wr(il, HBUS_TARG_MEM_WADDR, addr); |
338 | wmb(); | 328 | wmb(); |
339 | for (; 0 < len; len -= sizeof(u32), values++) | 329 | for (; 0 < len; len -= sizeof(u32), values++) |
340 | _il_write_direct32(il, | 330 | _il_wr(il, |
341 | HBUS_TARG_MEM_WDAT, *values); | 331 | HBUS_TARG_MEM_WDAT, *values); |
342 | 332 | ||
343 | _il_release_nic_access(il); | 333 | _il_release_nic_access(il); |
diff --git a/drivers/net/wireless/iwlegacy/iwl3945-base.c b/drivers/net/wireless/iwlegacy/iwl3945-base.c index def314073ce8..d45e9f532dcc 100644 --- a/drivers/net/wireless/iwlegacy/iwl3945-base.c +++ b/drivers/net/wireless/iwlegacy/iwl3945-base.c | |||
@@ -1706,7 +1706,7 @@ static int il3945_verify_inst_full(struct il_priv *il, __le32 *image, u32 len) | |||
1706 | /* read data comes through single port, auto-incr addr */ | 1706 | /* read data comes through single port, auto-incr addr */ |
1707 | /* NOTE: Use the debugless read so we don't flood kernel log | 1707 | /* NOTE: Use the debugless read so we don't flood kernel log |
1708 | * if IL_DL_IO is set */ | 1708 | * if IL_DL_IO is set */ |
1709 | val = _il_read_direct32(il, HBUS_TARG_MEM_RDAT); | 1709 | val = _il_rd(il, HBUS_TARG_MEM_RDAT); |
1710 | if (val != le32_to_cpu(*image)) { | 1710 | if (val != le32_to_cpu(*image)) { |
1711 | IL_ERR("uCode INST section is invalid at " | 1711 | IL_ERR("uCode INST section is invalid at " |
1712 | "offset 0x%x, is 0x%x, s/b 0x%x\n", | 1712 | "offset 0x%x, is 0x%x, s/b 0x%x\n", |
@@ -1747,7 +1747,7 @@ static int il3945_verify_inst_sparse(struct il_priv *il, __le32 *image, u32 len) | |||
1747 | * if IL_DL_IO is set */ | 1747 | * if IL_DL_IO is set */ |
1748 | il_write_direct32(il, HBUS_TARG_MEM_RADDR, | 1748 | il_write_direct32(il, HBUS_TARG_MEM_RADDR, |
1749 | i + IWL39_RTC_INST_LOWER_BOUND); | 1749 | i + IWL39_RTC_INST_LOWER_BOUND); |
1750 | val = _il_read_direct32(il, HBUS_TARG_MEM_RDAT); | 1750 | val = _il_rd(il, HBUS_TARG_MEM_RDAT); |
1751 | if (val != le32_to_cpu(*image)) { | 1751 | if (val != le32_to_cpu(*image)) { |
1752 | #if 0 /* Enable this if you want to see details */ | 1752 | #if 0 /* Enable this if you want to see details */ |
1753 | IL_ERR("uCode INST section is invalid at " | 1753 | IL_ERR("uCode INST section is invalid at " |