qcacmn: Initialize DFS radar table based on dfsdomain
* Initialize the radar table based on dfsdomain for country KOREA and CHINA. * Move UMAC related APIs from lmac_api.c to utils_api.c file. Change-Id: I9dc2acdf23fc10469884d23bb91f352d2ac259ca CRs-Fixed: 2110760
This commit is contained in:

committed by
Nandini Suresh

szülő
b432fc0ef7
commit
41eff4f752
@@ -29,17 +29,23 @@
|
||||
#include "dfs.h"
|
||||
|
||||
/**
|
||||
* enum DFS_DOMAIN - These defines should match the table from ah_internal.h
|
||||
* @DFS_UNINIT_DOMAIN: Uninitialized dfs domain.
|
||||
* @DFS_FCC_DOMAIN: FCC3 dfs domain.
|
||||
* @DFS_ETSI_DOMAIN: ETSI dfs domain.
|
||||
* @DFS_MKK4_DOMAIN: Japan dfs domain.
|
||||
* enum DFS_DOMAIN - DFS domain
|
||||
* @DFS_UNINIT_DOMAIN: Uninitialized domain
|
||||
* @DFS_FCC_DOMAIN: FCC domain
|
||||
* @DFS_ETSI_DOMAIN: ETSI domain
|
||||
* @DFS_MKK4_DOMAIN: MKK domain
|
||||
* @DFS_CN_DOMAIN: China domain
|
||||
* @DFS_KR_DOMAIN: Korea domain
|
||||
* @DFS_UNDEF_DOMAIN: Undefined domain
|
||||
*/
|
||||
enum DFS_DOMAIN {
|
||||
DFS_UNINIT_DOMAIN = 0,
|
||||
DFS_FCC_DOMAIN = 1,
|
||||
DFS_ETSI_DOMAIN = 2,
|
||||
DFS_MKK4_DOMAIN = 3
|
||||
DFS_MKK4_DOMAIN = 3,
|
||||
DFS_CN_DOMAIN = 4,
|
||||
DFS_KR_DOMAIN = 5,
|
||||
DFS_UNDEF_DOMAIN
|
||||
};
|
||||
|
||||
/* CAPABILITY: the device support STA DFS */
|
||||
|
@@ -25,7 +25,7 @@
|
||||
*/
|
||||
#include "../dfs.h"
|
||||
#include "../dfs_internal.h"
|
||||
#include "wlan_dfs_lmac_api.h"
|
||||
#include "wlan_dfs_utils_api.h"
|
||||
|
||||
/* Default 5212/5312 radar phy parameters. */
|
||||
#define AR5212_DFS_FIRPWR -41
|
||||
@@ -167,7 +167,7 @@ void dfs_get_radars_for_ar5212(struct wlan_dfs *dfs)
|
||||
int dfsdomain = DFS_FCC_DOMAIN;
|
||||
|
||||
qdf_mem_zero(&rinfo, sizeof(rinfo));
|
||||
dfsdomain = lmac_get_dfsdomain(dfs->dfs_pdev_obj);
|
||||
dfsdomain = utils_get_dfsdomain(dfs->dfs_pdev_obj);
|
||||
|
||||
switch (dfsdomain) {
|
||||
case DFS_FCC_DOMAIN:
|
||||
|
@@ -26,7 +26,7 @@
|
||||
|
||||
#include "../dfs.h"
|
||||
#include "../dfs_internal.h"
|
||||
#include "wlan_dfs_lmac_api.h"
|
||||
#include "wlan_dfs_utils_api.h"
|
||||
|
||||
/* Default 5413/5416 radar phy parameters. */
|
||||
#define AR5416_DFS_FIRPWR -33
|
||||
@@ -110,7 +110,7 @@ void dfs_get_radars_for_ar5416(struct wlan_dfs *dfs)
|
||||
int dfsdomain = DFS_FCC_DOMAIN;
|
||||
|
||||
qdf_mem_zero(&rinfo, sizeof(rinfo));
|
||||
dfsdomain = lmac_get_dfsdomain(dfs->dfs_pdev_obj);
|
||||
dfsdomain = utils_get_dfsdomain(dfs->dfs_pdev_obj);
|
||||
|
||||
switch (dfsdomain) {
|
||||
case DFS_FCC_DOMAIN:
|
||||
|
@@ -25,6 +25,7 @@
|
||||
|
||||
#include "../dfs.h"
|
||||
#include "../dfs_internal.h"
|
||||
#include "wlan_dfs_utils_api.h"
|
||||
#include "wlan_dfs_lmac_api.h"
|
||||
|
||||
/*
|
||||
@@ -164,7 +165,7 @@ void dfs_get_radars_for_ar9300(struct wlan_dfs *dfs)
|
||||
int dfsdomain = DFS_FCC_DOMAIN;
|
||||
|
||||
qdf_mem_zero(&rinfo, sizeof(rinfo));
|
||||
dfsdomain = lmac_get_dfsdomain(dfs->dfs_pdev_obj);
|
||||
dfsdomain = utils_get_dfsdomain(dfs->dfs_pdev_obj);
|
||||
|
||||
switch (dfsdomain) {
|
||||
case DFS_FCC_DOMAIN:
|
||||
@@ -185,12 +186,15 @@ void dfs_get_radars_for_ar9300(struct wlan_dfs *dfs)
|
||||
rinfo.numradars = QDF_ARRAY_SIZE(ar9300_etsi_radars);
|
||||
rinfo.b5pulses = &ar9300_bin5pulses[0];
|
||||
rinfo.numb5radars = QDF_ARRAY_SIZE(ar9300_bin5pulses);
|
||||
|
||||
if (lmac_is_countryCode_KOREA_ROC3(dfs->dfs_pdev_obj)) {
|
||||
dfs_info(dfs, WLAN_DEBUG_DFS_ALWAYS, "DFS_ETSI_DOMAIN_9300_Country_Korea");
|
||||
rinfo.dfs_radars = &ar9300_korea_radars[0];
|
||||
rinfo.numradars = QDF_ARRAY_SIZE(ar9300_korea_radars);
|
||||
}
|
||||
break;
|
||||
case DFS_KR_DOMAIN:
|
||||
dfs_info(dfs, WLAN_DEBUG_DFS_ALWAYS,
|
||||
"DFS_ETSI_DOMAIN_9300_Country_Korea");
|
||||
rinfo.dfsdomain = DFS_ETSI_DOMAIN;
|
||||
rinfo.dfs_radars = &ar9300_korea_radars[0];
|
||||
rinfo.numradars = QDF_ARRAY_SIZE(ar9300_korea_radars);
|
||||
rinfo.b5pulses = &ar9300_bin5pulses[0];
|
||||
rinfo.numb5radars = QDF_ARRAY_SIZE(ar9300_bin5pulses);
|
||||
break;
|
||||
case DFS_MKK4_DOMAIN:
|
||||
dfs_info(dfs, WLAN_DEBUG_DFS_ALWAYS, "DFS_MKK4_DOMAIN_9300");
|
||||
|
@@ -22,8 +22,8 @@
|
||||
|
||||
#include "../dfs.h"
|
||||
#include "wlan_dfs_mlme_api.h"
|
||||
#include "wlan_dfs_utils_api.h"
|
||||
#include "wlan_dfs_lmac_api.h"
|
||||
#include "wlan_dfs_mlme_api.h"
|
||||
#include "../dfs_internal.h"
|
||||
|
||||
/**
|
||||
@@ -287,7 +287,7 @@ void ol_if_dfs_configure(struct wlan_dfs *dfs)
|
||||
* Look up the current DFS regulatory domain and decide
|
||||
* which radar pulses to use.
|
||||
*/
|
||||
dfsdomain = lmac_get_dfsdomain(dfs->dfs_pdev_obj);
|
||||
dfsdomain = utils_get_dfsdomain(dfs->dfs_pdev_obj);
|
||||
target_type = lmac_get_target_type(dfs->dfs_pdev_obj);
|
||||
|
||||
psoc = wlan_pdev_get_psoc(dfs->dfs_pdev_obj);
|
||||
@@ -301,29 +301,35 @@ void ol_if_dfs_configure(struct wlan_dfs *dfs)
|
||||
case DFS_FCC_DOMAIN:
|
||||
dfs_info(dfs, WLAN_DEBUG_DFS_ALWAYS, "FCC domain");
|
||||
rinfo.dfsdomain = DFS_FCC_DOMAIN;
|
||||
dfs_assign_fcc_pulse_table(&rinfo, target_type, tx_ops);
|
||||
break;
|
||||
case DFS_CN_DOMAIN:
|
||||
dfs_info(dfs, WLAN_DEBUG_DFS_ALWAYS,
|
||||
"FCC domain -- Country China(156) override FCC radar pattern"
|
||||
);
|
||||
rinfo.dfsdomain = DFS_FCC_DOMAIN;
|
||||
/*
|
||||
* China uses a radar pattern that is similar to ETSI but it
|
||||
* follows FCC in all other respect like transmit power, CCA
|
||||
* threshold etc.
|
||||
*/
|
||||
if (lmac_is_countryCode_CHINA(dfs->dfs_pdev_obj)) {
|
||||
dfs_info(dfs, WLAN_DEBUG_DFS_ALWAYS,
|
||||
"FCC domain -- Country China(156) override FCC radar pattern"
|
||||
);
|
||||
rinfo.dfs_radars = dfs_china_radars;
|
||||
rinfo.numradars = QDF_ARRAY_SIZE(dfs_china_radars);
|
||||
rinfo.b5pulses = NULL;
|
||||
rinfo.numb5radars = 0;
|
||||
} else {
|
||||
dfs_assign_fcc_pulse_table(&rinfo, target_type, tx_ops);
|
||||
}
|
||||
|
||||
rinfo.dfs_radars = dfs_china_radars;
|
||||
rinfo.numradars = QDF_ARRAY_SIZE(dfs_china_radars);
|
||||
rinfo.b5pulses = NULL;
|
||||
rinfo.numb5radars = 0;
|
||||
break;
|
||||
case DFS_ETSI_DOMAIN:
|
||||
dfs_info(dfs, WLAN_DEBUG_DFS_ALWAYS, "ETSI domain");
|
||||
rinfo.dfsdomain = DFS_ETSI_DOMAIN;
|
||||
rinfo.dfs_radars = dfs_etsi_radars;
|
||||
rinfo.numradars = QDF_ARRAY_SIZE(dfs_etsi_radars);
|
||||
rinfo.b5pulses = NULL;
|
||||
rinfo.numb5radars = 0;
|
||||
break;
|
||||
case DFS_KR_DOMAIN:
|
||||
dfs_info(dfs, WLAN_DEBUG_DFS_ALWAYS,
|
||||
"ETSI domain -- Korea(412)");
|
||||
rinfo.dfsdomain = DFS_ETSI_DOMAIN;
|
||||
|
||||
/*
|
||||
* So far we have treated Korea as part of ETSI and did not
|
||||
@@ -333,13 +339,8 @@ void ol_if_dfs_configure(struct wlan_dfs *dfs)
|
||||
* we will address in the future. However, for now override
|
||||
* ETSI tables for Korea.
|
||||
*/
|
||||
|
||||
if (lmac_is_countryCode_KOREA_ROC3(dfs->dfs_pdev_obj)) {
|
||||
dfs_info(dfs, WLAN_DEBUG_DFS_ALWAYS, "ETSI domain -- Korea(412)");
|
||||
rinfo.dfs_radars = dfs_korea_radars;
|
||||
rinfo.numradars = QDF_ARRAY_SIZE(dfs_korea_radars);
|
||||
}
|
||||
|
||||
rinfo.dfs_radars = dfs_korea_radars;
|
||||
rinfo.numradars = QDF_ARRAY_SIZE(dfs_korea_radars);
|
||||
rinfo.b5pulses = NULL;
|
||||
rinfo.numb5radars = 0;
|
||||
break;
|
||||
|
@@ -30,7 +30,7 @@
|
||||
|
||||
#include "../dfs_channel.h"
|
||||
#include "../dfs_zero_cac.h"
|
||||
#include "wlan_dfs_lmac_api.h"
|
||||
#include "wlan_dfs_utils_api.h"
|
||||
#include "wlan_dfs_mlme_api.h"
|
||||
#include "../dfs_internal.h"
|
||||
|
||||
@@ -288,7 +288,7 @@ int dfs_random_channel(struct wlan_dfs *dfs,
|
||||
* Similarly if the current channel is 100 or higher then
|
||||
* pick a channel that is 100 or higher.
|
||||
*/
|
||||
if (lmac_get_dfsdomain(dfs->dfs_pdev_obj) == DFS_MKK4_DOMAIN) {
|
||||
if (utils_get_dfsdomain(dfs->dfs_pdev_obj) == DFS_MKK4_DOMAIN) {
|
||||
if (IEEE80211_IS_CHAN_11AC_VHT80_80(dfs->dfs_curchan)) {
|
||||
/* No action required for now. */
|
||||
use_lower_5g_only = 0;
|
||||
@@ -390,7 +390,7 @@ int dfs_random_channel(struct wlan_dfs *dfs,
|
||||
chan_flags)
|
||||
&& (freq == ADJACENT_WEATHER_RADAR_CHANNEL)
|
||||
)) && (DFS_ETSI_DOMAIN ==
|
||||
lmac_get_dfsdomain(dfs->dfs_pdev_obj)))
|
||||
utils_get_dfsdomain(dfs->dfs_pdev_obj)))
|
||||
continue;
|
||||
}
|
||||
#undef ADJACENT_WEATHER_RADAR_CHANNEL
|
||||
|
@@ -92,6 +92,7 @@
|
||||
#include "../dfs_zero_cac.h"
|
||||
#include "wlan_dfs_lmac_api.h"
|
||||
#include "wlan_dfs_mlme_api.h"
|
||||
#include "wlan_dfs_utils_api.h"
|
||||
#include "../dfs_internal.h"
|
||||
|
||||
void dfs_zero_cac_reset(struct wlan_dfs *dfs)
|
||||
@@ -803,7 +804,7 @@ void dfs_find_vht80_chan_for_precac(struct wlan_dfs *dfs,
|
||||
|
||||
if (dfs->dfs_precac_enable &&
|
||||
tx_ops->tgt_is_tgt_type_qca9984(target_type) &&
|
||||
(lmac_get_dfsdomain(dfs->dfs_pdev_obj) ==
|
||||
(utils_get_dfsdomain(dfs->dfs_pdev_obj) ==
|
||||
DFS_ETSI_DOMAIN)) {
|
||||
/*
|
||||
* If precac timer is running then do not change the
|
||||
|
@@ -75,12 +75,6 @@ uint64_t lmac_get_tsf64(struct wlan_objmgr_pdev *pdev);
|
||||
*/
|
||||
void lmac_dfs_disable(struct wlan_objmgr_pdev *pdev, int no_cac);
|
||||
|
||||
/**
|
||||
* lmac_get_dfsdomain() - Get DFS domain.
|
||||
* @pdev: Pointer to PDEV structure.
|
||||
*/
|
||||
int lmac_get_dfsdomain(struct wlan_objmgr_pdev *pdev);
|
||||
|
||||
/**
|
||||
* lmac_dfs_enable() - Enable DFS.
|
||||
* @pdev: Pointer to PDEV structure.
|
||||
@@ -147,12 +141,6 @@ uint16_t lmac_get_ah_devid(struct wlan_objmgr_pdev *pdev);
|
||||
*/
|
||||
uint32_t lmac_get_ext_busy(struct wlan_objmgr_pdev *pdev);
|
||||
|
||||
/**
|
||||
* lmac_is_countryCode_KOREA_ROC3() - Check is county code Korea.
|
||||
* @pdev: Pointer to PDEV structure.
|
||||
*/
|
||||
bool lmac_is_countryCode_KOREA_ROC3(struct wlan_objmgr_pdev *pdev);
|
||||
|
||||
/**
|
||||
* lmac_set_use_cac_prssi() - Set use_cac_prssi value.
|
||||
* @pdev: Pointer to PDEV structure.
|
||||
@@ -165,12 +153,6 @@ void lmac_set_use_cac_prssi(struct wlan_objmgr_pdev *pdev);
|
||||
*/
|
||||
uint32_t lmac_get_target_type(struct wlan_objmgr_pdev *pdev);
|
||||
|
||||
/**
|
||||
* lmac_is_countryCode_CHINA() - Check is country code CHINA.
|
||||
* @pdev: Pointer to PDEV structure.
|
||||
*/
|
||||
bool lmac_is_countryCode_CHINA(struct wlan_objmgr_pdev *pdev);
|
||||
|
||||
/**
|
||||
* lmac_get_phymode_info() - Get phymode info.
|
||||
* @pdev: Pointer to PDEV structure.
|
||||
|
@@ -432,8 +432,19 @@ uint32_t utils_dfs_chan_to_freq(uint8_t chan);
|
||||
* @pdev: Pointer to DFS pdev object.
|
||||
* @flags: New channel flags
|
||||
* @flagext: New Extended flags
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS utils_dfs_update_cur_chan_flags(struct wlan_objmgr_pdev *pdev,
|
||||
uint64_t flags,
|
||||
uint16_t flagext);
|
||||
|
||||
/**
|
||||
* utils_get_dfsdomain() - Get DFS domain.
|
||||
* @pdev: Pointer to PDEV structure.
|
||||
*
|
||||
* Return: DFS domain.
|
||||
*/
|
||||
int utils_get_dfsdomain(struct wlan_objmgr_pdev *pdev);
|
||||
|
||||
#endif /* _WLAN_DFS_UTILS_API_H_ */
|
||||
|
@@ -85,15 +85,6 @@ void lmac_dfs_disable(struct wlan_objmgr_pdev *pdev, int no_cac)
|
||||
dfs_tx_ops->dfs_disable(pdev, no_cac);
|
||||
}
|
||||
|
||||
int lmac_get_dfsdomain(struct wlan_objmgr_pdev *pdev)
|
||||
{
|
||||
enum dfs_reg dfsdomain;
|
||||
|
||||
wlan_reg_get_dfs_region(pdev, &dfsdomain);
|
||||
|
||||
return dfsdomain;
|
||||
}
|
||||
|
||||
void lmac_dfs_enable(struct wlan_objmgr_pdev *pdev,
|
||||
int *is_fastclk,
|
||||
int32_t pe_firpwr,
|
||||
@@ -204,24 +195,6 @@ uint32_t lmac_get_ext_busy(struct wlan_objmgr_pdev *pdev)
|
||||
return ext_chan_busy;
|
||||
}
|
||||
|
||||
bool lmac_is_countryCode_KOREA_ROC3(struct wlan_objmgr_pdev *pdev)
|
||||
{
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
struct wlan_lmac_if_dfs_tx_ops *dfs_tx_ops;
|
||||
bool ctry_korea = false;
|
||||
|
||||
psoc = wlan_pdev_get_psoc(pdev);
|
||||
|
||||
dfs_tx_ops = &psoc->soc_cb.tx_ops.dfs_tx_ops;
|
||||
|
||||
if (dfs_tx_ops->dfs_is_countryCode_KOREA_ROC3)
|
||||
dfs_tx_ops->dfs_is_countryCode_KOREA_ROC3(pdev,
|
||||
&ctry_korea);
|
||||
|
||||
return ctry_korea;
|
||||
|
||||
}
|
||||
|
||||
void lmac_set_use_cac_prssi(struct wlan_objmgr_pdev *pdev)
|
||||
{
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
@@ -251,22 +224,6 @@ uint32_t lmac_get_target_type(struct wlan_objmgr_pdev *pdev)
|
||||
return target_type;
|
||||
}
|
||||
|
||||
bool lmac_is_countryCode_CHINA(struct wlan_objmgr_pdev *pdev)
|
||||
{
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
struct wlan_lmac_if_dfs_tx_ops *dfs_tx_ops;
|
||||
bool country_china = false;
|
||||
|
||||
psoc = wlan_pdev_get_psoc(pdev);
|
||||
|
||||
dfs_tx_ops = &psoc->soc_cb.tx_ops.dfs_tx_ops;
|
||||
|
||||
if (dfs_tx_ops->dfs_is_countryCode_CHINA)
|
||||
dfs_tx_ops->dfs_is_countryCode_CHINA(pdev, &country_china);
|
||||
|
||||
return country_china;
|
||||
}
|
||||
|
||||
uint32_t lmac_get_phymode_info(struct wlan_objmgr_pdev *pdev,
|
||||
uint32_t chan_mode)
|
||||
{
|
||||
|
@@ -761,3 +761,12 @@ uint32_t utils_dfs_chan_to_freq(uint8_t chan)
|
||||
return DFS_5_GHZ_BASE_FREQ + (chan * DFS_CHAN_SPACING_5MHZ);
|
||||
}
|
||||
EXPORT_SYMBOL(utils_dfs_chan_to_freq);
|
||||
|
||||
int utils_get_dfsdomain(struct wlan_objmgr_pdev *pdev)
|
||||
{
|
||||
enum dfs_reg dfsdomain;
|
||||
|
||||
wlan_reg_get_dfs_region(pdev, &dfsdomain);
|
||||
|
||||
return dfsdomain;
|
||||
}
|
||||
|
Reference in New Issue
Block a user