iwlwifi: virtualize iwl_{grab,release}_nic_access
Since different transports have different ways to wake the up the NIC, we need to virtualize it. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:

gecommit door
Johannes Berg

bovenliggende
f317243a8b
commit
7a65d17053
@@ -467,13 +467,13 @@ static int iwl_test_indirect_read(struct iwl_test *tst, u32 addr, u32 size)
|
||||
if (IWL_ABS_PRPH_START <= addr &&
|
||||
addr < IWL_ABS_PRPH_START + PRPH_END) {
|
||||
spin_lock_irqsave(&trans->reg_lock, flags);
|
||||
iwl_grab_nic_access(trans);
|
||||
iwl_trans_grab_nic_access(trans, false);
|
||||
iwl_write32(trans, HBUS_TARG_PRPH_RADDR,
|
||||
addr | (3 << 24));
|
||||
for (i = 0; i < size; i += 4)
|
||||
*(u32 *)(tst->mem.addr + i) =
|
||||
iwl_read32(trans, HBUS_TARG_PRPH_RDAT);
|
||||
iwl_release_nic_access(trans);
|
||||
iwl_trans_release_nic_access(trans);
|
||||
spin_unlock_irqrestore(&trans->reg_lock, flags);
|
||||
} else { /* target memory (SRAM) */
|
||||
_iwl_read_targ_mem_dwords(trans, addr,
|
||||
@@ -505,12 +505,12 @@ static int iwl_test_indirect_write(struct iwl_test *tst, u32 addr,
|
||||
if (size < 4) {
|
||||
memcpy(&val, buf, size);
|
||||
spin_lock_irqsave(&trans->reg_lock, flags);
|
||||
iwl_grab_nic_access(trans);
|
||||
iwl_trans_grab_nic_access(trans, false);
|
||||
iwl_write32(trans, HBUS_TARG_PRPH_WADDR,
|
||||
(addr & 0x0000FFFF) |
|
||||
((size - 1) << 24));
|
||||
iwl_write32(trans, HBUS_TARG_PRPH_WDAT, val);
|
||||
iwl_release_nic_access(trans);
|
||||
iwl_trans_release_nic_access(trans);
|
||||
/* needed after consecutive writes w/o read */
|
||||
mmiowb();
|
||||
spin_unlock_irqrestore(&trans->reg_lock, flags);
|
||||
|
Verwijs in nieuw issue
Block a user