Skip to content

Commit

Permalink
Restored the way to access MAC register for 8864.
Browse files Browse the repository at this point in the history
In this way, it will get correct value.

Signed-off-by: David Lin <dlin@marvell.com>
  • Loading branch information
yuhhaurlin committed Dec 22, 2016
1 parent bb70b40 commit ccbfc8e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
1 change: 1 addition & 0 deletions dev.h
Expand Up @@ -30,6 +30,7 @@
#define MWL_DRV_VERSION "10.3.2.0-20161220"

#define MAC_REG_ADDR(offset) (offset)
#define MAC_REG_ADDR_PCI(offset) ((priv->iobase1 + 0xA000) + offset)

#define MCU_CCA_CNT MAC_REG_ADDR(0x06A0)
#define MCU_TXPE_CNT MAC_REG_ADDR(0x06A4)
Expand Down
29 changes: 17 additions & 12 deletions fwcmd.c
Expand Up @@ -888,18 +888,23 @@ static int mwl_fwcmd_encryption_set_cmd_info(struct hostcmd_cmd_set_key *cmd,

static u32 pci_read_mac_reg(struct mwl_priv *priv, u32 offset)
{
u32 *addr_val = kmalloc(64 * sizeof(u32), GFP_ATOMIC);
u32 val;

if(addr_val)
{
mwl_fwcmd_get_addr_value(priv->hw, 0x8000a000 + offset, 4,
addr_val, 0);
val = addr_val[0];
kfree(addr_val);
return val;
}
return 0;
if (priv->chip_type == MWL8964) {
u32 *addr_val = kmalloc(64 * sizeof(u32), GFP_ATOMIC);
u32 val;

if(addr_val)
{
mwl_fwcmd_get_addr_value(priv->hw,
0x8000a000 + offset, 4,
addr_val, 0);
val = addr_val[0];
kfree(addr_val);
return val;
}
return 0;
} else
return le32_to_cpu(*(volatile unsigned long *)
(MAC_REG_ADDR_PCI(offset)));
}

void mwl_fwcmd_reset(struct ieee80211_hw *hw)
Expand Down

0 comments on commit ccbfc8e

Please sign in to comment.