]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - net/wireless/util.c
cfg80211: apply same mandatory rate flags for 5GHz and 6GHz
[linux.git] / net / wireless / util.c
index d0e35b7b9e3502790cb6812f12824ff3826e7610..59ed0808c13e984730cbff41d1d300dbb5081014 100644 (file)
@@ -91,6 +91,11 @@ int ieee80211_channel_to_frequency(int chan, enum nl80211_band band)
                else
                        return 5000 + chan * 5;
                break;
+       case NL80211_BAND_6GHZ:
+               /* see 802.11ax D4.1 27.3.22.2 */
+               if (chan <= 253)
+                       return 5940 + chan * 5;
+               break;
        case NL80211_BAND_60GHZ:
                if (chan < 7)
                        return 56160 + chan * 2160;
@@ -111,8 +116,11 @@ int ieee80211_frequency_to_channel(int freq)
                return (freq - 2407) / 5;
        else if (freq >= 4910 && freq <= 4980)
                return (freq - 4000) / 5;
-       else if (freq <= 45000) /* DMG band lower limit */
+       else if (freq < 5940)
                return (freq - 5000) / 5;
+       else if (freq <= 45000) /* DMG band lower limit */
+               /* see 802.11ax D4.1 27.3.22.2 */
+               return (freq - 5940) / 5;
        else if (freq >= 58320 && freq <= 70200)
                return (freq - 56160) / 2160;
        else
@@ -148,6 +156,7 @@ static void set_mandatory_flags_band(struct ieee80211_supported_band *sband)
 
        switch (sband->band) {
        case NL80211_BAND_5GHZ:
+       case NL80211_BAND_6GHZ:
                want = 3;
                for (i = 0; i < sband->n_bitrates; i++) {
                        if (sband->bitrates[i].bitrate == 60 ||
@@ -1466,6 +1475,9 @@ bool ieee80211_operating_class_to_band(u8 operating_class,
        case 128 ... 130:
                *band = NL80211_BAND_5GHZ;
                return true;
+       case 131 ... 135:
+               *band = NL80211_BAND_6GHZ;
+               return true;
        case 81:
        case 82:
        case 83: