qcacmn: Add get Chan DFS attribute API

DFS chan "state" will be set to CHANNEL_STATE_DISABLE
if the dfs chan is added to NOL.
Add the new API wlan_reg_chan_has_dfs_attribute
to get the attribute from "chan_flag" which keeps
the chan's initial dfs attribute.

Change-Id: I5149d958c0dcb1e5909e02bd5be9acdf9fca7f2f
CRs-Fixed: 2324648
This commit is contained in:
Liangwei Dong
2018-09-28 04:02:43 -04:00
committed by nshrivas
parent ff17327ad5
commit 6d63c822b8
4 changed files with 50 additions and 0 deletions

View File

@@ -892,6 +892,29 @@ enum channel_state reg_get_channel_state(struct wlan_objmgr_pdev *pdev,
return pdev_priv_obj->cur_chan_list[ch_idx].state; return pdev_priv_obj->cur_chan_list[ch_idx].state;
} }
bool reg_chan_has_dfs_attribute(struct wlan_objmgr_pdev *pdev, uint32_t ch)
{
enum channel_enum ch_idx;
struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj;
ch_idx = reg_get_chan_enum(ch);
if (ch_idx == INVALID_CHANNEL)
return false;
pdev_priv_obj = reg_get_pdev_obj(pdev);
if (!IS_VALID_PDEV_REG_OBJ(pdev_priv_obj)) {
reg_err("pdev reg obj is NULL");
return false;
}
if (pdev_priv_obj->cur_chan_list[ch_idx].chan_flags &
REGULATORY_CHAN_RADAR)
return true;
return false;
}
/** /**
* reg_get_5g_bonded_chan_array() - get ptr to bonded channel * reg_get_5g_bonded_chan_array() - get ptr to bonded channel
* @oper_ch: operating channel number * @oper_ch: operating channel number

View File

@@ -106,6 +106,16 @@ QDF_STATUS reg_get_channel_list_with_power(struct wlan_objmgr_pdev *pdev,
enum channel_state reg_get_channel_state(struct wlan_objmgr_pdev *pdev, enum channel_state reg_get_channel_state(struct wlan_objmgr_pdev *pdev,
uint32_t ch); uint32_t ch);
/**
* reg_chan_has_dfs_attribute() - check channel has dfs attribue or not
* @ch: channel number.
*
* This API get chan initial dfs attribue flag from regdomain
*
* Return: true if chan is dfs, otherwise false
*/
bool reg_chan_has_dfs_attribute(struct wlan_objmgr_pdev *pdev, uint32_t ch);
enum channel_state reg_get_5g_bonded_channel_state(struct wlan_objmgr_pdev enum channel_state reg_get_5g_bonded_channel_state(struct wlan_objmgr_pdev
*pdev, *pdev,
uint8_t ch, uint8_t ch,

View File

@@ -103,6 +103,17 @@ QDF_STATUS wlan_reg_read_current_country(struct wlan_objmgr_psoc *psoc,
enum channel_state wlan_reg_get_channel_state(struct wlan_objmgr_pdev *pdev, enum channel_state wlan_reg_get_channel_state(struct wlan_objmgr_pdev *pdev,
uint32_t ch); uint32_t ch);
/**
* wlan_reg_chan_has_dfs_attribute() - check channel has dfs attribute flag
* @ch: channel number.
*
* This API get chan initial dfs attribute from regdomain
*
* Return: true if chan is dfs, otherwise false
*/
bool
wlan_reg_chan_has_dfs_attribute(struct wlan_objmgr_pdev *pdev, uint32_t ch);
/** /**
* wlan_reg_get_5g_bonded_channel_state() - Get 5G bonded channel state * wlan_reg_get_5g_bonded_channel_state() - Get 5G bonded channel state
* @pdev: The physical dev to program country code or regdomain * @pdev: The physical dev to program country code or regdomain

View File

@@ -85,6 +85,12 @@ enum channel_state wlan_reg_get_channel_state(struct wlan_objmgr_pdev *pdev,
return reg_get_channel_state(pdev, ch); return reg_get_channel_state(pdev, ch);
} }
bool
wlan_reg_chan_has_dfs_attribute(struct wlan_objmgr_pdev *pdev, uint32_t ch)
{
return reg_chan_has_dfs_attribute(pdev, ch);
}
/** /**
* wlan_reg_get_5g_bonded_channel_state() - Get 5G bonded channel state * wlan_reg_get_5g_bonded_channel_state() - Get 5G bonded channel state
* @ch: channel number. * @ch: channel number.