summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/marvell/mwifiex/sta_cmdresp.c
diff options
context:
space:
mode:
authorShengzhen Li <szli@marvell.com>2016-06-06 20:02:38 +0300
committerKalle Valo <kvalo@codeaurora.org>2016-07-05 16:29:24 +0300
commit3ee712857958c27f697b33fa520fdc51e7ffea88 (patch)
tree370ef4b0fe203caa471dd9fd65ec7adbcecf169c /drivers/net/wireless/marvell/mwifiex/sta_cmdresp.c
parent7d54bacadce17fc8042f8b32b0c930a187388ae9 (diff)
downloadlinux-3ee712857958c27f697b33fa520fdc51e7ffea88.tar.xz
mwifiex: add get_antenna support for cfg80211
Since commit de3bb771f471 ("cfg80211: add more warnings for inconsistent ops") the wireless core warns if a driver implements a cfg80211 callback but doesn't implements the inverse operation. The mwifiex driver defines a .set_antenna handler but not a .get_antenna so this not only makes the core to print a warning when creating a new wiphy but also the antenna isn't reported to user-space apps such as iw. This patch queries the antenna to the firmware so is properly reported to user-space. With this patch, the wireless core does not warn anymore and: $ iw phy phy0 info | grep Antennas Available Antennas: TX 0x3 RX 0x3 Configured Antennas: TX 0x3 RX 0x3 Signed-off-by: Shengzhen Li <szli@marvell.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> [javier: expand the commit message] Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Tested-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/marvell/mwifiex/sta_cmdresp.c')
-rw-r--r--drivers/net/wireless/marvell/mwifiex/sta_cmdresp.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/net/wireless/marvell/mwifiex/sta_cmdresp.c b/drivers/net/wireless/marvell/mwifiex/sta_cmdresp.c
index bcfd4b743145..9050d06998e6 100644
--- a/drivers/net/wireless/marvell/mwifiex/sta_cmdresp.c
+++ b/drivers/net/wireless/marvell/mwifiex/sta_cmdresp.c
@@ -469,7 +469,9 @@ static int mwifiex_ret_rf_antenna(struct mwifiex_private *priv,
struct host_cmd_ds_rf_ant_siso *ant_siso = &resp->params.ant_siso;
struct mwifiex_adapter *adapter = priv->adapter;
- if (adapter->hw_dev_mcs_support == HT_STREAM_2X2)
+ if (adapter->hw_dev_mcs_support == HT_STREAM_2X2) {
+ priv->tx_ant = le16_to_cpu(ant_mimo->tx_ant_mode);
+ priv->rx_ant = le16_to_cpu(ant_mimo->rx_ant_mode);
mwifiex_dbg(adapter, INFO,
"RF_ANT_RESP: Tx action = 0x%x, Tx Mode = 0x%04x\t"
"Rx action = 0x%x, Rx Mode = 0x%04x\n",
@@ -477,12 +479,14 @@ static int mwifiex_ret_rf_antenna(struct mwifiex_private *priv,
le16_to_cpu(ant_mimo->tx_ant_mode),
le16_to_cpu(ant_mimo->action_rx),
le16_to_cpu(ant_mimo->rx_ant_mode));
- else
+ } else {
+ priv->tx_ant = le16_to_cpu(ant_siso->ant_mode);
+ priv->rx_ant = le16_to_cpu(ant_siso->ant_mode);
mwifiex_dbg(adapter, INFO,
"RF_ANT_RESP: action = 0x%x, Mode = 0x%04x\n",
le16_to_cpu(ant_siso->action),
le16_to_cpu(ant_siso->ant_mode));
-
+ }
return 0;
}