From 1e56d5504052c25f0b664514bb24c5af2d496c18 Mon Sep 17 00:00:00 2001 From: Rakesh Pillai Date: Thu, 22 Jun 2017 00:25:24 +0530 Subject: [PATCH] ath10k: Add change interface handler Change interface handler is not registered with mac80211. The change interface handler is needed to run p2p go/cli on the same interface as p2p control interface. Add change interface handler for ath10k. CRs-Fixed: 2063870 Change-Id: Ia06850a938b9d5e89d970792e3f0a776693a5f25 Signed-off-by: Rakesh Pillai --- drivers/net/wireless/ath/ath10k/mac.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index a33203cb6a77..3ac6228d0ca7 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -5230,6 +5230,26 @@ static void ath10k_remove_interface(struct ieee80211_hw *hw, mutex_unlock(&ar->conf_mutex); } +static int ath10k_change_interface(struct ieee80211_hw *hw, + struct ieee80211_vif *vif, + enum nl80211_iftype new_type, bool p2p) +{ + struct ath10k *ar = hw->priv; + int ret = 0; + + ath10k_dbg(ar, ATH10K_DBG_MAC, + "change_interface new: %d (%d), old: %d (%d)\n", new_type, + p2p, vif->type, vif->p2p); + + if (new_type != vif->type || vif->p2p != p2p) { + ath10k_remove_interface(hw, vif); + vif->type = new_type; + vif->p2p = p2p; + ret = ath10k_add_interface(hw, vif); + } + return ret; +} + /* * FIXME: Has to be verified. */ @@ -7471,6 +7491,7 @@ static const struct ieee80211_ops ath10k_ops = { .stop = ath10k_stop, .config = ath10k_config, .add_interface = ath10k_add_interface, + .change_interface = ath10k_change_interface, .remove_interface = ath10k_remove_interface, .configure_filter = ath10k_configure_filter, .bss_info_changed = ath10k_bss_info_changed,