Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6eb18137 authored by Dedy Lansky's avatar Dedy Lansky Committed by Johannes Berg
Browse files

cfg80211: add bss_type and privacy arguments in cfg80211_get_bss()



802.11ad adds new a network type (PBSS) and changes the capability
field interpretation for the DMG (60G) band.
The same 2 bits that were interpreted as "ESS" and "IBSS" before are
re-used as a 2-bit field with 3 valid values (and 1 reserved). Valid
values are: "IBSS", "PBSS" (new) and "AP".

In order to get the BSS struct for the new PBSS networks, change the
cfg80211_get_bss() function to take a new enum ieee80211_bss_type
argument with the valid network types, as "capa_mask" and "capa_val"
no longer work correctly (the search must be band-aware now.)

The remaining bits in "capa_mask" and "capa_val" are used only for
privacy matching so replace those two with a privacy enum as well.

Signed-off-by: default avatarDedy Lansky <dlansky@codeaurora.org>
[rewrite commit log, tiny fixes]
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 76a70e9c
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -1386,7 +1386,8 @@ static void ath10k_peer_assoc_h_crypto(struct ath10k *ar,
	lockdep_assert_held(&ar->conf_mutex);
	lockdep_assert_held(&ar->conf_mutex);


	bss = cfg80211_get_bss(ar->hw->wiphy, ar->hw->conf.chandef.chan,
	bss = cfg80211_get_bss(ar->hw->wiphy, ar->hw->conf.chandef.chan,
			       info->bssid, NULL, 0, 0, 0);
			       info->bssid, NULL, 0, IEEE80211_BSS_TYPE_ANY,
			       IEEE80211_PRIVACY_ANY);
	if (bss) {
	if (bss) {
		const struct cfg80211_bss_ies *ies;
		const struct cfg80211_bss_ies *ies;


+5 −4
Original line number Original line Diff line number Diff line
@@ -686,20 +686,21 @@ ath6kl_add_bss_if_needed(struct ath6kl_vif *vif,
{
{
	struct ath6kl *ar = vif->ar;
	struct ath6kl *ar = vif->ar;
	struct cfg80211_bss *bss;
	struct cfg80211_bss *bss;
	u16 cap_mask, cap_val;
	u16 cap_val;
	enum ieee80211_bss_type bss_type;
	u8 *ie;
	u8 *ie;


	if (nw_type & ADHOC_NETWORK) {
	if (nw_type & ADHOC_NETWORK) {
		cap_mask = WLAN_CAPABILITY_IBSS;
		cap_val = WLAN_CAPABILITY_IBSS;
		cap_val = WLAN_CAPABILITY_IBSS;
		bss_type = IEEE80211_BSS_TYPE_IBSS;
	} else {
	} else {
		cap_mask = WLAN_CAPABILITY_ESS;
		cap_val = WLAN_CAPABILITY_ESS;
		cap_val = WLAN_CAPABILITY_ESS;
		bss_type = IEEE80211_BSS_TYPE_ESS;
	}
	}


	bss = cfg80211_get_bss(ar->wiphy, chan, bssid,
	bss = cfg80211_get_bss(ar->wiphy, chan, bssid,
			       vif->ssid, vif->ssid_len,
			       vif->ssid, vif->ssid_len,
			       cap_mask, cap_val);
			       bss_type, IEEE80211_PRIVACY_ANY);
	if (bss == NULL) {
	if (bss == NULL) {
		/*
		/*
		 * Since cfg80211 may not yet know about the BSS,
		 * Since cfg80211 may not yet know about the BSS,
+1 −1
Original line number Original line Diff line number Diff line
@@ -395,7 +395,7 @@ static int wil_cfg80211_connect(struct wiphy *wiphy,


	bss = cfg80211_get_bss(wiphy, sme->channel, sme->bssid,
	bss = cfg80211_get_bss(wiphy, sme->channel, sme->bssid,
			       sme->ssid, sme->ssid_len,
			       sme->ssid, sme->ssid_len,
			       WLAN_CAPABILITY_ESS, WLAN_CAPABILITY_ESS);
			       IEEE80211_BSS_TYPE_ESS, IEEE80211_PRIVACY_ANY);
	if (!bss) {
	if (!bss) {
		wil_err(wil, "Unable to find BSS\n");
		wil_err(wil, "Unable to find BSS\n");
		return -ENOENT;
		return -ENOENT;
+2 −2
Original line number Original line Diff line number Diff line
@@ -1240,8 +1240,8 @@ static void cw1200_do_join(struct cw1200_common *priv)


	bssid = priv->vif->bss_conf.bssid;
	bssid = priv->vif->bss_conf.bssid;


	bss = cfg80211_get_bss(priv->hw->wiphy, priv->channel,
	bss = cfg80211_get_bss(priv->hw->wiphy, priv->channel, bssid, NULL, 0,
			bssid, NULL, 0, 0, 0);
			       IEEE80211_BSS_TYPE_ANY, IEEE80211_PRIVACY_ANY);


	if (!bss && !conf->ibss_joined) {
	if (!bss && !conf->ibss_joined) {
		wsm_unlock_tx(priv);
		wsm_unlock_tx(priv);
+3 −3
Original line number Original line Diff line number Diff line
@@ -1356,8 +1356,8 @@ static int lbs_cfg_connect(struct wiphy *wiphy, struct net_device *dev,


	/* Find the BSS we want using available scan results */
	/* Find the BSS we want using available scan results */
	bss = cfg80211_get_bss(wiphy, sme->channel, sme->bssid,
	bss = cfg80211_get_bss(wiphy, sme->channel, sme->bssid,
		sme->ssid, sme->ssid_len,
		sme->ssid, sme->ssid_len, IEEE80211_BSS_TYPE_ESS,
		WLAN_CAPABILITY_ESS, WLAN_CAPABILITY_ESS);
		IEEE80211_PRIVACY_ANY);
	if (!bss) {
	if (!bss) {
		wiphy_err(wiphy, "assoc: bss %pM not in scan results\n",
		wiphy_err(wiphy, "assoc: bss %pM not in scan results\n",
			  sme->bssid);
			  sme->bssid);
@@ -2000,7 +2000,7 @@ static int lbs_join_ibss(struct wiphy *wiphy, struct net_device *dev,
	 * bss list is populated already */
	 * bss list is populated already */
	bss = cfg80211_get_bss(wiphy, params->chandef.chan, params->bssid,
	bss = cfg80211_get_bss(wiphy, params->chandef.chan, params->bssid,
		params->ssid, params->ssid_len,
		params->ssid, params->ssid_len,
		WLAN_CAPABILITY_IBSS, WLAN_CAPABILITY_IBSS);
		IEEE80211_BSS_TYPE_IBSS, IEEE80211_PRIVACY_ANY);


	if (bss) {
	if (bss) {
		ret = lbs_ibss_join_existing(priv, params, bss);
		ret = lbs_ibss_join_existing(priv, params, bss);
Loading