Browse Source

qcacld-3.0: Use mac_addr pointer as constant

Use mac_addr pointer as constant in wlan_hdd_ml_sap_get_peer,
hdd_set_mld_address and use the same for consecutive APIs.

Change-Id: Ie1b959b14d42b4040b7f960ee3a13b355210e6fd
CRs-Fixed: 3331292
Asutosh Mohapatra 2 years ago
parent
commit
89c2d25ba1

+ 2 - 2
core/hdd/inc/wlan_hdd_main.h

@@ -4240,11 +4240,11 @@ int wlan_hdd_set_mon_chan(struct hdd_adapter *adapter, qdf_freq_t freq,
  */
 void
 hdd_set_mld_address(struct hdd_adapter *adapter,
-		    struct qdf_mac_addr *mac_addr);
+		    const struct qdf_mac_addr *mac_addr);
 #else
 static inline void
 hdd_set_mld_address(struct hdd_adapter *adapter,
-		    struct qdf_mac_addr *mac_addr)
+		    const struct qdf_mac_addr *mac_addr)
 {
 }
 #endif

+ 3 - 7
core/hdd/src/wlan_hdd_cfg80211.c

@@ -21015,7 +21015,7 @@ QDF_STATUS wlan_hdd_send_key_vdev(struct wlan_objmgr_vdev *vdev,
 defined(CFG80211_SINGLE_NETDEV_MULTI_LINK_SUPPORT)
 struct wlan_objmgr_peer *
 wlan_hdd_ml_sap_get_peer(struct wlan_objmgr_vdev *vdev,
-			 uint8_t *peer_mld)
+			 const uint8_t *peer_mld)
 {
 	struct wlan_mlo_dev_context *ap_mlo_dev_ctx;
 	struct wlan_mlo_peer_list *mlo_peer_list;
@@ -21103,11 +21103,7 @@ static int wlan_hdd_add_key_all_mlo_vdev(mac_handle_t mac_handle,
 	 * both the links.
 	 */
 	hdd_ctx = WLAN_HDD_GET_CTX(adapter);
-	/* This is to avoid const qualifier voilation
-	 * while using the mac_addr received from kernel
-	 * to fetch peer
-	 */
-	qdf_mem_copy(&peer_mac.bytes[0], mac_addr, QDF_MAC_ADDR_SIZE);
+
 	mlo_sta_get_vdev_list(vdev, &vdev_count, wlan_vdev_list);
 	for (link = 0; link < vdev_count; link++) {
 		link_vdev = wlan_vdev_list[link];
@@ -21125,7 +21121,7 @@ static int wlan_hdd_add_key_all_mlo_vdev(mac_handle_t mac_handle,
 			if (wlan_vdev_mlme_is_mlo_vdev(link_vdev))
 				peer = wlan_hdd_ml_sap_get_peer(
 						link_vdev,
-						peer_mac.bytes);
+						mac_addr);
 			break;
 		case QDF_STA_MODE:
 		default:

+ 4 - 2
core/hdd/src/wlan_hdd_cfg80211.h

@@ -1047,10 +1047,12 @@ wlan_hdd_mlo_copy_partner_addr_from_mlie(struct wlan_objmgr_vdev *vdev,
  * Return: Peer object
  */
 struct wlan_objmgr_peer *
-wlan_hdd_ml_sap_get_peer(struct wlan_objmgr_vdev *vdev, uint8_t *peer_mld);
+wlan_hdd_ml_sap_get_peer(struct wlan_objmgr_vdev *vdev,
+			 const uint8_t *peer_mld);
 #else
 static inline struct wlan_objmgr_peer *
-wlan_hdd_ml_sap_get_peer(struct wlan_objmgr_vdev *vdev, uint8_t *peer_mld)
+wlan_hdd_ml_sap_get_peer(struct wlan_objmgr_vdev *vdev,
+			 const uint8_t *peer_mld)
 {
 	return NULL;
 }

+ 1 - 1
core/hdd/src/wlan_hdd_main.c

@@ -5006,7 +5006,7 @@ void hdd_update_dynamic_mac(struct hdd_context *hdd_ctx,
 #if defined(WLAN_FEATURE_11BE_MLO) && defined(CFG80211_11BE_BASIC)
 void
 hdd_set_mld_address(struct hdd_adapter *adapter,
-		    struct qdf_mac_addr *mac_addr)
+		    const struct qdf_mac_addr *mac_addr)
 {
 	int i;
 	bool eht_capab;