Browse Source

qcacmn: Replace QDF_FULL_MAC_FMT with QDF_MAC_ADDR_FMT

Currently in driver, two macros are defined to specify the
mac address printing format. Since both macros achieve
the same result, replace all instances of QDF_FULL_MAC_FMT
with QDF_MAC_ADDR_FMT.

Change-Id: I195448267ef8e77a7fd5b232ffbf2cfb0ded1be4
CRs-Fixed: 3559488
Aditya Kodukula 2 years ago
parent
commit
54ab05a36f

+ 13 - 12
iot_sim/core/iot_sim_common.c

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2023 Qualcomm Innovation Center, Inc. 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 above
@@ -198,8 +199,8 @@ iot_sim_add_peer(struct iot_sim_context *isc, struct qdf_mac_addr *mac)
 					   (struct iot_sim_rule_per_peer));
 		if (!peer_rule) {
 			iot_sim_err("Memory alloc failed for peer: "
-				    QDF_FULL_MAC_FMT,
-				    QDF_FULL_MAC_REF(mac->bytes));
+				    QDF_MAC_ADDR_FMT,
+				    QDF_MAC_ADDR_REF(mac->bytes));
 			goto rel_lock;
 		}
 
@@ -208,8 +209,8 @@ iot_sim_add_peer(struct iot_sim_context *isc, struct qdf_mac_addr *mac)
 					      &peer_rule->node);
 		if (QDF_IS_STATUS_ERROR(status)) {
 			iot_sim_err("peer_list enqueue failed for peer "
-				    QDF_FULL_MAC_FMT,
-				    QDF_FULL_MAC_REF(mac->bytes));
+				    QDF_MAC_ADDR_FMT,
+				    QDF_MAC_ADDR_REF(mac->bytes));
 			qdf_mem_free(peer_rule);
 			peer_rule = NULL;
 		}
@@ -865,8 +866,8 @@ iot_sim_delete_rule_for_mac(struct iot_sim_context *isc,
 	if (qdf_is_macaddr_zero(mac))
 		iot_sim_info("Rule deletion for all peers");
 	else
-		iot_sim_info("Rule deletion for " QDF_FULL_MAC_FMT,
-			     QDF_FULL_MAC_REF(mac->bytes));
+		iot_sim_info("Rule deletion for " QDF_MAC_ADDR_FMT,
+			     QDF_MAC_ADDR_REF(mac->bytes));
 
 	iot_sim_debug("oper:%s seq: %hu %s:%hu/%hu",
 		      iot_sim_oper_to_str(oper), seq,
@@ -1132,8 +1133,8 @@ iot_sim_add_rule_for_mac(struct iot_sim_context *isc,
 		if (qdf_is_macaddr_zero(mac))
 			iot_sim_info("Rule addition for all peers");
 		else
-			iot_sim_info("Rule addition for " QDF_FULL_MAC_FMT,
-				     QDF_FULL_MAC_REF(mac->bytes));
+			iot_sim_info("Rule addition for " QDF_MAC_ADDR_FMT,
+				     QDF_MAC_ADDR_REF(mac->bytes));
 
 		iot_sim_info("oper:%s seq: %hu %s:%hu/%hu delay:%hu",
 			     iot_sim_oper_to_str(oper), seq,
@@ -1349,8 +1350,8 @@ iot_sim_parse_user_input_delay(struct iot_sim_context *isc,
 	if (argv[5])
 		status = qdf_mac_parse(argv[5], addr);
 
-	iot_sim_err("delay rule mac address " QDF_FULL_MAC_FMT,
-		    QDF_FULL_MAC_REF(addr->bytes));
+	iot_sim_err("delay rule mac address " QDF_MAC_ADDR_FMT,
+		    QDF_MAC_ADDR_REF(addr->bytes));
 
 	return status;
 err:
@@ -1539,8 +1540,8 @@ iot_sim_parse_user_input_drop(struct iot_sim_context *isc,
 	if (argv[5])
 		status = qdf_mac_parse(argv[5], addr);
 
-	iot_sim_err("drop rule mac address " QDF_FULL_MAC_FMT,
-		    QDF_FULL_MAC_REF(addr->bytes));
+	iot_sim_err("drop rule mac address " QDF_MAC_ADDR_FMT,
+		    QDF_MAC_ADDR_REF(addr->bytes));
 
 	return status;
 err:

+ 2 - 2
os_if/linux/scan/src/wlan_cfg80211_scan.c

@@ -108,8 +108,8 @@ static void wlan_fill_scan_rand_attrs(struct wlan_objmgr_vdev *vdev,
 	*randomize = true;
 	memcpy(addr, mac_addr, QDF_MAC_ADDR_SIZE);
 	memcpy(mask, mac_addr_mask, QDF_MAC_ADDR_SIZE);
-	osif_debug("Random mac addr: "QDF_MAC_ADDR_FMT" and Random mac mask: "QDF_FULL_MAC_FMT,
-		   QDF_MAC_ADDR_REF(addr), QDF_FULL_MAC_REF(mask));
+	osif_debug("Random mac addr: "QDF_MAC_ADDR_FMT" and Random mac mask: "QDF_MAC_ADDR_FMT,
+		   QDF_MAC_ADDR_REF(addr), QDF_MAC_ADDR_REF(mask));
 }
 
 /**

+ 1 - 6
qdf/inc/qdf_types.h

@@ -978,17 +978,12 @@ QDF_STATUS qdf_uint64_parse(const char *int_str, uint64_t *out_int);
  * If the feature CONFIG_WLAN_TRACE_HIDE_MAC_ADDRESS is enabled,
  * then the requirement is to hide 2nd, 3rd and 4th octet of the
  * MAC address in the kernel logs and driver logs.
- * But other management interfaces like ioctl, debugfs, sysfs,
- * wext, unit test code or non-production simulator sw (iot_sim)
- * should continue to log the full mac address.
  *
- * Developers must use QDF_FULL_MAC_FMT instead of "%pM",
+ * Developers must use QDF_MAC_ADDR_FMT instead of "%pM",
  * as this macro helps avoid accidentally breaking the feature
  * CONFIG_WLAN_TRACE_HIDE_MAC_ADDRESS if enabled and code auditing
  * becomes easy.
  */
-#define QDF_FULL_MAC_FMT "%pM"
-#define QDF_FULL_MAC_REF(a) (a)
 
 #if defined(WLAN_TRACE_HIDE_MAC_ADDRESS)
 #define QDF_MAC_ADDR_FMT "%02x:**:**:**:%02x:%02x"

+ 5 - 5
qdf/test/qdf_types_test.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2018-2020 The Linux Foundation. All rights reserved.
- * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. 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
@@ -502,11 +502,11 @@ __ut_mac(const char *str, const char *display_str, QDF_STATUS exp_status,
 		return 0;
 
 	if (qdf_mem_cmp(&value, exp_value, sizeof(value))) {
-		qdf_nofl_alert("FAIL: qdf_mac_parse(%s) -> " QDF_FULL_MAC_FMT
-			       "; expected " QDF_FULL_MAC_FMT,
+		qdf_nofl_alert("FAIL: qdf_mac_parse(%s) -> " QDF_MAC_ADDR_FMT
+			       "; expected " QDF_MAC_ADDR_FMT,
 			       display_str,
-			       QDF_FULL_MAC_REF(value.bytes),
-			       QDF_FULL_MAC_REF(exp_value->bytes));
+			       QDF_MAC_ADDR_REF(value.bytes),
+			       QDF_MAC_ADDR_REF(exp_value->bytes));
 		return 1;
 	}
 

+ 5 - 5
umac/cfr/dispatcher/src/wlan_cfr_ucfg_api.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2019-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. 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
@@ -997,12 +997,12 @@ QDF_STATUS ucfg_cfr_get_cfg(struct wlan_objmgr_vdev *vdev)
 			glbl_cfg->data_subtype_filter);
 		cfr_err("TX Addr: " QDF_MAC_ADDR_FMT,
 			QDF_MAC_ADDR_REF(glbl_cfg->tx_addr));
-		cfr_err("TX Addr Mask: " QDF_FULL_MAC_FMT,
-			QDF_FULL_MAC_REF(glbl_cfg->tx_addr_mask));
+		cfr_err("TX Addr Mask: " QDF_MAC_ADDR_FMT,
+			QDF_MAC_ADDR_REF(glbl_cfg->tx_addr_mask));
 		cfr_err("RX Addr: " QDF_MAC_ADDR_FMT,
 			QDF_MAC_ADDR_REF(glbl_cfg->rx_addr));
-		cfr_err("RX Addr Mask: " QDF_FULL_MAC_FMT,
-			QDF_FULL_MAC_REF(glbl_cfg->rx_addr_mask));
+		cfr_err("RX Addr Mask: " QDF_MAC_ADDR_FMT,
+			QDF_MAC_ADDR_REF(glbl_cfg->rx_addr_mask));
 	}
 
 	wlan_objmgr_pdev_release_ref(pdev, WLAN_CFR_ID);