diff options
author | Prameela Rani Garnepudi <prameela.j04cs@gmail.com> | 2017-08-16 18:43:10 +0530 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2017-08-17 10:06:55 +0300 |
commit | 75ca0049aad68136c8f673013792063dde530810 (patch) | |
tree | 5fa7e3872b3477c679d0c49b0651210441a54687 /drivers | |
parent | 03c34c0d73ae872e6e962e02e3c4e98ae364379b (diff) |
rsi: remove interface changes for AP mode
remove_interface callback of mac80211 is handled for AP mode.
Same is notified to firmware through vap_capabilities frame
with VAP status VAP_DELETE.
Signed-off-by: Prameela Rani Garnepudi <prameela.j04cs@gmail.com>
Signed-off-by: Amitkumar Karwar <amit.karwar@redpinesignals.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/rsi/rsi_91x_mac80211.c | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/drivers/net/wireless/rsi/rsi_91x_mac80211.c b/drivers/net/wireless/rsi/rsi_91x_mac80211.c index edcba567bfe8..99446bbc0516 100644 --- a/drivers/net/wireless/rsi/rsi_91x_mac80211.c +++ b/drivers/net/wireless/rsi/rsi_91x_mac80211.c @@ -405,13 +405,31 @@ static void rsi_mac80211_remove_interface(struct ieee80211_hw *hw, { struct rsi_hw *adapter = hw->priv; struct rsi_common *common = adapter->priv; + enum opmode opmode; + + rsi_dbg(INFO_ZONE, "Remove Interface Called\n"); mutex_lock(&common->mutex); - if (vif->type == NL80211_IFTYPE_STATION) { - adapter->sc_nvifs--; - rsi_set_vap_capabilities(common, STA_OPMODE, vif->addr, - 0, VAP_DELETE); + + if (adapter->sc_nvifs <= 0) { + mutex_unlock(&common->mutex); + return; + } + + switch (vif->type) { + case NL80211_IFTYPE_STATION: + opmode = STA_OPMODE; + break; + case NL80211_IFTYPE_AP: + opmode = AP_OPMODE; + break; + default: + mutex_unlock(&common->mutex); + return; } + rsi_set_vap_capabilities(common, opmode, vif->addr, + 0, VAP_DELETE); + adapter->sc_nvifs--; if (!memcmp(adapter->vifs[0], vif, sizeof(struct ieee80211_vif))) adapter->vifs[0] = NULL; |