diff options
author | Lior David <liord@codeaurora.org> | 2018-02-26 21:12:15 +0300 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2018-02-27 19:50:33 +0300 |
commit | 3ada9314b4ea06e656ebb8f5806ff97596a3d548 (patch) | |
tree | ce6e920ec37e7be83246f59114cf8a1924cf9918 /drivers/net/wireless/ath/wil6210/netdev.c | |
parent | 4aebd3bdbd8a26ebcd2398289e2379472d17825f (diff) | |
download | linux-3ada9314b4ea06e656ebb8f5806ff97596a3d548.tar.xz |
wil6210: multiple VIFs support for start/stop AP
Add support for multiple VIFs in the cfg80211 operations start_ap,
stop_ap and change_beacon. This change allows starting multiple APs
using virtual interfaces.
The data path and most other operations are still working only
on the main interface.
Signed-off-by: Lior David <liord@codeaurora.org>
Signed-off-by: Maya Erez <merez@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/ath/wil6210/netdev.c')
-rw-r--r-- | drivers/net/wireless/ath/wil6210/netdev.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/drivers/net/wireless/ath/wil6210/netdev.c b/drivers/net/wireless/ath/wil6210/netdev.c index e23a80c235cc..87956c0f7c79 100644 --- a/drivers/net/wireless/ath/wil6210/netdev.c +++ b/drivers/net/wireless/ath/wil6210/netdev.c @@ -20,8 +20,8 @@ #include "wil6210.h" #include "txrx.h" -bool wil_has_other_up_ifaces(struct wil6210_priv *wil, - struct net_device *ndev) +bool wil_has_other_active_ifaces(struct wil6210_priv *wil, + struct net_device *ndev, bool up, bool ok) { int i; struct wil6210_vif *vif; @@ -31,17 +31,19 @@ bool wil_has_other_up_ifaces(struct wil6210_priv *wil, vif = wil->vifs[i]; if (vif) { ndev_i = vif_to_ndev(vif); - if (ndev_i != ndev && ndev_i->flags & IFF_UP) - return true; + if (ndev_i != ndev) + if ((up && (ndev_i->flags & IFF_UP)) || + (ok && netif_carrier_ok(ndev_i))) + return true; } } return false; } -bool wil_has_up_ifaces(struct wil6210_priv *wil) +bool wil_has_active_ifaces(struct wil6210_priv *wil, bool up, bool ok) { - return wil_has_other_up_ifaces(wil, NULL); + return wil_has_other_active_ifaces(wil, NULL, up, ok); } static int wil_open(struct net_device *ndev) @@ -57,7 +59,7 @@ static int wil_open(struct net_device *ndev) return -EINVAL; } - if (!wil_has_other_up_ifaces(wil, ndev)) { + if (!wil_has_other_active_ifaces(wil, ndev, true, false)) { wil_dbg_misc(wil, "open, first iface\n"); rc = wil_pm_runtime_get(wil); if (rc < 0) @@ -78,7 +80,7 @@ static int wil_stop(struct net_device *ndev) wil_dbg_misc(wil, "stop\n"); - if (!wil_has_other_up_ifaces(wil, ndev)) { + if (!wil_has_other_active_ifaces(wil, ndev, true, false)) { wil_dbg_misc(wil, "stop, last iface\n"); rc = wil_down(wil); if (!rc) @@ -359,7 +361,7 @@ int wil_vif_add(struct wil6210_priv *wil, struct wil6210_vif *vif) { struct net_device *ndev = vif_to_ndev(vif); struct wireless_dev *wdev = vif_to_wdev(vif); - bool any_active = wil_has_up_ifaces(wil); + bool any_active = wil_has_active_ifaces(wil, true, false); int rc; ASSERT_RTNL(); @@ -428,7 +430,7 @@ void wil_vif_remove(struct wil6210_priv *wil, u8 mid) { struct wil6210_vif *vif; struct net_device *ndev; - bool any_active = wil_has_up_ifaces(wil); + bool any_active = wil_has_active_ifaces(wil, true, false); ASSERT_RTNL(); if (mid >= wil->max_vifs) { |