|
@@ -0,0 +1,170 @@
|
|
|
+/*
|
|
|
+ * Copyright (c) 2017 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
|
|
|
+ * above copyright notice and this permission notice appear in all
|
|
|
+ * copies.
|
|
|
+ *
|
|
|
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
|
|
|
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
|
|
|
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
|
|
|
+ * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
|
|
|
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
|
|
|
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
|
|
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
|
+ * PERFORMANCE OF THIS SOFTWARE.
|
|
|
+ */
|
|
|
+
|
|
|
+/**
|
|
|
+ * DOC: wlan_reg_services_api.h
|
|
|
+ * This file provides prototypes of the routines needed for the
|
|
|
+ * external components to utilize the services provided by the
|
|
|
+ * regulatory component.
|
|
|
+ */
|
|
|
+
|
|
|
+#include "qdf_types.h"
|
|
|
+#include "qdf_trace.h"
|
|
|
+#include "wlan_objmgr_cmn.h"
|
|
|
+#include "wlan_objmgr_global_obj.h"
|
|
|
+#include "wlan_objmgr_psoc_obj.h"
|
|
|
+
|
|
|
+enum channel_state {
|
|
|
+ CHANNEL_STATE_DISABLE,
|
|
|
+ CHANNEL_STATE_PASSIVE,
|
|
|
+ CHANNEL_STATE_DFS,
|
|
|
+ CHANNEL_STATE_ENABLE,
|
|
|
+ CHANNEL_STATE_INVALID,
|
|
|
+};
|
|
|
+
|
|
|
+enum phy_ch_width {
|
|
|
+ CH_WIDTH_20MHZ = 0,
|
|
|
+ CH_WIDTH_40MHZ,
|
|
|
+ CH_WIDTH_80MHZ,
|
|
|
+ CH_WIDTH_160MHZ,
|
|
|
+ CH_WIDTH_80P80MHZ,
|
|
|
+ CH_WIDTH_5MHZ,
|
|
|
+ CH_WIDTH_10MHZ,
|
|
|
+ CH_WIDTH_INVALID,
|
|
|
+ CH_WIDTH_MAX
|
|
|
+};
|
|
|
+
|
|
|
+/**
|
|
|
+ * struct ch_params
|
|
|
+ * @ch_width: channel width
|
|
|
+ * @sec_ch_offset: secondary channel offset
|
|
|
+ * @center_freq_seg0: center freq for segment 0
|
|
|
+ * @center_freq_seg1: center freq for segment 1
|
|
|
+ */
|
|
|
+struct ch_params {
|
|
|
+ enum phy_ch_width ch_width;
|
|
|
+ uint8_t sec_ch_offset;
|
|
|
+ uint8_t center_freq_seg0;
|
|
|
+ uint8_t center_freq_seg1;
|
|
|
+};
|
|
|
+
|
|
|
+struct regulatory_channel {
|
|
|
+ enum channel_state state;
|
|
|
+ uint32_t chan_flags;
|
|
|
+ uint32_t tx_power;
|
|
|
+};
|
|
|
+
|
|
|
+struct channel_power {
|
|
|
+ uint32_t chan_num;
|
|
|
+ uint32_t tx_power;
|
|
|
+};
|
|
|
+
|
|
|
+struct chan_map {
|
|
|
+ uint32_t center_freq;
|
|
|
+ uint32_t chan_num;
|
|
|
+};
|
|
|
+
|
|
|
+/**
|
|
|
+ * enum dfs_region - DFS region
|
|
|
+ * @DFS_UNINIT_REGION: un-initialized region
|
|
|
+ * @DFS_FCC_REGION: FCC region
|
|
|
+ * @DFS_ETSI_REGION: ETSI region
|
|
|
+ * @DFS_MKK_REGION: MKK region
|
|
|
+ * @DFS_CN_REGION: China region
|
|
|
+ * @DFS_KR_REGION: Korea region
|
|
|
+ * @DFS_UNDEF_REGION: Undefined region
|
|
|
+ */
|
|
|
+enum dfs_region {
|
|
|
+ DFS_UNINIT_REGION = 0,
|
|
|
+ DFS_FCC_REGION = 1,
|
|
|
+ DFS_ETSI_REGION = 2,
|
|
|
+ DFS_MKK_REGION = 3,
|
|
|
+ DFS_CN_REGION = 4,
|
|
|
+ DFS_KR_REGION = 5,
|
|
|
+ DFS_UNDEF_REGION
|
|
|
+};
|
|
|
+
|
|
|
+/**
|
|
|
+ * wlan_reg_get_channel_list_with_power() - Provide the channel list with power
|
|
|
+ * @ch_list: pointer to the channel list.
|
|
|
+ *
|
|
|
+ * Return: QDF_STATUS
|
|
|
+ */
|
|
|
+QDF_STATUS wlan_reg_get_channel_list_with_power(
|
|
|
+ struct regulatory_channel *ch_list);
|
|
|
+
|
|
|
+/**
|
|
|
+ * wlan_reg_read_default_country() - Read the default country for the regdomain
|
|
|
+ * @country: pointer to the country code.
|
|
|
+ *
|
|
|
+ * Return: None
|
|
|
+ */
|
|
|
+void wlan_reg_read_default_country(uint8_t *country);
|
|
|
+
|
|
|
+/**
|
|
|
+ * wlan_reg_get_channel_state() - Get channel state from regulatory
|
|
|
+ * @ch: channel number.
|
|
|
+ *
|
|
|
+ * Return: channel state
|
|
|
+ */
|
|
|
+enum channel_state wlan_reg_get_channel_state(uint8_t ch);
|
|
|
+
|
|
|
+/**
|
|
|
+ * wlan_reg_get_5g_bonded_channel_state() - Get 5G bonded channel state
|
|
|
+ * @ch: channel number.
|
|
|
+ * @bw: channel band width
|
|
|
+ *
|
|
|
+ * Return: channel state
|
|
|
+ */
|
|
|
+enum channel_state wlan_reg_get_5g_bonded_channel_state(uint8_t ch,
|
|
|
+ uint8_t bw);
|
|
|
+
|
|
|
+/**
|
|
|
+ * wlan_reg_get_2g_bonded_channel_state() - Get 2G bonded channel state
|
|
|
+ * @ch: channel number.
|
|
|
+ * @bw: channel band width
|
|
|
+ *
|
|
|
+ * Return: channel state
|
|
|
+ */
|
|
|
+enum channel_state wlan_reg_get_2g_bonded_channel_state(uint8_t ch,
|
|
|
+ uint8_t bw);
|
|
|
+
|
|
|
+/**
|
|
|
+ * wlan_reg_set_channel_params () - Sets channel parameteres for given bandwidth
|
|
|
+ * @ch: channel number.
|
|
|
+ * @ch_params: pointer to the channel parameters.
|
|
|
+ *
|
|
|
+ * Return: None
|
|
|
+ */
|
|
|
+void wlan_reg_set_channel_params(uint8_t ch, struct ch_params *ch_params);
|
|
|
+
|
|
|
+/**
|
|
|
+ * wlan_reg_get_dfs_region () - Get the current dfs region
|
|
|
+ * @dfs_reg: pointer to dfs region
|
|
|
+ *
|
|
|
+ * Return: None
|
|
|
+ */
|
|
|
+void wlan_reg_get_dfs_region(enum dfs_region *dfs_reg);
|
|
|
+
|
|
|
+/**
|
|
|
+ * wlan_reg_is_dfs_ch () - Checks the channel state for DFS
|
|
|
+ * @ch: channel
|
|
|
+ *
|
|
|
+ * Return: true or false
|
|
|
+ */
|
|
|
+bool wlan_reg_is_dfs_ch(uint8_t ch);
|