wifi: mac80211: use cfg80211_chandef_get_width()
authorJohannes Berg <johannes.berg@intel.com>
Tue, 11 Mar 2025 11:25:35 +0000 (12:25 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 12 Mar 2025 08:50:27 +0000 (09:50 +0100)
We can now use this helper here and simplify some code.

Reviewed-by: Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250311122534.0a1d24a1a763.I51a52a67587a7eee65c80b9c5cf132820ebb9dd9@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/mlme.c
net/mac80211/wbrf.c

index 9bff639b522080c1ea191b134c25e671a3b84b65..9c823c6d0c2fab0ee800986184923000dffd31b6 100644 (file)
@@ -788,7 +788,7 @@ static int ieee80211_chandef_num_subchans(const struct cfg80211_chan_def *c)
        if (c->width == NL80211_CHAN_WIDTH_80P80)
                return 4 + 4;
 
-       return nl80211_chan_width_to_mhz(c->width) / 20;
+       return cfg80211_chandef_get_width(c) / 20;
 }
 
 static int ieee80211_chandef_num_widths(const struct cfg80211_chan_def *c)
index 3a8612309137312f88dfe6bad79ac854fe76fcc1..478b34b81919b0ded974fb1fad3ac03529ac748e 100644 (file)
@@ -2,6 +2,7 @@
 /*
  * Wifi Band Exclusion Interface for WLAN
  * Copyright (C) 2023 Advanced Micro Devices
+ * Copyright (C) 2025 Intel Corporation
  *
  */
 
@@ -45,7 +46,7 @@ static void get_ranges_from_chandef(struct cfg80211_chan_def *chandef,
        u64 start_freq2, end_freq2;
        int bandwidth;
 
-       bandwidth = nl80211_chan_width_to_mhz(chandef->width);
+       bandwidth = cfg80211_chandef_get_width(chandef);
 
        get_chan_freq_boundary(chandef->center_freq1, bandwidth, &start_freq1, &end_freq1);