mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-10 14:19:09 -04:00
qcacld-3.0: Refactor MGMT_RETRY configuration
One of the HDD functions with the highest cyclomatic complexity is __wlan_hdd_cfg80211_wifi_configuration_set(). In order to reduce the complexity there is a plan to replace the inline attribute handling with a vtable-based approach. As part of that goal refactor the following independent attribute handling into a separate function and add that function to the vtable: - QCA_WLAN_VENDOR_ATTR_CONFIG_MGMT_RETRY Change-Id: I19af4fa260bd837b55dc0ac38ef7556e5f181c13 CRs-Fixed: 2371570
This commit is contained in:
parent
b902100ff3
commit
0e8259ca6d
1 changed files with 17 additions and 9 deletions
|
|
@ -5737,6 +5737,21 @@ static int hdd_config_agg_retry(struct hdd_adapter *adapter,
|
|||
retry, PDEV_CMD);
|
||||
}
|
||||
|
||||
static int hdd_config_mgmt_retry(struct hdd_adapter *adapter,
|
||||
const struct nlattr *attr)
|
||||
{
|
||||
uint8_t retry;
|
||||
int param_id;
|
||||
|
||||
retry = nla_get_u8(attr);
|
||||
retry = retry > CFG_MGMT_RETRY_MAX ?
|
||||
CFG_MGMT_RETRY_MAX : retry;
|
||||
param_id = WMI_PDEV_PARAM_MGMT_RETRY_LIMIT;
|
||||
|
||||
return wma_cli_set_command(adapter->session_id, param_id,
|
||||
retry, PDEV_CMD);
|
||||
}
|
||||
|
||||
static int hdd_config_guard_time(struct hdd_adapter *adapter,
|
||||
const struct nlattr *attr)
|
||||
{
|
||||
|
|
@ -5847,6 +5862,8 @@ static const struct independent_setters independent_setters[] = {
|
|||
hdd_config_non_agg_retry},
|
||||
{QCA_WLAN_VENDOR_ATTR_CONFIG_AGG_RETRY,
|
||||
hdd_config_agg_retry},
|
||||
{QCA_WLAN_VENDOR_ATTR_CONFIG_MGMT_RETRY,
|
||||
hdd_config_mgmt_retry},
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -6045,15 +6062,6 @@ __wlan_hdd_cfg80211_wifi_configuration_set(struct wiphy *wiphy,
|
|||
access_policy);
|
||||
}
|
||||
|
||||
if (tb[QCA_WLAN_VENDOR_ATTR_CONFIG_MGMT_RETRY]) {
|
||||
retry = nla_get_u8(tb[QCA_WLAN_VENDOR_ATTR_CONFIG_MGMT_RETRY]);
|
||||
retry = retry > CFG_MGMT_RETRY_MAX ?
|
||||
CFG_MGMT_RETRY_MAX : retry;
|
||||
param_id = WMI_PDEV_PARAM_MGMT_RETRY_LIMIT;
|
||||
ret_val = wma_cli_set_command(adapter->session_id, param_id,
|
||||
retry, PDEV_CMD);
|
||||
}
|
||||
|
||||
if (tb[QCA_WLAN_VENDOR_ATTR_CONFIG_CTRL_RETRY]) {
|
||||
retry = nla_get_u8(tb[QCA_WLAN_VENDOR_ATTR_CONFIG_CTRL_RETRY]);
|
||||
retry = retry > CFG_CTRL_RETRY_MAX ?
|
||||
|
|
|
|||
Loading…
Reference in a new issue