diff options
author | Amit Beka | 2012-02-06 00:40:47 +0200 |
---|---|---|
committer | Wey-Yi Guy | 2012-02-17 10:55:00 -0800 |
commit | 858b7c74dda1d748a687a523e83cf7d1449c70f3 (patch) | |
tree | 4303849e0bd88de67147831c99a93bc9079ca399 | |
parent | 637d7925910df46bb29a0260dd2fec68b50a811b (diff) |
iwlwifi: fixes to testmode indirect access
Fixed casting of buffer addressing, and added size to
the read method, like in __iwl_read_prph.
Signed-off-by: Amit Beka <amit.beka@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-testmode.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-testmode.c b/drivers/net/wireless/iwlwifi/iwl-testmode.c index 5f00a3712707..ba5c63a023a2 100644 --- a/drivers/net/wireless/iwlwifi/iwl-testmode.c +++ b/drivers/net/wireless/iwlwifi/iwl-testmode.c @@ -799,9 +799,10 @@ static int iwl_testmode_indirect_read(struct iwl_priv *priv, u32 addr, u32 size) addr < IWL_TM_ABS_PRPH_START + PRPH_END) { spin_lock_irqsave(&trans->reg_lock, flags); iwl_grab_nic_access(trans); - iwl_write32(trans, HBUS_TARG_PRPH_RADDR, addr); + iwl_write32(trans, HBUS_TARG_PRPH_RADDR, + addr | (3 << 24)); for (i = 0; i < size; i += 4) - priv->testmode_mem.buff_addr[i] = + *(u32 *)(priv->testmode_mem.buff_addr + i) = iwl_read32(trans, HBUS_TARG_PRPH_RDAT); iwl_release_nic_access(trans); spin_unlock_irqrestore(&trans->reg_lock, flags); @@ -833,7 +834,8 @@ static int iwl_testmode_indirect_write(struct iwl_priv *priv, u32 addr, spin_lock_irqsave(&trans->reg_lock, flags); iwl_grab_nic_access(trans); iwl_write32(trans, HBUS_TARG_PRPH_WADDR, - (addr & 0x0000FFFF) | (size << 24)); + (addr & 0x0000FFFF) | + ((size - 1) << 24)); iwl_write32(trans, HBUS_TARG_PRPH_WDAT, val); iwl_release_nic_access(trans); /* needed after consecutive writes w/o read */ @@ -844,7 +846,7 @@ static int iwl_testmode_indirect_write(struct iwl_priv *priv, u32 addr, return -EINVAL; for (i = 0; i < size; i += 4) iwl_write_prph(trans, addr+i, - *(u32 *)buf+i); + *(u32 *)(buf+i)); } } else if (iwlagn_hw_valid_rtc_data_addr(addr) || (IWLAGN_RTC_INST_LOWER_BOUND <= addr && |