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

Commit 30686bf7 authored by Johannes Berg's avatar Johannes Berg
Browse files

mac80211: convert HW flags to unsigned long bitmap



As we're running out of hardware capability flags pretty quickly,
convert them to use the regular test_bit() style unsigned long
bitmaps.

This introduces a number of helper functions/macros to set and to
test the bits, along with new debugfs code.

The occurrences of an explicit __clear_bit() are intentional, the
drivers were never supposed to change their supported bits on the
fly. We should investigate changing this to be a per-frame flag.

Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 206c59d1
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -1373,9 +1373,9 @@ static void adm8211_configure_filter(struct ieee80211_hw *dev,
	ADM8211_CSR_READ(NAR);

	if (priv->nar & ADM8211_NAR_PR)
		dev->flags |= IEEE80211_HW_RX_INCLUDES_FCS;
		ieee80211_hw_set(dev, RX_INCLUDES_FCS);
	else
		dev->flags &= ~IEEE80211_HW_RX_INCLUDES_FCS;
		__clear_bit(IEEE80211_HW_RX_INCLUDES_FCS, dev->flags);

	if (*total_flags & FIF_BCN_PRBRESP_PROMISC)
		adm8211_set_bssid(dev, bcast);
@@ -1861,8 +1861,8 @@ static int adm8211_probe(struct pci_dev *pdev,
	SET_IEEE80211_PERM_ADDR(dev, perm_addr);

	dev->extra_tx_headroom = sizeof(struct adm8211_tx_hdr);
	/* dev->flags = IEEE80211_HW_RX_INCLUDES_FCS in promisc mode */
	dev->flags = IEEE80211_HW_SIGNAL_UNSPEC;
	/* dev->flags = RX_INCLUDES_FCS in promisc mode */
	ieee80211_hw_set(dev, SIGNAL_UNSPEC);
	dev->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION);

	dev->max_signal = 100;    /* FIXME: find better value */
+2 −2
Original line number Diff line number Diff line
@@ -2360,8 +2360,8 @@ static int at76_init_new_device(struct at76_priv *priv,
	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 |
			  IEEE80211_HW_SIGNAL_UNSPEC;
	ieee80211_hw_set(priv->hw, RX_INCLUDES_FCS);
	ieee80211_hw_set(priv->hw, SIGNAL_UNSPEC);
	priv->hw->max_signal = 100;

	SET_IEEE80211_DEV(priv->hw, &interface->dev);
+3 −3
Original line number Diff line number Diff line
@@ -1682,9 +1682,9 @@ static int ar5523_probe(struct usb_interface *intf,
			(id->driver_info & AR5523_FLAG_ABG) ? '5' : '2');

	ar->vif = NULL;
	hw->flags = IEEE80211_HW_RX_INCLUDES_FCS |
		    IEEE80211_HW_SIGNAL_DBM |
		    IEEE80211_HW_HAS_RATE_CONTROL;
	ieee80211_hw_set(hw, HAS_RATE_CONTROL);
	ieee80211_hw_set(hw, RX_INCLUDES_FCS);
	ieee80211_hw_set(hw, SIGNAL_DBM);
	hw->extra_tx_headroom = sizeof(struct ar5523_tx_desc) +
				sizeof(struct ar5523_chunk);
	hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION);
+17 −17
Original line number Diff line number Diff line
@@ -6882,21 +6882,21 @@ int ath10k_mac_register(struct ath10k *ar)
			BIT(NL80211_IFTYPE_P2P_CLIENT) |
			BIT(NL80211_IFTYPE_P2P_GO);

	ar->hw->flags = IEEE80211_HW_SIGNAL_DBM |
			IEEE80211_HW_SUPPORTS_PS |
			IEEE80211_HW_SUPPORTS_DYNAMIC_PS |
			IEEE80211_HW_MFP_CAPABLE |
			IEEE80211_HW_REPORTS_TX_ACK_STATUS |
			IEEE80211_HW_HAS_RATE_CONTROL |
			IEEE80211_HW_AP_LINK_PS |
			IEEE80211_HW_SPECTRUM_MGMT |
			IEEE80211_HW_SW_CRYPTO_CONTROL |
			IEEE80211_HW_SUPPORT_FAST_XMIT |
			IEEE80211_HW_CONNECTION_MONITOR |
			IEEE80211_HW_SUPPORTS_PER_STA_GTK |
			IEEE80211_HW_WANT_MONITOR_VIF |
			IEEE80211_HW_CHANCTX_STA_CSA |
			IEEE80211_HW_QUEUE_CONTROL;
	ieee80211_hw_set(ar->hw, SIGNAL_DBM);
	ieee80211_hw_set(ar->hw, SUPPORTS_PS);
	ieee80211_hw_set(ar->hw, SUPPORTS_DYNAMIC_PS);
	ieee80211_hw_set(ar->hw, MFP_CAPABLE);
	ieee80211_hw_set(ar->hw, REPORTS_TX_ACK_STATUS);
	ieee80211_hw_set(ar->hw, HAS_RATE_CONTROL);
	ieee80211_hw_set(ar->hw, AP_LINK_PS);
	ieee80211_hw_set(ar->hw, SPECTRUM_MGMT);
	ieee80211_hw_set(ar->hw, SW_CRYPTO_CONTROL);
	ieee80211_hw_set(ar->hw, SUPPORT_FAST_XMIT);
	ieee80211_hw_set(ar->hw, CONNECTION_MONITOR);
	ieee80211_hw_set(ar->hw, SUPPORTS_PER_STA_GTK);
	ieee80211_hw_set(ar->hw, WANT_MONITOR_VIF);
	ieee80211_hw_set(ar->hw, CHANCTX_STA_CSA);
	ieee80211_hw_set(ar->hw, QUEUE_CONTROL);

	ar->hw->wiphy->features |= NL80211_FEATURE_STATIC_SMPS;
	ar->hw->wiphy->flags |= WIPHY_FLAG_IBSS_RSN;
@@ -6905,8 +6905,8 @@ int ath10k_mac_register(struct ath10k *ar)
		ar->hw->wiphy->features |= NL80211_FEATURE_DYNAMIC_SMPS;

	if (ar->ht_cap_info & WMI_HT_CAP_ENABLED) {
		ar->hw->flags |= IEEE80211_HW_AMPDU_AGGREGATION;
		ar->hw->flags |= IEEE80211_HW_TX_AMPDU_SETUP_IN_HW;
		ieee80211_hw_set(ar->hw, AMPDU_AGGREGATION);
		ieee80211_hw_set(ar->hw, TX_AMPDU_SETUP_IN_HW);
	}

	ar->hw->wiphy->max_scan_ssids = WLAN_SCAN_PARAMS_MAX_SSID;
+6 −6
Original line number Diff line number Diff line
@@ -2537,12 +2537,12 @@ ath5k_init_ah(struct ath5k_hw *ah, const struct ath_bus_ops *bus_ops)

	/* Initialize driver private data */
	SET_IEEE80211_DEV(hw, ah->dev);
	hw->flags = IEEE80211_HW_RX_INCLUDES_FCS |
			IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING |
			IEEE80211_HW_SIGNAL_DBM |
			IEEE80211_HW_MFP_CAPABLE |
			IEEE80211_HW_REPORTS_TX_ACK_STATUS |
			IEEE80211_HW_SUPPORTS_RC_TABLE;
	ieee80211_hw_set(hw, SUPPORTS_RC_TABLE);
	ieee80211_hw_set(hw, REPORTS_TX_ACK_STATUS);
	ieee80211_hw_set(hw, MFP_CAPABLE);
	ieee80211_hw_set(hw, SIGNAL_DBM);
	ieee80211_hw_set(hw, RX_INCLUDES_FCS);
	ieee80211_hw_set(hw, HOST_BROADCAST_PS_BUFFERING);

	hw->wiphy->interface_modes =
		BIT(NL80211_IFTYPE_AP) |
Loading