mirror of
				https://github.com/oplus-giulia-dev/android_kernel_oneplus_sm8650-modules
				synced 2025-11-04 14:19:12 +08:00 
			
		
		
		
	qcom: wlan: cnss2: Reverse MAC address in cnss_qmi_get_dms_mac()
Change-Id: Ifecac206679e6ee230c6cfbb02038fa2ada6dc09
This commit is contained in:
		@@ -3661,6 +3661,10 @@ int cnss_qmi_get_dms_mac(struct cnss_plat_data *plat_priv)
 | 
				
			|||||||
	struct dms_get_mac_address_resp_msg_v01 resp;
 | 
						struct dms_get_mac_address_resp_msg_v01 resp;
 | 
				
			||||||
	struct qmi_txn txn;
 | 
						struct qmi_txn txn;
 | 
				
			||||||
	int ret = 0;
 | 
						int ret = 0;
 | 
				
			||||||
 | 
					#ifdef OPLUS_FEATURE_WIFI_MAC
 | 
				
			||||||
 | 
						int i;
 | 
				
			||||||
 | 
						char revert_mac[QMI_WLFW_MAC_ADDR_SIZE_V01];
 | 
				
			||||||
 | 
					#endif /* OPLUS_FEATURE_WIFI_MAC */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if  (!test_bit(CNSS_QMI_DMS_CONNECTED, &plat_priv->driver_state)) {
 | 
						if  (!test_bit(CNSS_QMI_DMS_CONNECTED, &plat_priv->driver_state)) {
 | 
				
			||||||
		cnss_pr_err("DMS QMI connection not established\n");
 | 
							cnss_pr_err("DMS QMI connection not established\n");
 | 
				
			||||||
@@ -3707,7 +3711,14 @@ int cnss_qmi_get_dms_mac(struct cnss_plat_data *plat_priv)
 | 
				
			|||||||
		goto out;
 | 
							goto out;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	plat_priv->dms.mac_valid = true;
 | 
						plat_priv->dms.mac_valid = true;
 | 
				
			||||||
 | 
					#ifdef OPLUS_FEATURE_WIFI_MAC
 | 
				
			||||||
 | 
						for (i = 0; i < QMI_WLFW_MAC_ADDR_SIZE_V01; i++) {
 | 
				
			||||||
 | 
							revert_mac[i] = resp.mac_address[QMI_WLFW_MAC_ADDR_SIZE_V01 - i -1];
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						memcpy(plat_priv->dms.mac, revert_mac, QMI_WLFW_MAC_ADDR_SIZE_V01);
 | 
				
			||||||
 | 
					#else
 | 
				
			||||||
	memcpy(plat_priv->dms.mac, resp.mac_address, QMI_WLFW_MAC_ADDR_SIZE_V01);
 | 
						memcpy(plat_priv->dms.mac, resp.mac_address, QMI_WLFW_MAC_ADDR_SIZE_V01);
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
	cnss_pr_info("Received DMS MAC: [%pM]\n", plat_priv->dms.mac);
 | 
						cnss_pr_info("Received DMS MAC: [%pM]\n", plat_priv->dms.mac);
 | 
				
			||||||
	ret = cnss_utils_set_wlan_mac_address(plat_priv->dms.mac, QMI_WLFW_MAC_ADDR_SIZE_V01);
 | 
						ret = cnss_utils_set_wlan_mac_address(plat_priv->dms.mac, QMI_WLFW_MAC_ADDR_SIZE_V01);
 | 
				
			||||||
	if (ret < 0) {
 | 
						if (ret < 0) {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user