Commit c3015313 authored by Yogesh Ashok Powar's avatar Yogesh Ashok Powar Committed by John W. Linville

mwl8k: Adding support to access BBP registers

Adding AP firmware command to access BBP
regs. This will be used for retrieving
different counters CCA/RX needed for ACS
Signed-off-by: default avatarYogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: default avatarNishant Sarmukadam <nishants@marvell.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 3ebe8e25
...@@ -396,6 +396,7 @@ static const struct ieee80211_rate mwl8k_rates_50[] = { ...@@ -396,6 +396,7 @@ static const struct ieee80211_rate mwl8k_rates_50[] = {
#define MWL8K_CMD_SET_HW_SPEC 0x0004 #define MWL8K_CMD_SET_HW_SPEC 0x0004
#define MWL8K_CMD_MAC_MULTICAST_ADR 0x0010 #define MWL8K_CMD_MAC_MULTICAST_ADR 0x0010
#define MWL8K_CMD_GET_STAT 0x0014 #define MWL8K_CMD_GET_STAT 0x0014
#define MWL8K_CMD_BBP_REG_ACCESS 0x001a
#define MWL8K_CMD_RADIO_CONTROL 0x001c #define MWL8K_CMD_RADIO_CONTROL 0x001c
#define MWL8K_CMD_RF_TX_POWER 0x001e #define MWL8K_CMD_RF_TX_POWER 0x001e
#define MWL8K_CMD_TX_POWER 0x001f #define MWL8K_CMD_TX_POWER 0x001f
...@@ -2986,6 +2987,47 @@ static int mwl8k_cmd_set_pre_scan(struct ieee80211_hw *hw) ...@@ -2986,6 +2987,47 @@ static int mwl8k_cmd_set_pre_scan(struct ieee80211_hw *hw)
return rc; return rc;
} }
/*
* CMD_BBP_REG_ACCESS.
*/
struct mwl8k_cmd_bbp_reg_access {
struct mwl8k_cmd_pkt header;
__le16 action;
__le16 offset;
u8 value;
u8 rsrv[3];
} __packed;
static int
mwl8k_cmd_bbp_reg_access(struct ieee80211_hw *hw,
u16 action,
u16 offset,
u8 *value)
{
struct mwl8k_cmd_bbp_reg_access *cmd;
int rc;
cmd = kzalloc(sizeof(*cmd), GFP_KERNEL);
if (cmd == NULL)
return -ENOMEM;
cmd->header.code = cpu_to_le16(MWL8K_CMD_BBP_REG_ACCESS);
cmd->header.length = cpu_to_le16(sizeof(*cmd));
cmd->action = cpu_to_le16(action);
cmd->offset = cpu_to_le16(offset);
rc = mwl8k_post_cmd(hw, &cmd->header);
if (!rc)
*value = cmd->value;
else
*value = 0;
kfree(cmd);
return rc;
}
/* /*
* CMD_SET_POST_SCAN. * CMD_SET_POST_SCAN.
*/ */
......
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