qcacld-3.0: Avoid bit addressing for HE Caps and HE Ops
Avoid bit addressing for HE Caps and HE Ops, and use structures to access fields within HE Caps and HE Ops. Change-Id: I1afa1926d1f4c7da5446870a7ad3121c06762f98 CRs-Fixed: 2145511
This commit is contained in:
parent
90067c812d
commit
436979baa9
@ -7491,29 +7491,6 @@ struct wow_enable_params {
|
||||
#define HE_OP_OUI_TYPE "\x24"
|
||||
#define HE_OP_OUI_SIZE 1
|
||||
|
||||
/* HE Op Mask is based on the HE Operation definition in the D1.0 spec */
|
||||
#define HE_OP_BSS_COLOR_MASK (0x3F << 0)
|
||||
#define HE_OP_DEF_PE_DUR_MASK (0x07 << 6)
|
||||
#define HE_OP_TWT_REQ_MASK (0x01 << 9)
|
||||
#define HE_OP_RTS_THRES_MASK (0x3FF << 10)
|
||||
#define HE_OP_PART_BSS_COLOR_MASK (0x01 << 20)
|
||||
#define HE_OP_MAXBSSID_IND_MASK (0xFF << 21)
|
||||
#define HE_OP_TX_BSSIX_IND_MASK (0x01 << 29)
|
||||
#define HE_OP_BSS_COLOR_DIS_MASK (0x01 << 30)
|
||||
#define HE_OP_DUAL_BEACON_MASK (0x01 << 31)
|
||||
|
||||
#define HE_OP_BSS_COLOR_GET(he_op) ((he_op & HE_OP_BSS_COLOR_MASK) >> 0)
|
||||
#define HE_OP_DEF_PE_DUR_GET(he_op) ((he_op & HE_OP_DEF_PE_DUR_MASK) >> 6)
|
||||
#define HE_OP_TWT_REQ_GET(he_op) ((he_op & HE_OP_TWT_REQ_MASK) >> 9)
|
||||
#define HE_OP_RTS_THRES_GET(he_op) ((he_op & HE_OP_RTS_THRES_MASK) >> 10)
|
||||
#define HE_OP_PART_BSS_COLOR_GET(he_op) ((he_op & HE_OP_PART_BSS_COLOR_MASK) \
|
||||
>> 20)
|
||||
#define HE_OP_MAXBSSID_IND_GET(he_op) ((he_op & HE_OP_MAXBSSID_IND_MASK) >> 21)
|
||||
#define HE_OP_TX_BSSIX_IND_GET(he_op) ((he_op & HE_OP_TX_BSSIX_IND_MASK) >> 29)
|
||||
#define HE_OP_BSS_COLOR_DIS_GET(he_op) ((he_op & HE_OP_BSS_COLOR_DIS_MASK) \
|
||||
>> 30)
|
||||
#define HE_OP_DUAL_BEACON_GET(he_op) ((he_op & HE_OP_DUAL_BEACON_MASK) >> 31)
|
||||
|
||||
#define HE_RU_ALLOC_INDX0_MASK (0x01 << 0)
|
||||
#define HE_RU_ALLOC_INDX1_MASK (0x01 << 1)
|
||||
#define HE_RU_ALLOC_INDX2_MASK (0x01 << 2)
|
||||
|
@ -2108,6 +2108,119 @@ typedef struct sSirMacRadioMeasureReport {
|
||||
} tSirMacRadioMeasureReport, *tpSirMacRadioMeasureReport;
|
||||
|
||||
#ifdef WLAN_FEATURE_11AX
|
||||
struct he_cap_network_endian {
|
||||
uint32_t htc_he:1;
|
||||
uint32_t twt_request:1;
|
||||
uint32_t twt_responder:1;
|
||||
uint32_t fragmentation:2;
|
||||
uint32_t max_num_frag_msdu:3;
|
||||
uint32_t min_frag_size:2;
|
||||
uint32_t trigger_frm_mac_pad:2;
|
||||
uint32_t multi_tid_aggr:3;
|
||||
uint32_t he_link_adaptation:2;
|
||||
uint32_t all_ack:1;
|
||||
uint32_t ul_mu_rsp_sched:1;
|
||||
uint32_t a_bsr:1;
|
||||
uint32_t broadcast_twt:1;
|
||||
uint32_t ba_32bit_bitmap:1;
|
||||
uint32_t mu_cascade:1;
|
||||
uint32_t ack_enabled_multitid:1;
|
||||
uint32_t dl_mu_ba:1;
|
||||
uint32_t omi_a_ctrl:1;
|
||||
uint32_t ofdma_ra:1;
|
||||
uint32_t max_ampdu_len:2;
|
||||
uint32_t amsdu_frag:1;
|
||||
uint32_t flex_twt_sched:1;
|
||||
uint32_t rx_ctrl_frame:1;
|
||||
|
||||
uint8_t bsrp_ampdu_aggr:1;
|
||||
uint8_t qtp:1;
|
||||
uint8_t a_bqr:1;
|
||||
uint8_t sr_responder:1;
|
||||
uint8_t ndp_feedback_supp:1;
|
||||
uint8_t ops_supp:1;
|
||||
uint8_t amsdu_in_ampdu:1;
|
||||
uint8_t reserved1:1;
|
||||
|
||||
uint32_t dual_band:1;
|
||||
uint32_t chan_width:7;
|
||||
uint32_t rx_pream_puncturing:4;
|
||||
uint32_t device_class:1;
|
||||
uint32_t ldpc_coding:1;
|
||||
uint32_t he_1x_ltf_800_gi_ppdu:1;
|
||||
uint32_t midamble_rx_max_nsts:2;
|
||||
uint32_t he_4x_ltf_3200_gi_ndp:1;
|
||||
uint32_t stbc_lt_80mhz:2;
|
||||
uint32_t doppler:2;
|
||||
uint32_t ul_mu:2;
|
||||
uint32_t dcm_enc_tx:3;
|
||||
uint32_t dcm_enc_rx:3;
|
||||
uint32_t ul_he_mu:1;
|
||||
uint32_t su_beamformer:1;
|
||||
|
||||
uint32_t su_beamformee:1;
|
||||
uint32_t mu_beamformer:1;
|
||||
uint32_t bfee_sts_lt_80:3;
|
||||
uint32_t bfee_sts_gt_80:3;
|
||||
uint32_t num_sounding_lt_80:3;
|
||||
uint32_t num_sounding_gt_80:3;
|
||||
uint32_t su_feedback_tone16:1;
|
||||
uint32_t mu_feedback_tone16:1;
|
||||
uint32_t codebook_su:1;
|
||||
uint32_t codebook_mu:1;
|
||||
uint32_t beamforming_feedback:3;
|
||||
uint32_t he_er_su_ppdu:1;
|
||||
uint32_t dl_mu_mimo_part_bw:1;
|
||||
uint32_t ppet_present:1;
|
||||
uint32_t srp:1;
|
||||
uint32_t power_boost:1;
|
||||
uint32_t he_ltf_800_gi_4x:1;
|
||||
uint32_t max_nc:3;
|
||||
uint32_t stbc_gt_80mhz:2;
|
||||
|
||||
uint8_t er_he_ltf_800_gi_4x:1;
|
||||
uint8_t he_ppdu_20_in_40Mhz_2G:1;
|
||||
uint8_t he_ppdu_20_in_160_80p80Mhz:1;
|
||||
uint8_t he_ppdu_80_in_160_80p80Mhz:1;
|
||||
uint8_t er_1x_he_ltf_gi:1;
|
||||
uint8_t midamble_rx_1x_he_ltf:1;
|
||||
uint8_t reserved2:2;
|
||||
|
||||
uint16_t rx_he_mcs_map_lt_80;
|
||||
uint16_t tx_he_mcs_map_lt_80;
|
||||
uint16_t rx_he_mcs_map_160;
|
||||
uint16_t tx_he_mcs_map_160;
|
||||
uint16_t rx_he_mcs_map_80_80;
|
||||
uint16_t tx_he_mcs_map_80_80;
|
||||
} qdf_packed;
|
||||
|
||||
struct he_ops_network_endian {
|
||||
uint32_t bss_color:6;
|
||||
uint32_t default_pe:3;
|
||||
uint32_t twt_required:1;
|
||||
uint32_t rts_threshold:10;
|
||||
uint32_t partial_bss_col:1;
|
||||
uint32_t vht_oper_present:1;
|
||||
uint32_t reserved1:6;
|
||||
uint32_t mbssid_ap:1;
|
||||
uint32_t tx_bssid_ind:1;
|
||||
uint32_t bss_col_disabled:1;
|
||||
uint32_t reserved2:1;
|
||||
uint8_t basic_mcs_nss[2];
|
||||
union {
|
||||
struct {
|
||||
uint8_t chan_width;
|
||||
uint8_t center_freq_seg0;
|
||||
uint8_t center_freq_seg1;
|
||||
} info; /* vht_oper_present = 1 */
|
||||
} vht_oper;
|
||||
union {
|
||||
struct {
|
||||
uint8_t data;
|
||||
} info; /* mbssid_ap = 1 */
|
||||
} maxbssid_ind;
|
||||
} qdf_packed;
|
||||
|
||||
/* HE Capabilities Info */
|
||||
struct he_capability_info {
|
||||
#ifndef ANI_LITTLE_BIT_ENDIAN
|
||||
|
@ -363,25 +363,5 @@ static inline void lim_fill_join_rsp_ht_caps(tpPESession session,
|
||||
QDF_STATUS lim_update_ext_cap_ie(tpAniSirGlobal mac_ctx,
|
||||
uint8_t *ie_data, uint8_t *local_ie_buf, uint16_t *local_ie_len);
|
||||
|
||||
#ifdef WLAN_FEATURE_11AX
|
||||
#define LIM_HE_SU_BEAMFORMER_BYTE_IDX 8
|
||||
#define LIM_HE_SU_BEAMFORMEE_BYTE_IDX 9
|
||||
#define LIM_HE_MU_BEAMFORMER_BYTE_IDX 9
|
||||
#define LIM_HE_SU_BEAMFORMER_BIT_POS 8
|
||||
#define LIM_HE_SU_BEAMFORMEE_BIT_POS 1
|
||||
#define LIM_HE_MU_BEAMFORMER_BIT_POS 2
|
||||
|
||||
#define LIM_GET_BIT_VALUE(arr, byte, bit) ((arr[byte-1] >> (bit - 1)) & 0x01)
|
||||
#define LIM_GET_SU_BEAMFORMER(he_cap) \
|
||||
LIM_GET_BIT_VALUE(he_cap, LIM_HE_SU_BEAMFORMER_BYTE_IDX, \
|
||||
LIM_HE_SU_BEAMFORMER_BIT_POS)
|
||||
#define LIM_GET_SU_BEAMFORMEE(he_cap) \
|
||||
LIM_GET_BIT_VALUE(he_cap, LIM_HE_SU_BEAMFORMEE_BYTE_IDX, \
|
||||
LIM_HE_SU_BEAMFORMEE_BIT_POS)
|
||||
#define LIM_GET_MU_BEAMFORMER(he_cap) \
|
||||
LIM_GET_BIT_VALUE(he_cap, LIM_HE_MU_BEAMFORMER_BYTE_IDX, \
|
||||
LIM_HE_MU_BEAMFORMER_BIT_POS)
|
||||
#endif
|
||||
|
||||
/************************************************************/
|
||||
#endif /* __LIM_API_H */
|
||||
|
@ -7291,9 +7291,9 @@ void lim_update_stads_he_caps(tpDphHashNode sta_ds, tpSirAssocRsp assoc_rsp,
|
||||
void lim_update_usr_he_cap(tpAniSirGlobal mac_ctx, tpPESession session)
|
||||
{
|
||||
const uint8_t *vendor_ie;
|
||||
const uint8_t *he_cap_data;
|
||||
tSirAddIeParams *add_ie = &session->addIeParams;
|
||||
tDot11fIEhe_cap *he_cap = &session->he_config;
|
||||
struct he_cap_network_endian *he_cap_from_ie;
|
||||
|
||||
vendor_ie = wlan_get_ext_ie_ptr_from_ext_id(
|
||||
HE_CAP_OUI_TYPE, HE_CAP_OUI_SIZE,
|
||||
@ -7304,16 +7304,18 @@ void lim_update_usr_he_cap(tpAniSirGlobal mac_ctx, tpPESession session)
|
||||
return;
|
||||
}
|
||||
|
||||
he_cap_data = vendor_ie + HE_OP_OUI_SIZE + 2;
|
||||
|
||||
pe_debug("Before update: su_beamformer: %d, su_beamformee: %d, mu_beamformer: %d",
|
||||
he_cap->su_beamformer, he_cap->su_beamformee, he_cap->mu_beamformer);
|
||||
if (he_cap->su_beamformer)
|
||||
he_cap->su_beamformer = LIM_GET_SU_BEAMFORMER(he_cap_data);
|
||||
if (he_cap->su_beamformee)
|
||||
he_cap->su_beamformee = LIM_GET_SU_BEAMFORMEE(he_cap_data);
|
||||
if (he_cap->mu_beamformer)
|
||||
he_cap->mu_beamformer = LIM_GET_MU_BEAMFORMER(he_cap_data);
|
||||
|
||||
he_cap_from_ie =
|
||||
(struct he_cap_network_endian *)&vendor_ie[HE_OP_OUI_SIZE + 2];
|
||||
|
||||
he_cap->su_beamformer =
|
||||
he_cap->su_beamformer & he_cap_from_ie->su_beamformer;
|
||||
he_cap->su_beamformee =
|
||||
he_cap->su_beamformee & he_cap_from_ie->su_beamformee;
|
||||
he_cap->mu_beamformer =
|
||||
he_cap->mu_beamformer & he_cap_from_ie->mu_beamformer;
|
||||
|
||||
pe_debug("After update: su_beamformer: %d, su_beamformee: %d, mu_beamformer: %d",
|
||||
he_cap->su_beamformer, he_cap->su_beamformee, he_cap->mu_beamformer);
|
||||
@ -7322,8 +7324,9 @@ void lim_update_usr_he_cap(tpAniSirGlobal mac_ctx, tpPESession session)
|
||||
void lim_decide_he_op(tpAniSirGlobal mac_ctx, tpAddBssParams add_bss,
|
||||
tpPESession session)
|
||||
{
|
||||
uint32_t val;
|
||||
const uint8_t *vendor_ie;
|
||||
uint32_t he_op;
|
||||
struct he_ops_network_endian *he_ops_from_ie;
|
||||
tDot11fIEhe_op *he_ops = &add_bss->he_op;
|
||||
tSirAddIeParams *add_ie = &session->addIeParams;
|
||||
|
||||
@ -7336,30 +7339,34 @@ void lim_decide_he_op(tpAniSirGlobal mac_ctx, tpAddBssParams add_bss,
|
||||
return;
|
||||
}
|
||||
|
||||
qdf_mem_copy(&he_op, &vendor_ie[HE_OP_OUI_SIZE + 2], sizeof(uint32_t));
|
||||
he_ops_from_ie =
|
||||
(struct he_ops_network_endian *)&vendor_ie[HE_OP_OUI_SIZE + 2];
|
||||
|
||||
he_ops->bss_color = HE_OP_BSS_COLOR_GET(he_op);
|
||||
he_ops->default_pe = HE_OP_DEF_PE_DUR_GET(he_op);
|
||||
he_ops->twt_required = HE_OP_TWT_REQ_GET(he_op);
|
||||
he_ops->rts_threshold = HE_OP_RTS_THRES_GET(he_op);
|
||||
he_ops->partial_bss_col = HE_OP_PART_BSS_COLOR_GET(he_op);
|
||||
he_ops->tx_bssid_ind = HE_OP_TX_BSSIX_IND_GET(he_op);
|
||||
he_ops->bss_col_disabled = HE_OP_BSS_COLOR_DIS_GET(he_op);
|
||||
he_ops->bss_color = he_ops_from_ie->bss_color;
|
||||
he_ops->default_pe = he_ops_from_ie->default_pe;
|
||||
he_ops->twt_required = he_ops_from_ie->twt_required;
|
||||
he_ops->rts_threshold = he_ops_from_ie->rts_threshold;
|
||||
he_ops->partial_bss_col = he_ops_from_ie->partial_bss_col;
|
||||
he_ops->tx_bssid_ind = he_ops_from_ie->tx_bssid_ind;
|
||||
he_ops->bss_col_disabled = he_ops_from_ie->bss_col_disabled;
|
||||
|
||||
session->he_op.bss_color = he_ops->bss_color;
|
||||
session->he_op.default_pe = he_ops->default_pe;
|
||||
session->he_op.twt_required = he_ops->twt_required;
|
||||
session->he_op.rts_threshold = he_ops->rts_threshold;
|
||||
session->he_op.partial_bss_col = he_ops->partial_bss_col;
|
||||
session->he_op.tx_bssid_ind = he_ops->tx_bssid_ind;
|
||||
session->he_op.bss_col_disabled = he_ops->bss_col_disabled;
|
||||
if (eSIR_SUCCESS != wlan_cfg_get_int(mac_ctx,
|
||||
WNI_CFG_HE_OPS_BASIC_MCS_NSS, &val))
|
||||
val = WNI_CFG_HE_OPS_BASIC_MCS_NSS_DEF;
|
||||
*((uint16_t *)he_ops->basic_mcs_nss) = (uint16_t)val;
|
||||
|
||||
pe_debug("HE Operation: bss_color: %0x, default_pe_duration: %0x, twt_required: %0x, rts_threshold: %0x",
|
||||
he_ops->bss_color, he_ops->default_pe,
|
||||
qdf_mem_copy(&session->he_op, he_ops, sizeof(*he_ops));
|
||||
|
||||
pe_debug("HE Op: bss_color: 0x%0x, default_pe_duration: 0x%0x",
|
||||
he_ops->bss_color, he_ops->default_pe);
|
||||
pe_debug("He Op: twt_required: 0x%0x, rts_threshold: 0x%0x",
|
||||
he_ops->twt_required, he_ops->rts_threshold);
|
||||
pe_debug("partial_bss_color: %0x, Tx BSSID Indicator: %0x, BSS color disabled: %0x",
|
||||
he_ops->partial_bss_col, he_ops->tx_bssid_ind,
|
||||
pe_debug("HE Op: partial_bss_color: 0x%0x, Tx BSSID Indicator: 0x%0x",
|
||||
he_ops->partial_bss_col, he_ops->tx_bssid_ind);
|
||||
pe_debug("HE Op: BSS color disabled: 0x%0x",
|
||||
he_ops->bss_col_disabled);
|
||||
pe_debug("HE Op: Basic MCS NSS: 0x%04x",
|
||||
*((uint16_t *)he_ops->basic_mcs_nss));
|
||||
}
|
||||
|
||||
void lim_copy_bss_he_cap(tpPESession session,
|
||||
@ -7550,6 +7557,9 @@ void lim_log_he_op(tpAniSirGlobal mac, tDot11fIEhe_op *he_ops)
|
||||
he_ops->partial_bss_col, he_ops->mbssid_ap,
|
||||
he_ops->tx_bssid_ind, he_ops->bss_col_disabled);
|
||||
|
||||
pe_debug("he basic mcs nss: 0x%04x",
|
||||
*((uint16_t *)he_ops->basic_mcs_nss));
|
||||
|
||||
if (he_ops->vht_oper_present)
|
||||
pe_debug("VHT Info not present in HE Operation");
|
||||
else
|
||||
|
@ -6262,16 +6262,7 @@ QDF_STATUS populate_dot11f_he_caps(tpAniSirGlobal mac_ctx, tpPESession session,
|
||||
QDF_STATUS populate_dot11f_he_operation(tpAniSirGlobal mac_ctx,
|
||||
tpPESession session, tDot11fIEhe_op *he_op)
|
||||
{
|
||||
he_op->present = 1;
|
||||
|
||||
he_op->bss_color = session->he_op.bss_color;
|
||||
he_op->default_pe = session->he_op.default_pe;
|
||||
he_op->twt_required = session->he_op.twt_required;
|
||||
he_op->rts_threshold = session->he_op.rts_threshold;
|
||||
he_op->partial_bss_col = session->he_op.partial_bss_col;
|
||||
he_op->mbssid_ap = session->he_op.mbssid_ap;
|
||||
he_op->tx_bssid_ind = session->he_op.tx_bssid_ind;
|
||||
he_op->bss_col_disabled = session->he_op.bss_col_disabled;
|
||||
qdf_mem_copy(he_op, &session->he_op, sizeof(*he_op));
|
||||
|
||||
he_op->vht_oper_present = 1;
|
||||
if (session->ch_width > CH_WIDTH_40MHZ) {
|
||||
|
Loading…
Reference in New Issue
Block a user