staging: rtl8192e: Use standard api to calculate channel to frequency
authorPhilipp Hortmann <philipp.g.hortmann@gmail.com>
Thu, 8 Jun 2023 06:52:34 +0000 (08:52 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 15 Jun 2023 10:47:06 +0000 (12:47 +0200)
Use ieee80211_channel_to_freq_khz() to calculate channel to frequency to
omit proprietary code.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Message-ID: <c3a94a403d04ba810cffff8afa734a94a218a4e9.1686166624.git.philipp.g.hortmann@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
drivers/staging/rtl8192e/rtllib.h
drivers/staging/rtl8192e/rtllib_softmac_wx.c

index 8b656980ee25fc6d43a743c153d795898a9296ff..3346c4d72c3e74634e27820e9ac6cc31388fd2a4 100644 (file)
@@ -342,9 +342,11 @@ static int _rtl92e_wx_get_range(struct net_device *dev,
 
        for (i = 0, val = 0; i < 14; i++) {
                if ((priv->rtllib->active_channel_map)[i + 1]) {
+                       s32 freq_khz;
+
                        range->freq[val].i = i + 1;
-                       range->freq[val].m = rtllib_wlan_frequencies[i] *
-                                            100000;
+                       freq_khz = ieee80211_channel_to_freq_khz(i + 1, NL80211_BAND_2GHZ);
+                       range->freq[val].m = freq_khz * 100;
                        range->freq[val].e = 1;
                        val++;
                }
index cdd7fdc5befe6b89acedfb442e38dc34f8b7321e..87e9169214f6482e6dc139ee14bb428e323094cb 100644 (file)
@@ -2049,8 +2049,6 @@ void TsStartAddBaProcess(struct rtllib_device *ieee,
 void RemovePeerTS(struct rtllib_device *ieee, u8 *Addr);
 void RemoveAllTS(struct rtllib_device *ieee);
 
-extern const long rtllib_wlan_frequencies[];
-
 static inline const char *escape_essid(const char *essid, u8 essid_len)
 {
        static char escaped[IW_ESSID_MAX_SIZE * 2 + 1];
index 6fd2e94d5f8af2bf8b2bb59472f0747783ebd0ef..d6d90e6ba2d3931f1896e1ca4d20d644f254a128 100644 (file)
 
 #include "rtllib.h"
 #include "dot11d.h"
-/* FIXME: add A freqs */
-
-const long rtllib_wlan_frequencies[] = {
-       2412, 2417, 2422, 2427,
-       2432, 2437, 2442, 2447,
-       2452, 2457, 2462, 2467,
-       2472, 2484
-};
-EXPORT_SYMBOL(rtllib_wlan_frequencies);
 
 int rtllib_wx_set_freq(struct rtllib_device *ieee, struct iw_request_info *a,
                             union iwreq_data *wrqu, char *b)
@@ -83,8 +74,8 @@ int rtllib_wx_get_freq(struct rtllib_device *ieee,
 
        if (ieee->current_network.channel == 0)
                return -1;
-       fwrq->m = rtllib_wlan_frequencies[ieee->current_network.channel - 1] *
-                 100000;
+       fwrq->m = ieee80211_channel_to_freq_khz(ieee->current_network.channel,
+                                               NL80211_BAND_2GHZ) * 100;
        fwrq->e = 1;
        return 0;
 }