qcacld-3.0: Refactor PROPAGATION_DELAY 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_PROPAGATION_DELAY Change-Id: I3457a98592164d83db09f20b9e63d28bc8429055 CRs-Fixed: 2371572
Этот коммит содержится в:
@@ -5767,6 +5767,23 @@ static int hdd_config_ctrl_retry(struct hdd_adapter *adapter,
|
|||||||
retry, PDEV_CMD);
|
retry, PDEV_CMD);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int hdd_config_propagation_delay(struct hdd_adapter *adapter,
|
||||||
|
const struct nlattr *attr)
|
||||||
|
{
|
||||||
|
uint8_t delay;
|
||||||
|
uint32_t abs_delay;
|
||||||
|
int param_id;
|
||||||
|
|
||||||
|
delay = nla_get_u8(attr);
|
||||||
|
delay = delay > CFG_PROPAGATION_DELAY_MAX ?
|
||||||
|
CFG_PROPAGATION_DELAY_MAX : delay;
|
||||||
|
abs_delay = delay + CFG_PROPAGATION_DELAY_BASE;
|
||||||
|
param_id = WMI_PDEV_PARAM_PROPAGATION_DELAY;
|
||||||
|
|
||||||
|
return wma_cli_set_command(adapter->session_id, param_id,
|
||||||
|
abs_delay, PDEV_CMD);
|
||||||
|
}
|
||||||
|
|
||||||
static int hdd_config_guard_time(struct hdd_adapter *adapter,
|
static int hdd_config_guard_time(struct hdd_adapter *adapter,
|
||||||
const struct nlattr *attr)
|
const struct nlattr *attr)
|
||||||
{
|
{
|
||||||
@@ -5881,6 +5898,8 @@ static const struct independent_setters independent_setters[] = {
|
|||||||
hdd_config_mgmt_retry},
|
hdd_config_mgmt_retry},
|
||||||
{QCA_WLAN_VENDOR_ATTR_CONFIG_CTRL_RETRY,
|
{QCA_WLAN_VENDOR_ATTR_CONFIG_CTRL_RETRY,
|
||||||
hdd_config_ctrl_retry},
|
hdd_config_ctrl_retry},
|
||||||
|
{QCA_WLAN_VENDOR_ATTR_CONFIG_PROPAGATION_DELAY,
|
||||||
|
hdd_config_propagation_delay},
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -6002,7 +6021,6 @@ __wlan_hdd_cfg80211_wifi_configuration_set(struct wiphy *wiphy,
|
|||||||
bool vendor_ie_present = false, access_policy_present = false;
|
bool vendor_ie_present = false, access_policy_present = false;
|
||||||
struct sir_set_tx_rx_aggregation_size request;
|
struct sir_set_tx_rx_aggregation_size request;
|
||||||
QDF_STATUS qdf_status;
|
QDF_STATUS qdf_status;
|
||||||
uint8_t delay;
|
|
||||||
uint32_t abs_delay;
|
uint32_t abs_delay;
|
||||||
int param_id;
|
int param_id;
|
||||||
uint32_t tx_fail_count;
|
uint32_t tx_fail_count;
|
||||||
@@ -6079,17 +6097,6 @@ __wlan_hdd_cfg80211_wifi_configuration_set(struct wiphy *wiphy,
|
|||||||
access_policy);
|
access_policy);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tb[QCA_WLAN_VENDOR_ATTR_CONFIG_PROPAGATION_DELAY]) {
|
|
||||||
delay = nla_get_u8(tb[
|
|
||||||
QCA_WLAN_VENDOR_ATTR_CONFIG_PROPAGATION_DELAY]);
|
|
||||||
delay = delay > CFG_PROPAGATION_DELAY_MAX ?
|
|
||||||
CFG_PROPAGATION_DELAY_MAX : delay;
|
|
||||||
abs_delay = delay + CFG_PROPAGATION_DELAY_BASE;
|
|
||||||
param_id = WMI_PDEV_PARAM_PROPAGATION_DELAY;
|
|
||||||
ret_val = wma_cli_set_command(adapter->session_id, param_id,
|
|
||||||
abs_delay, PDEV_CMD);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (tb[QCA_WLAN_VENDOR_ATTR_CONFIG_PROPAGATION_ABS_DELAY]) {
|
if (tb[QCA_WLAN_VENDOR_ATTR_CONFIG_PROPAGATION_ABS_DELAY]) {
|
||||||
abs_delay = nla_get_u8(tb[
|
abs_delay = nla_get_u8(tb[
|
||||||
QCA_WLAN_VENDOR_ATTR_CONFIG_PROPAGATION_ABS_DELAY]);
|
QCA_WLAN_VENDOR_ATTR_CONFIG_PROPAGATION_ABS_DELAY]);
|
||||||
|
Ссылка в новой задаче
Block a user