qcacld-3.0: Fill correct txpower information

As a part of 802.11ax amendment, 6GHz band operation is added.
Since the 6 GHz channel numbers are overlapping with existing 2.4GHz
and 5GHz channel numbers, use frequency to identify unique channel
operation instead of channel number. Channel frequency is unique across
bands.

As a part of above requirement frequency attribute is added to the
struct sSirMacChanInfo, in driver some APIs directly copies this
structure info considering as every member of the structure as uint8_t,
as frequency is uint32_t this breaks above asumption and results into
corrupt info and gives undefined behaviour.

To address above issue, use the structure members individually and
give the information by member-by-member copy.

Change-Id: Ied6ad30d8a0800211f99371969ddd192ff40545c
CRs-Fixed: 2537975
This commit is contained in:
Ashish Kumar Dhanotiya
2019-09-19 18:06:30 +05:30
committato da nshrivas
parent 3548a66560
commit b035570f53
10 ha cambiato i file con 272 aggiunte e 69 eliminazioni

Vedi File

@@ -29,6 +29,9 @@
* @Min: 0 minimum length of tx power
* @Max: default data length of tx power in string format
* @Default: 1, 14, 20
*
* This ini contains the string in the form of first_channel number,
* number of channels and max tx power triplets
*/
#define CFG_MAX_TX_POWER_2_4_DATA "1, 14, 20"
#define CFG_MAX_TX_POWER_2_4 CFG_STRING( \
@@ -44,6 +47,9 @@
* @Min: 0 minimum length of tx power
* @Max: default data length of tx power in string format
* @Default: 36, 126, 20
*
* This ini contains the string in the form of first_channel number,
* number of channels and max tx power triplets
*/
#define CFG_MAX_TX_POWER_5_DATA "36, 126, 20"
#define CFG_MAX_TX_POWER_5 CFG_STRING( \

Vedi File

@@ -54,7 +54,7 @@
#define CFG_STR_DATA_LEN 17
#define CFG_EDCA_DATA_LEN 17
#define CFG_MAX_TX_POWER_2_4_LEN 128
#define CFG_MAX_TX_POWER_5_LEN 128
#define CFG_MAX_TX_POWER_5_LEN 256
#define CFG_POWER_USAGE_MAX_LEN 4
#define CFG_MAX_STR_LEN 256
#define MAX_VENDOR_IES_LEN 1532
@@ -1882,8 +1882,18 @@ struct mlme_power_usage {
/*
* struct wlan_mlme_power - power related config items
* @max_tx_power_24: max power Tx for 2.4 ghz
* @max_tx_power_5: max power Tx for 5 ghz
* @max_tx_power_24: max power Tx for 2.4 ghz, this is based on frequencies
* @max_tx_power_5: max power Tx for 5 ghz, this is based on frequencies
* @max_tx_power_24_chan: max power Tx for 2.4 ghz, this is based on channel
* numbers, this is added to parse the ini values to maintain the backward
* compatibility, these channel numbers are converted to frequencies and copied
* to max_tx_power_24 structure, once this conversion is done this structure
* should not be used.
* @max_tx_power_5_chan: max power Tx for 5 ghz, this is based on channel
* numbers, this is added to parse the ini values to maintain the backward
* compatibility, these channel numbers are converted to frequencies and copied
* to max_tx_power_24 structure, once this conversion is done this structure
* should not be used.
* @power_usage: power usage mode, min, max, mod
* @tx_power_2g: limit tx power in 2.4 ghz
* @tx_power_5g: limit tx power in 5 ghz
@@ -1894,6 +1904,8 @@ struct mlme_power_usage {
struct wlan_mlme_power {
struct mlme_max_tx_power_24 max_tx_power_24;
struct mlme_max_tx_power_5 max_tx_power_5;
struct mlme_max_tx_power_24 max_tx_power_24_chan;
struct mlme_max_tx_power_5 max_tx_power_5_chan;
struct mlme_power_usage power_usage;
uint8_t tx_power_2g;
uint8_t tx_power_5g;

Vedi File

@@ -101,6 +101,17 @@ QDF_STATUS ucfg_mlme_global_init(void);
*/
QDF_STATUS ucfg_mlme_global_deinit(void);
/**
* ucfg_mlme_cfg_chan_to_freq() - convert channel numbers to frequencies
* @pdev: pointer to pdev object
*
* convert the channels numbers received as part of cfg items to
* frequencies.
*
* Return: None
*/
void ucfg_mlme_cfg_chan_to_freq(struct wlan_objmgr_pdev *pdev);
/**
* wlan_mlme_get_power_usage() - Get the power usage info
* @psoc: pointer to psoc object