qcacmn: Add common, build_chan_list and priv_objs regdb files

Create below regdb files in core component and move the code from
reg_services.c file.

These files has the common code used by both WIN and MCL.

reg_common_services.c: this file has regdb common APIs used by both WIN and
MCL.
reg_build_chan_list.c: this file has APIs to build master and current
channel list.
reg_priv_objs.c: this file has the APIs to create regulatory private PSOC
and pdev objects.

Change-Id: I891b14fac7a4eddf2697d2ecdc0ac4a82046f532
CRs-Fixed: 2349173
这个提交包含在:
Shashikala Prabhu
2018-12-21 18:08:38 +05:30
提交者 nshrivas
父节点 65572e5538
当前提交 c8c709f6d4
修改 18 个文件,包含 4338 行新增243 行删除

查看文件

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
* Copyright (c) 2017-2019 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
@@ -24,9 +24,6 @@
#ifndef __REG_SERVICES_PUBLIC_STRUCT_H_
#define __REG_SERVICES_PUBLIC_STRUCT_H_
#include "../../core/src/reg_db.h"
#include "wlan_cmn.h"
#define REG_SBS_SEPARATION_THRESHOLD 100
#define REG_MAX_CHANNELS_PER_OPERATING_CLASS 25
#define REG_MAX_SUPP_OPER_CLASSES 32
@@ -35,6 +32,47 @@
#define INVALID_VDEV_ID 0xFF
#define INVALID_CHANNEL_NUM 0xBAD
#define CH_AVOID_MAX_RANGE 4
#define REG_ALPHA2_LEN 2
#define MAX_REG_RULES 10
#define REGULATORY_CHAN_DISABLED BIT(0)
#define REGULATORY_CHAN_NO_IR BIT(1)
#define REGULATORY_CHAN_RADAR BIT(3)
#define REGULATORY_CHAN_NO_OFDM BIT(6)
#define REGULATORY_CHAN_INDOOR_ONLY BIT(9)
#define REGULATORY_CHAN_NO_HT40 BIT(4)
#define REGULATORY_CHAN_NO_80MHZ BIT(7)
#define REGULATORY_CHAN_NO_160MHZ BIT(8)
#define REGULATORY_CHAN_NO_20MHZ BIT(11)
#define REGULATORY_CHAN_NO_10MHZ BIT(12)
#define REGULATORY_PHYMODE_NO11A BIT(0)
#define REGULATORY_PHYMODE_NO11B BIT(1)
#define REGULATORY_PHYMODE_NO11G BIT(2)
#define REGULATORY_CHAN_NO11N BIT(3)
#define REGULATORY_PHYMODE_NO11AC BIT(4)
#define REGULATORY_PHYMODE_NO11AX BIT(5)
/**
* enum dfs_reg - 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_reg {
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 = 0xFFFF,
};
#ifdef CONFIG_LEGACY_CHAN_ENUM

查看文件

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
* Copyright (c) 2017-2019 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
@@ -26,46 +26,137 @@
#ifndef __WLAN_REG_SERVICES_API_H
#define __WLAN_REG_SERVICES_API_H
#include "../../core/src/reg_services.h"
#include <reg_services_public_struct.h>
/**
* wlan_reg_min_24ghz_ch_num() - Get minimum 2.4GHz channel number
*
* Return: Minimum 2.4GHz channel number
*/
#define WLAN_REG_MIN_24GHZ_CH_NUM wlan_reg_min_24ghz_ch_num()
uint32_t wlan_reg_min_24ghz_ch_num(void);
/**
* wlan_reg_max_24ghz_ch_num() - Get maximum 2.4GHz channel number
*
* Return: Maximum 2.4GHz channel number
*/
#define WLAN_REG_MAX_24GHZ_CH_NUM wlan_reg_max_24ghz_ch_num()
uint32_t wlan_reg_max_24ghz_ch_num(void);
#define WLAN_REG_MIN_24GHZ_CH_NUM REG_MIN_24GHZ_CH_NUM
#define WLAN_REG_MAX_24GHZ_CH_NUM REG_MAX_24GHZ_CH_NUM
#define WLAN_REG_MIN_5GHZ_CH_NUM REG_MIN_5GHZ_CH_NUM
#define WLAN_REG_MAX_5GHZ_CH_NUM REG_MAX_5GHZ_CH_NUM
/**
* wlan_reg_min_5ghz_ch_num() - Get minimum 5GHz channel number
*
* Return: Minimum 5GHz channel number
*/
#define WLAN_REG_MIN_5GHZ_CH_NUM wlan_reg_min_5ghz_ch_num()
uint32_t wlan_reg_min_5ghz_ch_num(void);
#define WLAN_REG_IS_24GHZ_CH(chan) REG_IS_24GHZ_CH(chan)
#define WLAN_REG_IS_5GHZ_CH(chan) REG_IS_5GHZ_CH(chan)
/**
* wlan_reg_max_5ghz_ch_num() - Get maximum 5GHz channel number
*
* Return: Maximum 5GHz channel number
*/
#define WLAN_REG_MAX_5GHZ_CH_NUM wlan_reg_max_5ghz_ch_num()
uint32_t wlan_reg_max_5ghz_ch_num(void);
#define WLAN_REG_IS_24GHZ_CH_FREQ(freq) REG_IS_24GHZ_CH_FREQ(freq)
#define WLAN_REG_IS_5GHZ_CH_FREQ(freq) REG_IS_5GHZ_FREQ(freq)
/**
* wlan_reg_is_24ghz_ch() - Check if the given channel number is 2.4GHz
* @chan: Channel number
*
* Return: true if channel number is 2.4GHz, else false
*/
#define WLAN_REG_IS_24GHZ_CH(chan) wlan_reg_is_24ghz_ch(chan)
bool wlan_reg_is_24ghz_ch(uint32_t chan);
/**
* wlan_reg_is_5ghz_ch() - Check if the given channel number is 5GHz
* @chan: Channel number
*
* Return: true if channel number is 5GHz, else false
*/
#define WLAN_REG_IS_5GHZ_CH(chan) wlan_reg_is_5ghz_ch(chan)
bool wlan_reg_is_5ghz_ch(uint32_t chan);
/**
* wlan_reg_is_24ghz_ch_freq() - Check if the given channel frequency is 2.4GHz
* @freq: Channel frequency
*
* Return: true if channel frequency is 2.4GHz, else false
*/
#define WLAN_REG_IS_24GHZ_CH_FREQ(freq) wlan_reg_is_24ghz_ch_freq(freq)
bool wlan_reg_is_24ghz_ch_freq(uint32_t freq);
/**
* wlan_reg_is_5ghz_ch_freq() - Check if the given channel frequency is 5GHz
* @freq: Channel frequency
*
* Return: true if channel frequency is 5GHz, else false
*/
#define WLAN_REG_IS_5GHZ_CH_FREQ(freq) wlan_reg_is_5ghz_ch_freq(freq)
bool wlan_reg_is_5ghz_ch_freq(uint32_t freq);
#ifndef CONFIG_LEGACY_CHAN_ENUM
#define WLAN_REG_IS_49GHZ_FREQ(freq) REG_IS_49GHZ_FREQ(freq)
/**
* wlan_reg_is_49ghz_freq() - Check if the given channel frequency is 4.9GHz
* @freq: Channel frequency
*
* Return: true if channel frequency is 4.9GHz, else false
*/
#define WLAN_REG_IS_49GHZ_FREQ(freq) wlan_reg_is_49ghz_freq(freq)
bool wlan_reg_is_49ghz_freq(uint32_t freq);
#endif
#define WLAN_REG_CH_NUM(ch_enum) REG_CH_NUM(ch_enum)
#define WLAN_REG_CH_TO_FREQ(ch_enum) REG_CH_TO_FREQ(ch_enum)
/**
* wlan_reg_ch_num() - Get channel number from channel enum
* @ch_enum: Channel enum
*
* Return: channel number
*/
#define WLAN_REG_CH_NUM(ch_enum) wlan_reg_ch_num(ch_enum)
uint32_t wlan_reg_ch_num(uint32_t ch_enum);
/**
* wlan_reg_ch_to_freq() - Get channel frequency from channel enum
* @ch_enum: Channel enum
*
* Return: channel frequency
*/
#define WLAN_REG_CH_TO_FREQ(ch_enum) wlan_reg_ch_to_freq(ch_enum)
uint32_t wlan_reg_ch_to_freq(uint32_t ch_enum);
/**
* wlan_reg_is_same_band_channels() - Check if given channel numbers have same
* band
* @chan_num1: Channel number1
* @chan_num2: Channel number2
*
* Return: true if both the channels has the same band.
*/
#define WLAN_REG_IS_SAME_BAND_CHANNELS(chan_num1, chan_num2) \
(chan_num1 && chan_num2 && \
(WLAN_REG_IS_5GHZ_CH(chan_num1) == WLAN_REG_IS_5GHZ_CH(chan_num2)))
wlan_reg_is_same_band_channels(chan_num1, chan_num2)
bool wlan_reg_is_same_band_channels(uint32_t chan_num1, uint32_t chan_num2);
/**
* wlan_reg_is_channel_valid_5g_sbs() Check if the given channel is 5G SBS.
* @curchan: current channel
* @newchan:new channel
*
* Return: true if the given channel is a valid 5G SBS
*/
#define WLAN_REG_IS_CHANNEL_VALID_5G_SBS(curchan, newchan) \
(curchan > newchan ? \
REG_CH_TO_FREQ(reg_get_chan_enum(curchan)) \
- REG_CH_TO_FREQ(reg_get_chan_enum(newchan)) \
> REG_SBS_SEPARATION_THRESHOLD : \
REG_CH_TO_FREQ(reg_get_chan_enum(newchan)) \
- REG_CH_TO_FREQ(reg_get_chan_enum(curchan)) \
> REG_SBS_SEPARATION_THRESHOLD)
wlan_reg_is_channel_valid_5g_sbs(curchan, newchan)
bool wlan_reg_is_channel_valid_5g_sbs(uint32_t curchan, uint32_t newchan);
#define WLAN_REG_INVALID_CHANNEL_ID
#define WLAN_REG_GET_24_END_CHAN_NUM 14
#define WLAN_REG_CHAN_TO_BAND(chan_num) reg_chan_to_band(chan_num)
/**
* wlan_reg_chan_to_band() - Get band from channel number
* @chan_num: channel number
*
* Return: band info
*/
#define WLAN_REG_CHAN_TO_BAND(chan_num) wlan_reg_chan_to_band(chan_num)
enum band_info wlan_reg_chan_to_band(uint32_t chan_num);
/**
* wlan_reg_get_channel_list_with_power() - Provide the channel list with power
@@ -86,6 +177,7 @@ QDF_STATUS wlan_reg_get_channel_list_with_power(struct wlan_objmgr_pdev *pdev,
QDF_STATUS wlan_reg_read_default_country(struct wlan_objmgr_psoc *psoc,
uint8_t *country);
#ifdef CONFIG_MCL_REGDB
/**
* wlan_reg_read_current_country() - Read the current country for the regdomain
* @country: pointer to the country code.
@@ -95,15 +187,6 @@ QDF_STATUS wlan_reg_read_default_country(struct wlan_objmgr_psoc *psoc,
QDF_STATUS wlan_reg_read_current_country(struct wlan_objmgr_psoc *psoc,
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(struct wlan_objmgr_pdev *pdev,
uint32_t ch);
/**
* wlan_reg_chan_has_dfs_attribute() - check channel has dfs attribute flag
* @ch: channel number.
@@ -115,6 +198,61 @@ enum channel_state wlan_reg_get_channel_state(struct wlan_objmgr_pdev *pdev,
bool
wlan_reg_chan_has_dfs_attribute(struct wlan_objmgr_pdev *pdev, uint32_t ch);
/**
* wlan_reg_is_etsi13_srd_chan () - Checks if the ch is ETSI13 srd ch or not
* @pdev: pdev ptr
* @chan_num: channel
*
* Return: true or false
*/
bool wlan_reg_is_etsi13_srd_chan(struct wlan_objmgr_pdev *pdev,
uint8_t chan_num);
/**
* wlan_reg_is_etsi13_regdmn() - Checks if current reg domain is ETSI13 or not
* @pdev: pdev ptr
*
* Return: true or false
*/
bool wlan_reg_is_etsi13_regdmn(struct wlan_objmgr_pdev *pdev);
/**
* wlan_reg_is_etsi13_srd_chan_allowed_master_mode() - Checks if regdmn is
* ETSI13 and SRD channels are allowed in master mode or not.
*
* @pdev: pdev ptr
*
* Return: true or false
*/
bool wlan_reg_is_etsi13_srd_chan_allowed_master_mode(struct wlan_objmgr_pdev
*pdev);
#endif
/**
* wlan_reg_is_world() - reg is world mode
* @country: The country information
*
* Return: true or false
*/
bool wlan_reg_is_world(uint8_t *country);
/**
* wlan_reg_get_chan_enum() - Get channel enum for given channel number
* @chan_num: Channel number
*
* Return: Channel enum
*/
enum channel_enum wlan_reg_get_chan_enum(uint32_t chan_num);
/**
* wlan_reg_get_channel_state() - Get channel state from regulatory
* @ch: channel number.
*
* Return: channel state
*/
enum channel_state wlan_reg_get_channel_state(struct wlan_objmgr_pdev *pdev,
uint32_t ch);
/**
* wlan_reg_get_5g_bonded_channel_state() - Get 5G bonded channel state
* @pdev: The physical dev to program country code or regdomain
@@ -354,35 +492,6 @@ bool wlan_reg_is_dfs_ch(struct wlan_objmgr_pdev *pdev, uint32_t chan);
*/
bool wlan_reg_is_dsrc_chan(struct wlan_objmgr_pdev *pdev, uint8_t chan_num);
/**
* wlan_reg_is_etsi13_srd_chan () - Checks if the ch is ETSI13 srd ch or not
* @pdev: pdev ptr
* @chan_num: channel
*
* Return: true or false
*/
bool wlan_reg_is_etsi13_srd_chan(struct wlan_objmgr_pdev *pdev,
uint8_t chan_num);
/**
* wlan_reg_is_etsi13_regdmn() - Checks if current reg domain is ETSI13 or not
* @pdev: pdev ptr
*
* Return: true or false
*/
bool wlan_reg_is_etsi13_regdmn(struct wlan_objmgr_pdev *pdev);
/**
* wlan_reg_is_etsi13_srd_chan_allowed_master_mode() - Checks if regdmn is
* ETSI13 and SRD channels are allowed in master mode or not.
*
* @pdev: pdev ptr
*
* Return: true or false
*/
bool wlan_reg_is_etsi13_srd_chan_allowed_master_mode(struct wlan_objmgr_pdev
*pdev);
/**
* wlan_reg_is_passive_or_disable_ch () - Checks chan state for passive
* and disabled
@@ -421,13 +530,6 @@ uint32_t wlan_reg_freq_to_chan(struct wlan_objmgr_pdev *pdev,
*/
uint32_t wlan_reg_chan_to_freq(struct wlan_objmgr_pdev *pdev,
uint32_t chan);
/**
* wlan_reg_is_world() - reg is world mode
* @country: The country information
*
* Return: true or false
*/
bool wlan_reg_is_world(uint8_t *country);
/**
* wlan_reg_is_us() - reg is us country
@@ -477,8 +579,7 @@ QDF_STATUS wlan_reg_set_11d_country(struct wlan_objmgr_pdev *pdev,
* Return: true or false
*/
void wlan_reg_register_chan_change_callback(struct wlan_objmgr_psoc *psoc,
reg_chan_change_callback cbk,
void *arg);
void *cbk, void *arg);
/**
* wlan_reg_unregister_chan_change_callback () - remove chan change cbk
@@ -488,7 +589,7 @@ void wlan_reg_register_chan_change_callback(struct wlan_objmgr_psoc *psoc,
* Return: true or false
*/
void wlan_reg_unregister_chan_change_callback(struct wlan_objmgr_psoc *psoc,
reg_chan_change_callback cbk);
void *cbk);
/**
* wlan_reg_is_11d_offloaded() - 11d offloaded supported

查看文件

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017 The Linux Foundation. All rights reserved.
* Copyright (c) 2017-2019 The Linux Foundation. All rights reserved.
*
*
* Permission to use, copy, modify, and/or distribute this software for
@@ -26,10 +26,6 @@
#ifndef __WLAN_REG_TGT_API_H
#define __WLAN_REG_TGT_API_H
#include <qdf_types.h>
#include <qdf_status.h>
#include <reg_services_public_struct.h>
QDF_STATUS tgt_reg_process_master_chan_list(struct cur_regulatory_info
*reg_info);

查看文件

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
* Copyright (c) 2017-2019 The Linux Foundation. All rights reserved.
*
*
* Permission to use, copy, modify, and/or distribute this software for
@@ -26,11 +26,6 @@
#ifndef __WLAN_REG_UCFG_API_H
#define __WLAN_REG_UCFG_API_H
#include <qdf_types.h>
#include <qdf_status.h>
#include "../../core/src/reg_services.h"
#include <reg_services_public_struct.h>
typedef QDF_STATUS (*reg_event_cb)(void *status_struct);
/**
@@ -274,8 +269,7 @@ QDF_STATUS ucfg_reg_get_regd_rules(struct wlan_objmgr_pdev *pdev,
* Return: void
*/
void ucfg_reg_register_chan_change_callback(struct wlan_objmgr_psoc *psoc,
reg_chan_change_callback cbk,
void *arg);
void *cbk, void *arg);
/**
* ucfg_reg_unregister_chan_change_callback () - remove chan change cbk
@@ -285,7 +279,7 @@ void ucfg_reg_register_chan_change_callback(struct wlan_objmgr_psoc *psoc,
* Return: void
*/
void ucfg_reg_unregister_chan_change_callback(struct wlan_objmgr_psoc *psoc,
reg_chan_change_callback cbk);
void *cbk);
/**
* ucfg_reg_get_cc_and_src () - get country code and src

查看文件

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
* Copyright (c) 2017-2019 The Linux Foundation. All rights reserved.
*
*
* Permission to use, copy, modify, and/or distribute this software for
@@ -25,10 +25,21 @@
#include <qdf_status.h>
#include <qdf_types.h>
#include <wlan_cmn.h>
#include <reg_services_public_struct.h>
#include <wlan_reg_services_api.h>
#include "../../core/src/reg_services.h"
#include "../../core/src/reg_priv.h"
#include <wlan_objmgr_psoc_obj.h>
#include <wlan_objmgr_pdev_obj.h>
#include "../../core/src/reg_priv_objs.h"
#include "../../core/src/reg_getset.h"
#include "../../core/src/reg_services_common.h"
#include "../../core/src/reg_db.h"
#include "../../core/src/reg_db_parser.h"
#include <../../core/src/reg_build_chan_list.h>
#include <../../core/src/reg_opclass.h>
#include <../../core/src/reg_callbacks.h>
#include <../../core/src/reg_host_11d.h>
#include <wlan_objmgr_global_obj.h>
/**
* wlan_reg_get_channel_list_with_power() - Provide the channel list with power
@@ -510,17 +521,18 @@ bool wlan_reg_is_us(uint8_t *country)
}
void wlan_reg_register_chan_change_callback(struct wlan_objmgr_psoc *psoc,
reg_chan_change_callback cbk,
void *arg)
void *cbk, void *arg)
{
reg_register_chan_change_callback(psoc, cbk, arg);
reg_register_chan_change_callback(psoc, (reg_chan_change_callback)cbk,
arg);
}
void wlan_reg_unregister_chan_change_callback(struct wlan_objmgr_psoc *psoc,
reg_chan_change_callback cbk)
void *cbk)
{
reg_unregister_chan_change_callback(psoc, cbk);
reg_unregister_chan_change_callback(psoc,
(reg_chan_change_callback)cbk);
}
bool wlan_reg_is_11d_offloaded(struct wlan_objmgr_psoc *psoc)
@@ -613,3 +625,86 @@ QDF_STATUS wlan_reg_get_curr_regdomain(struct wlan_objmgr_pdev *pdev,
{
return reg_get_curr_regdomain(pdev, cur_regdmn);
}
uint32_t wlan_reg_min_24ghz_ch_num(void)
{
return reg_min_24ghz_ch_num();
}
uint32_t wlan_reg_max_24ghz_ch_num(void)
{
return reg_max_24ghz_ch_num();
}
uint32_t wlan_reg_min_5ghz_ch_num(void)
{
return reg_min_5ghz_ch_num();
}
uint32_t wlan_reg_max_5ghz_ch_num(void)
{
return reg_max_5ghz_ch_num();
}
bool wlan_reg_is_24ghz_ch(uint32_t chan)
{
return reg_is_24ghz_ch(chan);
}
bool wlan_reg_is_5ghz_ch(uint32_t chan)
{
return reg_is_5ghz_ch(chan);
}
bool wlan_reg_is_24ghz_ch_freq(uint32_t freq)
{
return reg_is_24ghz_ch_freq(freq);
}
bool wlan_reg_is_5ghz_ch_freq(uint32_t freq)
{
return reg_is_5ghz_ch_freq(freq);
}
#ifndef CONFIG_LEGACY_CHAN_ENUM
bool wlan_reg_is_49ghz_freq(uint32_t freq)
{
return reg_is_49ghz_freq(freq);
}
#endif
uint32_t wlan_reg_ch_num(uint32_t ch_enum)
{
return reg_ch_num(ch_enum);
}
uint32_t wlan_reg_ch_to_freq(uint32_t ch_enum)
{
return reg_ch_to_freq(ch_enum);
}
bool wlan_reg_is_same_band_channels(uint32_t chan_num1, uint32_t chan_num2)
{
return reg_is_same_band_channels(chan_num1, chan_num2);
}
bool wlan_reg_is_channel_valid_5g_sbs(uint32_t curchan, uint32_t newchan)
{
return reg_is_channel_valid_5g_sbs(curchan, newchan);
}
enum band_info wlan_reg_chan_to_band(uint32_t chan_num)
{
return reg_chan_to_band(chan_num);
}
/**
* wlan_reg_get_chan_enum() - Get channel enum for given channel number
* @chan_num: Channel number
*
* Return: Channel enum
*/
enum channel_enum wlan_reg_get_chan_enum(uint32_t chan_num)
{
return reg_get_chan_enum(chan_num);
}

查看文件

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017 The Linux Foundation. All rights reserved.
* Copyright (c) 2017-2019 The Linux Foundation. All rights reserved.
*
*
* Permission to use, copy, modify, and/or distribute this software for
@@ -24,8 +24,16 @@
#include <qdf_status.h>
#include <qdf_types.h>
#include <wlan_cmn.h>
#include <reg_services_public_struct.h>
#include <wlan_reg_tgt_api.h>
#include "../../core/src/reg_services.h"
#include <wlan_objmgr_psoc_obj.h>
#include <../../core/src/reg_priv_objs.h>
#include <../../core/src/reg_getset.h>
#include <../../core/src/reg_services_common.h>
#include <../../core/src/reg_lte.h>
#include <../../core/src/reg_build_chan_list.h>
#include <../../core/src/reg_host_11d.h>
/**
* tgt_process_master_chan_list() - process master channel list

查看文件

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
* Copyright (c) 2017-2019 The Linux Foundation. All rights reserved.
*
*
* Permission to use, copy, modify, and/or distribute this software for
@@ -22,8 +22,16 @@
* @brief contains regulatory user config interface definations
*/
#include <wlan_objmgr_vdev_obj.h>
#include <wlan_reg_ucfg_api.h>
#include "../../core/src/reg_services.h"
#include <wlan_objmgr_psoc_obj.h>
#include <../../core/src/reg_priv_objs.h>
#include <../../core/src/reg_getset.h>
#include <../../core/src/reg_services_common.h>
#include <../../core/src/reg_lte.h>
#include <../../core/src/reg_host_11d.h>
#include <../../core/src/reg_build_chan_list.h>
#include <../../core/src/reg_callbacks.h>
#include <qdf_module.h>
QDF_STATUS ucfg_reg_register_event_handler(uint8_t vdev_id, reg_event_cb cb,
@@ -108,6 +116,7 @@ QDF_STATUS ucfg_reg_get_current_cc(struct wlan_objmgr_pdev *pdev,
return reg_get_current_cc(pdev, rd);
}
#ifdef CONFIG_MCL_REGDB
/**
* ucfg_reg_set_band() - Sets the band information for the PDEV
* @pdev: The physical pdev to set the band for
@@ -134,30 +143,6 @@ QDF_STATUS ucfg_reg_notify_sap_event(struct wlan_objmgr_pdev *pdev,
return reg_notify_sap_event(pdev, sap_state);
}
#ifdef DISABLE_CHANNEL_LIST
/**
* ucfg_reg_cache_channel_state() - Cache the current state of the channles
* @pdev: The physical dev to cache the channels for
* @channel_list: List of the channels for which states needs to be cached
* @num_channels: Number of channels in the list
*
*/
void ucfg_reg_cache_channel_state(struct wlan_objmgr_pdev *pdev,
uint32_t *channel_list, uint32_t num_channels)
{
reg_cache_channel_state(pdev, channel_list, num_channels);
}
/**
* ucfg_reg_restore_cached_channels() - Cache the current state of the channles
* @pdev: The physical dev to cache the channels for
*/
void ucfg_reg_restore_cached_channels(struct wlan_objmgr_pdev *pdev)
{
reg_restore_cached_channels(pdev);
}
#endif
/**
* ucfg_reg_set_fcc_constraint() - apply fcc constraints on channels 12/13
* @pdev: The physical pdev to reduce tx power for
@@ -173,25 +158,12 @@ QDF_STATUS ucfg_reg_set_fcc_constraint(struct wlan_objmgr_pdev *pdev,
return reg_set_fcc_constraint(pdev, fcc_constraint);
}
/**
* ucfg_reg_get_default_country() - Get the default regulatory country
* @psoc: The physical SoC to get default country from
* @country_code: the buffer to populate the country code into
*
* Return: QDF_STATUS
*/
QDF_STATUS ucfg_reg_get_default_country(struct wlan_objmgr_psoc *psoc,
uint8_t *country_code)
{
return reg_read_default_country(psoc, country_code);
}
QDF_STATUS ucfg_reg_get_current_country(struct wlan_objmgr_psoc *psoc,
uint8_t *country_code)
{
return reg_read_current_country(psoc, country_code);
}
/**
* ucfg_reg_set_default_country() - Set the default regulatory country
* @psoc: The physical SoC to set default country for
@@ -204,6 +176,20 @@ QDF_STATUS ucfg_reg_set_default_country(struct wlan_objmgr_psoc *psoc,
{
return reg_set_default_country(psoc, country);
}
#endif
/**
* ucfg_reg_get_default_country() - Get the default regulatory country
* @psoc: The physical SoC to get default country from
* @country_code: the buffer to populate the country code into
*
* Return: QDF_STATUS
*/
QDF_STATUS ucfg_reg_get_default_country(struct wlan_objmgr_psoc *psoc,
uint8_t *country_code)
{
return reg_read_default_country(psoc, country_code);
}
/**
* ucfg_reg_set_country() - Set the current regulatory country
@@ -249,16 +235,17 @@ QDF_STATUS ucfg_reg_get_curr_band(struct wlan_objmgr_pdev *pdev,
}
void ucfg_reg_register_chan_change_callback(struct wlan_objmgr_psoc *psoc,
reg_chan_change_callback cbk,
void *arg)
void *cbk, void *arg)
{
reg_register_chan_change_callback(psoc, cbk, arg);
reg_register_chan_change_callback(psoc, (reg_chan_change_callback)cbk,
arg);
}
void ucfg_reg_unregister_chan_change_callback(struct wlan_objmgr_psoc *psoc,
reg_chan_change_callback cbk)
void *cbk)
{
reg_unregister_chan_change_callback(psoc, cbk);
reg_unregister_chan_change_callback(psoc,
(reg_chan_change_callback)cbk);
}
enum country_src ucfg_reg_get_cc_and_src(struct wlan_objmgr_psoc *psoc,
@@ -298,3 +285,27 @@ QDF_STATUS ucfg_reg_set_hal_reg_cap(struct wlan_objmgr_psoc *psoc,
return reg_set_hal_reg_cap(psoc, hal_reg_cap, phy_cnt);
}
qdf_export_symbol(ucfg_reg_set_hal_reg_cap);
#ifdef DISABLE_CHANNEL_LIST
/**
* ucfg_reg_cache_channel_state() - Cache the current state of the channles
* @pdev: The physical dev to cache the channels for
* @channel_list: List of the channels for which states needs to be cached
* @num_channels: Number of channels in the list
*
*/
void ucfg_reg_cache_channel_state(struct wlan_objmgr_pdev *pdev,
uint32_t *channel_list, uint32_t num_channels)
{
reg_cache_channel_state(pdev, channel_list, num_channels);
}
/**
* ucfg_reg_restore_cached_channels() - Cache the current state of the channles
* @pdev: The physical dev to cache the channels for
*/
void ucfg_reg_restore_cached_channels(struct wlan_objmgr_pdev *pdev)
{
reg_restore_cached_channels(pdev);
}
#endif