P2P: Enhance determination of secondary offset to support 6 GHz channels
Current definition of wpas_p2p_get_ht40_mode() determines secondary offset in the 5 GHz band. Enhance the functionality of this function to determine offset to support 6 GHz channels also. Signed-off-by: Sreeramya Soratkal <ssramya@codeaurora.org>
This commit is contained in:
parent
575a8e6ca3
commit
f725254cc1
5 changed files with 47 additions and 10 deletions
|
@ -2293,6 +2293,30 @@ bool is_6ghz_psc_frequency(int freq)
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* get_6ghz_sec_channel - Get the relative position of the secondary channel
|
||||
* to the primary channel in 6 GHz
|
||||
* @channel: Primary channel to be checked for (in global op class 131)
|
||||
* Returns: 1 = secondary channel above, -1 = secondary channel below
|
||||
*/
|
||||
|
||||
int get_6ghz_sec_channel(int channel)
|
||||
{
|
||||
/*
|
||||
* In the 6 GHz band, primary channels are numbered as 1, 5, 9, 13.., so
|
||||
* the 40 MHz channels are formed with the channel pairs as (1,5),
|
||||
* (9,13), (17,21)..
|
||||
* The secondary channel for a given primary channel is below the
|
||||
* primary channel for the channels 5, 13, 21.. and it is above the
|
||||
* primary channel for the channels 1, 9, 17..
|
||||
*/
|
||||
|
||||
if (((channel - 1) / 4) % 2)
|
||||
return -1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
int ieee802_11_parse_candidate_list(const char *pos, u8 *nei_rep,
|
||||
size_t nei_rep_len)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue