Przeglądaj źródła

qcacmn: Hide 4th and 5th bytes of MAC address

Currently in the driver, we hide 2nd, 3rd and 4th bytes of the
MAC address in GKI builds. Since 2nd and 3rd bytes are needed for
debugging, hide only 4th and 5th bytes of the MAC address.

Change-Id: Ia432bb0d40e0a09b56e581f192a810e727127d3a
CRs-Fixed: 3616774
Aditya Kodukula 1 rok temu
rodzic
commit
7c2ddd6c3e

+ 7 - 6
qdf/inc/qdf_types.h

@@ -977,30 +977,31 @@ QDF_STATUS qdf_uint64_parse(const char *int_str, uint64_t *out_int);
 #define QDF_MAC_ADDR_SIZE 6
 
 /*
- * If the feature CONFIG_WLAN_TRACE_HIDE_MAC_ADDRESS is enabled,
- * then the requirement is to hide 2nd, 3rd and 4th octet of the
+ * If the feature WLAN_TRACE_HIDE_MAC_ADDRESS is enabled,
+ * then the requirement is to hide 4th and 5th octet of the
  * MAC address in the kernel logs and driver logs.
  *
  * 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
+ * WLAN_TRACE_HIDE_MAC_ADDRESS if enabled and code auditing
  * becomes easy.
  */
 
 #if defined(WLAN_TRACE_HIDE_MAC_ADDRESS)
-#define QDF_MAC_ADDR_FMT "%02x:**:**:**:%02x:%02x"
+#define QDF_MAC_ADDR_FMT "%02x:%02x:%02x:**:**:%02x"
 
 /*
  * The input data type for QDF_MAC_ADDR_REF can be pointer or an array.
  * In case of array, compiler was throwing following warning
  * 'address of array will always evaluate as ‘true’
  * and if the pointer is NULL, zero is passed to the format specifier
- * which results in zero mac address (00:**:**:**:00:00)
+ * which results in zero mac address (00:00:00:**:**:00)
  * For this reason, input data type is typecasted to (uintptr_t).
  */
 #define QDF_MAC_ADDR_REF(a) \
 	(((uintptr_t)NULL != (uintptr_t)(a)) ? (a)[0] : 0), \
-	(((uintptr_t)NULL != (uintptr_t)(a)) ? (a)[4] : 0), \
+	(((uintptr_t)NULL != (uintptr_t)(a)) ? (a)[1] : 0), \
+	(((uintptr_t)NULL != (uintptr_t)(a)) ? (a)[2] : 0), \
 	(((uintptr_t)NULL != (uintptr_t)(a)) ? (a)[5] : 0)
 #else
 #define QDF_MAC_ADDR_FMT "%pM"

+ 1 - 1
umac/cmn_services/crypto/src/wlan_crypto_obj_mgr.c

@@ -329,7 +329,7 @@ static void crypto_free_list(struct crypto_psoc_priv_obj *psoc, void *ptr)
 			   hash_entry_next) {
 		crypto_debug("crypto delete for link_id %d mac_addr "
 			     QDF_MAC_ADDR_FMT, crypto_entry->link_id,
-			     QDF_MAC_ADDR_REF(&crypto_entry->mac_addr.raw));
+			     QDF_MAC_ADDR_REF(crypto_entry->mac_addr.raw));
 		qdf_mem_free(crypto_entry);
 		if (!qdf_atomic_read(&psoc->crypto_key_cnt))
 			crypto_debug("Invalid crypto_key_cnt %d",

+ 1 - 1
wmi/src/wmi_unified_11be_tlv.c

@@ -342,7 +342,7 @@ uint8_t *peer_assoc_add_mlo_params(uint8_t *buf_ptr,
 		  mlo_params->mlo_flags.nstr_bitmap_size,
 		  mlo_params->mlo_flags.mlo_link_switch,
 		  mlo_params->nstr_indication_bitmap,
-		  req->mlo_params.mld_mac);
+		  QDF_MAC_ADDR_REF(req->mlo_params.mld_mac));
 
 	return buf_ptr + sizeof(wmi_peer_assoc_mlo_params);
 }