diff --git a/core/mac/src/pe/lim/lim_utils.c b/core/mac/src/pe/lim/lim_utils.c index f8ea05752c37..a73d40fb43f7 100644 --- a/core/mac/src/pe/lim/lim_utils.c +++ b/core/mac/src/pe/lim/lim_utils.c @@ -7404,18 +7404,44 @@ static void lim_intersect_he_ch_width_2g(struct mac_context *mac, he_cap->chan_width, he_cap->he_ppdu_20_in_40Mhz_2G); } +static uint8_t lim_set_he_caps_ppet(struct mac_context *mac, uint8_t *ie, + enum cds_band_type band) +{ + uint8_t ppe_th[WNI_CFG_HE_PPET_LEN] = {0}; + /* Append at the end after ID + LEN + OUI + IE_Data */ + uint8_t offset = ie[1] + 1 + 1 + 1; + uint8_t num_ppe_th; + + if (band == CDS_BAND_2GHZ) + qdf_mem_copy(ppe_th, mac->mlme_cfg->he_caps.he_ppet_2g, + WNI_CFG_HE_PPET_LEN); + else if (band == CDS_BAND_5GHZ) + qdf_mem_copy(ppe_th, mac->mlme_cfg->he_caps.he_ppet_5g, + WNI_CFG_HE_PPET_LEN); + else + return 0; + + num_ppe_th = lim_truncate_ppet(ppe_th, WNI_CFG_HE_PPET_LEN); + + qdf_mem_copy(ie + offset, ppe_th, num_ppe_th); + + return num_ppe_th; +} + QDF_STATUS lim_send_he_caps_ie(struct mac_context *mac_ctx, struct pe_session *session, enum QDF_OPMODE device_mode, uint8_t vdev_id) { uint8_t he_caps[SIR_MAC_HE_CAP_MIN_LEN + HE_CAP_OUI_LEN + - HE_CAP_160M_MCS_MAP_LEN + HE_CAP_80P80_MCS_MAP_LEN]; + HE_CAP_160M_MCS_MAP_LEN + HE_CAP_80P80_MCS_MAP_LEN + + WNI_CFG_HE_PPET_LEN]; struct he_capability_info *he_cap; QDF_STATUS status_5g, status_2g; uint8_t he_cap_total_len = SIR_MAC_HE_CAP_MIN_LEN + HE_CAP_OUI_LEN + HE_CAP_160M_MCS_MAP_LEN + HE_CAP_80P80_MCS_MAP_LEN; + uint8_t num_ppe_th = 0; /* Sending only minimal info(no PPET) to FW now, update if required */ qdf_mem_zero(he_caps, he_cap_total_len); @@ -7424,7 +7450,6 @@ QDF_STATUS lim_send_he_caps_ie(struct mac_context *mac_ctx, qdf_mem_copy(&he_caps[2], HE_CAP_OUI_TYPE, HE_CAP_OUI_SIZE); lim_set_he_caps(mac_ctx, session, he_caps, he_cap_total_len); he_cap = (struct he_capability_info *) (&he_caps[2 + HE_CAP_OUI_SIZE]); - he_cap->ppet_present = 0; if(device_mode == QDF_NDI_MODE) { he_cap->su_beamformee = 0; he_cap->su_beamformer = 0; @@ -7436,18 +7461,27 @@ QDF_STATUS lim_send_he_caps_ie(struct mac_context *mac_ctx, he_cap->su_feedback_tone16 = 0; he_cap->mu_feedback_tone16 = 0; } + + if (he_cap->ppet_present) + num_ppe_th = lim_set_he_caps_ppet(mac_ctx, he_caps, + CDS_BAND_5GHZ); + status_5g = lim_send_ie(mac_ctx, vdev_id, DOT11F_EID_HE_CAP, CDS_BAND_5GHZ, &he_caps[2], - he_caps[1] + 1); + he_caps[1] + 1 + num_ppe_th); if (QDF_IS_STATUS_ERROR(status_5g)) pe_err("Unable send HE Cap IE for 5GHZ band, status: %d", status_5g); lim_intersect_he_ch_width_2g(mac_ctx, he_cap); + if (he_cap->ppet_present) + num_ppe_th = lim_set_he_caps_ppet(mac_ctx, he_caps, + CDS_BAND_2GHZ); + status_2g = lim_send_ie(mac_ctx, vdev_id, DOT11F_EID_HE_CAP, CDS_BAND_2GHZ, &he_caps[2], - he_caps[1] + 1); + he_caps[1] + 1 + num_ppe_th); if (QDF_IS_STATUS_ERROR(status_2g)) pe_err("Unable send HE Cap IE for 2GHZ band, status: %d", status_2g);