瀏覽代碼

qcacmn: Add validation check for MLD address

-Add validation check for MLD address as part of ML dev context
creation.
-Modify some function descriptions to clearly state the purpose.

Change-Id: Id049145351bdd790126e0ab522d24e4c399c0ad2
CRs-Fixed: 2976130
Sandeep Puligilla 4 年之前
父節點
當前提交
1d0ef56609
共有 3 個文件被更改,包括 22 次插入12 次删除
  1. 1 1
      umac/mlo_mgr/inc/wlan_mlo_mgr_ap.h
  2. 12 8
      umac/mlo_mgr/inc/wlan_mlo_mgr_peer.h
  3. 9 3
      umac/mlo_mgr/src/wlan_mlo_mgr_main.c

+ 1 - 1
umac/mlo_mgr/inc/wlan_mlo_mgr_ap.h

@@ -67,7 +67,7 @@ void mlo_ap_get_vdev_list(struct wlan_objmgr_vdev *vdev,
 void mlo_ap_link_sync_wait_notify(struct wlan_objmgr_vdev *vdev);
 
 /**
- * mlo_ap_link_start_rsp_notify - Notifies that the link is completed
+ * mlo_ap_link_start_rsp_notify - Notify that the link start is completed
  *
  * @vdev: pointer to vdev
  *

+ 12 - 8
umac/mlo_mgr/inc/wlan_mlo_mgr_peer.h

@@ -21,8 +21,8 @@
 #define _WLAN_MLO_MGR_PEER_H_
 
 /**
- * mlo_peer_create - Initiatiate peer create on second link by posting
- * message to LIM
+ * mlo_peer_create - Initiatiate peer create on secondary link(s)
+ * by posting a message
  *
  * @vdev: pointer to vdev
  * @peer: pointer to peer context
@@ -34,11 +34,12 @@
  * Return: none
  */
 void mlo_peer_create(struct wlan_objmgr_vdev *vdev,
-		     struct wlan_objmgr_peer *peer, uint8_t *mlo_ie,
-		     uint8_t aid);
+			       struct wlan_objmgr_peer *peer, uint8_t *mlo_ie,
+			       uint8_t aid);
 
 /**
- * mlo_peer_attach - Update the MLO peer context with the new link information
+ * mlo_peer_attach - Attaches the peer by updating the MLO peer context with
+ * the new link information
  *
  * @vdev: pointer to vdev
  * @peer: pointer to peer context
@@ -49,7 +50,8 @@ void mlo_peer_attach(struct wlan_objmgr_vdev *vdev,
 		     struct wlan_objmgr_peer *peer);
 
 /**
- * mlo_peer_setup_failed_notify - Notify MLO manageer to delete partner peers
+ * mlo_peer_setup_failed_notify - Notify MLO manager that peer setup has failed
+ * and to cleanup by deleting the partner peers
  *
  * @vdev: pointer to vdev
  *
@@ -60,7 +62,8 @@ void mlo_peer_attach(struct wlan_objmgr_vdev *vdev,
 void mlo_peer_setup_failed_notify(struct wlan_objmgr_vdev *vdev);
 
 /**
- * mlo_peer_disconnect_notify - Delete partner peers
+ * mlo_peer_disconnect_notify - Notify MLO manager that peer has disconnected
+ * and to clean up by deleting partner peers
  *
  * @vdev: pointer to vdev
  *
@@ -69,7 +72,8 @@ void mlo_peer_setup_failed_notify(struct wlan_objmgr_vdev *vdev);
 void mlo_peer_disconnect_notify(struct wlan_objmgr_peer *peer);
 
 /**
- * wlan_peer_delete_complete - Unlink the peer object
+ * wlan_peer_delete_complete - Notify MLO manager that peer delete is completed
+ * and to clean up by unlinking the peer object
  *
  * @peer: pointer to peer context
  *

+ 9 - 3
umac/mlo_mgr/src/wlan_mlo_mgr_main.c

@@ -227,7 +227,7 @@ static QDF_STATUS mlo_dev_ctx_init(struct wlan_objmgr_vdev *vdev)
 	} else if (wlan_vdev_mlme_get_opmode(vdev) == QDF_SAP_MODE) {
 		ml_dev->ap_ctx = qdf_mem_malloc(sizeof(struct wlan_mlo_ap));
 		if (!ml_dev->ap_ctx)
-			return QDF_STATUS_E_NOMEM;
+			mlo_debug("Failed to allocate memory for ap ctx");
 	}
 
 	ml_link_lock_acquire(g_mlo_ctx);
@@ -284,10 +284,13 @@ QDF_STATUS wlan_mlo_mgr_vdev_created_notification(struct wlan_objmgr_vdev *vdev,
 						  void *arg_list)
 {
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
+	struct qdf_mac_addr *mld_addr;
 
-	if (!wlan_vdev_mlme_get_mldaddr(vdev))
+	mld_addr = (struct qdf_mac_addr *)wlan_vdev_mlme_get_mldaddr(vdev);
+	if (qdf_is_macaddr_zero(mld_addr)) {
 		/* It's not a ML interface*/
 		return QDF_STATUS_SUCCESS;
+	}
 	status = mlo_dev_ctx_init(vdev);
 
 	return status;
@@ -297,10 +300,13 @@ QDF_STATUS wlan_mlo_mgr_vdev_destroyed_notification(struct wlan_objmgr_vdev *vde
 						    void *arg_list)
 {
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
+	struct qdf_mac_addr *mld_addr;
 
-	if (!wlan_vdev_mlme_get_mldaddr(vdev))
+	mld_addr = (struct qdf_mac_addr *)wlan_vdev_mlme_get_mldaddr(vdev);
+	if (qdf_is_macaddr_zero(mld_addr)) {
 		/* It's not a ML interface*/
 		return QDF_STATUS_SUCCESS;
+	}
 
 	status = mlo_dev_ctx_deinit(vdev);