qcacmn: Add APIs to set current client type

For “Subordinate” clients in SP or VLP mode, FW does not send any
regulatory rules as currently no country supports subordinate in SP and
VLP. When the rules are not present, SP/VLP clients are connected to the
root ap in 0dBm tx power, which results in low throughput. Connecting to
the root ap using 0dBm tx power is not the correct behavior. If the rules
for any power mode is not available, clients should not connect in that
mode. Therefore, "Subordinate" clients cannot connect to the SP/VLP APs.

To resolve this issue, the device client type should be changed to
"Default" client type when it is connected to the root AP in SP or VLP
mode. Once it gets disconnected or when the root AP moves to LP mode,
its mode should be reset back to "Subordinate" client type.

Add a variable reg_target_client_type to wlan_regulatory_pdev_priv_obj
structure and in reg_propagate_6g_mas_channel_list, store the client
type received from target in it.

Add API reg_set_cur_6ghz_client_type to set the current client type to a
given value.

Add API reg_set_6ghz_client_type_from_target to set the current client
type to the value received from target.

Change-Id: Ie7d9e8b45cd831018c0058d65880a3659457b499
CRs-Fixed: 3349767
This commit is contained in:
Amith A
2022-11-30 21:16:57 +05:30
کامیت شده توسط Madan Koyyalamudi
والد 9fc190e537
کامیت 4fc546e9f7
6فایلهای تغییر یافته به همراه126 افزوده شده و 0 حذف شده

مشاهده پرونده

@@ -1088,6 +1088,8 @@ static void reg_propagate_6g_mas_channel_list(
pdev_priv_obj->reg_cur_6g_client_mobility_type =
mas_chan_params->client_type;
pdev_priv_obj->reg_target_client_type =
mas_chan_params->client_type;
pdev_priv_obj->reg_rnr_tpe_usable = mas_chan_params->rnr_tpe_usable;
pdev_priv_obj->reg_unspecified_ap_usable =
mas_chan_params->unspecified_ap_usable;

مشاهده پرونده

@@ -264,6 +264,8 @@ struct wlan_regulatory_psoc_priv_obj {
* @pdev_opened: whether pdev has been opened by application
* @reg_cur_6g_ap_pwr_type: 6G AP type ie VLP/SP/LPI.
* @reg_cur_6g_client_mobility_type: 6G client type ie Default/Subordinate.
* @reg_target_client_type: 6 GHz client type received from target. The Client
* type can be Default/Subordinate.
* @reg_rnr_tpe_usable: Indicates whether RNR IE is applicable for current reg
* domain.
* @reg_unspecified_ap_usable: Indicates if the AP type mentioned is not part of
@@ -345,6 +347,7 @@ struct wlan_regulatory_pdev_priv_obj {
#if defined(CONFIG_BAND_6GHZ)
enum reg_6g_ap_type reg_cur_6g_ap_pwr_type;
enum reg_6g_client_type reg_cur_6g_client_mobility_type;
enum reg_6g_client_type reg_target_client_type;
bool reg_rnr_tpe_usable;
bool reg_unspecified_ap_usable;
qdf_freq_t reg_6g_thresh_priority_freq;

مشاهده پرونده

@@ -8074,6 +8074,43 @@ reg_get_cur_6g_client_type(struct wlan_objmgr_pdev *pdev,
return QDF_STATUS_SUCCESS;
}
QDF_STATUS
reg_set_cur_6ghz_client_type(struct wlan_objmgr_pdev *pdev,
enum reg_6g_client_type in_6ghz_client_type)
{
struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj;
pdev_priv_obj = reg_get_pdev_obj(pdev);
if (!IS_VALID_PDEV_REG_OBJ(pdev_priv_obj)) {
reg_err("pdev reg component is NULL");
return QDF_STATUS_E_FAILURE;
}
if (in_6ghz_client_type >= REG_MAX_CLIENT_TYPE)
return QDF_STATUS_E_FAILURE;
pdev_priv_obj->reg_cur_6g_client_mobility_type = in_6ghz_client_type;
return QDF_STATUS_SUCCESS;
}
QDF_STATUS
reg_set_6ghz_client_type_from_target(struct wlan_objmgr_pdev *pdev)
{
struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj;
pdev_priv_obj = reg_get_pdev_obj(pdev);
if (!IS_VALID_PDEV_REG_OBJ(pdev_priv_obj)) {
reg_err("pdev reg component is NULL");
return QDF_STATUS_E_FAILURE;
}
pdev_priv_obj->reg_cur_6g_client_mobility_type =
pdev_priv_obj->reg_target_client_type;
return QDF_STATUS_SUCCESS;
}
QDF_STATUS reg_get_rnr_tpe_usable(struct wlan_objmgr_pdev *pdev,
bool *reg_rnr_tpe_usable)
{

مشاهده پرونده

@@ -1888,6 +1888,28 @@ reg_get_cur_6g_client_type(struct wlan_objmgr_pdev *pdev,
enum reg_6g_client_type
*reg_cur_6g_client_mobility_type);
/**
* reg_set_cur_6ghz_client_type() - Set the cur 6 GHz regulatory client type to
* the given value.
* @pdev: Pointer to PDEV object.
* @in_6ghz_client_type: Input 6 GHz client type ie. default/subordinate.
*
* Return: QDF_STATUS.
*/
QDF_STATUS
reg_set_cur_6ghz_client_type(struct wlan_objmgr_pdev *pdev,
enum reg_6g_client_type in_6ghz_client_type);
/**
* reg_set_6ghz_client_type_from_target() - Set the current 6 GHz regulatory
* client type to the value received from target.
* @pdev: Pointer to PDEV object.
*
* Return: QDF_STATUS.
*/
QDF_STATUS
reg_set_6ghz_client_type_from_target(struct wlan_objmgr_pdev *pdev);
/**
* reg_get_rnr_tpe_usable() - Tells if RNR IE is applicable for current domain.
* @pdev: Pointer to PDEV object.
@@ -2050,6 +2072,19 @@ reg_get_cur_6g_client_type(struct wlan_objmgr_pdev *pdev,
return QDF_STATUS_E_NOSUPPORT;
}
static inline QDF_STATUS
reg_set_cur_6ghz_client_type(struct wlan_objmgr_pdev *pdev,
enum reg_6g_client_type in_6ghz_client_type)
{
return QDF_STATUS_E_NOSUPPORT;
}
static inline QDF_STATUS
reg_set_6ghz_client_type_from_target(struct wlan_objmgr_pdev *pdev)
{
return QDF_STATUS_E_NOSUPPORT;
}
static inline
QDF_STATUS reg_get_rnr_tpe_usable(struct wlan_objmgr_pdev *pdev,
bool *reg_rnr_tpe_usable)

مشاهده پرونده

@@ -2235,6 +2235,29 @@ QDF_STATUS
wlan_reg_get_cur_6g_client_type(struct wlan_objmgr_pdev *pdev,
enum reg_6g_client_type
*reg_cur_6g_client_mobility_type);
/**
* wlan_reg_set_cur_6ghz_client_type() - Set the cur 6 GHz regulatory client
* type to the given value.
* @pdev: Pointer to PDEV object.
* @in_6ghz_client_type: Input Client type to be set ie. default/subordinate.
*
* Return: QDF_STATUS.
*/
QDF_STATUS
wlan_reg_set_cur_6ghz_client_type(struct wlan_objmgr_pdev *pdev,
enum reg_6g_client_type in_6ghz_client_type);
/**
* wlan_reg_set_6ghz_client_type_from_target() - Set the current 6 GHz
* regulatory client type to the value received from target.
* @pdev: Pointer to PDEV object.
*
* Return: QDF_STATUS.
*/
QDF_STATUS
wlan_reg_set_6ghz_client_type_from_target(struct wlan_objmgr_pdev *pdev);
/**
* wlan_reg_get_rnr_tpe_usable() - Tells if RNR IE is applicable for current
* domain.
@@ -2411,6 +2434,19 @@ wlan_reg_get_cur_6g_client_type(struct wlan_objmgr_pdev *pdev,
return QDF_STATUS_E_NOSUPPORT;
}
static inline QDF_STATUS
wlan_reg_set_cur_6ghz_client_type(struct wlan_objmgr_pdev *pdev,
enum reg_6g_client_type in_6ghz_client_type)
{
return QDF_STATUS_E_NOSUPPORT;
}
static inline QDF_STATUS
wlan_reg_set_6ghz_client_type_from_target(struct wlan_objmgr_pdev *pdev)
{
return QDF_STATUS_E_NOSUPPORT;
}
static inline
QDF_STATUS wlan_reg_get_rnr_tpe_usable(struct wlan_objmgr_pdev *pdev,
bool *reg_rnr_tpe_usable)

مشاهده پرونده

@@ -1729,6 +1729,19 @@ wlan_reg_get_cur_6g_client_type(struct wlan_objmgr_pdev *pdev,
qdf_export_symbol(wlan_reg_get_cur_6g_client_type);
QDF_STATUS
wlan_reg_set_cur_6ghz_client_type(struct wlan_objmgr_pdev *pdev,
enum reg_6g_client_type in_6ghz_client_type)
{
return reg_set_cur_6ghz_client_type(pdev, in_6ghz_client_type);
}
QDF_STATUS
wlan_reg_set_6ghz_client_type_from_target(struct wlan_objmgr_pdev *pdev)
{
return reg_set_6ghz_client_type_from_target(pdev);
}
bool wlan_reg_is_6g_psd_power(struct wlan_objmgr_pdev *pdev)
{
return reg_is_6g_psd_power(pdev);