Commit 12cfc9c8 authored by Ajay Singh's avatar Ajay Singh Committed by Kalle Valo

wifi: wilc1000: fix multi-vif management when deleting a vif

Adding then removing a second vif currently makes the first vif not working
anymore. This is visible for example when we have a first interface
connected to some access point:
- create a wpa_supplicant.conf with some AP credentials
- wpa_supplicant -Dnl80211 -c /etc/wpa_supplicant.conf -i wlan0
- dhclient wlan0
- iw phy phy0 interface add wlan1 type managed
- iw dev wlan1 del
wlan0 does not manage properly traffic anymore (eg: ping not working)

This is due to vif mode being incorrectly reconfigured with some default
values in del_virtual_intf, affecting by default first vif.

Prevent first vif from being affected on second vif removal by removing vif
mode change command in del_virtual_intf

Fixes: 9bc061e8 ("staging: wilc1000: added support to dynamically add/remove interfaces")
Signed-off-by: default avatarAjay Singh <ajay.kathat@microchip.com>
Co-developed-by: default avatarAlexis Lothoré <alexis.lothore@bootlin.com>
Signed-off-by: default avatarAlexis Lothoré <alexis.lothore@bootlin.com>
Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240115-wilc_1000_fixes-v1-5-54d29463a738@bootlin.com
parent a4f1a05b
...@@ -1609,7 +1609,6 @@ static int del_virtual_intf(struct wiphy *wiphy, struct wireless_dev *wdev) ...@@ -1609,7 +1609,6 @@ static int del_virtual_intf(struct wiphy *wiphy, struct wireless_dev *wdev)
cfg80211_unregister_netdevice(vif->ndev); cfg80211_unregister_netdevice(vif->ndev);
vif->monitor_flag = 0; vif->monitor_flag = 0;
wilc_set_operation_mode(vif, 0, 0, 0);
mutex_lock(&wl->vif_mutex); mutex_lock(&wl->vif_mutex);
list_del_rcu(&vif->list); list_del_rcu(&vif->list);
wl->vif_num--; wl->vif_num--;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment