mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2025-01-03 10:32:33 +01:00
band: add 6GHz support to {channel,freq}_to_{freq,channel}
Adds support for the channels and frequencies defined in the 802.11ax spec.
This commit is contained in:
parent
ff6961fbc4
commit
1343cb928f
35
src/band.c
35
src/band.c
@ -1016,6 +1016,25 @@ uint8_t band_freq_to_channel(uint32_t freq, enum band_freq *out_band)
|
||||
return channel;
|
||||
}
|
||||
|
||||
if (freq > 5950 && freq <= 7115) {
|
||||
if (freq % 5)
|
||||
return 0;
|
||||
|
||||
channel = (freq - 5950) / 5;
|
||||
|
||||
if (out_band)
|
||||
*out_band = BAND_FREQ_6_GHZ;
|
||||
|
||||
return channel;
|
||||
}
|
||||
|
||||
if (freq == 5935) {
|
||||
if (out_band)
|
||||
*out_band = BAND_FREQ_6_GHZ;
|
||||
|
||||
return 2;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1037,6 +1056,22 @@ uint32_t band_channel_to_freq(uint8_t channel, enum band_freq band)
|
||||
return 4000 + 5 * channel;
|
||||
}
|
||||
|
||||
if (band == BAND_FREQ_6_GHZ) {
|
||||
/* operating class 136 */
|
||||
if (channel == 2)
|
||||
return 5935;
|
||||
|
||||
/* Channels increment by 4, starting with 1 */
|
||||
if (channel % 4 != 1)
|
||||
return 0;
|
||||
|
||||
if (channel < 1 || channel > 233)
|
||||
return 0;
|
||||
|
||||
/* operating classes 131, 132, 133, 134, 135 */
|
||||
return 5950 + 5 * channel;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user