|
@@ -1,5 +1,5 @@
|
|
|
/*
|
|
|
- * Copyright (c) 2016-2020 The Linux Foundation. All rights reserved.
|
|
|
+ * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved.
|
|
|
*
|
|
|
* Permission to use, copy, modify, and/or distribute this software for
|
|
|
* any purpose with or without fee is hereby granted, provided that the
|
|
@@ -30,6 +30,7 @@
|
|
|
#include "wlan_objmgr_pdev_obj.h"
|
|
|
#include "wlan_objmgr_vdev_obj.h"
|
|
|
#include "nan_ucfg_api.h"
|
|
|
+#include <wlan_mlme_api.h>
|
|
|
|
|
|
static QDF_STATUS nan_psoc_obj_created_notification(
|
|
|
struct wlan_objmgr_psoc *psoc, void *arg_list)
|
|
@@ -408,3 +409,24 @@ QDF_STATUS nan_psoc_disable(struct wlan_objmgr_psoc *psoc)
|
|
|
|
|
|
return QDF_STATUS_SUCCESS;
|
|
|
}
|
|
|
+
|
|
|
+bool wlan_is_nan_allowed_on_freq(struct wlan_objmgr_pdev *pdev, uint32_t freq)
|
|
|
+{
|
|
|
+ bool nan_allowed = true;
|
|
|
+
|
|
|
+ /* Check for SRD channels */
|
|
|
+ if (wlan_reg_is_etsi13_srd_chan_for_freq(pdev, freq))
|
|
|
+ wlan_mlme_get_srd_master_mode_for_vdev(wlan_pdev_get_psoc(pdev),
|
|
|
+ QDF_NAN_DISC_MODE,
|
|
|
+ &nan_allowed);
|
|
|
+
|
|
|
+ /* Check for Indoor channels */
|
|
|
+ if (wlan_reg_is_freq_indoor(pdev, freq))
|
|
|
+ wlan_mlme_get_indoor_support_for_nan(wlan_pdev_get_psoc(pdev),
|
|
|
+ &nan_allowed);
|
|
|
+ /* Check for dfs only if channel is not indoor */
|
|
|
+ else if (wlan_reg_is_dfs_for_freq(pdev, freq))
|
|
|
+ nan_allowed = false;
|
|
|
+
|
|
|
+ return nan_allowed;
|
|
|
+}
|