Browse Source

qcacld-3.0: Update STA nss in OMN ie of assoc req for WFA CERT

For WFA certification testing, host updates station's max nss support
value in the omn ie of association request.

Change-Id: I0b001e0a0953aff0ff8ba614fab3e67c23eb2cfa
CRs-Fixed: 2690460
Abhishek Ambure 4 years ago
parent
commit
07204a8ccb

+ 3 - 11
core/mac/src/pe/lim/lim_process_assoc_rsp_frame.c

@@ -510,18 +510,10 @@ lim_handle_assoc_reject_status(struct mac_context *mac_ctx,
 }
 #endif
 
-/**
- * lim_get_nss_supported_by_ap() - finds out nss from AP's beacons
- * @vht_caps: VHT capabilities
- * @ht_caps: HT capabilities
- *
- * Return: nss advertised by AP in beacon
- */
-static uint8_t lim_get_nss_supported_by_ap(tDot11fIEVHTCaps *vht_caps,
-					   tDot11fIEHTCaps *ht_caps,
-					   tDot11fIEhe_cap *he_caps)
+uint8_t lim_get_nss_supported_by_ap(tDot11fIEVHTCaps *vht_caps,
+				    tDot11fIEHTCaps *ht_caps,
+				    tDot11fIEhe_cap *he_caps)
 {
-
 	if (he_caps->present) {
 		if ((he_caps->rx_he_mcs_map_lt_80 & 0xC0) != 0xC0)
 			return NSS_4x4_MODE;

+ 22 - 1
core/mac/src/pe/lim/lim_prop_exts_utils.c

@@ -509,13 +509,34 @@ void lim_extract_ap_capability(struct mac_context *mac_ctx, uint8_t *p_ie,
 		session->gLimOperatingMode.present =
 			ext_cap->oper_mode_notification;
 		if (ext_cap->oper_mode_notification) {
+			uint8_t self_nss = 0;
+
+			if (!wlan_reg_is_24ghz_ch_freq(session->curr_op_freq))
+				self_nss = mac_ctx->vdev_type_nss_5g.sta;
+			else
+				self_nss = mac_ctx->vdev_type_nss_2g.sta;
+
 			if (CH_WIDTH_160MHZ > session->ch_width)
 				session->gLimOperatingMode.chanWidth =
 						session->ch_width;
 			else
 				session->gLimOperatingMode.chanWidth =
 					CH_WIDTH_160MHZ;
-			session->gLimOperatingMode.rxNSS = session->nss - 1;
+			/** Populate vdev nss in OMN ie of assoc requse for
+			 *  WFA CERT test scenario.
+			 */
+			if (ext_cap->beacon_protection_enable &&
+			    (session->opmode == QDF_STA_MODE) &&
+			    (!session->nss_forced_1x1) &&
+			     lim_get_nss_supported_by_ap(
+					&beacon_struct->VHTCaps,
+					&beacon_struct->HTCaps,
+					&beacon_struct->he_cap) ==
+						 NSS_1x1_MODE)
+				session->gLimOperatingMode.rxNSS = self_nss - 1;
+			else
+				session->gLimOperatingMode.rxNSS =
+							session->nss - 1;
 		} else {
 			pe_err("AP does not support op_mode rx");
 		}

+ 11 - 0
core/mac/src/pe/lim/lim_types.h

@@ -451,6 +451,17 @@ void lim_send_mlm_assoc_ind(struct mac_context *mac, tpDphHashNode sta,
 
 void lim_process_assoc_rsp_frame(struct mac_context *, uint8_t *, uint8_t, struct pe_session *);
 void lim_process_disassoc_frame(struct mac_context *, uint8_t *, struct pe_session *);
+
+/**
+ * lim_get_nss_supported_by_ap() - finds out nss from AP's beacons
+ * @vht_caps: VHT capabilities
+ * @ht_caps: HT capabilities
+ *
+ * Return: nss advertised by AP in beacon
+ */
+uint8_t lim_get_nss_supported_by_ap(tDot11fIEVHTCaps *vht_caps,
+				    tDot11fIEHTCaps *ht_caps,
+				    tDot11fIEhe_cap *he_caps);
 /*
  * lim_perform_disassoc() - Actual action taken after receiving disassoc
  * @mac_ctx: Global MAC context