浏览代码

qcacld-3.0: Set TWT req and res bit for SAP peer

In 11ax mode, peer twt req and res bit can send in HE cap ie's
and firmware can extract before processing any TWT setup command
request in SAP side.
But for 11n mode, send twt req and res bit during SAP peer assoc
command itself so that firmware can extract peer caps if any TWT
setup command comes in SAP side.

Change-Id: I51e4688ead41112696dbb19de7b28bc0c59e0f4d
CRs-Fixed: 3185083
Jyoti Kumari 2 年之前
父节点
当前提交
55f3dc275b
共有 2 个文件被更改,包括 73 次插入0 次删除
  1. 24 0
      core/mac/src/pe/lim/lim_assoc_utils.c
  2. 49 0
      core/mac/src/pe/lim/lim_process_assoc_req_frame.c

+ 24 - 0
core/mac/src/pe/lim/lim_assoc_utils.c

@@ -2208,6 +2208,27 @@ static bool lim_is_add_sta_params_eht_capable(tpAddStaParams add_sta_params)
 
 #endif
 
+#ifdef WLAN_SUPPORT_TWT
+/**
+ * lim_update_peer_twt_caps() - Update peer twt caps to add sta params
+ * @add_sta_params: pointer to add sta params
+ * @@session_entry: pe session entry
+ *
+ * Return: None
+ */
+static void lim_update_peer_twt_caps(tpAddStaParams add_sta_params,
+				    struct pe_session *session_entry)
+{
+	add_sta_params->twt_requestor = session_entry->peer_twt_requestor;
+	add_sta_params->twt_responder = session_entry->peer_twt_responder;
+}
+#else
+static inline void
+lim_update_peer_twt_caps(tpAddStaParams add_sta_params,
+			     struct pe_session *session_entry)
+{}
+#endif
+
 /**
  * lim_add_sta()- called to add an STA context at hardware
  * @mac_ctx: pointer to global mac structure
@@ -2568,6 +2589,9 @@ lim_add_sta(struct mac_context *mac_ctx,
 	lim_update_he_stbc_capable(add_sta_params);
 	lim_update_he_mcs_12_13(add_sta_params, sta_ds);
 
+	/* Send peer twt req and res bit during peer assoc command */
+	lim_update_peer_twt_caps(add_sta_params, session_entry);
+
 	msg_q.type = WMA_ADD_STA_REQ;
 	msg_q.reserved = 0;
 	msg_q.bodyptr = add_sta_params;

+ 49 - 0
core/mac/src/pe/lim/lim_process_assoc_req_frame.c

@@ -2362,6 +2362,52 @@ QDF_STATUS lim_check_assoc_req(struct mac_context *mac_ctx,
 	return QDF_STATUS_SUCCESS;
 }
 
+#ifdef WLAN_SUPPORT_TWT
+/* lim_set_sap_peer_twt_cap() - Set SAP peer twt requestor and responder bit
+ * @session: PE session handle
+ * @ext_cap: pointer to ext cap
+ *
+ * This function is used to update SAP peer twt requestor and responder bit
+ * from ext cap of assoc request received by SAP
+ *
+ * Return: None
+ */
+static void lim_set_sap_peer_twt_cap(struct pe_session *session,
+				     struct s_ext_cap *ext_cap)
+{
+	session->peer_twt_requestor = ext_cap->twt_requestor_support;
+	session->peer_twt_responder = ext_cap->twt_responder_support;
+
+	pe_debug("Ext Cap peer TWT requestor: %d, responder: %d",
+		 ext_cap->twt_requestor_support,
+		 ext_cap->twt_responder_support);
+}
+#else
+static inline void
+lim_set_sap_peer_twt_cap(struct pe_session *session,
+			 struct s_ext_cap *ext_cap)
+{
+}
+#endif
+
+/* lim_update_ap_ext_cap() - Update SAP with ext capabilities
+ * @session: PE session handle
+ * @ assoc_req: pointer to assoc req
+ *
+ * This function is called by lim_proc_assoc_req_frm_cmn to
+ * update SAP ext capabilities
+ *
+ * Return: None
+ */
+static void lim_update_ap_ext_cap(struct pe_session *session,
+				  tpSirAssocReq assoc_req)
+{
+	struct s_ext_cap *ext_cap;
+
+	ext_cap = (struct s_ext_cap *)assoc_req->ExtCap.bytes;
+	lim_set_sap_peer_twt_cap(session, ext_cap);
+}
+
 QDF_STATUS lim_proc_assoc_req_frm_cmn(struct mac_context *mac_ctx,
 				      uint8_t sub_type,
 				      struct pe_session *session,
@@ -2490,6 +2536,9 @@ QDF_STATUS lim_proc_assoc_req_frm_cmn(struct mac_context *mac_ctx,
 					  &akm_type))
 		goto error;
 
+	/* Update ap ext cap */
+	lim_update_ap_ext_cap(session, assoc_req);
+
 	/* Extract pre-auth context for the STA, if any. */
 	sta_pre_auth_ctx = lim_search_pre_auth_list(mac_ctx, sa);