|
@@ -6658,9 +6658,69 @@ void lim_update_he_6gop_assoc_resp(struct bss_params *pAddBssParams,
|
|
|
pAddBssParams->staContext.ch_width = pAddBssParams->ch_width;
|
|
|
}
|
|
|
|
|
|
+static bool lim_check_is_bss_greater_than_4_nss_supp(struct pe_session *session,
|
|
|
+ tDot11fIEhe_cap *he_cap)
|
|
|
+{
|
|
|
+ uint8_t i;
|
|
|
+ uint16_t mcs_map;
|
|
|
+#define NSS_4 4
|
|
|
+#define NSS_8 8
|
|
|
+
|
|
|
+ if (!session->he_capable || !he_cap->present)
|
|
|
+ return false;
|
|
|
+ mcs_map = he_cap->rx_he_mcs_map_lt_80;
|
|
|
+ for (i = NSS_4; i < NSS_8; i++) {
|
|
|
+ if (((mcs_map >> (i * 2)) & 0x3) != 0x3)
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+static bool lim_check_he_80_mcs11_supp(struct pe_session *session,
|
|
|
+ tDot11fIEhe_cap *he_cap)
|
|
|
+{
|
|
|
+ uint16_t rx_mcs_map;
|
|
|
+ uint16_t tx_mcs_map;
|
|
|
+ rx_mcs_map = he_cap->rx_he_mcs_map_lt_80;
|
|
|
+ tx_mcs_map = he_cap->tx_he_mcs_map_lt_80;
|
|
|
+ if ((session->nss == NSS_1x1_MODE) &&
|
|
|
+ ((HE_GET_MCS_4_NSS(rx_mcs_map, 1) == HE_MCS_0_11) ||
|
|
|
+ (HE_GET_MCS_4_NSS(tx_mcs_map, 1) == HE_MCS_0_11)))
|
|
|
+ return true;
|
|
|
+
|
|
|
+ if ((session->nss == NSS_2x2_MODE) &&
|
|
|
+ ((HE_GET_MCS_4_NSS(rx_mcs_map, 2) == HE_MCS_0_11) ||
|
|
|
+ (HE_GET_MCS_4_NSS(tx_mcs_map, 2) == HE_MCS_0_11)))
|
|
|
+ return true;
|
|
|
+
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * lim_check_he_ldpc_cap() - set he ladpc coding to one if
|
|
|
+ * channel width is > 20 or mcs 10/11 bit are supported or
|
|
|
+ * nss is greater than 4.
|
|
|
+ * @beacon_struct: beacon structure
|
|
|
+ * @session: A pointer to session entry.
|
|
|
+ *
|
|
|
+ * Return: None
|
|
|
+ */
|
|
|
+
|
|
|
+static void lim_check_and_force_he_ldpc_cap(struct pe_session *session,
|
|
|
+ tDot11fIEhe_cap *he_cap)
|
|
|
+{
|
|
|
+ if (!he_cap->ldpc_coding &&
|
|
|
+ (session->ch_width > CH_WIDTH_20MHZ ||
|
|
|
+ lim_check_he_80_mcs11_supp(session, he_cap) ||
|
|
|
+ lim_check_is_bss_greater_than_4_nss_supp(session, he_cap)))
|
|
|
+ he_cap->ldpc_coding = 1;
|
|
|
+}
|
|
|
+
|
|
|
void lim_update_stads_he_caps(struct mac_context *mac_ctx,
|
|
|
tpDphHashNode sta_ds, tpSirAssocRsp assoc_rsp,
|
|
|
- struct pe_session *session_entry)
|
|
|
+ struct pe_session *session_entry,
|
|
|
+ tSchBeaconStruct *beacon)
|
|
|
{
|
|
|
tDot11fIEhe_cap *he_cap;
|
|
|
|
|
@@ -6670,6 +6730,13 @@ void lim_update_stads_he_caps(struct mac_context *mac_ctx,
|
|
|
if (!he_cap->present)
|
|
|
return;
|
|
|
|
|
|
+ /* setting lpdc_coding if any of assoc_rsp or beacon has ladpc_coding
|
|
|
+ * enabled
|
|
|
+ */
|
|
|
+ if (beacon)
|
|
|
+ he_cap->ldpc_coding |= beacon->he_cap.ldpc_coding;
|
|
|
+ lim_check_and_force_he_ldpc_cap(session_entry, he_cap);
|
|
|
+
|
|
|
qdf_mem_copy(&sta_ds->he_config, he_cap, sizeof(*he_cap));
|
|
|
|
|
|
/* If HE is not supported, do not fill sta_ds and return */
|