From d1e45b8dc7197e0f04028a83c7d1f5ace144ecde Mon Sep 17 00:00:00 2001 From: Srinivas Girigowda Date: Mon, 15 Apr 2019 15:08:28 -0700 Subject: [PATCH] qcacld-3.0: Replace multiple IPv4/v6 address len macros with QDF macro Replace multiple IPv4/v6 address len macros with QDF macro. Change-Id: Id8ee0e1a4d6057f74ea5b7122a33f5137ea533e4 CRs-Fixed: 2435753 --- components/pmo/core/src/wlan_pmo_arp.c | 2 +- components/pmo/core/src/wlan_pmo_ns.c | 2 +- .../pmo/dispatcher/inc/wlan_pmo_arp_public_struct.h | 4 ++-- .../pmo/dispatcher/inc/wlan_pmo_common_public_struct.h | 2 -- .../pmo/dispatcher/inc/wlan_pmo_ns_public_struct.h | 10 +++++----- core/hdd/inc/wlan_hdd_host_offload.h | 6 +++--- core/hdd/src/wlan_hdd_power.c | 4 ++-- core/mac/inc/sir_api.h | 8 +++----- core/mac/inc/sir_mac_prot_def.h | 1 - core/sme/src/common/sme_api.c | 8 ++++---- 10 files changed, 21 insertions(+), 26 deletions(-) diff --git a/components/pmo/core/src/wlan_pmo_arp.c b/components/pmo/core/src/wlan_pmo_arp.c index a1d0955d0eed0..43857289190ab 100644 --- a/components/pmo/core/src/wlan_pmo_arp.c +++ b/components/pmo/core/src/wlan_pmo_arp.c @@ -58,7 +58,7 @@ static QDF_STATUS pmo_core_cache_arp_in_vdev_priv( request->enable = PMO_OFFLOAD_ENABLE; request->is_offload_applied = false; /* converting u32 to IPV4 address */ - for (index = 0; index < PMO_IPV4_ADDR_LEN; index++) + for (index = 0; index < QDF_IPV4_ADDR_SIZE; index++) request->host_ipv4_addr[index] = (arp_req->ipv4_addr >> (index * 8)) & 0xFF; diff --git a/components/pmo/core/src/wlan_pmo_ns.c b/components/pmo/core/src/wlan_pmo_ns.c index e61f54ea0d482..5160e3d2f2268 100644 --- a/components/pmo/core/src/wlan_pmo_ns.c +++ b/components/pmo/core/src/wlan_pmo_ns.c @@ -54,7 +54,7 @@ static void pmo_core_fill_ns_addr(struct pmo_ns_offload_params *request, ns_req->ipv6_addr[i][15]; request->slot_idx = i; qdf_mem_copy(&request->target_ipv6_addr[i], - &ns_req->ipv6_addr[i][0], PMO_MAC_IPV6_ADDR_LEN); + &ns_req->ipv6_addr[i][0], QDF_IPV6_ADDR_SIZE); request->target_ipv6_addr_valid[i] = PMO_IPV6_ADDR_VALID; diff --git a/components/pmo/dispatcher/inc/wlan_pmo_arp_public_struct.h b/components/pmo/dispatcher/inc/wlan_pmo_arp_public_struct.h index 4a789213aada4..305afcf0fc004 100644 --- a/components/pmo/dispatcher/inc/wlan_pmo_arp_public_struct.h +++ b/components/pmo/dispatcher/inc/wlan_pmo_arp_public_struct.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2019 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -50,7 +50,7 @@ struct pmo_arp_req { */ struct pmo_arp_offload_params { uint8_t enable; - uint8_t host_ipv4_addr[PMO_IPV4_ADDR_LEN]; + uint8_t host_ipv4_addr[QDF_IPV4_ADDR_SIZE]; struct qdf_mac_addr bssid; bool is_offload_applied; }; diff --git a/components/pmo/dispatcher/inc/wlan_pmo_common_public_struct.h b/components/pmo/dispatcher/inc/wlan_pmo_common_public_struct.h index 8484b9be58a59..a9894daf050ad 100644 --- a/components/pmo/dispatcher/inc/wlan_pmo_common_public_struct.h +++ b/components/pmo/dispatcher/inc/wlan_pmo_common_public_struct.h @@ -39,7 +39,6 @@ #include "qdf_event.h" #include "wlan_pmo_hw_filter_public_struct.h" -#define PMO_IPV4_ADDR_LEN 4 #define PMO_IPV4_ARP_REPLY_OFFLOAD 0 #define PMO_IPV6_NEIGHBOR_DISCOVERY_OFFLOAD 1 @@ -49,7 +48,6 @@ #define PMO_MAC_NS_OFFLOAD_SIZE 1 #define PMO_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA 16 -#define PMO_MAC_IPV6_ADDR_LEN 16 #define PMO_IPV6_ADDR_VALID 1 #define PMO_IPV6_ADDR_UC_TYPE 0 #define PMO_IPV6_ADDR_AC_TYPE 1 diff --git a/components/pmo/dispatcher/inc/wlan_pmo_ns_public_struct.h b/components/pmo/dispatcher/inc/wlan_pmo_ns_public_struct.h index 7aa44d419fab6..2028d7bab546c 100644 --- a/components/pmo/dispatcher/inc/wlan_pmo_ns_public_struct.h +++ b/components/pmo/dispatcher/inc/wlan_pmo_ns_public_struct.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2019 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -62,11 +62,11 @@ enum pmo_ns_addr_scope { struct pmo_ns_offload_params { uint8_t enable; uint32_t num_ns_offload_count; - uint8_t src_ipv6_addr[PMO_MAC_IPV6_ADDR_LEN]; + uint8_t src_ipv6_addr[QDF_IPV6_ADDR_SIZE]; uint8_t self_ipv6_addr[PMO_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA] - [PMO_MAC_IPV6_ADDR_LEN]; + [QDF_IPV6_ADDR_SIZE]; uint8_t target_ipv6_addr[PMO_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA] - [PMO_MAC_IPV6_ADDR_LEN]; + [QDF_IPV6_ADDR_SIZE]; struct qdf_mac_addr self_macaddr; uint8_t src_ipv6_addr_valid; uint8_t target_ipv6_addr_valid[PMO_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA]; @@ -92,7 +92,7 @@ struct pmo_ns_req { enum pmo_offload_trigger trigger; uint32_t count; uint8_t ipv6_addr[PMO_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA] - [PMO_MAC_IPV6_ADDR_LEN]; + [QDF_IPV6_ADDR_SIZE]; uint8_t ipv6_addr_type[PMO_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA]; enum pmo_ns_addr_scope scope[PMO_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA]; }; diff --git a/core/hdd/inc/wlan_hdd_host_offload.h b/core/hdd/inc/wlan_hdd_host_offload.h index b1a30dcd4f829..e9b984e5d2703 100644 --- a/core/hdd/inc/wlan_hdd_host_offload.h +++ b/core/hdd/inc/wlan_hdd_host_offload.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2014-2017, 2019 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -41,8 +41,8 @@ struct host_offload_req { uint8_t offloadType; uint8_t enableOrDisable; union { - uint8_t hostIpv4Addr[SIR_IPV4_ADDR_LEN]; - uint8_t hostIpv6Addr[SIR_MAC_IPV6_ADDR_LEN]; + uint8_t hostIpv4Addr[QDF_IPV4_ADDR_SIZE]; + uint8_t hostIpv6Addr[QDF_IPV6_ADDR_SIZE]; } params; struct qdf_mac_addr bssId; }; diff --git a/core/hdd/src/wlan_hdd_power.c b/core/hdd/src/wlan_hdd_power.c index a814303e0fc69..0f966e52cc50d 100644 --- a/core/hdd/src/wlan_hdd_power.c +++ b/core/hdd/src/wlan_hdd_power.c @@ -280,7 +280,7 @@ int wlan_hdd_ipv6_changed(struct notifier_block *nb, * Return: 0 on success, error number otherwise. */ static int hdd_fill_ipv6_uc_addr(struct inet6_dev *idev, - uint8_t ipv6_uc_addr[][SIR_MAC_IPV6_ADDR_LEN], + uint8_t ipv6_uc_addr[][QDF_IPV6_ADDR_SIZE], uint8_t *ipv6addr_type, enum pmo_ns_addr_scope *scope_array, uint32_t *count) @@ -333,7 +333,7 @@ static int hdd_fill_ipv6_uc_addr(struct inet6_dev *idev, * Return: 0 on success, error number otherwise. */ static int hdd_fill_ipv6_ac_addr(struct inet6_dev *idev, - uint8_t ipv6_ac_addr[][SIR_MAC_IPV6_ADDR_LEN], + uint8_t ipv6_ac_addr[][QDF_IPV6_ADDR_SIZE], uint8_t *ipv6addr_type, enum pmo_ns_addr_scope *scope_array, uint32_t *count) diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h index a857467e86c67..e229071c8467c 100644 --- a/core/mac/inc/sir_api.h +++ b/core/mac/inc/sir_api.h @@ -65,9 +65,7 @@ struct mac_context; #define SIR_NUM_11B_RATES 4 /* 1,2,5.5,11 */ #define SIR_NUM_11A_RATES 8 /* 6,9,12,18,24,36,48,54 */ -#define SIR_IPV4_ADDR_LEN 4 - -typedef uint8_t tSirIpv4Addr[SIR_IPV4_ADDR_LEN]; +typedef uint8_t tSirIpv4Addr[QDF_IPV4_ADDR_SIZE]; #define SIR_VERSION_STRING_LEN 64 typedef uint8_t tSirVersionString[SIR_VERSION_STRING_LEN]; @@ -1933,8 +1931,8 @@ struct sir_host_offload_req { uint8_t enableOrDisable; uint32_t num_ns_offload_count; union { - uint8_t hostIpv4Addr[SIR_IPV4_ADDR_LEN]; - uint8_t hostIpv6Addr[SIR_MAC_IPV6_ADDR_LEN]; + uint8_t hostIpv4Addr[QDF_IPV4_ADDR_SIZE]; + uint8_t hostIpv6Addr[QDF_IPV6_ADDR_SIZE]; } params; struct qdf_mac_addr bssid; }; diff --git a/core/mac/inc/sir_mac_prot_def.h b/core/mac/inc/sir_mac_prot_def.h index ee10b6f8dc71d..9823b3d741669 100644 --- a/core/mac/inc/sir_mac_prot_def.h +++ b/core/mac/inc/sir_mac_prot_def.h @@ -319,7 +319,6 @@ /* min size of wme oui header: oui(3) + type + subtype + version */ #define SIR_MAC_OUI_WME_HDR_MIN 6 -#define SIR_MAC_IPV6_ADDR_LEN 16 /* ----------------------------------------------------------------------------- */ /* OFFSET definitions for fixed fields in Management frames */ diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index d03e40c353595..4384d9c7ff99a 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -6120,7 +6120,7 @@ void sme_send_hlp_ie_info(mac_handle_t mac_handle, uint8_t vdev_id, return; if ((profile->hlp_ie_len + - SIR_IPV4_ADDR_LEN) > FILS_MAX_HLP_DATA_LEN) { + QDF_IPV4_ADDR_SIZE) > FILS_MAX_HLP_DATA_LEN) { sme_err("HLP IE len exceeds %d", profile->hlp_ie_len); qdf_mem_free(params); @@ -6128,12 +6128,12 @@ void sme_send_hlp_ie_info(mac_handle_t mac_handle, uint8_t vdev_id, } params->vdev_id = vdev_id; - params->hlp_ie_len = profile->hlp_ie_len + SIR_IPV4_ADDR_LEN; + params->hlp_ie_len = profile->hlp_ie_len + QDF_IPV4_ADDR_SIZE; - for (i = 0; i < SIR_IPV4_ADDR_LEN; i++) + for (i = 0; i < QDF_IPV4_ADDR_SIZE; i++) params->hlp_ie[i] = (if_addr >> (i * 8)) & 0xFF; - qdf_mem_copy(params->hlp_ie + SIR_IPV4_ADDR_LEN, + qdf_mem_copy(params->hlp_ie + QDF_IPV4_ADDR_SIZE, profile->hlp_ie, profile->hlp_ie_len); msg.type = SIR_HAL_HLP_IE_INFO;