Commit 1c8cae57 authored by Stanislaw Gruszka's avatar Stanislaw Gruszka

iwlegacy: remove _il_{read,write}_direct32

Use _il_{rd,wr} instead of another name of these operations.
Signed-off-by: default avatarStanislaw Gruszka <sgruszka@redhat.com>
parent 13882269
...@@ -63,7 +63,7 @@ il4965_verify_inst_sparse(struct il_priv *il, __le32 *image, u32 len) ...@@ -63,7 +63,7 @@ il4965_verify_inst_sparse(struct il_priv *il, __le32 *image, u32 len)
* if IL_DL_IO is set */ * if IL_DL_IO is set */
il_write_direct32(il, HBUS_TARG_MEM_RADDR, il_write_direct32(il, HBUS_TARG_MEM_RADDR,
i + IWL4965_RTC_INST_LOWER_BOUND); i + IWL4965_RTC_INST_LOWER_BOUND);
val = _il_read_direct32(il, HBUS_TARG_MEM_RDAT); val = _il_rd(il, HBUS_TARG_MEM_RDAT);
if (val != le32_to_cpu(*image)) { if (val != le32_to_cpu(*image)) {
ret = -EIO; ret = -EIO;
errcnt++; errcnt++;
...@@ -97,7 +97,7 @@ static int il4965_verify_inst_full(struct il_priv *il, __le32 *image, ...@@ -97,7 +97,7 @@ static int il4965_verify_inst_full(struct il_priv *il, __le32 *image,
/* read data comes through single port, auto-incr addr */ /* read data comes through single port, auto-incr addr */
/* NOTE: Use the debugless read so we don't flood kernel log /* NOTE: Use the debugless read so we don't flood kernel log
* if IL_DL_IO is set */ * if IL_DL_IO is set */
val = _il_read_direct32(il, HBUS_TARG_MEM_RDAT); val = _il_rd(il, HBUS_TARG_MEM_RDAT);
if (val != le32_to_cpu(*image)) { if (val != le32_to_cpu(*image)) {
IL_ERR("uCode INST section is invalid at " IL_ERR("uCode INST section is invalid at "
"offset 0x%x, is 0x%x, s/b 0x%x\n", "offset 0x%x, is 0x%x, s/b 0x%x\n",
......
...@@ -235,7 +235,7 @@ int il_eeprom_init(struct il_priv *il) ...@@ -235,7 +235,7 @@ int il_eeprom_init(struct il_priv *il)
addr); addr);
goto done; goto done;
} }
r = _il_read_direct32(il, CSR_EEPROM_REG); r = _il_rd(il, CSR_EEPROM_REG);
e[addr / 2] = cpu_to_le16(r >> 16); e[addr / 2] = cpu_to_le16(r >> 16);
} }
......
...@@ -144,11 +144,6 @@ static inline void _il_release_nic_access(struct il_priv *il) ...@@ -144,11 +144,6 @@ static inline void _il_release_nic_access(struct il_priv *il)
CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ); CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ);
} }
static inline u32 _il_read_direct32(struct il_priv *il, u32 reg)
{
return _il_rd(il, reg);
}
static inline u32 il_read_direct32(struct il_priv *il, u32 reg) static inline u32 il_read_direct32(struct il_priv *il, u32 reg)
{ {
u32 value; u32 value;
...@@ -156,18 +151,13 @@ static inline u32 il_read_direct32(struct il_priv *il, u32 reg) ...@@ -156,18 +151,13 @@ static inline u32 il_read_direct32(struct il_priv *il, u32 reg)
spin_lock_irqsave(&il->reg_lock, reg_flags); spin_lock_irqsave(&il->reg_lock, reg_flags);
_il_grab_nic_access(il); _il_grab_nic_access(il);
value = _il_read_direct32(il, reg); value = _il_rd(il, reg);
_il_release_nic_access(il); _il_release_nic_access(il);
spin_unlock_irqrestore(&il->reg_lock, reg_flags); spin_unlock_irqrestore(&il->reg_lock, reg_flags);
return value; return value;
} }
static inline void _il_write_direct32(struct il_priv *il,
u32 reg, u32 value)
{
_il_wr(il, reg, value);
}
static inline void static inline void
il_write_direct32(struct il_priv *il, u32 reg, u32 value) il_write_direct32(struct il_priv *il, u32 reg, u32 value)
{ {
...@@ -175,7 +165,7 @@ il_write_direct32(struct il_priv *il, u32 reg, u32 value) ...@@ -175,7 +165,7 @@ il_write_direct32(struct il_priv *il, u32 reg, u32 value)
spin_lock_irqsave(&il->reg_lock, reg_flags); spin_lock_irqsave(&il->reg_lock, reg_flags);
if (!_il_grab_nic_access(il)) { if (!_il_grab_nic_access(il)) {
_il_write_direct32(il, reg, value); _il_wr(il, reg, value);
_il_release_nic_access(il); _il_release_nic_access(il);
} }
spin_unlock_irqrestore(&il->reg_lock, reg_flags); 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,9 +200,9 @@ static inline int _il_poll_direct_bit(struct il_priv *il, u32 addr,
static inline u32 _il_read_prph(struct il_priv *il, u32 reg) static inline u32 _il_read_prph(struct il_priv *il, u32 reg)
{ {
_il_write_direct32(il, HBUS_TARG_PRPH_RADDR, reg | (3 << 24)); _il_wr(il, HBUS_TARG_PRPH_RADDR, reg | (3 << 24));
rmb(); rmb();
return _il_read_direct32(il, HBUS_TARG_PRPH_RDAT); return _il_rd(il, HBUS_TARG_PRPH_RDAT);
} }
static inline u32 il_read_prph(struct il_priv *il, u32 reg) static inline u32 il_read_prph(struct il_priv *il, u32 reg)
{ {
...@@ -230,10 +220,10 @@ static inline u32 il_read_prph(struct il_priv *il, u32 reg) ...@@ -230,10 +220,10 @@ static inline u32 il_read_prph(struct il_priv *il, u32 reg)
static inline void _il_write_prph(struct il_priv *il, static inline void _il_write_prph(struct il_priv *il,
u32 addr, u32 val) u32 addr, u32 val)
{ {
_il_write_direct32(il, HBUS_TARG_PRPH_WADDR, _il_wr(il, HBUS_TARG_PRPH_WADDR,
((addr & 0x0000FFFF) | (3 << 24))); ((addr & 0x0000FFFF) | (3 << 24)));
wmb(); wmb();
_il_write_direct32(il, HBUS_TARG_PRPH_WDAT, val); _il_wr(il, HBUS_TARG_PRPH_WDAT, val);
} }
static inline void static inline void
...@@ -302,9 +292,9 @@ static inline u32 il_read_targ_mem(struct il_priv *il, u32 addr) ...@@ -302,9 +292,9 @@ static inline u32 il_read_targ_mem(struct il_priv *il, u32 addr)
spin_lock_irqsave(&il->reg_lock, reg_flags); spin_lock_irqsave(&il->reg_lock, reg_flags);
_il_grab_nic_access(il); _il_grab_nic_access(il);
_il_write_direct32(il, HBUS_TARG_MEM_RADDR, addr); _il_wr(il, HBUS_TARG_MEM_RADDR, addr);
rmb(); rmb();
value = _il_read_direct32(il, HBUS_TARG_MEM_RDAT); value = _il_rd(il, HBUS_TARG_MEM_RDAT);
_il_release_nic_access(il); _il_release_nic_access(il);
spin_unlock_irqrestore(&il->reg_lock, reg_flags); 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,9 +308,9 @@ il_write_targ_mem(struct il_priv *il, u32 addr, u32 val)
spin_lock_irqsave(&il->reg_lock, reg_flags); spin_lock_irqsave(&il->reg_lock, reg_flags);
if (!_il_grab_nic_access(il)) { if (!_il_grab_nic_access(il)) {
_il_write_direct32(il, HBUS_TARG_MEM_WADDR, addr); _il_wr(il, HBUS_TARG_MEM_WADDR, addr);
wmb(); wmb();
_il_write_direct32(il, HBUS_TARG_MEM_WDAT, val); _il_wr(il, HBUS_TARG_MEM_WDAT, val);
_il_release_nic_access(il); _il_release_nic_access(il);
} }
spin_unlock_irqrestore(&il->reg_lock, reg_flags); spin_unlock_irqrestore(&il->reg_lock, reg_flags);
...@@ -334,10 +324,10 @@ il_write_targ_mem_buf(struct il_priv *il, u32 addr, ...@@ -334,10 +324,10 @@ il_write_targ_mem_buf(struct il_priv *il, u32 addr,
spin_lock_irqsave(&il->reg_lock, reg_flags); spin_lock_irqsave(&il->reg_lock, reg_flags);
if (!_il_grab_nic_access(il)) { if (!_il_grab_nic_access(il)) {
_il_write_direct32(il, HBUS_TARG_MEM_WADDR, addr); _il_wr(il, HBUS_TARG_MEM_WADDR, addr);
wmb(); wmb();
for (; 0 < len; len -= sizeof(u32), values++) for (; 0 < len; len -= sizeof(u32), values++)
_il_write_direct32(il, _il_wr(il,
HBUS_TARG_MEM_WDAT, *values); HBUS_TARG_MEM_WDAT, *values);
_il_release_nic_access(il); _il_release_nic_access(il);
......
...@@ -1706,7 +1706,7 @@ static int il3945_verify_inst_full(struct il_priv *il, __le32 *image, u32 len) ...@@ -1706,7 +1706,7 @@ static int il3945_verify_inst_full(struct il_priv *il, __le32 *image, u32 len)
/* read data comes through single port, auto-incr addr */ /* read data comes through single port, auto-incr addr */
/* NOTE: Use the debugless read so we don't flood kernel log /* NOTE: Use the debugless read so we don't flood kernel log
* if IL_DL_IO is set */ * if IL_DL_IO is set */
val = _il_read_direct32(il, HBUS_TARG_MEM_RDAT); val = _il_rd(il, HBUS_TARG_MEM_RDAT);
if (val != le32_to_cpu(*image)) { if (val != le32_to_cpu(*image)) {
IL_ERR("uCode INST section is invalid at " IL_ERR("uCode INST section is invalid at "
"offset 0x%x, is 0x%x, s/b 0x%x\n", "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,7 +1747,7 @@ static int il3945_verify_inst_sparse(struct il_priv *il, __le32 *image, u32 len)
* if IL_DL_IO is set */ * if IL_DL_IO is set */
il_write_direct32(il, HBUS_TARG_MEM_RADDR, il_write_direct32(il, HBUS_TARG_MEM_RADDR,
i + IWL39_RTC_INST_LOWER_BOUND); i + IWL39_RTC_INST_LOWER_BOUND);
val = _il_read_direct32(il, HBUS_TARG_MEM_RDAT); val = _il_rd(il, HBUS_TARG_MEM_RDAT);
if (val != le32_to_cpu(*image)) { if (val != le32_to_cpu(*image)) {
#if 0 /* Enable this if you want to see details */ #if 0 /* Enable this if you want to see details */
IL_ERR("uCode INST section is invalid at " IL_ERR("uCode INST section is invalid at "
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment