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>
This commit is contained in:
Prameela Rani Garnepudi 2017-08-16 18:43:10 +05:30 committed by Kalle Valo
parent 03c34c0d73
commit 75ca0049aa
1 changed files with 22 additions and 4 deletions

View File

@ -405,14 +405,32 @@ static void rsi_mac80211_remove_interface(struct ieee80211_hw *hw,
{ {
struct rsi_hw *adapter = hw->priv; struct rsi_hw *adapter = hw->priv;
struct rsi_common *common = adapter->priv; struct rsi_common *common = adapter->priv;
enum opmode opmode;
rsi_dbg(INFO_ZONE, "Remove Interface Called\n");
mutex_lock(&common->mutex); mutex_lock(&common->mutex);
if (vif->type == NL80211_IFTYPE_STATION) {
adapter->sc_nvifs--; if (adapter->sc_nvifs <= 0) {
rsi_set_vap_capabilities(common, STA_OPMODE, vif->addr, mutex_unlock(&common->mutex);
0, VAP_DELETE); 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))) if (!memcmp(adapter->vifs[0], vif, sizeof(struct ieee80211_vif)))
adapter->vifs[0] = NULL; adapter->vifs[0] = NULL;
mutex_unlock(&common->mutex); mutex_unlock(&common->mutex);