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

Commit 881d948c authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville
Browse files

wireless: restrict to 32 legacy rates



Since the standards only define 12 legacy rates, 32 is certainly
a sane upper limit and we don't need to use u64 everywhere. Add
sanity checking that no more than 32 rates are registered and
change the variables to u32 throughout.

Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 369391db
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3398,7 +3398,7 @@ static int b43_op_config(struct ieee80211_hw *hw, u32 changed)
	return err;
}

static void b43_update_basic_rates(struct b43_wldev *dev, u64 brates)
static void b43_update_basic_rates(struct b43_wldev *dev, u32 brates)
{
	struct ieee80211_supported_band *sband =
		dev->wl->hw->wiphy->bands[b43_current_band(dev->wl)];
+1 −1
Original line number Diff line number Diff line
@@ -2650,7 +2650,7 @@ static int b43legacy_op_dev_config(struct ieee80211_hw *hw,
	return err;
}

static void b43legacy_update_basic_rates(struct b43legacy_wldev *dev, u64 brates)
static void b43legacy_update_basic_rates(struct b43legacy_wldev *dev, u32 brates)
{
	struct ieee80211_supported_band *sband =
		dev->wl->hw->wiphy->bands[IEEE80211_BAND_2GHZ];
+1 −1
Original line number Diff line number Diff line
@@ -144,7 +144,7 @@ struct p54_common {
	unsigned int output_power;
	u32 tsf_low32;
	u32 tsf_high32;
	u64 basic_rate_mask;
	u32 basic_rate_mask;
	u16 wakeup_timer;
	u16 aid;
	struct ieee80211_tx_queue_stats tx_stats[8];
+1 −1
Original line number Diff line number Diff line
@@ -396,7 +396,7 @@ struct rt2x00lib_erp {
	int ack_timeout;
	int ack_consume_time;

	u64 basic_rates;
	u32 basic_rates;

	int slot_time;

+2 −2
Original line number Diff line number Diff line
@@ -207,7 +207,7 @@ struct ieee80211_bss_conf {
	u16 beacon_int;
	u16 assoc_capability;
	u64 timestamp;
	u64 basic_rates;
	u32 basic_rates;
	struct ieee80211_bss_ht_conf ht;
};

@@ -761,7 +761,7 @@ enum set_key_cmd {
 *	sizeof(void *), size is determined in hw information.
 */
struct ieee80211_sta {
	u64 supp_rates[IEEE80211_NUM_BANDS];
	u32 supp_rates[IEEE80211_NUM_BANDS];
	u8 addr[ETH_ALEN];
	u16 aid;
	struct ieee80211_sta_ht_cap ht_cap;
Loading