From 7c4335001d02c535d75ffb506078d35de93560e2 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Mon, 12 Nov 2018 15:00:52 -0800 Subject: [PATCH] qcacld-3.0: Refactor WE_SET_AMPDU ioctl processing One of the HDD functions with the highest cyclomatic complexity is __iw_setint_getnone(). In order to reduce the complexity there is a plan to replace the existing switch with a vtable. As part of that goal refactor the WE_SET_AMPDU ioctl handling into a separate function. Change-Id: I76c11e2a099c2f9734a0e9b0208b339406b4a22c CRs-Fixed: 2348656 --- core/hdd/src/wlan_hdd_wext.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/core/hdd/src/wlan_hdd_wext.c b/core/hdd/src/wlan_hdd_wext.c index f850d1a7f4df..7aba0acf7ea7 100644 --- a/core/hdd/src/wlan_hdd_wext.c +++ b/core/hdd/src/wlan_hdd_wext.c @@ -4448,6 +4448,15 @@ static int hdd_we_set_vht_rate(struct hdd_adapter *adapter, int rate_code) return errno; } +static int hdd_we_set_ampdu(struct hdd_adapter *adapter, int ampdu) +{ + hdd_debug("AMPDU %d", ampdu); + + return wma_cli_set_command(adapter->session_id, + GEN_VDEV_PARAM_AMPDU, + ampdu, GEN_CMD); +} + static int hdd_we_set_amsdu(struct hdd_adapter *adapter, int amsdu) { struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); @@ -5217,13 +5226,8 @@ static int __iw_setint_getnone(struct net_device *dev, break; case WE_SET_AMPDU: - { - hdd_debug("SET AMPDU val %d", set_value); - ret = wma_cli_set_command(adapter->session_id, - GEN_VDEV_PARAM_AMPDU, - set_value, GEN_CMD); + ret = hdd_we_set_ampdu(adapter, set_value); break; - } case WE_SET_AMSDU: ret = hdd_we_set_amsdu(adapter, set_value);