소스 검색

qcacld-3.0: Advertise twt capability correctly

Fix the logic to not to advertise twt requester for SAP &
twt responder for STA.

Change-Id: I153f7c52d0107c75f7c59b4c880bb4aa0757356b
CRs-Fixed: 2473541
Tushnim Bhattacharyya 5 년 전
부모
커밋
72adeb5673
2개의 변경된 파일35개의 추가작업 그리고 0개의 파일을 삭제
  1. 28 0
      core/sme/src/csr/csr_api_roam.c
  2. 7 0
      core/sme/src/csr/csr_inside_api.h

+ 28 - 0
core/sme/src/csr/csr_api_roam.c

@@ -2292,9 +2292,20 @@ static void csr_start_bss_copy_he_cap(struct start_bss_req *req,
 		     sizeof(session->he_config));
 }
 
+void csr_init_session_twt_cap(struct csr_roam_session *session,
+			      uint32_t type_of_persona)
+{
+	if (WMI_VDEV_TYPE_AP == type_of_persona) {
+		session->he_config.twt_request = 0;
+	} else if (WMI_VDEV_TYPE_STA == type_of_persona) {
+		session->he_config.twt_responder = 0;
+	}
+}
+
 void csr_update_session_he_cap(struct mac_context *mac_ctx,
 			       struct csr_roam_session *session)
 {
+	enum QDF_OPMODE persona;
 	tDot11fIEhe_cap *he_cap = &session->he_config;
 	he_cap->present = true;
 
@@ -2302,6 +2313,17 @@ void csr_update_session_he_cap(struct mac_context *mac_ctx,
 		     &mac_ctx->mlme_cfg->he_caps.dot11_he_cap,
 		     sizeof(session->he_config));
 
+	/*
+	 * Do not advertise requester role for SAP & responder role
+	 * for STA
+	 */
+	persona = csr_get_session_persona(mac_ctx, session->sessionId);
+	if (QDF_SAP_MODE == persona) {
+		session->he_config.twt_request = 0;
+	} else if (QDF_STA_MODE == persona) {
+		session->he_config.twt_responder = 0;
+	}
+
 	if (he_cap->ppet_present) {
 		/* till now operating channel is not decided yet, use 5g cap */
 		qdf_mem_copy(he_cap->ppet.ppe_threshold.ppe_th,
@@ -17077,6 +17099,12 @@ QDF_STATUS csr_roam_open_session(struct mac_context *mac_ctx,
 
 	csr_update_session_he_cap(mac_ctx, session);
 
+	/*
+	 * Do not advertise requester role for SAP & responder role
+	 * for STA
+	 */
+	csr_init_session_twt_cap(session, session_param->type_of_persona);
+
 	return csr_issue_add_sta_for_session_req(mac_ctx,
 				session_param->sme_session_id,
 				session_param->self_mac_addr,

+ 7 - 0
core/sme/src/csr/csr_inside_api.h

@@ -968,11 +968,18 @@ bool csr_is_pmkid_found_for_peer(struct mac_context *mac,
 #ifdef WLAN_FEATURE_11AX
 void csr_update_session_he_cap(struct mac_context *mac_ctx,
 			struct csr_roam_session *session);
+void csr_init_session_twt_cap(struct csr_roam_session *session,
+			      uint32_t type_of_persona);
 #else
 static inline void csr_update_session_he_cap(struct mac_context *mac_ctx,
 			struct csr_roam_session *session)
 {
 }
+
+static inline void csr_init_session_twt_cap(struct csr_roam_session *session,
+					    uint32_t type_of_persona)
+{
+}
 #endif
 /**
  * csr_get_channel_for_hw_mode_change() - This function to find