Commit be69c24a authored by Avraham Stern's avatar Avraham Stern Committed by Johannes Berg

cfg80211: Allow GO concurrent relaxation after BSS disconnection

If a P2P GO was allowed on a channel because of the GO concurrent
relaxation, i.e., another station interface was associated to an AP on
the same channel or the same UNII band, and the station interface
disconnected from the AP, allow the following use cases unless the
channel is marked as indoor only and the device is not operating in an
indoor environment:

1. Allow the P2P GO to stay on its current channel. The rationale behind
   this is that if the channel or UNII band were allowed by the AP they
   could still be used to continue the P2P GO operation, and avoid connection
   breakage.
2. Allow another P2P GO to start on the same channel or another channel
   that is in the same UNII band as the previous instantiated P2P GO.
Signed-off-by: default avatarAvraham Stern <avraham.stern@intel.com>
Signed-off-by: default avatarArik Nemtsov <arikx.nemtsov@intel.com>
Signed-off-by: default avatarIlan Peer <ilan.peer@intel.com>
Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent e3a55b53
...@@ -709,7 +709,7 @@ EXPORT_SYMBOL(cfg80211_chandef_usable); ...@@ -709,7 +709,7 @@ EXPORT_SYMBOL(cfg80211_chandef_usable);
static bool cfg80211_go_permissive_chan(struct cfg80211_registered_device *rdev, static bool cfg80211_go_permissive_chan(struct cfg80211_registered_device *rdev,
struct ieee80211_channel *chan) struct ieee80211_channel *chan)
{ {
struct wireless_dev *wdev_iter; struct wireless_dev *wdev;
struct wiphy *wiphy = wiphy_idx_to_wiphy(rdev->wiphy_idx); struct wiphy *wiphy = wiphy_idx_to_wiphy(rdev->wiphy_idx);
ASSERT_RTNL(); ASSERT_RTNL();
...@@ -732,18 +732,27 @@ static bool cfg80211_go_permissive_chan(struct cfg80211_registered_device *rdev, ...@@ -732,18 +732,27 @@ static bool cfg80211_go_permissive_chan(struct cfg80211_registered_device *rdev,
* and thus fail the GO instantiation, consider only the interfaces of * and thus fail the GO instantiation, consider only the interfaces of
* the current registered device. * the current registered device.
*/ */
list_for_each_entry(wdev_iter, &rdev->wdev_list, list) { list_for_each_entry(wdev, &rdev->wdev_list, list) {
struct ieee80211_channel *other_chan = NULL; struct ieee80211_channel *other_chan = NULL;
int r1, r2; int r1, r2;
if (wdev_iter->iftype != NL80211_IFTYPE_STATION || wdev_lock(wdev);
!netif_running(wdev_iter->netdev)) if (wdev->iftype == NL80211_IFTYPE_STATION &&
continue; wdev->current_bss)
other_chan = wdev->current_bss->pub.channel;
wdev_lock(wdev_iter);
if (wdev_iter->current_bss) /*
other_chan = wdev_iter->current_bss->pub.channel; * If a GO already operates on the same GO_CONCURRENT channel,
wdev_unlock(wdev_iter); * this one (maybe the same one) can beacon as well. We allow
* the operation even if the station we relied on with
* GO_CONCURRENT is disconnected now. But then we must make sure
* we're not outdoor on an indoor-only channel.
*/
if (wdev->iftype == NL80211_IFTYPE_P2P_GO &&
wdev->beacon_interval &&
!(chan->flags & IEEE80211_CHAN_INDOOR_ONLY))
other_chan = wdev->chandef.chan;
wdev_unlock(wdev);
if (!other_chan) if (!other_chan)
continue; continue;
......
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