ソースを参照

qcacld-3.0: Update peer TWT capabilities after roaming

While processing the roam synch indication reassoc response frame,
the new roamed peer object is not created. So call to
mlme_set_twt_peer_capabilities() to update the new peer capabilities
will fail with null peer object for new bssid. So after roaming,
update the peer TWT capabilities once the new peer object is
created.

Update peer TWT capabilities to new peer object after roaming to
avoid invalid peer capabilities.

Change-Id: Ic37bd4d96bf122b2ec3a60c1ae41650a672b9020
CRs-Fixed: 2870589
Pragaspathi Thilagaraj 4 年 前
コミット
8e170220f7

+ 18 - 0
core/mac/src/pe/include/lim_api.h

@@ -491,5 +491,23 @@ void lim_handle_sap_beacon(struct wlan_objmgr_pdev *pdev,
  */
 enum ani_akm_type lim_translate_rsn_oui_to_akm_type(uint8_t auth_suite[4]);
 
+#ifdef WLAN_SUPPORT_TWT
+/**
+ * lim_fill_roamed_peer_twt_caps() - Update Peer TWT capabilities
+ * @mac_ctx: Pointer to mac context
+ * @vdev_id: vdev id
+ * @roam_synch: Pointer to roam synch indication
+ *
+ * Return: None
+ */
+void lim_fill_roamed_peer_twt_caps(struct mac_context *mac_ctx, uint8_t vdev_id,
+				   struct roam_offload_synch_ind *roam_synch);
+#else
+static inline
+void lim_fill_roamed_peer_twt_caps(struct mac_context *mac_ctx, uint8_t vdev_id,
+				   struct roam_offload_synch_ind *roam_synch)
+{}
+#endif
+
 /************************************************************/
 #endif /* __LIM_API_H */

+ 50 - 0
core/mac/src/pe/lim/lim_api.c

@@ -74,6 +74,7 @@
 #include <wlan_tdls_cfg_api.h>
 #include "cfg_ucfg_api.h"
 #include "wlan_mlme_public_struct.h"
+#include "wlan_mlme_twt_api.h"
 #include "wlan_scan_utils_api.h"
 #include <qdf_hang_event_notifier.h>
 #include <qdf_notifier.h>
@@ -2381,6 +2382,55 @@ lim_fill_fils_ft(struct pe_session *src_session,
 {}
 #endif
 
+#ifdef WLAN_SUPPORT_TWT
+void
+lim_fill_roamed_peer_twt_caps(struct mac_context *mac_ctx,
+			      uint8_t vdev_id,
+			      struct roam_offload_synch_ind *roam_synch)
+{
+	uint8_t *reassoc_body;
+	uint16_t len;
+	uint32_t status;
+	tDot11fReAssocResponse *reassoc_rsp;
+	struct pe_session *pe_session;
+
+	pe_session = pe_find_session_by_vdev_id(mac_ctx, vdev_id);
+	if (!pe_session) {
+		pe_err("session not found for given vdev_id %d", vdev_id);
+		return;
+	}
+
+	reassoc_rsp = qdf_mem_malloc(sizeof(*reassoc_rsp));
+	if (!reassoc_rsp)
+		return;
+
+	len = roam_synch->reassocRespLength - sizeof(tSirMacMgmtHdr);
+	reassoc_body = (uint8_t *)roam_synch + sizeof(tSirMacMgmtHdr) +
+			roam_synch->reassocRespOffset;
+
+	status = dot11f_unpack_re_assoc_response(mac_ctx, reassoc_body, len,
+						 reassoc_rsp, false);
+	if (DOT11F_FAILED(status)) {
+		pe_err("Failed to parse a Re-association Rsp (0x%08x, %d bytes):",
+		       status, len);
+		QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_INFO,
+				   reassoc_body, len);
+		qdf_mem_free(reassoc_rsp);
+		return;
+	} else if (DOT11F_WARNED(status)) {
+		pe_debug("Warnings while unpacking a Re-association Rsp (0x%08x, %d bytes):",
+			 status, len);
+	}
+
+	if (lim_is_session_he_capable(pe_session))
+		mlme_set_twt_peer_capabilities(mac_ctx->psoc,
+					       &roam_synch->bssid,
+					       &reassoc_rsp->he_cap,
+					       &reassoc_rsp->he_op);
+	qdf_mem_free(reassoc_rsp);
+}
+#endif
+
 /**
  * lim_check_ft_initial_im_association() - To check FT initial mobility(im)
  * association

+ 2 - 0
core/wma/src/wma_scan_roam.c

@@ -1014,6 +1014,8 @@ wma_roam_update_vdev(tp_wma_handle wma,
 	wma_add_sta(wma, add_sta_params);
 	qdf_mem_copy(bssid, roam_synch_ind_ptr->bssid.bytes,
 		     QDF_MAC_ADDR_SIZE);
+	lim_fill_roamed_peer_twt_caps(wma->mac_context, vdev_id,
+				      roam_synch_ind_ptr);
 	qdf_mem_free(add_sta_params);
 }