Commit e4b1681e authored by Emmanuel Grumbach's avatar Emmanuel Grumbach Committed by Johannes Berg

iwlwifi: iwl_{read,write}_targ_mem_words takes dwords

Change its name to better reflect this.
Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 7eb89baa
...@@ -473,7 +473,7 @@ static int iwlagn_mac_resume(struct ieee80211_hw *hw) ...@@ -473,7 +473,7 @@ static int iwlagn_mac_resume(struct ieee80211_hw *hw)
} }
if (priv->wowlan_sram) if (priv->wowlan_sram)
_iwl_read_targ_mem_words( _iwl_read_targ_mem_dwords(
priv->trans, 0x800000, priv->trans, 0x800000,
priv->wowlan_sram, priv->wowlan_sram,
img->sec[IWL_UCODE_SECTION_DATA].len / 4); img->sec[IWL_UCODE_SECTION_DATA].len / 4);
......
...@@ -298,8 +298,8 @@ void iwl_clear_bits_prph(struct iwl_trans *trans, u32 reg, u32 mask) ...@@ -298,8 +298,8 @@ void iwl_clear_bits_prph(struct iwl_trans *trans, u32 reg, u32 mask)
} }
EXPORT_SYMBOL_GPL(iwl_clear_bits_prph); EXPORT_SYMBOL_GPL(iwl_clear_bits_prph);
void _iwl_read_targ_mem_words(struct iwl_trans *trans, u32 addr, void _iwl_read_targ_mem_dwords(struct iwl_trans *trans, u32 addr,
void *buf, int words) void *buf, int dwords)
{ {
unsigned long flags; unsigned long flags;
int offs; int offs;
...@@ -308,26 +308,26 @@ void _iwl_read_targ_mem_words(struct iwl_trans *trans, u32 addr, ...@@ -308,26 +308,26 @@ void _iwl_read_targ_mem_words(struct iwl_trans *trans, u32 addr,
spin_lock_irqsave(&trans->reg_lock, flags); spin_lock_irqsave(&trans->reg_lock, flags);
if (likely(iwl_grab_nic_access(trans))) { if (likely(iwl_grab_nic_access(trans))) {
iwl_write32(trans, HBUS_TARG_MEM_RADDR, addr); iwl_write32(trans, HBUS_TARG_MEM_RADDR, addr);
for (offs = 0; offs < words; offs++) for (offs = 0; offs < dwords; offs++)
vals[offs] = iwl_read32(trans, HBUS_TARG_MEM_RDAT); vals[offs] = iwl_read32(trans, HBUS_TARG_MEM_RDAT);
iwl_release_nic_access(trans); iwl_release_nic_access(trans);
} }
spin_unlock_irqrestore(&trans->reg_lock, flags); spin_unlock_irqrestore(&trans->reg_lock, flags);
} }
EXPORT_SYMBOL_GPL(_iwl_read_targ_mem_words); EXPORT_SYMBOL_GPL(_iwl_read_targ_mem_dwords);
u32 iwl_read_targ_mem(struct iwl_trans *trans, u32 addr) u32 iwl_read_targ_mem(struct iwl_trans *trans, u32 addr)
{ {
u32 value; u32 value;
_iwl_read_targ_mem_words(trans, addr, &value, 1); _iwl_read_targ_mem_dwords(trans, addr, &value, 1);
return value; return value;
} }
EXPORT_SYMBOL_GPL(iwl_read_targ_mem); EXPORT_SYMBOL_GPL(iwl_read_targ_mem);
int _iwl_write_targ_mem_words(struct iwl_trans *trans, u32 addr, int _iwl_write_targ_mem_dwords(struct iwl_trans *trans, u32 addr,
void *buf, int words) void *buf, int dwords)
{ {
unsigned long flags; unsigned long flags;
int offs, result = 0; int offs, result = 0;
...@@ -336,7 +336,7 @@ int _iwl_write_targ_mem_words(struct iwl_trans *trans, u32 addr, ...@@ -336,7 +336,7 @@ int _iwl_write_targ_mem_words(struct iwl_trans *trans, u32 addr,
spin_lock_irqsave(&trans->reg_lock, flags); spin_lock_irqsave(&trans->reg_lock, flags);
if (likely(iwl_grab_nic_access(trans))) { if (likely(iwl_grab_nic_access(trans))) {
iwl_write32(trans, HBUS_TARG_MEM_WADDR, addr); iwl_write32(trans, HBUS_TARG_MEM_WADDR, addr);
for (offs = 0; offs < words; offs++) for (offs = 0; offs < dwords; offs++)
iwl_write32(trans, HBUS_TARG_MEM_WDAT, vals[offs]); iwl_write32(trans, HBUS_TARG_MEM_WDAT, vals[offs]);
iwl_release_nic_access(trans); iwl_release_nic_access(trans);
} else } else
...@@ -345,10 +345,10 @@ int _iwl_write_targ_mem_words(struct iwl_trans *trans, u32 addr, ...@@ -345,10 +345,10 @@ int _iwl_write_targ_mem_words(struct iwl_trans *trans, u32 addr,
return result; return result;
} }
EXPORT_SYMBOL_GPL(_iwl_write_targ_mem_words); EXPORT_SYMBOL_GPL(_iwl_write_targ_mem_dwords);
int iwl_write_targ_mem(struct iwl_trans *trans, u32 addr, u32 val) int iwl_write_targ_mem(struct iwl_trans *trans, u32 addr, u32 val)
{ {
return _iwl_write_targ_mem_words(trans, addr, &val, 1); return _iwl_write_targ_mem_dwords(trans, addr, &val, 1);
} }
EXPORT_SYMBOL_GPL(iwl_write_targ_mem); EXPORT_SYMBOL_GPL(iwl_write_targ_mem);
...@@ -76,18 +76,18 @@ void iwl_set_bits_mask_prph(struct iwl_trans *trans, u32 reg, ...@@ -76,18 +76,18 @@ void iwl_set_bits_mask_prph(struct iwl_trans *trans, u32 reg,
u32 bits, u32 mask); u32 bits, u32 mask);
void iwl_clear_bits_prph(struct iwl_trans *trans, u32 reg, u32 mask); void iwl_clear_bits_prph(struct iwl_trans *trans, u32 reg, u32 mask);
void _iwl_read_targ_mem_words(struct iwl_trans *trans, u32 addr, void _iwl_read_targ_mem_dwords(struct iwl_trans *trans, u32 addr,
void *buf, int words); void *buf, int dwords);
#define iwl_read_targ_mem_bytes(trans, addr, buf, bufsize) \ #define iwl_read_targ_mem_bytes(trans, addr, buf, bufsize) \
do { \ do { \
BUILD_BUG_ON((bufsize) % sizeof(u32)); \ BUILD_BUG_ON((bufsize) % sizeof(u32)); \
_iwl_read_targ_mem_words(trans, addr, buf, \ _iwl_read_targ_mem_dwords(trans, addr, buf, \
(bufsize) / sizeof(u32));\ (bufsize) / sizeof(u32));\
} while (0) } while (0)
int _iwl_write_targ_mem_words(struct iwl_trans *trans, u32 addr, int _iwl_write_targ_mem_dwords(struct iwl_trans *trans, u32 addr,
void *buf, int words); void *buf, int dwords);
u32 iwl_read_targ_mem(struct iwl_trans *trans, u32 addr); u32 iwl_read_targ_mem(struct iwl_trans *trans, u32 addr);
int iwl_write_targ_mem(struct iwl_trans *trans, u32 addr, u32 val); int iwl_write_targ_mem(struct iwl_trans *trans, u32 addr, u32 val);
......
...@@ -476,9 +476,9 @@ static int iwl_test_indirect_read(struct iwl_test *tst, u32 addr, u32 size) ...@@ -476,9 +476,9 @@ static int iwl_test_indirect_read(struct iwl_test *tst, u32 addr, u32 size)
iwl_release_nic_access(trans); iwl_release_nic_access(trans);
spin_unlock_irqrestore(&trans->reg_lock, flags); spin_unlock_irqrestore(&trans->reg_lock, flags);
} else { /* target memory (SRAM) */ } else { /* target memory (SRAM) */
_iwl_read_targ_mem_words(trans, addr, _iwl_read_targ_mem_dwords(trans, addr,
tst->mem.addr, tst->mem.addr,
tst->mem.size / 4); tst->mem.size / 4);
} }
tst->mem.nchunks = tst->mem.nchunks =
...@@ -522,7 +522,7 @@ static int iwl_test_indirect_write(struct iwl_test *tst, u32 addr, ...@@ -522,7 +522,7 @@ static int iwl_test_indirect_write(struct iwl_test *tst, u32 addr,
*(u32 *)(buf+i)); *(u32 *)(buf+i));
} }
} else if (iwl_test_valid_hw_addr(tst, addr)) { } else if (iwl_test_valid_hw_addr(tst, addr)) {
_iwl_write_targ_mem_words(trans, addr, buf, size/4); _iwl_write_targ_mem_dwords(trans, addr, buf, size / 4);
} else { } else {
return -EINVAL; return -EINVAL;
} }
......
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