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

Commit 18a83659 authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville
Browse files

cfg80211: introduce scan IE limit attribute



This patch introduces a new attribute for a wiphy that tells
userspace how long the information elements added to a probe
request frame can be at most. It also updates the at76 to
advertise that it cannot support that, and, for now until I
can fix that, iwlwifi too.

Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 75c2148f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -2250,6 +2250,7 @@ static int at76_init_new_device(struct at76_priv *priv,

	/* mac80211 initialisation */
	priv->hw->wiphy->max_scan_ssids = 1;
	priv->hw->wiphy->max_scan_ie_len = 0;
	priv->hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION);
	priv->hw->wiphy->bands[IEEE80211_BAND_2GHZ] = &at76_supported_band;
	priv->hw->flags = IEEE80211_HW_RX_INCLUDES_FCS |
+1 −0
Original line number Diff line number Diff line
@@ -1306,6 +1306,7 @@ int iwl_setup_mac(struct iwl_priv *priv)

	hw->wiphy->custom_regulatory = true;
	hw->wiphy->max_scan_ssids = 1;
	hw->wiphy->max_scan_ie_len = 0; /* XXX for now */

	/* Default value; 4 EDCA QOS priorities */
	hw->queues = 4;
+4 −0
Original line number Diff line number Diff line
@@ -390,6 +390,8 @@ enum nl80211_commands {
 *
 * @NL80211_ATTR_MAX_NUM_SCAN_SSIDS: number of SSIDs you can scan with
 *	a single scan request, a wiphy attribute.
 * @NL80211_ATTR_MAX_SCAN_IE_LEN: maximum length of information elements
 *	that can be added to a scan request
 *
 * @NL80211_ATTR_SCAN_FREQUENCIES: nested attribute with frequencies (in MHz)
 * @NL80211_ATTR_SCAN_SSIDS: nested attribute with SSIDs, leave out for passive
@@ -507,6 +509,8 @@ enum nl80211_attrs {

	NL80211_ATTR_KEY_TYPE,

	NL80211_ATTR_MAX_SCAN_IE_LEN,

	/* add attributes here, update the policy in nl80211.c */

	__NL80211_ATTR_AFTER_LAST,
+1 −0
Original line number Diff line number Diff line
@@ -222,6 +222,7 @@ struct wiphy {

	int bss_priv_size;
	u8 max_scan_ssids;
	u16 max_scan_ie_len;

	/* If multiple wiphys are registered and you're handed e.g.
	 * a regular netdev with assigned ieee80211_ptr, you won't
+12 −1
Original line number Diff line number Diff line
@@ -728,7 +728,18 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len,
		return NULL;

	wiphy->privid = mac80211_wiphy_privid;

	if (!ops->hw_scan) {
		/* For hw_scan, driver needs to set these up. */
		wiphy->max_scan_ssids = 4;

		/* we support a maximum of 32 rates in cfg80211 */
		wiphy->max_scan_ie_len = IEEE80211_MAX_DATA_LEN
					 - 2 - 32 /* SSID */
					 - 4 - 32 /* (ext) supp rates */;

	}

	/* Yes, putting cfg80211_bss into ieee80211_bss is a hack */
	wiphy->bss_priv_size = sizeof(struct ieee80211_bss) -
			       sizeof(struct cfg80211_bss);
Loading