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

Commit 5be83de5 authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville
Browse files

cfg80211: convert bools into flags



We've accumulated a number of options for wiphys
which make more sense as flags as we keep adding
more. Convert the existing ones.

Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 9bd568a5
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -450,7 +450,7 @@ ath_regd_init_wiphy(struct ath_regulatory *reg,
	const struct ieee80211_regdomain *regd;

	wiphy->reg_notifier = reg_notifier;
	wiphy->strict_regulatory = true;
	wiphy->flags |= WIPHY_FLAG_STRICT_REGULATORY;

	if (ath_is_world_regd(reg)) {
		/*
@@ -458,8 +458,7 @@ ath_regd_init_wiphy(struct ath_regulatory *reg,
		 * saved on the wiphy orig_* parameters
		 */
		regd = ath_world_regdomain(reg);
		wiphy->custom_regulatory = true;
		wiphy->strict_regulatory = false;
		wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY;
	} else {
		/*
		 * This gets applied in the case of the absense of CRDA,
+3 −5
Original line number Diff line number Diff line
@@ -2400,16 +2400,14 @@ static int iwl_setup_mac(struct iwl_priv *priv)
		BIT(NL80211_IFTYPE_STATION) |
		BIT(NL80211_IFTYPE_ADHOC);

	hw->wiphy->custom_regulatory = true;

	/* Firmware does not support this */
	hw->wiphy->disable_beacon_hints = true;
	hw->wiphy->flags |= WIPHY_FLAG_STRICT_REGULATORY |
			    WIPHY_FLAG_DISABLE_BEACON_HINTS;

	/*
	 * For now, disable PS by default because it affects
	 * RX performance significantly.
	 */
	hw->wiphy->ps_default = false;
	hw->wiphy->flags &= ~WIPHY_FLAG_PS_ON_BY_DEFAULT;

	hw->wiphy->max_scan_ssids = PROBE_OPTION_MAX;
	/* we create the 802.11 header and a zero-length SSID element */
+2 −4
Original line number Diff line number Diff line
@@ -3904,10 +3904,8 @@ static int iwl3945_setup_mac(struct iwl_priv *priv)
		BIT(NL80211_IFTYPE_STATION) |
		BIT(NL80211_IFTYPE_ADHOC);

	hw->wiphy->custom_regulatory = true;

	/* Firmware does not support this */
	hw->wiphy->disable_beacon_hints = true;
	hw->wiphy->flags |= WIPHY_FLAG_STRICT_REGULATORY |
			    WIPHY_FLAG_DISABLE_BEACON_HINTS;

	hw->wiphy->max_scan_ssids = PROBE_OPTION_MAX_3945;
	/* we create the 802.11 header and a zero-length SSID element */
+9 −9
Original line number Diff line number Diff line
@@ -1146,46 +1146,46 @@ static int __init init_mac80211_hwsim(void)
			break;
		case HWSIM_REGTEST_WORLD_ROAM:
			if (i == 0) {
				hw->wiphy->custom_regulatory = true;
				hw->wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY;
				wiphy_apply_custom_regulatory(hw->wiphy,
					&hwsim_world_regdom_custom_01);
			}
			break;
		case HWSIM_REGTEST_CUSTOM_WORLD:
			hw->wiphy->custom_regulatory = true;
			hw->wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY;
			wiphy_apply_custom_regulatory(hw->wiphy,
				&hwsim_world_regdom_custom_01);
			break;
		case HWSIM_REGTEST_CUSTOM_WORLD_2:
			if (i == 0) {
				hw->wiphy->custom_regulatory = true;
				hw->wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY;
				wiphy_apply_custom_regulatory(hw->wiphy,
					&hwsim_world_regdom_custom_01);
			} else if (i == 1) {
				hw->wiphy->custom_regulatory = true;
				hw->wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY;
				wiphy_apply_custom_regulatory(hw->wiphy,
					&hwsim_world_regdom_custom_02);
			}
			break;
		case HWSIM_REGTEST_STRICT_ALL:
			hw->wiphy->strict_regulatory = true;
			hw->wiphy->flags |= WIPHY_FLAG_STRICT_REGULATORY;
			break;
		case HWSIM_REGTEST_STRICT_FOLLOW:
		case HWSIM_REGTEST_STRICT_AND_DRIVER_REG:
			if (i == 0)
				hw->wiphy->strict_regulatory = true;
				hw->wiphy->flags |= WIPHY_FLAG_STRICT_REGULATORY;
			break;
		case HWSIM_REGTEST_ALL:
			if (i == 0) {
				hw->wiphy->custom_regulatory = true;
				hw->wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY;
				wiphy_apply_custom_regulatory(hw->wiphy,
					&hwsim_world_regdom_custom_01);
			} else if (i == 1) {
				hw->wiphy->custom_regulatory = true;
				hw->wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY;
				wiphy_apply_custom_regulatory(hw->wiphy,
					&hwsim_world_regdom_custom_02);
			} else if (i == 4)
				hw->wiphy->strict_regulatory = true;
				hw->wiphy->flags |= WIPHY_FLAG_STRICT_REGULATORY;
			break;
		default:
			break;
+1 −1
Original line number Diff line number Diff line
@@ -579,7 +579,7 @@ struct ieee80211_hw *p54_init_common(size_t priv_data_len)
	 * For now, disable PS by default because it affects
	 * link stability significantly.
	 */
	dev->wiphy->ps_default = false;
	dev->wiphy->flags &= ~WIPHY_FLAG_PS_ON_BY_DEFAULT;

	mutex_init(&priv->conf_mutex);
	mutex_init(&priv->eeprom_mutex);
Loading