Bladeren bron

qcacmn: Move wlan utility modules due to layering violation

Modules wlan_util_get_vdev_by_ifname/wlan_util_vdev_get_if_name,
which are part of wlan utility under UMAC, are accessing OS IF
private structure that points to the interface name. This is a
layering violation since OS IF private structure should only be
accessed from OS IF layer. Move these modules in NAN OS IF files
in CLD where they are more appropriate.

Move modules that access os if priv to NAN OS IF files in CLD.

Change-Id: Ie4c2f51cddf3abfccbaa6a80580f38345697cfd1
CRs-Fixed: 2384474
Nachiket Kukade 6 jaren geleden
bovenliggende
commit
dace806a9d
2 gewijzigde bestanden met toevoegingen van 0 en 110 verwijderingen
  1. 0 37
      umac/cmn_services/utils/inc/wlan_utility.h
  2. 0 73
      umac/cmn_services/utils/src/wlan_utility.c

+ 0 - 37
umac/cmn_services/utils/inc/wlan_utility.h

@@ -32,16 +32,6 @@
 #define TGT_IS_VALID_SNR(x)     ((x) >= 0 && (x) < TGT_MAX_SNR)
 #define TGT_IS_VALID_RSSI(x)    ((x) != 0xFF)
 
-/**
- * struct wlan_find_vdev_filter - find vdev filter object. this can be extended
- * @ifname:           interface name of vdev
- * @found_vdev:       found vdev object matching one or more of above params
- */
-struct wlan_find_vdev_filter {
-	char *ifname;
-	struct wlan_objmgr_vdev *found_vdev;
-};
-
 #ifdef CMN_VDEV_MLME_SM_ENABLE
 /**
  * struct wlan_vdev_ch_check_filter - vdev chan check filter object
@@ -155,33 +145,6 @@ uint32_t wlan_get_pdev_id_from_vdev_id(struct wlan_objmgr_psoc *psoc,
 				 uint8_t vdev_id,
 				 wlan_objmgr_ref_dbgid dbg_id);
 
-/**
- * wlan_util_get_vdev_by_ifname() - function to return vdev object from psoc
- * matching given interface name
- * @psoc: psoc object
- * @ifname: interface name
- * @ref_id: object manager ref id
- *
- * This function returns vdev object from psoc by interface name. If found this
- * will also take reference with given ref_id
- *
- * Return : vdev object if found, NULL otherwise
- */
-struct wlan_objmgr_vdev *wlan_util_get_vdev_by_ifname(
-				struct wlan_objmgr_psoc *psoc, char *ifname,
-				wlan_objmgr_ref_dbgid ref_id);
-
-/**
- * wlan_util_vdev_get_if_name() - get vdev's interface name
- * @vdev: VDEV object
- *
- * API to get vdev's interface name
- *
- * Return:
- * @id: vdev's interface name
- */
-uint8_t *wlan_util_vdev_get_if_name(struct wlan_objmgr_vdev *vdev);
-
 /**
  * wlan_util_is_vdev_active() - Check for vdev active
  * @pdev: pdev pointer

+ 0 - 73
umac/cmn_services/utils/src/wlan_utility.c

@@ -183,79 +183,6 @@ uint32_t wlan_get_pdev_id_from_vdev_id(struct wlan_objmgr_psoc *psoc,
 }
 qdf_export_symbol(wlan_get_pdev_id_from_vdev_id);
 
-static void wlan_util_get_vdev_by_ifname_cb(struct wlan_objmgr_psoc *psoc,
-					    void *obj, void *arg)
-{
-	struct wlan_objmgr_vdev *vdev = obj;
-	struct wlan_find_vdev_filter *filter = arg;
-
-	if (filter->found_vdev)
-		return;
-
-	wlan_vdev_obj_lock(vdev);
-	if (!qdf_str_cmp(vdev->vdev_nif.osdev->wdev->netdev->name,
-			 filter->ifname)) {
-		filter->found_vdev = vdev;
-	}
-	wlan_vdev_obj_unlock(vdev);
-}
-
-struct wlan_objmgr_vdev *wlan_util_get_vdev_by_ifname(
-				struct wlan_objmgr_psoc *psoc, char *ifname,
-				wlan_objmgr_ref_dbgid ref_id)
-{
-	QDF_STATUS status;
-	struct wlan_find_vdev_filter filter = {0};
-
-	filter.ifname = ifname;
-	wlan_objmgr_iterate_obj_list(psoc, WLAN_VDEV_OP,
-				     wlan_util_get_vdev_by_ifname_cb,
-				     &filter, 0, ref_id);
-
-	if (!filter.found_vdev)
-		return NULL;
-
-	status = wlan_objmgr_vdev_try_get_ref(filter.found_vdev, ref_id);
-	if (QDF_IS_STATUS_ERROR(status))
-		return NULL;
-
-	return filter.found_vdev;
-}
-
-/**
- * wlan_util_vdev_get_if_name() - get vdev's interface name
- * @vdev: VDEV object
- *
- * API to get vdev's interface name
- *
- * Return:
- * @id: vdev's interface name
- */
-uint8_t *wlan_util_vdev_get_if_name(struct wlan_objmgr_vdev *vdev)
-{
-	uint8_t *name;
-	struct vdev_osif_priv *osif_priv;
-
-	wlan_vdev_obj_lock(vdev);
-
-	osif_priv = wlan_vdev_get_ospriv(vdev);
-	if (!osif_priv) {
-		wlan_vdev_obj_unlock(vdev);
-		return NULL;
-	}
-
-	if (!osif_priv->wdev) {
-		wlan_vdev_obj_unlock(vdev);
-		return NULL;
-	}
-
-	name = osif_priv->wdev->netdev->name;
-	wlan_vdev_obj_unlock(vdev);
-
-	return name;
-}
-qdf_export_symbol(wlan_util_vdev_get_if_name);
-
 #ifdef CMN_VDEV_MLME_SM_ENABLE
 static void wlan_vdev_active(struct wlan_objmgr_pdev *pdev, void *object,
 			     void *arg)