mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-11-09 20:31:13 -05:00
qcacld-3.0: Refactor WE_SET_MAX_TX_POWER_5_0 processing
Currently the HDD function with the highest cyclomatic complexity is __iw_setint_getnone(). The handing of WE_SET_MAX_TX_POWER_5_0 has a complexity greater than 1, so refactor that logic into a separate function to help reduce the complexity of __iw_setint_getnone(). Change-Id: I3eb942b5bbed7cdc8199c5a4233b4443613023b0 CRs-Fixed: 2338379
This commit is contained in:
parent
62743f4c71
commit
175004cd2e
1 changed files with 13 additions and 11 deletions
|
|
@ -4272,6 +4272,18 @@ static int hdd_we_set_max_tx_power_2_4(struct hdd_adapter *adapter, int power)
|
|||
return qdf_status_to_os_return(status);
|
||||
}
|
||||
|
||||
static int hdd_we_set_max_tx_power_5_0(struct hdd_adapter *adapter, int power)
|
||||
{
|
||||
QDF_STATUS status;
|
||||
|
||||
hdd_debug("power %d dBm", power);
|
||||
status = sme_set_max_tx_power_per_band(BAND_5G, power);
|
||||
if (QDF_IS_STATUS_ERROR(status))
|
||||
hdd_err("cfg set failed, value %d status %d", power, status);
|
||||
|
||||
return qdf_status_to_os_return(status);
|
||||
}
|
||||
|
||||
/**
|
||||
* iw_setint_getnone() - Generic "set integer" private ioctl handler
|
||||
* @dev: device upon which the ioctl was received
|
||||
|
|
@ -4345,18 +4357,8 @@ static int __iw_setint_getnone(struct net_device *dev,
|
|||
break;
|
||||
|
||||
case WE_SET_MAX_TX_POWER_5_0:
|
||||
{
|
||||
hdd_debug("Setting maximum tx power %d dBm for 5.0 GHz band",
|
||||
set_value);
|
||||
if (sme_set_max_tx_power_per_band(BAND_5G, set_value) !=
|
||||
QDF_STATUS_SUCCESS) {
|
||||
hdd_err("Setting max tx power failed for 5.0 GHz band");
|
||||
ret = -EIO;
|
||||
break;
|
||||
}
|
||||
|
||||
ret = hdd_we_set_max_tx_power_5_0(adapter, set_value);
|
||||
break;
|
||||
}
|
||||
|
||||
case WE_SET_TM_LEVEL:
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue