|
@@ -1,5 +1,6 @@
|
|
/*
|
|
/*
|
|
* Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
|
|
* Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
|
|
|
|
+ * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
|
|
*
|
|
*
|
|
*
|
|
*
|
|
* Permission to use, copy, modify, and/or distribute this software for
|
|
* Permission to use, copy, modify, and/or distribute this software for
|
|
@@ -184,6 +185,42 @@ free_vdevref:
|
|
}
|
|
}
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
+#ifdef MOBILE_DFS_SUPPORT
|
|
|
|
+/**
|
|
|
|
+ * target_if_dfs_get_pdev() - retrieve pdev by id
|
|
|
|
+ * @psoc: PSOC object
|
|
|
|
+ * @id: pdev id
|
|
|
|
+ * @dbg_id: id of the caller
|
|
|
|
+ *
|
|
|
|
+ * Return: pdev pointer
|
|
|
|
+ * NULL on FAILURE
|
|
|
|
+ */
|
|
|
|
+static struct wlan_objmgr_pdev *target_if_dfs_get_pdev(
|
|
|
|
+ struct wlan_objmgr_psoc *psoc, uint8_t id,
|
|
|
|
+ wlan_objmgr_ref_dbgid dbg_id)
|
|
|
|
+{
|
|
|
|
+ struct wlan_objmgr_pdev *pdev;
|
|
|
|
+
|
|
|
|
+ pdev = wlan_objmgr_get_pdev_by_id(psoc, id, dbg_id);
|
|
|
|
+ if (!pdev) {
|
|
|
|
+ pdev = wlan_objmgr_get_pdev_by_id(psoc, TGT_WMI_PDEV_ID_SOC,
|
|
|
|
+ dbg_id);
|
|
|
|
+ if (!pdev)
|
|
|
|
+ target_if_err("pdev id %d null pdev",
|
|
|
|
+ TGT_WMI_PDEV_ID_SOC);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return pdev;
|
|
|
|
+}
|
|
|
|
+#else
|
|
|
|
+static struct wlan_objmgr_pdev *target_if_dfs_get_pdev(
|
|
|
|
+ struct wlan_objmgr_psoc *psoc, uint8_t id,
|
|
|
|
+ wlan_objmgr_ref_dbgid dbg_id)
|
|
|
|
+{
|
|
|
|
+ return wlan_objmgr_get_pdev_by_id(psoc, id, dbg_id);
|
|
|
|
+}
|
|
|
|
+#endif
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* target_if_dfs_radar_detection_event_handler() - Indicate RADAR detection and
|
|
* target_if_dfs_radar_detection_event_handler() - Indicate RADAR detection and
|
|
* process RADAR detection.
|
|
* process RADAR detection.
|
|
@@ -233,9 +270,9 @@ static int target_if_dfs_radar_detection_event_handler(
|
|
return -EFAULT;
|
|
return -EFAULT;
|
|
}
|
|
}
|
|
|
|
|
|
- pdev = wlan_objmgr_get_pdev_by_id(psoc, radar.pdev_id, WLAN_DFS_ID);
|
|
|
|
|
|
+ pdev = target_if_dfs_get_pdev(psoc, radar.pdev_id, WLAN_DFS_ID);
|
|
if (!pdev) {
|
|
if (!pdev) {
|
|
- target_if_err("null pdev");
|
|
|
|
|
|
+ target_if_err("pdev id %d null pdev", radar.pdev_id);
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
}
|
|
}
|
|
|
|
|