summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/marvell/mwifiex/cfg80211.c
diff options
context:
space:
mode:
authorShengzhen Li <szli@marvell.com>2016-06-06 13:02:38 -0400
committerKalle Valo <kvalo@codeaurora.org>2016-07-05 16:29:24 +0300
commit3ee712857958c27f697b33fa520fdc51e7ffea88 (patch)
tree370ef4b0fe203caa471dd9fd65ec7adbcecf169c /drivers/net/wireless/marvell/mwifiex/cfg80211.c
parent7d54bacadce17fc8042f8b32b0c930a187388ae9 (diff)
downloadlwn-3ee712857958c27f697b33fa520fdc51e7ffea88.tar.gz
lwn-3ee712857958c27f697b33fa520fdc51e7ffea88.zip
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/cfg80211.c')
-rw-r--r--drivers/net/wireless/marvell/mwifiex/cfg80211.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
index 3044b42395b7..df5ebdf2273e 100644
--- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
@@ -1830,6 +1830,21 @@ mwifiex_cfg80211_set_antenna(struct wiphy *wiphy, u32 tx_ant, u32 rx_ant)
HostCmd_ACT_GEN_SET, 0, &ant_cfg, true);
}
+static int
+mwifiex_cfg80211_get_antenna(struct wiphy *wiphy, u32 *tx_ant, u32 *rx_ant)
+{
+ struct mwifiex_adapter *adapter = mwifiex_cfg80211_get_adapter(wiphy);
+ struct mwifiex_private *priv = mwifiex_get_priv(adapter,
+ MWIFIEX_BSS_ROLE_ANY);
+ mwifiex_send_cmd(priv, HostCmd_CMD_RF_ANTENNA,
+ HostCmd_ACT_GEN_GET, 0, NULL, true);
+
+ *tx_ant = priv->tx_ant;
+ *rx_ant = priv->rx_ant;
+
+ return 0;
+}
+
/* cfg80211 operation handler for stop ap.
* Function stops BSS running at uAP interface.
*/
@@ -3983,6 +3998,7 @@ static struct cfg80211_ops mwifiex_cfg80211_ops = {
.change_beacon = mwifiex_cfg80211_change_beacon,
.set_cqm_rssi_config = mwifiex_cfg80211_set_cqm_rssi_config,
.set_antenna = mwifiex_cfg80211_set_antenna,
+ .get_antenna = mwifiex_cfg80211_get_antenna,
.del_station = mwifiex_cfg80211_del_station,
.sched_scan_start = mwifiex_cfg80211_sched_scan_start,
.sched_scan_stop = mwifiex_cfg80211_sched_scan_stop,