Browse Source

qcacld-3.0: Refactor LRO 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_LRO

Change-Id: I5627292f84cefe79b1a89d1be84cea5d8a7c6cc1
CRs-Fixed: 2371563
Jeff Johnson 6 years ago
parent
commit
9381d0329f
1 changed files with 13 additions and 6 deletions
  1. 13 6
      core/hdd/src/wlan_hdd_cfg80211.c

+ 13 - 6
core/hdd/src/wlan_hdd_cfg80211.c

@@ -5648,6 +5648,17 @@ static int hdd_config_listen_interval(struct hdd_adapter *adapter,
 	return qdf_status_to_os_return(status);
 }
 
+static int hdd_config_lro(struct hdd_adapter *adapter,
+			  const struct nlattr *attr)
+{
+	struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
+	uint8_t enable_flag;
+
+	enable_flag = nla_get_u8(attr);
+
+	return hdd_lro_set_reset(hdd_ctx, adapter, enable_flag);
+}
+
 static int hdd_config_scan_default_ies(struct hdd_adapter *adapter,
 				       const struct nlattr *attr)
 {
@@ -5729,6 +5740,8 @@ static const struct independent_setters independent_setters[] = {
 	 hdd_config_modulated_dtim},
 	{QCA_WLAN_VENDOR_ATTR_CONFIG_LISTEN_INTERVAL,
 	 hdd_config_listen_interval},
+	{QCA_WLAN_VENDOR_ATTR_CONFIG_LRO,
+	 hdd_config_lro},
 };
 
 /**
@@ -5897,12 +5910,6 @@ __wlan_hdd_cfg80211_wifi_configuration_set(struct wiphy *wiphy,
 
 	mac_handle = hdd_ctx->mac_handle;
 
-	if (tb[QCA_WLAN_VENDOR_ATTR_CONFIG_LRO]) {
-		enable_flag = nla_get_u8(tb[QCA_WLAN_VENDOR_ATTR_CONFIG_LRO]);
-		ret_val = hdd_lro_set_reset(hdd_ctx, adapter,
-							 enable_flag);
-	}
-
 	if (tb[QCA_WLAN_VENDOR_ATTR_CONFIG_SCAN_ENABLE]) {
 		enable_flag =
 			nla_get_u8(tb[QCA_WLAN_VENDOR_ATTR_CONFIG_SCAN_ENABLE]);