Kaynağa Gözat

qcacld-3.0: Move VDEV specific fields to per link struct

To support multiple VDEVs in single adapter, the VDEV
specific fields in hdd_adapter needs to be moved to
link specific data structure.

Move the following fields from hdd_adapter structure to
wlan_hdd_link_info structure.
 1) vdev_id
 2) vdev_lock
 3) vdev
 4) vdev_destroy_event

Change-Id: I80d0ed167ca31bff7445b9c7788c86ef6f776018
CRs-Fixed: 3291070
Vinod Kumar Pirla 2 yıl önce
ebeveyn
işleme
de515fcd94
79 değiştirilmiş dosya ile 1384 ekleme ve 1198 silme
  1. 21 20
      core/hdd/inc/wlan_hdd_main.h
  2. 2 2
      core/hdd/src/wlan_hdd_active_tos.c
  3. 6 5
      core/hdd/src/wlan_hdd_apf.c
  4. 34 30
      core/hdd/src/wlan_hdd_assoc.c
  5. 10 9
      core/hdd/src/wlan_hdd_bcn_recv.c
  6. 3 3
      core/hdd/src/wlan_hdd_btc_chain_mode.c
  7. 28 22
      core/hdd/src/wlan_hdd_cfg.c
  8. 174 142
      core/hdd/src/wlan_hdd_cfg80211.c
  9. 2 2
      core/hdd/src/wlan_hdd_cfr.c
  10. 28 24
      core/hdd/src/wlan_hdd_cm_connect.c
  11. 20 17
      core/hdd/src/wlan_hdd_cm_disconnect.c
  12. 2 2
      core/hdd/src/wlan_hdd_coex_config.c
  13. 13 10
      core/hdd/src/wlan_hdd_dcs.c
  14. 8 6
      core/hdd/src/wlan_hdd_debugfs_coex.c
  15. 2 2
      core/hdd/src/wlan_hdd_debugfs_offload.c
  16. 2 2
      core/hdd/src/wlan_hdd_debugfs_roam.c
  17. 2 2
      core/hdd/src/wlan_hdd_disa.c
  18. 1 1
      core/hdd/src/wlan_hdd_eht.c
  19. 11 11
      core/hdd/src/wlan_hdd_ext_scan.c
  20. 2 2
      core/hdd/src/wlan_hdd_gpio.c
  21. 3 2
      core/hdd/src/wlan_hdd_green_ap.c
  22. 10 8
      core/hdd/src/wlan_hdd_he.c
  23. 108 102
      core/hdd/src/wlan_hdd_hostapd.c
  24. 72 62
      core/hdd/src/wlan_hdd_hostapd_wext.c
  25. 120 107
      core/hdd/src/wlan_hdd_ioctl.c
  26. 2 2
      core/hdd/src/wlan_hdd_ipa.c
  27. 3 3
      core/hdd/src/wlan_hdd_lpass.c
  28. 161 142
      core/hdd/src/wlan_hdd_main.c
  29. 4 4
      core/hdd/src/wlan_hdd_mcc_quota.c
  30. 2 2
      core/hdd/src/wlan_hdd_mdns_offload.c
  31. 4 3
      core/hdd/src/wlan_hdd_medium_assess.c
  32. 2 2
      core/hdd/src/wlan_hdd_nan.c
  33. 21 18
      core/hdd/src/wlan_hdd_nan_datapath.c
  34. 3 3
      core/hdd/src/wlan_hdd_nud_tracking.c
  35. 6 6
      core/hdd/src/wlan_hdd_object_manager.c
  36. 17 17
      core/hdd/src/wlan_hdd_ocb.c
  37. 14 13
      core/hdd/src/wlan_hdd_oemdata.c
  38. 7 6
      core/hdd/src/wlan_hdd_ota_test.c
  39. 18 15
      core/hdd/src/wlan_hdd_p2p.c
  40. 3 2
      core/hdd/src/wlan_hdd_p2p_listen_offload.c
  41. 3 2
      core/hdd/src/wlan_hdd_packet_filter.c
  42. 2 2
      core/hdd/src/wlan_hdd_peer_txq_flush.c
  43. 56 47
      core/hdd/src/wlan_hdd_power.c
  44. 12 10
      core/hdd/src/wlan_hdd_pre_cac.c
  45. 9 8
      core/hdd/src/wlan_hdd_regulatory.c
  46. 3 3
      core/hdd/src/wlan_hdd_rssi_monitor.c
  47. 8 7
      core/hdd/src/wlan_hdd_scan.c
  48. 6 4
      core/hdd/src/wlan_hdd_softap_tx_rx.c
  49. 13 12
      core/hdd/src/wlan_hdd_son.c
  50. 13 10
      core/hdd/src/wlan_hdd_station_info.c
  51. 41 35
      core/hdd/src/wlan_hdd_stats.c
  52. 2 2
      core/hdd/src/wlan_hdd_subnet_detect.c
  53. 1 1
      core/hdd/src/wlan_hdd_sysfs.c
  54. 2 2
      core/hdd/src/wlan_hdd_sysfs_bmiss.c
  55. 3 3
      core/hdd/src/wlan_hdd_sysfs_dcm.c
  56. 3 1
      core/hdd/src/wlan_hdd_sysfs_dl_modes.c
  57. 3 3
      core/hdd/src/wlan_hdd_sysfs_dp_traffic_end_indication.c
  58. 10 5
      core/hdd/src/wlan_hdd_sysfs_dp_tx_delay_stats.c
  59. 4 3
      core/hdd/src/wlan_hdd_sysfs_gtx_bw_mask.c
  60. 3 1
      core/hdd/src/wlan_hdd_sysfs_he_bss_color.c
  61. 5 5
      core/hdd/src/wlan_hdd_sysfs_motion_detection.c
  62. 3 3
      core/hdd/src/wlan_hdd_sysfs_range_ext.c
  63. 4 3
      core/hdd/src/wlan_hdd_sysfs_reassoc.c
  64. 2 2
      core/hdd/src/wlan_hdd_sysfs_rts_cts.c
  65. 3 2
      core/hdd/src/wlan_hdd_sysfs_stats.c
  66. 2 1
      core/hdd/src/wlan_hdd_sysfs_tx_stbc.c
  67. 3 1
      core/hdd/src/wlan_hdd_sysfs_txrx_fw_st_rst.c
  68. 3 1
      core/hdd/src/wlan_hdd_sysfs_txrx_fw_stats.c
  69. 2 1
      core/hdd/src/wlan_hdd_sysfs_txrx_stats.c
  70. 2 2
      core/hdd/src/wlan_hdd_sysfs_unit_test.c
  71. 5 5
      core/hdd/src/wlan_hdd_tdls.c
  72. 19 16
      core/hdd/src/wlan_hdd_tsf.c
  73. 24 23
      core/hdd/src/wlan_hdd_twt.c
  74. 3 3
      core/hdd/src/wlan_hdd_tx_power.c
  75. 15 15
      core/hdd/src/wlan_hdd_tx_rx.c
  76. 2 2
      core/hdd/src/wlan_hdd_wds.c
  77. 115 97
      core/hdd/src/wlan_hdd_wext.c
  78. 7 7
      core/hdd/src/wlan_hdd_wifi_pos_pasn.c
  79. 17 15
      core/hdd/src/wlan_hdd_wmm.c

+ 21 - 20
core/hdd/inc/wlan_hdd_main.h

@@ -994,11 +994,32 @@ enum udp_qos_upgrade {
 
 /**
  * struct wlan_hdd_link_info - Data structure to store the link specific info
+ * @vdev_id: Unique value to identify VDEV. Equal to WLAN_UMAC_VDEV_ID_MAX
+ *           for invalid VDEVs.
+ * @vdev_lock: Lock to protect VDEV pointer access.
+ * @vdev: Pointer to VDEV objmgr.
+ * @vdev_destroy_event: vdev_destroy_event is moved from the qdf_event
+ *                      to linux event consciously, Lets take example
+ *                      when sap interface is waiting on the
+ *                      session_close event and then there is a SSR
+ *                      the wait event is completed the interface down
+ *                      is returned and the next command to the driver
+ *                      will be hdd_hostapd_uinit-->
+ *                      hdd_deinit_ap_mode-->
+ *                      hdd_hostapd_deinit_sap_session where in the
+ *                      sap_ctx would be freed.  During the SSR if the
+ *                      same sap context is used it would result in
+ *                      null pointer de-reference.
  * @session: union of @ap and @station specific structs
  * @session.station: station mode information
  * @session.ap: ap mode specific information
  */
 struct wlan_hdd_link_info {
+	uint8_t vdev_id;
+	qdf_spinlock_t vdev_lock;
+	struct wlan_objmgr_vdev *vdev;
+	struct completion vdev_destroy_event;
+
 	union {
 		struct hdd_station_ctx station;
 		struct hdd_ap_ctx ap;
@@ -1013,9 +1034,6 @@ struct wlan_hdd_link_info {
  *         will always be in mapped memory
  * @node: list node for membership in the adapter list
  * @hdd_ctx:
- * @vdev: object manager vdev context
- * @vdev_lock: lock to protect vdev context access
- * @vdev_id: Unique identifier assigned to the vdev
  * @dev: Handle to the network device
  * @device_mode:
  * @ipv4_notifier_work: IPv4 notifier callback for handling ARP offload on
@@ -1032,18 +1050,6 @@ struct wlan_hdd_link_info {
  * @event_flags: a bitmap of hdd_adapter_flags
  * @hdd_stats: HDD statistics
  * @estimated_linkspeed: estimated link speed
- * @vdev_destroy_event: vdev_destroy_event is moved from the qdf_event
- *                      to linux event consciously, Lets take example
- *                      when sap interface is waiting on the
- *                      session_close event and then there is a SSR
- *                      the wait event is completed the interface down
- *                      is returned and the next command to the driver
- *                      will be hdd_hostapd_uinit-->
- *                      hdd_deinit_ap_mode-->
- *                      hdd_hostapd_deinit_sap_session where in the
- *                      sap_ctx would be freed.  During the SSR if the
- *                      same sap context is used it would result in
- *                      null pointer de-reference.
  * @qdf_monitor_mode_vdev_up_event: QDF event for monitor mode vdev up
  * @disconnect_comp_var: completion variable for disconnect callback
  * @linkup_event_var: completion variable for Linkup Event
@@ -1155,9 +1161,6 @@ struct hdd_adapter {
 	qdf_list_node_t node;
 
 	struct hdd_context *hdd_ctx;
-	struct wlan_objmgr_vdev *vdev;
-	qdf_spinlock_t vdev_lock;
-	uint8_t vdev_id;
 
 	struct net_device *dev;
 
@@ -1183,8 +1186,6 @@ struct hdd_adapter {
 
 	uint32_t estimated_linkspeed;
 
-	struct completion vdev_destroy_event;
-
 #ifdef FEATURE_MONITOR_MODE_SUPPORT
 	qdf_event_t qdf_monitor_mode_vdev_up_event;
 #endif

+ 2 - 2
core/hdd/src/wlan_hdd_active_tos.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2012-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
@@ -125,7 +125,7 @@ hdd_set_limit_off_chan_for_tos(struct hdd_adapter *adapter,
 
 	ucfg_scan_cfg_get_conc_max_resttime(hdd_ctx->psoc, &rest_conc_time);
 	status = sme_send_limit_off_channel_params(hdd_ctx->mac_handle,
-					adapter->vdev_id,
+					adapter->deflink->vdev_id,
 					is_tos_active,
 					max_off_chan_time,
 					rest_conc_time,

+ 6 - 5
core/hdd/src/wlan_hdd_apf.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2012-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
@@ -239,7 +239,7 @@ static int hdd_set_reset_apf_offload(struct hdd_context *hdd_ctx,
 		goto fail;
 	}
 
-	apf_set_offload.session_id = adapter->vdev_id;
+	apf_set_offload.session_id = adapter->deflink->vdev_id;
 	apf_set_offload.total_length = nla_get_u32(tb[APF_PACKET_SIZE]);
 
 	if (!apf_set_offload.total_length) {
@@ -320,7 +320,8 @@ hdd_enable_disable_apf(struct hdd_adapter *adapter, bool apf_enable)
 	QDF_STATUS status;
 
 	status = sme_set_apf_enable_disable(hdd_adapter_get_mac_handle(adapter),
-					    adapter->vdev_id, apf_enable);
+					    adapter->deflink->vdev_id,
+					    apf_enable);
 	if (!QDF_IS_STATUS_SUCCESS(status)) {
 		hdd_err("Unable to post sme apf enable/disable message (status-%d)",
 				status);
@@ -350,7 +351,7 @@ hdd_apf_write_memory(struct hdd_adapter *adapter, struct nlattr **tb)
 	QDF_STATUS status;
 	int ret = 0;
 
-	write_mem_params.vdev_id = adapter->vdev_id;
+	write_mem_params.vdev_id = adapter->deflink->vdev_id;
 	if (adapter->apf_context.apf_enabled) {
 		hdd_err("Cannot get/set when APF interpreter is enabled");
 		return -EINVAL;
@@ -500,7 +501,7 @@ static int hdd_apf_read_memory(struct hdd_adapter *adapter, struct nlattr **tb)
 		return -EINVAL;
 	}
 
-	read_mem_params.vdev_id = adapter->vdev_id;
+	read_mem_params.vdev_id = adapter->deflink->vdev_id;
 
 	/* Read APF work memory offset */
 	if (!tb[APF_CURRENT_OFFSET]) {

+ 34 - 30
core/hdd/src/wlan_hdd_assoc.c

@@ -246,16 +246,17 @@ void wlan_hdd_sae_copy_ta_addr(struct cfg80211_external_auth_params *params,
 {
 	struct qdf_mac_addr ta = QDF_MAC_ADDR_ZERO_INIT;
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
+	uint8_t *link_addr;
 
 	status = ucfg_cm_get_sae_auth_ta(adapter->hdd_ctx->pdev,
-					 adapter->vdev_id,
+					 adapter->deflink->vdev_id,
 					 &ta);
 	if (QDF_IS_STATUS_SUCCESS(status))
 		qdf_mem_copy(params->tx_addr, ta.bytes, QDF_MAC_ADDR_SIZE);
-	else if (wlan_vdev_mlme_is_mlo_vdev(adapter->vdev))
-		qdf_mem_copy(params->tx_addr,
-			     wlan_vdev_mlme_get_linkaddr(adapter->vdev),
-			     QDF_MAC_ADDR_SIZE);
+	else if (wlan_vdev_mlme_is_mlo_vdev(adapter->deflink->vdev)) {
+		link_addr = wlan_vdev_mlme_get_linkaddr(adapter->deflink->vdev);
+		qdf_mem_copy(params->tx_addr, link_addr, QDF_MAC_ADDR_SIZE);
+	}
 
 	hdd_debug("status:%d ta:" QDF_MAC_ADDR_FMT, status,
 		  QDF_MAC_ADDR_REF(params->tx_addr));
@@ -286,10 +287,11 @@ wlan_hdd_sae_update_mld_addr(struct cfg80211_external_auth_params *params,
 	struct qdf_mac_addr mld_addr;
 	QDF_STATUS status;
 
-	if (!wlan_vdev_mlme_is_mlo_vdev(adapter->vdev))
+	if (!wlan_vdev_mlme_is_mlo_vdev(adapter->deflink->vdev))
 		return QDF_STATUS_SUCCESS;
 
-	status = wlan_vdev_get_bss_peer_mld_mac(adapter->vdev, &mld_addr);
+	status = wlan_vdev_get_bss_peer_mld_mac(adapter->deflink->vdev,
+						&mld_addr);
 	if (QDF_IS_STATUS_ERROR(status))
 		return QDF_STATUS_E_INVAL;
 
@@ -409,7 +411,7 @@ static void hdd_start_powersave_timer_on_associated(struct hdd_adapter *adapter)
 		AUTO_PS_ENTRY_TIMER_DEFAULT_VALUE :
 		(auto_bmps_timer_val * 1000);
 	sme_ps_enable_auto_ps_timer(hdd_ctx->mac_handle,
-				    adapter->vdev_id,
+				    adapter->deflink->vdev_id,
 				    timeout);
 }
 
@@ -457,7 +459,7 @@ void hdd_conn_set_connection_state(struct hdd_adapter *adapter,
 
 	hdd_nofl_debug("connection state changed %d --> %d for dev %s (vdev %d)",
 		       hdd_sta_ctx->conn_info.conn_state, conn_state,
-		       adapter->dev->name, adapter->vdev_id);
+		       adapter->dev->name, adapter->deflink->vdev_id);
 
 	hdd_sta_ctx->conn_info.conn_state = conn_state;
 }
@@ -523,7 +525,7 @@ struct hdd_adapter *hdd_get_sta_connection_in_progress(
 		    (QDF_P2P_DEVICE_MODE == adapter->device_mode)) {
 			if (hdd_cm_is_connecting(adapter)) {
 				hdd_debug("vdev_id %d: Connection is in progress",
-					  adapter->vdev_id);
+					  adapter->deflink->vdev_id);
 				hdd_adapter_dev_put_debug(adapter, dbgid);
 				if (next_adapter)
 					hdd_adapter_dev_put_debug(next_adapter,
@@ -591,7 +593,7 @@ QDF_STATUS hdd_get_first_connected_sta_vdev_id(struct hdd_context *hdd_ctx,
 		if (adapter->device_mode == QDF_STA_MODE ||
 		    adapter->device_mode == QDF_P2P_CLIENT_MODE) {
 			if (hdd_cm_is_vdev_connected(adapter)) {
-				*vdev_id = adapter->vdev_id;
+				*vdev_id = adapter->deflink->vdev_id;
 				hdd_adapter_dev_put_debug(adapter, dbgid);
 				if (next_adapter)
 					hdd_adapter_dev_put_debug(next_adapter,
@@ -616,7 +618,7 @@ int hdd_remove_beacon_filter(struct hdd_adapter *adapter)
 	struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
 
 	status = sme_remove_beacon_filter(hdd_ctx->mac_handle,
-					  adapter->vdev_id);
+					  adapter->deflink->vdev_id);
 	if (!QDF_IS_STATUS_SUCCESS(status)) {
 		hdd_err("sme_remove_beacon_filter() failed");
 		return -EFAULT;
@@ -641,7 +643,7 @@ int hdd_add_beacon_filter(struct hdd_adapter *adapter)
 			    (unsigned long *)ie_map);
 
 	status = sme_add_beacon_filter(hdd_ctx->mac_handle,
-				       adapter->vdev_id, ie_map);
+				       adapter->deflink->vdev_id, ie_map);
 	if (!QDF_IS_STATUS_SUCCESS(status)) {
 		hdd_err("sme_add_beacon_filter() failed");
 		return -EFAULT;
@@ -1233,7 +1235,7 @@ void hdd_set_unpause_queue(void *soc, struct hdd_adapter *adapter)
 	if (!rc)
 		hdd_debug("timeout waiting for sta_authorized_event");
 
-	cdp_fc_vdev_unpause(soc, adapter->vdev_id,
+	cdp_fc_vdev_unpause(soc, adapter->deflink->vdev_id,
 			    OL_TXQ_PAUSE_REASON_PEER_UNAUTHORIZED,
 			    0);
 }
@@ -1261,14 +1263,14 @@ hdd_config_wds_repeater_mode(struct hdd_adapter *adapter, uint8_t *peer_addr)
 	ol_txrx_soc_handle soc = cds_get_context(QDF_MODULE_ID_SOC);
 
 	vdev_param.cdp_vdev_param_mec = true;
-	if (cdp_txrx_set_vdev_param(soc, adapter->vdev_id, CDP_ENABLE_MEC,
-				    vdev_param))
+	if (cdp_txrx_set_vdev_param(soc, adapter->deflink->vdev_id,
+				    CDP_ENABLE_MEC, vdev_param))
 		hdd_debug("Failed to set MEC param on DP vdev");
 
 	hdd_nofl_info("Turn on 4 address for peer: " QDF_MAC_ADDR_FMT,
 		      QDF_MAC_ADDR_REF(peer_addr));
 	if (sme_set_peer_param(peer_addr, WMI_HOST_PEER_USE_4ADDR, true,
-			       adapter->vdev_id))
+			       adapter->deflink->vdev_id))
 		hdd_err("Failed to enable WDS on vdev");
 }
 #else
@@ -1292,7 +1294,7 @@ QDF_STATUS hdd_change_peer_state(struct hdd_adapter *adapter,
 		return QDF_STATUS_E_FAULT;
 	}
 
-	if (hdd_is_roam_sync_in_progress(hdd_ctx, adapter->vdev_id)) {
+	if (hdd_is_roam_sync_in_progress(hdd_ctx, adapter->deflink->vdev_id)) {
 		if (adapter->device_mode == QDF_STA_MODE &&
 		    (wlan_mlme_get_wds_mode(hdd_ctx->psoc) ==
 		    WLAN_WDS_MODE_REPEATER))
@@ -1314,7 +1316,7 @@ QDF_STATUS hdd_change_peer_state(struct hdd_adapter *adapter,
 		err = sme_set_peer_authorized(
 				peer_mac,
 				hdd_set_peer_authorized_event,
-				adapter->vdev_id);
+				adapter->deflink->vdev_id);
 		if (err != QDF_STATUS_SUCCESS) {
 			hdd_err("Failed to set the peer state to authorized");
 			return QDF_STATUS_E_FAULT;
@@ -1415,8 +1417,9 @@ QDF_STATUS hdd_roam_register_sta(struct hdd_adapter *adapter,
 	}
 
 	if (adapter->device_mode == QDF_NDI_MODE) {
-		phymode = ucfg_mlme_get_vdev_phy_mode(adapter->hdd_ctx->psoc,
-						      adapter->vdev_id);
+		phymode = ucfg_mlme_get_vdev_phy_mode(
+						adapter->hdd_ctx->psoc,
+						adapter->deflink->vdev_id);
 		ch_width = ucfg_mlme_get_ch_width_from_phymode(phymode);
 	} else {
 		ch_width = ucfg_mlme_get_peer_ch_width(adapter->hdd_ctx->psoc,
@@ -1462,7 +1465,8 @@ static int hdd_change_sta_state_authenticated(struct hdd_adapter *adapter,
 	    hddstactx->conn_info.auth_type != eCSR_AUTH_TYPE_OPEN_SYSTEM &&
 	    hddstactx->conn_info.auth_type != eCSR_AUTH_TYPE_SHARED_KEY)
 		ucfg_ipa_wlan_evt(adapter->hdd_ctx->pdev, adapter->dev,
-				  adapter->device_mode, adapter->vdev_id,
+				  adapter->device_mode,
+				  adapter->deflink->vdev_id,
 				  WLAN_IPA_STA_CONNECT, mac_addr,
 				  WLAN_REG_IS_24GHZ_CH_FREQ(
 					hddstactx->conn_info.chan_freq));
@@ -1504,7 +1508,7 @@ static void hdd_change_peer_state_after_set_key(struct hdd_adapter *adapter,
 		 * case of 11R roaming.
 		 */
 		if (sme_neighbor_roam_is11r_assoc(adapter->hdd_ctx->mac_handle,
-						  adapter->vdev_id))
+						  adapter->deflink->vdev_id))
 			hdd_sta_ctx->conn_info.ptk_installed = true;
 	} else {
 		hdd_sta_ctx->conn_info.ptk_installed = true;
@@ -2153,7 +2157,7 @@ static void hdd_roam_channel_switch_handler(struct hdd_adapter *adapter,
 
 	/* Enable Roaming on STA interface which was disabled before CSA */
 	if (adapter->device_mode == QDF_STA_MODE)
-		sme_start_roaming(mac_handle, adapter->vdev_id,
+		sme_start_roaming(mac_handle, adapter->deflink->vdev_id,
 				  REASON_DRIVER_ENABLED,
 				  RSO_CHANNEL_SWITCH);
 
@@ -2179,7 +2183,7 @@ static void hdd_roam_channel_switch_handler(struct hdd_adapter *adapter,
 				hdd_ctx->pdev, sta_ctx->conn_info.bssid.bytes,
 				&connected_vdev))
 			notify = false;
-		else if (adapter->vdev_id != connected_vdev)
+		else if (adapter->deflink->vdev_id != connected_vdev)
 			notify = false;
 	}
 	if (notify) {
@@ -2192,10 +2196,10 @@ static void hdd_roam_channel_switch_handler(struct hdd_adapter *adapter,
 	} else {
 		hdd_err("BSS "QDF_MAC_ADDR_FMT" no connected with vdev %d (%d)",
 			QDF_MAC_ADDR_REF(sta_ctx->conn_info.bssid.bytes),
-			adapter->vdev_id, connected_vdev);
+			adapter->deflink->vdev_id, connected_vdev);
 	}
 	status = policy_mgr_set_hw_mode_on_channel_switch(hdd_ctx->psoc,
-		adapter->vdev_id);
+		adapter->deflink->vdev_id);
 	if (QDF_IS_STATUS_ERROR(status))
 		hdd_debug("set hw mode change not done");
 
@@ -2251,7 +2255,7 @@ hdd_sme_roam_callback(void *context, struct csr_roam_info *roam_info,
 	hdd_ctx = WLAN_HDD_GET_CTX(adapter);
 
 	MTRACE(qdf_trace(QDF_MODULE_ID_HDD, TRACE_CODE_HDD_RX_SME_MSG,
-				 adapter->vdev_id, roam_status));
+				 adapter->deflink->vdev_id, roam_status));
 
 	switch (roam_status) {
 	case eCSR_ROAM_MIC_ERROR_IND:
@@ -2266,7 +2270,7 @@ hdd_sme_roam_callback(void *context, struct csr_roam_info *roam_info,
 							  roam_result);
 		if (eCSR_ROAM_RESULT_AUTHENTICATED == roam_result)
 			hdd_debug("set key complete, session: %d",
-				  adapter->vdev_id);
+				  adapter->deflink->vdev_id);
 	}
 		break;
 	case eCSR_ROAM_UNPROT_MGMT_FRAME_IND:
@@ -2612,7 +2616,7 @@ bool hdd_is_fils_connection(struct hdd_context *hdd_ctx,
 	struct wlan_fils_connection_info *fils_info;
 
 	fils_info = wlan_cm_get_fils_connection_info(hdd_ctx->psoc,
-						     adapter->vdev_id);
+						     adapter->deflink->vdev_id);
 	if (fils_info)
 		return fils_info->is_fils_connection;
 

+ 10 - 9
core/hdd/src/wlan_hdd_bcn_recv.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
@@ -230,8 +230,8 @@ static int hdd_handle_beacon_reporting_start_op(struct hdd_context *hdd_ctx,
 	}
 	/* Handle beacon receive start indication */
 	qdf_status = sme_handle_bcn_recv_start(hdd_ctx->mac_handle,
-					       adapter->vdev_id, nth_value,
-					       do_not_resume);
+					       adapter->deflink->vdev_id,
+					       nth_value, do_not_resume);
 	if (QDF_IS_STATUS_ERROR(qdf_status)) {
 		hdd_err("bcn rcv start failed with status=%d", qdf_status);
 		if (sme_register_bcn_report_pe_cb(hdd_ctx->mac_handle, NULL))
@@ -262,7 +262,7 @@ static int hdd_handle_beacon_reporting_stop_op(struct hdd_context *hdd_ctx,
 	int errno;
 
 	/* Reset bcn recv start flag */
-	sme_stop_beacon_report(hdd_ctx->mac_handle, adapter->vdev_id);
+	sme_stop_beacon_report(hdd_ctx->mac_handle, adapter->deflink->vdev_id);
 
 	/* Deregister beacon report callback */
 	qdf_status = sme_register_bcn_report_pe_cb(hdd_ctx->mac_handle, NULL);
@@ -390,7 +390,7 @@ static int __wlan_hdd_cfg80211_bcn_rcv_op(struct wiphy *wiphy,
 		hdd_debug("Beacon Report: Period: %d", nth_value);
 
 		if (sme_is_beacon_report_started(hdd_ctx->mac_handle,
-						 adapter->vdev_id)) {
+						 adapter->deflink->vdev_id)) {
 			hdd_debug("Start cmd already in progress, issue the stop to FW, before new start");
 			if (hdd_handle_beacon_reporting_stop_op(hdd_ctx,
 								adapter)) {
@@ -410,7 +410,7 @@ static int __wlan_hdd_cfg80211_bcn_rcv_op(struct wiphy *wiphy,
 		break;
 	case QCA_WLAN_VENDOR_BEACON_REPORTING_OP_STOP:
 		if (sme_is_beacon_report_started(hdd_ctx->mac_handle,
-						 adapter->vdev_id)) {
+						 adapter->deflink->vdev_id)) {
 			errno = hdd_handle_beacon_reporting_stop_op(hdd_ctx,
 								    adapter);
 			if (errno) {
@@ -464,15 +464,16 @@ void hdd_beacon_recv_pause_indication(hdd_handle_t hdd_handle,
 	}
 
 	do_not_resume =
-		sme_is_beacon_reporting_do_not_resume(hdd_ctx->mac_handle,
-						      adapter->vdev_id);
+		sme_is_beacon_reporting_do_not_resume(
+						hdd_ctx->mac_handle,
+						adapter->deflink->vdev_id);
 
 	if (is_disconnected) {
 		abort_reason =
 		     QCA_WLAN_VENDOR_BEACON_REPORTING_PAUSE_REASON_DISCONNECTED;
 		/* Deregister callbacks and Reset bcn recv start flag */
 		if (sme_is_beacon_report_started(hdd_ctx->mac_handle,
-						 adapter->vdev_id))
+						 adapter->deflink->vdev_id))
 			hdd_handle_beacon_reporting_stop_op(hdd_ctx,
 							    adapter);
 	} else {

+ 3 - 3
core/hdd/src/wlan_hdd_btc_chain_mode.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2020-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 above
@@ -78,13 +78,13 @@ wlan_hdd_btc_chain_mode_handler(struct wlan_objmgr_vdev *vdev)
 		mode == WLAN_COEX_BTC_CHAIN_MODE_HYBRID) ? 1 : 2);
 
 	hdd_debug("update nss to %d for vdev %d, device mode %d",
-		  nss, adapter->vdev_id, adapter->device_mode);
+		  nss, adapter->deflink->vdev_id, adapter->device_mode);
 	band = NSS_CHAINS_BAND_2GHZ;
 	sme_update_nss_in_mlme_cfg(mac_handle, nss, nss,
 				   adapter->device_mode, band);
 	sme_update_vdev_type_nss(mac_handle, nss, band);
 	hdd_store_nss_chains_cfg_in_vdev(adapter);
-	sme_update_he_cap_nss(mac_handle, adapter->vdev_id, nss);
+	sme_update_he_cap_nss(mac_handle, adapter->deflink->vdev_id, nss);
 
 	freq = hdd_get_adapter_home_channel(adapter);
 

+ 28 - 22
core/hdd/src/wlan_hdd_cfg.c

@@ -1118,7 +1118,7 @@ hdd_set_nss_params(struct hdd_adapter *adapter,
 	if (QDF_IS_STATUS_ERROR(
 		sme_nss_chains_update(mac_handle,
 				      &user_cfg,
-				      adapter->vdev_id)))
+				      adapter->deflink->vdev_id)))
 		return QDF_STATUS_E_FAILURE;
 
 	/* Check TDLS status and update antenna mode */
@@ -1229,15 +1229,15 @@ QDF_STATUS hdd_update_nss(struct hdd_adapter *adapter, uint8_t tx_nss,
 		if (hdd_is_vdev_in_conn_state(adapter))
 			return hdd_set_nss_params(adapter, tx_nss, rx_nss);
 		hdd_debug("Vdev %d in disconnect state, changing ini nss params",
-			  adapter->vdev_id);
+			  adapter->deflink->vdev_id);
 		if (!bval) {
 			hdd_err("Nss in 1x1, no change required, 2x2 mode disabled");
 			return QDF_STATUS_SUCCESS;
 		}
 
 		hdd_update_nss_in_vdev(adapter, mac_handle, tx_nss, rx_nss);
-		sme_set_nss_capability(mac_handle, adapter->vdev_id, rx_nss,
-				       adapter->device_mode);
+		sme_set_nss_capability(mac_handle, adapter->deflink->vdev_id,
+				       rx_nss, adapter->device_mode);
 
 		return QDF_STATUS_SUCCESS;
 	}
@@ -1346,8 +1346,8 @@ skip_ht_cap_update:
 		status = false;
 		hdd_err("Could not get MCS SET from CFG");
 	}
-	sme_set_nss_capability(mac_handle, adapter->vdev_id, rx_nss,
-			       adapter->device_mode);
+	sme_set_nss_capability(mac_handle, adapter->deflink->vdev_id,
+			       rx_nss, adapter->device_mode);
 #undef WLAN_HDD_RX_MCS_ALL_NSTREAM_RATES
 
 	if (QDF_STATUS_SUCCESS != sme_update_nss(mac_handle, rx_nss))
@@ -1843,7 +1843,7 @@ hdd_set_ht2040_mode(struct hdd_adapter *adapter,
 		else
 			csr_config->obssEnabled = false;
 		status = sme_set_ht2040_mode(hdd_ctx->mac_handle,
-					     adapter->vdev_id,
+					     adapter->deflink->vdev_id,
 					     eHT_CHAN_HT20,
 					     csr_config->obssEnabled);
 	}
@@ -1968,7 +1968,7 @@ int hdd_get_ldpc(struct hdd_adapter *adapter, int *value)
 	int ret;
 
 	hdd_enter();
-	ret = sme_get_ht_config(mac_handle, adapter->vdev_id,
+	ret = sme_get_ht_config(mac_handle, adapter->deflink->vdev_id,
 				WNI_CFG_HT_CAP_INFO_ADVANCE_CODING);
 	if (ret < 0) {
 		hdd_err("Failed to get LDPC value");
@@ -2011,15 +2011,16 @@ int hdd_set_ldpc(struct hdd_adapter *adapter, int value)
 		hdd_err("Failed to set VHT LDPC capability info");
 		return -EIO;
 	}
-	ret = sme_update_ht_config(mac_handle, adapter->vdev_id,
+	ret = sme_update_ht_config(mac_handle, adapter->deflink->vdev_id,
 				   WNI_CFG_HT_CAP_INFO_ADVANCE_CODING,
 				   value);
 	if (ret)
 		hdd_err("Failed to set LDPC value");
-	ret = sme_update_he_ldpc_supp(mac_handle, adapter->vdev_id, value);
+	ret = sme_update_he_ldpc_supp(mac_handle,
+				      adapter->deflink->vdev_id, value);
 	if (ret)
 		hdd_err("Failed to set HE LDPC value");
-	ret = sme_set_auto_rate_ldpc(mac_handle, adapter->vdev_id,
+	ret = sme_set_auto_rate_ldpc(mac_handle, adapter->deflink->vdev_id,
 				     (value ? 0 : 1));
 
 	return ret;
@@ -2031,7 +2032,7 @@ int hdd_get_tx_stbc(struct hdd_adapter *adapter, int *value)
 	int ret;
 
 	hdd_enter();
-	ret = sme_get_ht_config(mac_handle, adapter->vdev_id,
+	ret = sme_get_ht_config(mac_handle, adapter->deflink->vdev_id,
 				WNI_CFG_HT_CAP_INFO_TX_STBC);
 	if (ret < 0) {
 		hdd_err("Failed to get TX STBC value");
@@ -2071,12 +2072,13 @@ int hdd_set_tx_stbc(struct hdd_adapter *adapter, int value)
 			return -EINVAL;
 		}
 	}
-	ret = sme_update_ht_config(mac_handle, adapter->vdev_id,
+	ret = sme_update_ht_config(mac_handle, adapter->deflink->vdev_id,
 				   WNI_CFG_HT_CAP_INFO_TX_STBC,
 				   value);
 	if (ret)
 		hdd_err("Failed to set TX STBC value");
-	ret = sme_update_he_tx_stbc_cap(mac_handle, adapter->vdev_id, value);
+	ret = sme_update_he_tx_stbc_cap(mac_handle,
+					adapter->deflink->vdev_id, value);
 	if (ret)
 		hdd_err("Failed to set HE TX STBC value");
 
@@ -2089,7 +2091,7 @@ int hdd_get_rx_stbc(struct hdd_adapter *adapter, int *value)
 	int ret;
 
 	hdd_enter();
-	ret = sme_get_ht_config(mac_handle, adapter->vdev_id,
+	ret = sme_get_ht_config(mac_handle, adapter->deflink->vdev_id,
 				WNI_CFG_HT_CAP_INFO_RX_STBC);
 	if (ret < 0) {
 		hdd_err("Failed to get RX STBC value");
@@ -2129,13 +2131,14 @@ int hdd_set_rx_stbc(struct hdd_adapter *adapter, int value)
 			return -EINVAL;
 		}
 	}
-	ret = sme_update_ht_config(mac_handle, adapter->vdev_id,
+	ret = sme_update_ht_config(mac_handle, adapter->deflink->vdev_id,
 				   WNI_CFG_HT_CAP_INFO_RX_STBC,
 				   value);
 	if (ret)
 		hdd_err("Failed to set RX STBC value");
 
-	ret = sme_update_he_rx_stbc_cap(mac_handle, adapter->vdev_id, value);
+	ret = sme_update_he_rx_stbc_cap(mac_handle,
+					adapter->deflink->vdev_id, value);
 	if (ret)
 		hdd_err("Failed to set HE RX STBC value");
 
@@ -2160,8 +2163,8 @@ int hdd_update_channel_width(struct hdd_adapter *adapter,
 	if (!sme_config)
 		return -ENOMEM;
 
-	ret = wma_cli_set_command(adapter->vdev_id, wmi_vdev_param_chwidth,
-				  chwidth, VDEV_CMD);
+	ret = wma_cli_set_command(adapter->deflink->vdev_id,
+				  wmi_vdev_param_chwidth, chwidth, VDEV_CMD);
 	if (ret)
 		goto free_config;
 
@@ -2169,9 +2172,12 @@ int hdd_update_channel_width(struct hdd_adapter *adapter,
 	sme_config->csr_config.channelBondingMode5GHz = bonding_mode;
 	sme_config->csr_config.channelBondingMode24GHz = bonding_mode;
 	sme_update_config(hdd_ctx->mac_handle, sme_config);
-	sme_set_he_bw_cap(hdd_ctx->mac_handle, adapter->vdev_id, chwidth);
-	sme_set_eht_bw_cap(hdd_ctx->mac_handle, adapter->vdev_id, chwidth);
-	sme_set_vdev_ies_per_band(hdd_ctx->mac_handle, adapter->vdev_id,
+	sme_set_he_bw_cap(hdd_ctx->mac_handle,
+			  adapter->deflink->vdev_id, chwidth);
+	sme_set_eht_bw_cap(hdd_ctx->mac_handle,
+			   adapter->deflink->vdev_id, chwidth);
+	sme_set_vdev_ies_per_band(hdd_ctx->mac_handle,
+				  adapter->deflink->vdev_id,
 				  adapter->device_mode);
 
 free_config:

Dosya farkı çok büyük olduğundan ihmal edildi
+ 174 - 142
core/hdd/src/wlan_hdd_cfg80211.c


+ 2 - 2
core/hdd/src/wlan_hdd_cfr.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2020-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 above
@@ -729,7 +729,7 @@ static int __wlan_hdd_cfg80211_peer_cfr_capture_cfg(struct wiphy *wiphy,
 	}
 
 	adapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	if (wlan_hdd_validate_vdev_id(adapter->vdev_id))
+	if (wlan_hdd_validate_vdev_id(adapter->deflink->vdev_id))
 		return -EINVAL;
 
 	wlan_cfg80211_peer_cfr_capture_cfg(wiphy, adapter,

+ 28 - 24
core/hdd/src/wlan_hdd_cm_connect.c

@@ -190,7 +190,8 @@ void hdd_cm_set_peer_authenticate(struct hdd_adapter *adapter,
 			      OL_TXRX_PEER_STATE_CONN :
 			      OL_TXRX_PEER_STATE_AUTH);
 	hdd_conn_set_authenticated(adapter, !is_auth_required);
-	hdd_objmgr_set_peer_mlme_auth_state(adapter->vdev, !is_auth_required);
+	hdd_objmgr_set_peer_mlme_auth_state(adapter->deflink->vdev,
+					    !is_auth_required);
 }
 
 void hdd_cm_update_rssi_snr_by_bssid(struct hdd_adapter *adapter)
@@ -236,7 +237,7 @@ void hdd_cm_handle_assoc_event(struct wlan_objmgr_vdev *vdev, uint8_t *peer_mac)
 	}
 
 	sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter);
-	ret = hdd_objmgr_set_peer_mlme_state(adapter->vdev,
+	ret = hdd_objmgr_set_peer_mlme_state(adapter->deflink->vdev,
 					     WLAN_ASSOC_STATE);
 	if (ret)
 		hdd_err("Peer object " QDF_MAC_ADDR_FMT " fail to set associated state",
@@ -249,7 +250,7 @@ void hdd_cm_handle_assoc_event(struct wlan_objmgr_vdev *vdev, uint8_t *peer_mac)
 	ucfg_dp_bus_bw_compute_timer_start(hdd_ctx->psoc);
 
 	if (ucfg_pkt_capture_get_pktcap_mode(hdd_ctx->psoc))
-		ucfg_pkt_capture_record_channel(adapter->vdev);
+		ucfg_pkt_capture_record_channel(adapter->deflink->vdev);
 }
 
 /**
@@ -285,7 +286,7 @@ void hdd_cm_netif_queue_enable(struct hdd_adapter *adapter)
 	    hdd_cm_netif_features_update_required(adapter)) {
 		hdd_adapter_ops_record_event(hdd_ctx,
 					     WLAN_HDD_ADAPTER_OPS_WORK_POST,
-					     adapter->vdev_id);
+					     adapter->deflink->vdev_id);
 		qdf_queue_work(0, hdd_ctx->adapter_ops_wq,
 			       &adapter->netdev_features_update_work);
 	}
@@ -509,7 +510,7 @@ static struct hdd_adapter
 		    (hdd_ctx->dev_dfs_cac_status != DFS_CAC_IN_PROGRESS))
 			goto loop_next;
 
-		chan = wlan_vdev_get_active_channel(adapter->vdev);
+		chan = wlan_vdev_get_active_channel(adapter->deflink->vdev);
 		if (!chan) {
 			hdd_debug("Can not get active channel");
 			goto loop_next;
@@ -649,7 +650,8 @@ def_chan:
 	if (!ch_freq || wlan_reg_is_dfs_for_freq(hdd_ctx->pdev, ch_freq) ||
 	    !policy_mgr_is_safe_channel(hdd_ctx->psoc, ch_freq))
 		ch_freq = policy_mgr_get_nondfs_preferred_channel(
-			hdd_ctx->psoc, PM_SAP_MODE, true, ap_adapter->vdev_id);
+				hdd_ctx->psoc, PM_SAP_MODE,
+				true, ap_adapter->deflink->vdev_id);
 	if (WLAN_REG_IS_5GHZ_CH_FREQ(ch_freq) &&
 	    ch_bw > CH_WIDTH_20MHZ) {
 		struct ch_params ch_params;
@@ -677,7 +679,7 @@ def_chan:
 
 	hostapd_state = WLAN_HDD_GET_HOSTAP_STATE_PTR(ap_adapter);
 	qdf_event_reset(&hostapd_state->qdf_event);
-	wlan_hdd_set_sap_csa_reason(hdd_ctx->psoc, ap_adapter->vdev_id,
+	wlan_hdd_set_sap_csa_reason(hdd_ctx->psoc, ap_adapter->deflink->vdev_id,
 				    CSA_REASON_STA_CONNECT_DFS_TO_NON_DFS);
 
 	status = wlansap_set_channel_change_with_csa(
@@ -726,12 +728,12 @@ int wlan_hdd_cm_connect(struct wiphy *wiphy,
 		return -EINVAL;
 	}
 
-	if (wlan_hdd_validate_vdev_id(adapter->vdev_id))
+	if (wlan_hdd_validate_vdev_id(adapter->deflink->vdev_id))
 		return -EINVAL;
 
 	qdf_mtrace(QDF_MODULE_ID_HDD, QDF_MODULE_ID_HDD,
 		   TRACE_CODE_HDD_CFG80211_CONNECT,
-		   adapter->vdev_id, adapter->device_mode);
+		   adapter->deflink->vdev_id, adapter->device_mode);
 
 	if (adapter->device_mode != QDF_STA_MODE &&
 	    adapter->device_mode != QDF_P2P_CLIENT_MODE) {
@@ -784,17 +786,18 @@ int wlan_hdd_cm_connect(struct wiphy *wiphy,
 	hdd_update_scan_ie_for_connect(adapter, &params);
 	hdd_update_action_oui_for_connect(hdd_ctx, req);
 
-	wlan_hdd_connectivity_event_connecting(hdd_ctx, req, adapter->vdev_id);
+	wlan_hdd_connectivity_event_connecting(hdd_ctx, req,
+					       adapter->deflink->vdev_id);
 	status = osif_cm_connect(ndev, vdev, req, &params);
 
 	if (status || ucfg_cm_is_vdev_roaming(vdev)) {
 		/* Release suspend and wake lock for failure or roam invoke */
 		if (status)
 			hdd_err("Vdev %d connect failed status %d",
-				adapter->vdev_id, status);
+				adapter->deflink->vdev_id, status);
 		else
 			hdd_debug("Vdev %d: connect lead to roam invoke",
-				  adapter->vdev_id);
+				  adapter->deflink->vdev_id);
 		qdf_runtime_pm_allow_suspend(&hdd_ctx->runtime_context.connect);
 		hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_CONNECT);
 	}
@@ -875,7 +878,7 @@ hdd_cm_connect_failure_post_user_update(struct wlan_objmgr_vdev *vdev,
 
 	wlan_hdd_connectivity_fail_event(vdev, rsp);
 	hdd_clear_roam_profile_ie(adapter);
-	ucfg_cm_reset_key(hdd_ctx->pdev, adapter->vdev_id);
+	ucfg_cm_reset_key(hdd_ctx->pdev, adapter->deflink->vdev_id);
 	hdd_wmm_dscp_initial_state(adapter);
 	hdd_debug("Disabling queues");
 	wlan_hdd_netif_queue_control(adapter,
@@ -993,7 +996,7 @@ static void hdd_cm_save_bss_info(struct hdd_adapter *adapter,
 	} else {
 		hdd_sta_ctx->conn_info.conn_flag.ht_present = false;
 	}
-	if (hdd_is_roam_sync_in_progress(hdd_ctx, adapter->vdev_id))
+	if (hdd_is_roam_sync_in_progress(hdd_ctx, adapter->deflink->vdev_id))
 		hdd_sta_ctx->conn_info.roam_count++;
 
 	if (assoc_resp->HTInfo.present) {
@@ -1123,8 +1126,8 @@ static void hdd_wmm_cm_connect(struct wlan_objmgr_vdev *vdev,
 				is_access_allowed = true;
 			}
 			if (!sme_neighbor_roam_is11r_assoc(
-							mac_handle,
-							adapter->vdev_id) &&
+						mac_handle,
+						adapter->deflink->vdev_id) &&
 			    !hdd_is_ese_assoc(auth_type, bcn_ie, mac_ctx)) {
 				adapter->hdd_wmm_status.ac_status[ac].
 					is_tspec_valid = false;
@@ -1175,7 +1178,8 @@ static void hdd_cm_save_connect_info(struct hdd_adapter *adapter,
 
 	sta_ctx->conn_info.assoc_status_code = rsp->status_code;
 
-	crypto_params = wlan_crypto_vdev_get_crypto_params(adapter->vdev);
+	crypto_params =
+		wlan_crypto_vdev_get_crypto_params(adapter->deflink->vdev);
 
 	if (crypto_params) {
 		sme_fill_enc_type(&sta_ctx->conn_info.uc_encrypt_type,
@@ -1188,7 +1192,7 @@ static void hdd_cm_save_connect_info(struct hdd_adapter *adapter,
 		sta_ctx->conn_info.last_auth_type =
 					sta_ctx->conn_info.auth_type;
 	}
-	des_chan = wlan_vdev_mlme_get_des_chan(adapter->vdev);
+	des_chan = wlan_vdev_mlme_get_des_chan(adapter->deflink->vdev);
 
 	sta_ctx->conn_info.chan_freq = rsp->freq;
 
@@ -1444,7 +1448,7 @@ hdd_cm_connect_success_pre_user_update(struct wlan_objmgr_vdev *vdev,
 		uapsd_mask =
 			vdev_mlme->ext_vdev_ptr->connect_info.uapsd_per_ac_bitmask;
 
-	cdp_hl_fc_set_td_limit(soc, adapter->vdev_id,
+	cdp_hl_fc_set_td_limit(soc, adapter->deflink->vdev_id,
 			       sta_ctx->conn_info.chan_freq);
 	hdd_wmm_assoc(adapter, false, uapsd_mask);
 
@@ -1488,7 +1492,7 @@ hdd_cm_connect_success_pre_user_update(struct wlan_objmgr_vdev *vdev,
 			&rsp->bssid,
 			ePeerConnected,
 			vdev_mlme->ext_vdev_ptr->connect_info.timing_meas_cap,
-			adapter->vdev_id,
+			adapter->deflink->vdev_id,
 			&vdev_mlme->ext_vdev_ptr->connect_info.chan_info,
 			adapter->device_mode);
 	}
@@ -1496,7 +1500,7 @@ hdd_cm_connect_success_pre_user_update(struct wlan_objmgr_vdev *vdev,
 	if (ucfg_ipa_is_enabled() && !is_auth_required)
 		ucfg_ipa_wlan_evt(hdd_ctx->pdev, adapter->dev,
 				  adapter->device_mode,
-				  adapter->vdev_id,
+				  adapter->deflink->vdev_id,
 				  WLAN_IPA_STA_CONNECT,
 				  rsp->bssid.bytes,
 				  WLAN_REG_IS_24GHZ_CH_FREQ(
@@ -1508,7 +1512,7 @@ hdd_cm_connect_success_pre_user_update(struct wlan_objmgr_vdev *vdev,
 	wlan_hdd_auto_shutdown_enable(hdd_ctx, false);
 
 	DPTRACE(qdf_dp_trace_mgmt_pkt(QDF_DP_TRACE_MGMT_PACKET_RECORD,
-		adapter->vdev_id,
+		adapter->deflink->vdev_id,
 		QDF_TRACE_DEFAULT_PDEV_ID,
 		QDF_PROTO_TYPE_MGMT, QDF_PROTO_MGMT_ASSOC));
 
@@ -1843,12 +1847,12 @@ static void hdd_update_hlp_info(struct net_device *dev,
 	skb->ip_summed = CHECKSUM_UNNECESSARY;
 
 	/*
-	 * adapter->vdev is directly dereferenced because in per packet
+	 * adapter->deflink->vdev is directly dereferenced because in per packet
 	 * path usage of hdd_get_vdev_by_user is costly operation as it
 	 * involves lock access. And it is guaranteed during TX/RX operations
 	 * vdev will be active will not deleted.
 	 */
-	status = ucfg_dp_rx_packet_cbk(adapter->vdev, (qdf_nbuf_t)skb);
+	status = ucfg_dp_rx_packet_cbk(adapter->deflink->vdev, (qdf_nbuf_t)skb);
 	if (QDF_IS_STATUS_ERROR(status)) {
 		hdd_err("Sending HLP packet fails");
 		return;

+ 20 - 17
core/hdd/src/wlan_hdd_cm_disconnect.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2012-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 above
@@ -68,7 +68,7 @@ void hdd_handle_disassociation_event(struct hdd_adapter *adapter,
 		/* send peer status indication to oem app */
 		hdd_send_peer_status_ind_to_app(peer_macaddr,
 						ePeerDisconnected, 0,
-						adapter->vdev_id, NULL,
+						adapter->deflink->vdev_id, NULL,
 						adapter->device_mode);
 
 	hdd_lpass_notify_disconnect(adapter);
@@ -135,7 +135,7 @@ void __hdd_cm_disconnect_handler_pre_user_update(struct hdd_adapter *adapter)
 				  &sta_ctx->conn_info.bssid)))
 		ucfg_ipa_wlan_evt(hdd_ctx->pdev, adapter->dev,
 				  adapter->device_mode,
-				  adapter->vdev_id,
+				  adapter->deflink->vdev_id,
 				  WLAN_IPA_STA_DISCONNECT,
 				  sta_ctx->conn_info.bssid.bytes,
 				  false);
@@ -149,7 +149,7 @@ void __hdd_cm_disconnect_handler_pre_user_update(struct hdd_adapter *adapter)
 	wlan_hdd_auto_shutdown_enable(hdd_ctx, true);
 
 	DPTRACE(qdf_dp_trace_mgmt_pkt(QDF_DP_TRACE_MGMT_PACKET_RECORD,
-		adapter->vdev_id,
+		adapter->deflink->vdev_id,
 		QDF_TRACE_DEFAULT_PDEV_ID,
 		QDF_PROTO_TYPE_MGMT, QDF_PROTO_MGMT_DISASSOC));
 
@@ -172,21 +172,22 @@ void __hdd_cm_disconnect_handler_post_user_update(struct hdd_adapter *adapter,
 
 	/* update P2P connection status */
 	ucfg_p2p_status_disconnect(vdev);
-	hdd_cfr_disconnect(adapter->vdev);
+	hdd_cfr_disconnect(adapter->deflink->vdev);
 
 	hdd_wmm_adapter_clear(adapter);
 	ucfg_cm_ft_reset(vdev);
-	ucfg_cm_reset_key(hdd_ctx->pdev, adapter->vdev_id);
+	ucfg_cm_reset_key(hdd_ctx->pdev, adapter->deflink->vdev_id);
 	hdd_clear_roam_profile_ie(adapter);
 
 	if (adapter->device_mode == QDF_STA_MODE)
 		wlan_crypto_reset_vdev_params(vdev);
 
 	hdd_remove_beacon_filter(adapter);
-	if (sme_is_beacon_report_started(mac_handle, adapter->vdev_id)) {
+	if (sme_is_beacon_report_started(mac_handle,
+					 adapter->deflink->vdev_id)) {
 		hdd_debug("Sending beacon pause indication to userspace");
 		hdd_beacon_recv_pause_indication((hdd_handle_t)hdd_ctx,
-						 adapter->vdev_id,
+						 adapter->deflink->vdev_id,
 						 SCAN_EVENT_TYPE_MAX, true);
 	}
 
@@ -206,7 +207,8 @@ void __hdd_cm_disconnect_handler_post_user_update(struct hdd_adapter *adapter,
 	ucfg_dp_remove_conn_info(vdev);
 
 	/* Setting the RTS profile to original value */
-	if (sme_cli_set_command(adapter->vdev_id, wmi_vdev_param_enable_rtscts,
+	if (sme_cli_set_command(adapter->deflink->vdev_id,
+				wmi_vdev_param_enable_rtscts,
 				cfg_get(hdd_ctx->psoc,
 					CFG_ENABLE_FW_RTS_PROFILE),
 				VDEV_CMD))
@@ -218,7 +220,7 @@ void __hdd_cm_disconnect_handler_post_user_update(struct hdd_adapter *adapter,
 	if ((QDF_STA_MODE == adapter->device_mode) ||
 	    (QDF_P2P_CLIENT_MODE == adapter->device_mode)) {
 		sme_ps_disable_auto_ps_timer(mac_handle,
-					     adapter->vdev_id);
+					     adapter->deflink->vdev_id);
 		adapter->send_mode_change = true;
 	}
 	wlan_hdd_clear_link_layer_stats(adapter);
@@ -234,7 +236,7 @@ void __hdd_cm_disconnect_handler_post_user_update(struct hdd_adapter *adapter,
 #ifdef WLAN_FEATURE_MSCS
 void reset_mscs_params(struct hdd_adapter *adapter)
 {
-	mlme_set_is_mscs_req_sent(adapter->vdev, false);
+	mlme_set_is_mscs_req_sent(adapter->deflink->vdev, false);
 	adapter->mscs_counter = 0;
 }
 #endif
@@ -259,7 +261,7 @@ QDF_STATUS wlan_hdd_cm_issue_disconnect(struct hdd_adapter *adapter,
 
 	qdf_rtpm_sync_resume();
 
-	wlan_rec_conn_info(adapter->vdev_id, DEBUG_CONN_DISCONNECT,
+	wlan_rec_conn_info(adapter->deflink->vdev_id, DEBUG_CONN_DISCONNECT,
 			   sta_ctx->conn_info.bssid.bytes, 0, reason);
 
 	if (sync)
@@ -289,7 +291,7 @@ int wlan_hdd_cm_disconnect(struct wiphy *wiphy,
 	if (ret)
 		return ret;
 
-	if (wlan_hdd_validate_vdev_id(adapter->vdev_id))
+	if (wlan_hdd_validate_vdev_id(adapter->deflink->vdev_id))
 		return -EINVAL;
 
 	if (hdd_ctx->is_wiphy_suspended) {
@@ -299,7 +301,7 @@ int wlan_hdd_cm_disconnect(struct wiphy *wiphy,
 
 	qdf_mtrace(QDF_MODULE_ID_HDD, QDF_MODULE_ID_HDD,
 		   TRACE_CODE_HDD_CFG80211_DISCONNECT,
-		   adapter->vdev_id, reason);
+		   adapter->deflink->vdev_id, reason);
 
 	hdd_print_netdev_txq_status(dev);
 
@@ -349,7 +351,8 @@ hdd_cm_disconnect_complete_pre_user_update(struct wlan_objmgr_vdev *vdev,
 
 	hdd_handle_disassociation_event(adapter, &rsp->req.req.bssid);
 
-	wlan_rec_conn_info(adapter->vdev_id, DEBUG_CONN_DISCONNECT_HANDLER,
+	wlan_rec_conn_info(adapter->deflink->vdev_id,
+			   DEBUG_CONN_DISCONNECT_HANDLER,
 			   rsp->req.req.bssid.bytes,
 			   rsp->req.cm_id,
 			   rsp->req.req.reason_code << 16 |
@@ -406,8 +409,8 @@ static void hdd_cm_set_default_wlm_mode(struct hdd_adapter *adapter)
 	} else {
 		status =
 			sme_set_wlm_latency_level(hdd_ctx->mac_handle,
-						  adapter->vdev_id, def_level,
-						  0, false);
+						  adapter->deflink->vdev_id,
+						  def_level, 0, false);
 		if (QDF_IS_STATUS_SUCCESS(status)) {
 			hdd_debug("reset wlm mode %x on disconnection",
 				  def_level);

+ 2 - 2
core/hdd/src/wlan_hdd_coex_config.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2019-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
@@ -164,7 +164,7 @@ static int __wlan_hdd_cfg80211_set_coex_config(struct wiphy *wiphy,
 
 	hdd_debug("priority4 0x%x", coex_cfg_params.config_arg4);
 
-	coex_cfg_params.vdev_id = adapter->vdev_id;
+	coex_cfg_params.vdev_id = adapter->deflink->vdev_id;
 	status = sme_send_coex_config_cmd(&coex_cfg_params);
 	if (QDF_IS_STATUS_ERROR(status)) {
 		hdd_err("Failed to send coex config params");

+ 13 - 10
core/hdd/src/wlan_hdd_dcs.c

@@ -134,7 +134,7 @@ static QDF_STATUS hdd_dcs_switch_chan_cb(struct wlan_objmgr_vdev *vdev,
 		if (!psoc)
 			return QDF_STATUS_E_INVAL;
 
-		wlan_hdd_set_sap_csa_reason(psoc, adapter->vdev_id,
+		wlan_hdd_set_sap_csa_reason(psoc, adapter->deflink->vdev_id,
 					    CSA_REASON_DCS);
 		ret = hdd_softap_set_channel_change(adapter->dev, tgt_freq,
 						    tgt_width, true);
@@ -301,10 +301,11 @@ static void hdd_dcs_cb(struct wlan_objmgr_psoc *psoc, uint8_t mac_id,
 			 * selecting freq of other MAC may cause MCC with
 			 * other modes if present.
 			 */
-			if (wlan_mlme_get_ap_policy(adapter->vdev) !=
+			if (wlan_mlme_get_ap_policy(adapter->deflink->vdev) !=
 			    HOST_CONCURRENT_AP_POLICY_UNSPECIFIED) {
 				status = hdd_dcs_select_random_chan(
-						hdd_ctx->pdev, adapter->vdev);
+						hdd_ctx->pdev,
+						adapter->deflink->vdev);
 				if (QDF_IS_STATUS_SUCCESS(status))
 					return;
 			}
@@ -431,7 +432,7 @@ void hdd_dcs_hostapd_set_chan(struct hdd_context *hdd_ctx,
 				  ap_ctx->operating_chan_freq,
 				  dcs_ch_freq);
 			wlan_hdd_set_sap_csa_reason(hdd_ctx->psoc,
-						    adapter->vdev_id,
+						    adapter->deflink->vdev_id,
 						    CSA_REASON_DCS);
 			hdd_switch_sap_channel(adapter, dcs_ch, true);
 
@@ -482,6 +483,7 @@ void hdd_dcs_chan_select_complete(struct hdd_adapter *adapter)
 {
 	qdf_freq_t dcs_freq;
 	struct hdd_context *hdd_ctx;
+	uint32_t chan_freq;
 
 	hdd_ctx = WLAN_HDD_GET_CTX(adapter);
 	if (!hdd_ctx) {
@@ -490,13 +492,13 @@ void hdd_dcs_chan_select_complete(struct hdd_adapter *adapter)
 	}
 
 	dcs_freq = wlansap_dcs_get_freq(WLAN_HDD_GET_SAP_CTX_PTR(adapter));
-	if (dcs_freq && dcs_freq !=
-	    adapter->deflink->session.ap.operating_chan_freq)
-		hdd_dcs_hostapd_set_chan(hdd_ctx, adapter->vdev_id, dcs_freq);
+	chan_freq = adapter->deflink->session.ap.operating_chan_freq;
+	if (dcs_freq && dcs_freq != chan_freq)
+		hdd_dcs_hostapd_set_chan(hdd_ctx, adapter->deflink->vdev_id,
+					 dcs_freq);
 	else
 		hdd_dcs_hostapd_enable_wlan_interference_mitigation(
-							hdd_ctx,
-							adapter->vdev_id);
+					hdd_ctx, adapter->deflink->vdev_id);
 
 	qdf_atomic_set(&adapter->deflink->session.ap.acs_in_progress, 0);
 }
@@ -517,7 +519,8 @@ void hdd_dcs_clear(struct hdd_adapter *adapter)
 
 	psoc = hdd_ctx->psoc;
 
-	status = policy_mgr_get_mac_id_by_session_id(psoc, adapter->vdev_id,
+	status = policy_mgr_get_mac_id_by_session_id(psoc,
+						     adapter->deflink->vdev_id,
 						     &mac_id);
 	if (QDF_IS_STATUS_ERROR(status)) {
 		hdd_err("get mac id failed");

+ 8 - 6
core/hdd/src/wlan_hdd_debugfs_coex.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2019 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
@@ -157,7 +157,8 @@ static QDF_STATUS __hdd_debugfs_mws_coex_state_read(struct hdd_context *hdd_ctx,
 	cookie = osif_request_cookie(request);
 
 	status = sme_get_mws_coex_info(hdd_ctx->mac_handle,
-				       adapter->vdev_id, WMI_MWS_COEX_STATE,
+				       adapter->deflink->vdev_id,
+				       WMI_MWS_COEX_STATE,
 				       hdd_debugfs_mws_coex_info_cb, cookie);
 
 	if (QDF_IS_STATUS_ERROR(status)) {
@@ -253,7 +254,7 @@ static QDF_STATUS __hdd_debugfs_mws_coex_dpwb_read(struct hdd_context *hdd_ctx,
 	cookie = osif_request_cookie(request);
 
 	status = sme_get_mws_coex_info(hdd_ctx->mac_handle,
-				       adapter->vdev_id,
+				       adapter->deflink->vdev_id,
 				       WMI_MWS_COEX_DPWB_STATE,
 				       hdd_debugfs_mws_coex_info_cb, cookie);
 
@@ -354,7 +355,8 @@ static QDF_STATUS __hdd_debugfs_mws_tdm_state_read(struct hdd_context *hdd_ctx,
 	cookie = osif_request_cookie(request);
 
 	status = sme_get_mws_coex_info(hdd_ctx->mac_handle,
-				       adapter->vdev_id, WMI_MWS_COEX_TDM_STATE,
+				       adapter->deflink->vdev_id,
+				       WMI_MWS_COEX_TDM_STATE,
 				       hdd_debugfs_mws_coex_info_cb, cookie);
 
 	if (QDF_IS_STATUS_ERROR(status)) {
@@ -440,7 +442,7 @@ static QDF_STATUS __hdd_debugfs_mws_coex_idrx_read(struct hdd_context *hdd_ctx,
 	cookie = osif_request_cookie(request);
 
 	status = sme_get_mws_coex_info(hdd_ctx->mac_handle,
-				       adapter->vdev_id,
+				       adapter->deflink->vdev_id,
 				       WMI_MWS_COEX_IDRX_STATE,
 				       hdd_debugfs_mws_coex_info_cb, cookie);
 
@@ -544,7 +546,7 @@ static QDF_STATUS __hdd_debugfs_mws_antenna_sharing_read(struct hdd_context
 	cookie = osif_request_cookie(request);
 
 	status = sme_get_mws_coex_info(hdd_ctx->mac_handle,
-				       adapter->vdev_id,
+				       adapter->deflink->vdev_id,
 				       WMI_MWS_COEX_ANTENNA_SHARING_STATE,
 				       hdd_debugfs_mws_coex_info_cb, cookie);
 

+ 2 - 2
core/hdd/src/wlan_hdd_debugfs_offload.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-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
@@ -68,7 +68,7 @@ wlan_hdd_mc_addr_list_info_debugfs(struct hdd_context *hdd_ctx,
 	}
 
 	status = ucfg_pmo_get_mc_addr_list(hdd_ctx->psoc,
-					   adapter->vdev_id,
+					   adapter->deflink->vdev_id,
 					   &mc_addr_list);
 	if (!QDF_IS_STATUS_SUCCESS(status)) {
 		ret = scnprintf(buf, buf_avail_len,

+ 2 - 2
core/hdd/src/wlan_hdd_debugfs_roam.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
@@ -140,7 +140,7 @@ wmi_roam_scan_stats_res *hdd_get_roam_scan_stats(struct hdd_context *hdd_ctx,
 
 	status = sme_get_roam_scan_stats(hdd_ctx->mac_handle,
 					 hdd_roam_scan_stats_cb,
-					 context, adapter->vdev_id);
+					 context, adapter->deflink->vdev_id);
 	if (!QDF_IS_STATUS_SUCCESS(status)) {
 		hdd_err("roam scan stats request failed");
 		goto cleanup;

+ 2 - 2
core/hdd/src/wlan_hdd_disa.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2016-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
@@ -186,7 +186,7 @@ hdd_fill_encrypt_decrypt_params(struct disa_encrypt_decrypt_req_params
 		return -EINVAL;
 	}
 
-	encrypt_decrypt_params->vdev_id = adapter->vdev_id;
+	encrypt_decrypt_params->vdev_id = adapter->deflink->vdev_id;
 	hdd_debug("vdev_id: %d", encrypt_decrypt_params->vdev_id);
 
 	if (!tb[QCA_WLAN_VENDOR_ATTR_ENCRYPTION_TEST_NEEDS_DECRYPTION]) {

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

@@ -300,7 +300,7 @@ int hdd_set_11be_rate_code(struct hdd_adapter *adapter, uint16_t rate_code)
 	hdd_debug("SET_11BE_RATE rate_code %d rix %d preamble %x nss %d",
 		  rate_code, rix, preamble, nss);
 
-	ret = wma_cli_set_command(adapter->vdev_id,
+	ret = wma_cli_set_command(adapter->deflink->vdev_id,
 				  wmi_vdev_param_fixed_rate,
 				  rate_code, VDEV_CMD);
 

+ 11 - 11
core/hdd/src/wlan_hdd_ext_scan.c

@@ -1580,7 +1580,7 @@ __wlan_hdd_cfg80211_extscan_get_capabilities(struct wiphy *wiphy,
 	}
 
 	params.request_id = nla_get_u32(tb[id]);
-	params.vdev_id = adapter->vdev_id;
+	params.vdev_id = adapter->deflink->vdev_id;
 	hdd_debug("Req Id %d Vdev Id %d", params.request_id, params.vdev_id);
 
 	context = &ext_scan_context;
@@ -1702,7 +1702,7 @@ __wlan_hdd_cfg80211_extscan_get_cached_results(struct wiphy *wiphy,
 	}
 
 	params.request_id = nla_get_u32(tb[id]);
-	params.vdev_id = adapter->vdev_id;
+	params.vdev_id = adapter->deflink->vdev_id;
 
 	/* Parse and fetch flush parameter */
 	id = QCA_WLAN_VENDOR_ATTR_EXTSCAN_GET_CACHED_SCAN_RESULTS_CONFIG_PARAM_FLUSH;
@@ -1916,7 +1916,7 @@ __wlan_hdd_cfg80211_extscan_set_bssid_hotlist(struct wiphy *wiphy,
 			params->num_ap, WMI_WLAN_EXTSCAN_MAX_HOTLIST_APS);
 		goto fail;
 	}
-	params->vdev_id = adapter->vdev_id;
+	params->vdev_id = adapter->deflink->vdev_id;
 	hdd_debug("Number of AP %d vdev Id %d",
 		  params->num_ap, params->vdev_id);
 
@@ -2126,7 +2126,7 @@ __wlan_hdd_cfg80211_extscan_set_significant_change(struct wiphy *wiphy,
 		goto fail;
 	}
 
-	params->vdev_id = adapter->vdev_id;
+	params->vdev_id = adapter->deflink->vdev_id;
 	hdd_debug("Number of AP %d Vdev Id %d",
 		  params->num_ap, params->vdev_id);
 
@@ -2801,7 +2801,7 @@ __wlan_hdd_cfg80211_extscan_start(struct wiphy *wiphy,
 	}
 
 	params->request_id = nla_get_u32(tb[id]);
-	params->vdev_id = adapter->vdev_id;
+	params->vdev_id = adapter->deflink->vdev_id;
 
 	/* Parse and fetch base period */
 	id = QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_BASE_PERIOD;
@@ -3003,7 +3003,7 @@ __wlan_hdd_cfg80211_extscan_stop(struct wiphy *wiphy,
 		return -EINVAL;
 	}
 	params.request_id = nla_get_u32(tb[id]);
-	params.vdev_id = adapter->vdev_id;
+	params.vdev_id = adapter->deflink->vdev_id;
 	hdd_debug("Req Id %d Vdev Id %d",
 		  params.request_id, params.vdev_id);
 
@@ -3121,7 +3121,7 @@ __wlan_hdd_cfg80211_extscan_reset_bssid_hotlist(struct wiphy *wiphy,
 	}
 
 	params.request_id = nla_get_u32(tb[id]);
-	params.vdev_id = adapter->vdev_id;
+	params.vdev_id = adapter->deflink->vdev_id;
 	hdd_debug("Req Id %d vdev Id %d", params.request_id, params.vdev_id);
 
 	context = &ext_scan_context;
@@ -3240,7 +3240,7 @@ __wlan_hdd_cfg80211_extscan_reset_significant_change(struct wiphy *wiphy,
 	}
 
 	params.request_id = nla_get_u32(tb[id]);
-	params.vdev_id = adapter->vdev_id;
+	params.vdev_id = adapter->deflink->vdev_id;
 	hdd_debug("Req Id %d Vdev Id %d", params.request_id, params.vdev_id);
 
 	context = &ext_scan_context;
@@ -3512,7 +3512,7 @@ static int __wlan_hdd_cfg80211_set_epno_list(struct wiphy *wiphy,
 	req_msg->request_id = nla_get_u32(tb[id]);
 	hdd_debug("Req Id %u", req_msg->request_id);
 
-	req_msg->vdev_id = adapter->vdev_id;
+	req_msg->vdev_id = adapter->deflink->vdev_id;
 	hdd_debug("Vdev Id %d", req_msg->vdev_id);
 
 	if (num_networks) {
@@ -3834,7 +3834,7 @@ static int __wlan_hdd_cfg80211_set_passpoint_list(struct wiphy *wiphy,
 	}
 	req_msg->request_id = nla_get_u32(tb[id]);
 
-	req_msg->vdev_id = adapter->vdev_id;
+	req_msg->vdev_id = adapter->deflink->vdev_id;
 	hdd_debug("Req Id %u Vdev Id %d",
 		  req_msg->request_id, req_msg->vdev_id);
 
@@ -3943,7 +3943,7 @@ static int __wlan_hdd_cfg80211_reset_passpoint_list(struct wiphy *wiphy,
 	}
 	req_msg->request_id = nla_get_u32(tb[id]);
 
-	req_msg->vdev_id = adapter->vdev_id;
+	req_msg->vdev_id = adapter->deflink->vdev_id;
 	hdd_debug("Req Id %u Vdev Id %d",
 		  req_msg->request_id, req_msg->vdev_id);
 

+ 2 - 2
core/hdd/src/wlan_hdd_gpio.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 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 above
@@ -66,7 +66,7 @@ __wlan_hdd_cfg80211_set_gpio_config(struct wiphy *wiphy,
 	}
 
 	adapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	if (wlan_hdd_validate_vdev_id(adapter->vdev_id))
+	if (wlan_hdd_validate_vdev_id(adapter->deflink->vdev_id))
 		return -EINVAL;
 
 	ret = wlan_cfg80211_start_gpio_config(wiphy,

+ 3 - 2
core/hdd/src/wlan_hdd_green_ap.c

@@ -249,8 +249,9 @@ __wlan_hdd_enter_sap_low_pwr_mode(struct wiphy *wiphy,
 	hdd_debug("state: %s",
 		  lp_flags == QCA_WLAN_DOZED_AP_ENABLE ? "ENABLE" : "DISABLE");
 
-	status = ucfg_green_ap_ll_ps(hdd_ctx->pdev, adapter->vdev, lp_flags,
-				     ap_ctx->sap_config.beacon_int, &cookie_id);
+	status = ucfg_green_ap_ll_ps(
+			hdd_ctx->pdev, adapter->deflink->vdev, lp_flags,
+			ap_ctx->sap_config.beacon_int, &cookie_id);
 	if (status != QDF_STATUS_SUCCESS) {
 		hdd_err("unable to send low latency power save cmd");
 		return -EINVAL;

+ 10 - 8
core/hdd/src/wlan_hdd_he.c

@@ -858,12 +858,13 @@ static int __wlan_hdd_cfg80211_sr_operations(struct wiphy *wiphy,
 			ret = -EINVAL;
 			goto exit;
 		}
-		status = policy_mgr_get_mac_id_by_session_id(hdd_ctx->psoc,
-							     adapter->vdev_id,
-							     &mac_id);
+		status = policy_mgr_get_mac_id_by_session_id(
+						hdd_ctx->psoc,
+						adapter->deflink->vdev_id,
+						&mac_id);
 		if (QDF_IS_STATUS_ERROR(status)) {
 			hdd_err("Failed to get mac_id for vdev_id: %u",
-				adapter->vdev_id); {
+				adapter->deflink->vdev_id); {
 				ret = -EAGAIN;
 				goto exit;
 			}
@@ -893,12 +894,13 @@ static int __wlan_hdd_cfg80211_sr_operations(struct wiphy *wiphy,
 			ret = -EINVAL;
 			goto exit;
 		}
-		status = policy_mgr_get_mac_id_by_session_id(hdd_ctx->psoc,
-							     adapter->vdev_id,
-							     &mac_id);
+		status = policy_mgr_get_mac_id_by_session_id(
+						hdd_ctx->psoc,
+						adapter->deflink->vdev_id,
+						&mac_id);
 		if (QDF_IS_STATUS_ERROR(status)) {
 			hdd_err("Failed to get mac_id for vdev_id: %u",
-				adapter->vdev_id);
+				adapter->deflink->vdev_id);
 			ret = -EAGAIN;
 			goto exit;
 		}

+ 108 - 102
core/hdd/src/wlan_hdd_hostapd.c

@@ -296,7 +296,7 @@ hdd_hostapd_init_sap_session(struct hdd_adapter *adapter, bool reinit)
 	}
 	status = sap_init_ctx(sap_ctx, adapter->device_mode,
 			       adapter->mac_addr.bytes,
-			       adapter->vdev_id, reinit);
+			       adapter->deflink->vdev_id, reinit);
 	if (QDF_IS_STATUS_ERROR(status)) {
 		hdd_err("wlansap_start failed!! status: %d", status);
 		adapter->deflink->session.ap.sap_context = NULL;
@@ -306,7 +306,7 @@ hdd_hostapd_init_sap_session(struct hdd_adapter *adapter, bool reinit)
 error:
 	wlansap_context_put(sap_ctx);
 	hdd_err("releasing the sap context for session-id:%d",
-		adapter->vdev_id);
+		adapter->deflink->vdev_id);
 
 	return NULL;
 }
@@ -695,9 +695,9 @@ QDF_STATUS hdd_set_sap_ht2040_mode(struct hdd_adapter *adapter,
 			hdd_err("mac handle is null");
 			return QDF_STATUS_E_FAULT;
 		}
-		qdf_ret_status =
-			sme_set_ht2040_mode(mac_handle, adapter->vdev_id,
-					    channel_type, true);
+		qdf_ret_status = sme_set_ht2040_mode(mac_handle,
+						     adapter->deflink->vdev_id,
+						     channel_type, true);
 		if (qdf_ret_status == QDF_STATUS_E_FAILURE) {
 			hdd_err("Failed to change HT20/40 mode");
 			return QDF_STATUS_E_FAILURE;
@@ -712,7 +712,7 @@ QDF_STATUS hdd_get_sap_ht2040_mode(struct hdd_adapter *adapter,
 	QDF_STATUS status = QDF_STATUS_E_FAILURE;
 	mac_handle_t mac_handle;
 
-	hdd_debug("get HT20/40 mode vdev_id %d", adapter->vdev_id);
+	hdd_debug("get HT20/40 mode vdev_id %d", adapter->deflink->vdev_id);
 
 	if (adapter->device_mode == QDF_SAP_MODE) {
 		mac_handle = adapter->hdd_ctx->mac_handle;
@@ -720,7 +720,8 @@ QDF_STATUS hdd_get_sap_ht2040_mode(struct hdd_adapter *adapter,
 			hdd_err("mac handle is null");
 			return status;
 		}
-		status = sme_get_ht2040_mode(mac_handle, adapter->vdev_id,
+		status = sme_get_ht2040_mode(mac_handle,
+					     adapter->deflink->vdev_id,
 					     channel_type);
 		if (QDF_IS_STATUS_ERROR(status))
 			hdd_err("Failed to get HT20/40 mode");
@@ -786,7 +787,7 @@ static int __hdd_hostapd_set_mac_address(struct net_device *dev, void *addr)
 		  QDF_MAC_ADDR_REF(mac_addr.bytes),
 		  dev->name);
 
-	if (adapter->vdev) {
+	if (adapter->deflink->vdev) {
 		if (!hdd_is_dynamic_set_mac_addr_allowed(adapter))
 			return -ENOTSUPP;
 
@@ -885,7 +886,7 @@ static int hdd_stop_bss_link(struct hdd_adapter *adapter)
 		clear_bit(SOFTAP_BSS_STARTED, &adapter->event_flags);
 		policy_mgr_decr_session_set_pcl(hdd_ctx->psoc,
 					adapter->device_mode,
-					adapter->vdev_id);
+					adapter->deflink->vdev_id);
 		hdd_green_ap_start_state_mc(hdd_ctx, adapter->device_mode,
 					    false);
 		errno = (status == QDF_STATUS_SUCCESS) ? 0 : -EBUSY;
@@ -1621,7 +1622,8 @@ void hdd_stop_sap_due_to_invalid_channel(struct work_struct *work)
 	if (osif_vdev_sync_op_start(sap_adapter->dev, &vdev_sync))
 		return;
 
-	hdd_debug("work started for sap session[%d]", sap_adapter->vdev_id);
+	hdd_debug("work started for sap session[%d]",
+		  sap_adapter->deflink->vdev_id);
 	wlan_hdd_stop_sap(sap_adapter);
 	wlansap_cleanup_cac_timer(WLAN_HDD_GET_SAP_CTX_PTR(sap_adapter));
 	hdd_debug("work finished for sap");
@@ -1681,7 +1683,7 @@ hdd_hostapd_apply_action_oui(struct hdd_context *hdd_ctx,
 
 	status = sme_set_peer_param(attr.mac_addr,
 				    WMI_PEER_PARAM_DISABLE_AGGRESSIVE_TX,
-				    true, adapter->vdev_id);
+				    true, adapter->deflink->vdev_id);
 	if (QDF_IS_STATUS_ERROR(status))
 		hdd_err("Failed to disable aggregation for peer");
 }
@@ -1692,12 +1694,13 @@ static void hdd_hostapd_set_sap_key(struct hdd_adapter *adapter)
 	uint8_t key_index;
 
 	for (key_index = 0; key_index < WLAN_CRYPTO_MAXKEYIDX; ++key_index) {
-		crypto_key = wlan_crypto_get_key(adapter->vdev, key_index);
+		crypto_key = wlan_crypto_get_key(adapter->deflink->vdev,
+						 key_index);
 		if (!crypto_key)
 			continue;
-		ucfg_crypto_set_key_req(adapter->vdev, crypto_key,
+		ucfg_crypto_set_key_req(adapter->deflink->vdev, crypto_key,
 					WLAN_CRYPTO_KEY_TYPE_GROUP);
-		wma_update_set_key(adapter->vdev_id, false, key_index,
+		wma_update_set_key(adapter->deflink->vdev_id, false, key_index,
 				   crypto_key->cipher_type);
 	}
 }
@@ -1820,7 +1823,7 @@ hdd_hostapd_update_beacon_country_ie(struct hdd_adapter *adapter)
 			if (!ap_ctx->country_ie_updated) {
 				status = sme_update_beacon_country_ie(
 						hdd_ctx->mac_handle,
-						adapter->vdev_id,
+						adapter->deflink->vdev_id,
 						true);
 				if (status == QDF_STATUS_SUCCESS)
 					ap_ctx->country_ie_updated = true;
@@ -1845,8 +1848,8 @@ release_ref:
 
 	if (ap_ctx->country_ie_updated) {
 		status = sme_update_beacon_country_ie(
-						hdd_ctx->mac_handle,
-						adapter->vdev_id, false);
+					    hdd_ctx->mac_handle,
+					    adapter->deflink->vdev_id, false);
 		if (status == QDF_STATUS_SUCCESS)
 			ap_ctx->country_ie_updated = false;
 		else
@@ -2005,7 +2008,7 @@ QDF_STATUS hdd_hostapd_sap_event_cb(struct sap_event *sap_event,
 			sap_event->sapevt.sapStartBssCompleteEvent
 			.operating_chan_freq;
 
-		adapter->vdev_id =
+		adapter->deflink->vdev_id =
 			sap_event->sapevt.sapStartBssCompleteEvent.sessionId;
 		sap_config->chan_freq =
 			sap_event->sapevt.sapStartBssCompleteEvent.
@@ -2014,7 +2017,7 @@ QDF_STATUS hdd_hostapd_sap_event_cb(struct sap_event *sap_event,
 			sap_event->sapevt.sapStartBssCompleteEvent.ch_width;
 
 		hdd_nofl_info("AP started vid %d freq %d BW %d",
-			      adapter->vdev_id,
+			      adapter->deflink->vdev_id,
 			      ap_ctx->operating_chan_freq,
 			      sap_config->ch_params.ch_width);
 
@@ -2027,7 +2030,7 @@ QDF_STATUS hdd_hostapd_sap_event_cb(struct sap_event *sap_event,
 		qdf_atomic_set(&adapter->ch_switch_in_progress, 0);
 		wlansap_get_dfs_ignore_cac(mac_handle, &ignoreCAC);
 		if (!policy_mgr_get_dfs_master_dynamic_enabled(
-				hdd_ctx->psoc, adapter->vdev_id))
+				hdd_ctx->psoc, adapter->deflink->vdev_id))
 			ignoreCAC = true;
 
 		wlansap_get_dfs_cac_state(mac_handle,
@@ -2060,7 +2063,7 @@ QDF_STATUS hdd_hostapd_sap_event_cb(struct sap_event *sap_event,
 
 		hdd_debug("The value of dfs_cac_block_tx[%d] for ApCtx[%pK]:%d",
 				ap_ctx->dfs_cac_block_tx, ap_ctx,
-				adapter->vdev_id);
+				adapter->deflink->vdev_id);
 
 		if (hostapd_state->qdf_status) {
 			hdd_err("startbss event failed!!");
@@ -2086,7 +2089,7 @@ QDF_STATUS hdd_hostapd_sap_event_cb(struct sap_event *sap_event,
 
 			cdp_hl_fc_set_td_limit(
 				cds_get_context(QDF_MODULE_ID_SOC),
-				adapter->vdev_id,
+				adapter->deflink->vdev_id,
 				ap_ctx->operating_chan_freq);
 
 			hdd_register_tx_flow_control(adapter,
@@ -2114,7 +2117,7 @@ QDF_STATUS hdd_hostapd_sap_event_cb(struct sap_event *sap_event,
 					hdd_ctx->pdev,
 					adapter->dev,
 					adapter->device_mode,
-					adapter->vdev_id,
+					adapter->deflink->vdev_id,
 					WLAN_IPA_AP_CONNECT,
 					adapter->dev->dev_addr,
 					WLAN_REG_IS_24GHZ_CH_FREQ(
@@ -2166,7 +2169,7 @@ QDF_STATUS hdd_hostapd_sap_event_cb(struct sap_event *sap_event,
 		if (sap_ctx->is_chan_change_inprogress) {
 			hdd_debug("check for possible hw mode change");
 			status = policy_mgr_set_hw_mode_on_channel_switch(
-				hdd_ctx->psoc, adapter->vdev_id);
+				hdd_ctx->psoc, adapter->deflink->vdev_id);
 			if (QDF_IS_STATUS_ERROR(status))
 				hdd_debug("set hw mode change not done");
 		}
@@ -2221,12 +2224,14 @@ QDF_STATUS hdd_hostapd_sap_event_cb(struct sap_event *sap_event,
 				hdd_objmgr_put_vdev_by_user(vdev, WLAN_DP_ID);
 			}
 		}
-		hdd_nofl_info("Ap stopped vid %d reason=%d", adapter->vdev_id,
+		hdd_nofl_info("Ap stopped vid %d reason=%d",
+			      adapter->deflink->vdev_id,
 			      ap_ctx->bss_stop_reason);
 		qdf_status =
-			policy_mgr_get_mac_id_by_session_id(hdd_ctx->psoc,
-							    adapter->vdev_id,
-							    &pdev_id);
+			policy_mgr_get_mac_id_by_session_id(
+						    hdd_ctx->psoc,
+						    adapter->deflink->vdev_id,
+						    &pdev_id);
 		if (QDF_IS_STATUS_SUCCESS(qdf_status))
 			hdd_medium_assess_stop_timer(pdev_id, hdd_ctx);
 
@@ -2470,7 +2475,7 @@ QDF_STATUS hdd_hostapd_sap_event_cb(struct sap_event *sap_event,
 			status = ucfg_ipa_wlan_evt(hdd_ctx->pdev,
 						   adapter->dev,
 						   adapter->device_mode,
-						   adapter->vdev_id,
+						   adapter->deflink->vdev_id,
 						   WLAN_IPA_CLIENT_CONNECT_EX,
 						   event->staMac.bytes,
 						   false);
@@ -2479,7 +2484,7 @@ QDF_STATUS hdd_hostapd_sap_event_cb(struct sap_event *sap_event,
 		}
 
 		DPTRACE(qdf_dp_trace_mgmt_pkt(QDF_DP_TRACE_MGMT_PACKET_RECORD,
-			adapter->vdev_id,
+			adapter->deflink->vdev_id,
 			QDF_TRACE_DEFAULT_PDEV_ID,
 			QDF_PROTO_TYPE_MGMT, QDF_PROTO_MGMT_ASSOC));
 
@@ -2544,11 +2549,11 @@ QDF_STATUS hdd_hostapd_sap_event_cb(struct sap_event *sap_event,
 			qdf_mem_free(sta_info);
 		}
 		/* Lets abort scan to ensure smooth authentication for client */
-		if (ucfg_scan_get_vdev_status(adapter->vdev) !=
+		if (ucfg_scan_get_vdev_status(adapter->deflink->vdev) !=
 				SCAN_NOT_IN_PROGRESS) {
 			wlan_abort_scan(hdd_ctx->pdev, INVAL_PDEV_ID,
-					adapter->vdev_id, INVALID_SCAN_ID,
-					false);
+					adapter->deflink->vdev_id,
+					INVALID_SCAN_ID, false);
 		}
 		if (adapter->device_mode == QDF_P2P_GO_MODE) {
 			/* send peer status indication to oem app */
@@ -2556,7 +2561,7 @@ QDF_STATUS hdd_hostapd_sap_event_cb(struct sap_event *sap_event,
 				&event->staMac,
 				ePeerConnected,
 				event->timingMeasCap,
-				adapter->vdev_id,
+				adapter->deflink->vdev_id,
 				&event->chan_info,
 				adapter->device_mode);
 		}
@@ -2616,7 +2621,7 @@ QDF_STATUS hdd_hostapd_sap_event_cb(struct sap_event *sap_event,
 		we_event = IWEVEXPIRED;
 
 		DPTRACE(qdf_dp_trace_mgmt_pkt(QDF_DP_TRACE_MGMT_PACKET_RECORD,
-			adapter->vdev_id,
+			adapter->deflink->vdev_id,
 			QDF_TRACE_DEFAULT_PDEV_ID,
 			QDF_PROTO_TYPE_MGMT, QDF_PROTO_MGMT_DISASSOC));
 
@@ -2629,7 +2634,7 @@ QDF_STATUS hdd_hostapd_sap_event_cb(struct sap_event *sap_event,
 			return QDF_STATUS_E_INVAL;
 		}
 
-		if (wlan_vdev_mlme_is_mlo_vdev(adapter->vdev) &&
+		if (wlan_vdev_mlme_is_mlo_vdev(adapter->deflink->vdev) &&
 		    !qdf_is_macaddr_zero(&stainfo->mld_addr)) {
 			qdf_copy_macaddr(&sta_addr, &stainfo->mld_addr);
 		} else {
@@ -2701,7 +2706,7 @@ QDF_STATUS hdd_hostapd_sap_event_cb(struct sap_event *sap_event,
 
 		/* Update the beacon Interval if it is P2P GO */
 		qdf_status = policy_mgr_change_mcc_go_beacon_interval(
-			hdd_ctx->psoc, adapter->vdev_id,
+			hdd_ctx->psoc, adapter->deflink->vdev_id,
 			adapter->device_mode);
 		if (QDF_STATUS_SUCCESS != qdf_status) {
 			hdd_err("Failed to update Beacon interval status: %d",
@@ -2713,7 +2718,7 @@ QDF_STATUS hdd_hostapd_sap_event_cb(struct sap_event *sap_event,
 						sapStationDisassocCompleteEvent.
 						staMac, ePeerDisconnected,
 						0,
-						adapter->vdev_id,
+						adapter->deflink->vdev_id,
 						NULL,
 						adapter->device_mode);
 		}
@@ -2823,7 +2828,7 @@ QDF_STATUS hdd_hostapd_sap_event_cb(struct sap_event *sap_event,
 			sap_event->sapevt.sap_ch_selected.ch_width;
 
 		cdp_hl_fc_set_td_limit(cds_get_context(QDF_MODULE_ID_SOC),
-				       adapter->vdev_id,
+				       adapter->deflink->vdev_id,
 				       ap_ctx->operating_chan_freq);
 		sap_ctx = WLAN_HDD_GET_SAP_CTX_PTR(adapter);
 		if (!sap_ctx) {
@@ -2834,7 +2839,8 @@ QDF_STATUS hdd_hostapd_sap_event_cb(struct sap_event *sap_event,
 		if (sap_ctx->is_chan_change_inprogress) {
 			hdd_debug("check for possible hw mode change");
 			status = policy_mgr_set_hw_mode_on_channel_switch(
-					hdd_ctx->psoc, adapter->vdev_id);
+						hdd_ctx->psoc,
+						adapter->deflink->vdev_id);
 			if (QDF_IS_STATUS_ERROR(status))
 				hdd_debug("set hw mode change not done");
 		}
@@ -2858,7 +2864,7 @@ QDF_STATUS hdd_hostapd_sap_event_cb(struct sap_event *sap_event,
 		ap_ctx->sap_config.acs_cfg.ch_width =
 			sap_event->sapevt.sap_ch_selected.ch_width;
 		hdd_nofl_info("ACS Completed vid %d freq %d BW %d",
-			      adapter->vdev_id,
+			      adapter->deflink->vdev_id,
 			      ap_ctx->sap_config.acs_cfg.pri_ch_freq,
 			      ap_ctx->sap_config.acs_cfg.ch_width);
 
@@ -2877,7 +2883,8 @@ QDF_STATUS hdd_hostapd_sap_event_cb(struct sap_event *sap_event,
 	case eSAP_ECSA_CHANGE_CHAN_IND:
 		hdd_debug("Channel change indication from peer for channel freq %d",
 			  sap_event->sapevt.sap_chan_cng_ind.new_chan_freq);
-		wlan_hdd_set_sap_csa_reason(hdd_ctx->psoc, adapter->vdev_id,
+		wlan_hdd_set_sap_csa_reason(hdd_ctx->psoc,
+					    adapter->deflink->vdev_id,
 					    CSA_REASON_PEER_ACTION_FRAME);
 		if (hdd_softap_set_channel_change(dev,
 			 sap_event->sapevt.sap_chan_cng_ind.new_chan_freq,
@@ -2894,7 +2901,7 @@ QDF_STATUS hdd_hostapd_sap_event_cb(struct sap_event *sap_event,
 
 	case eSAP_STOP_BSS_DUE_TO_NO_CHNL:
 		hdd_debug("Stop sap session[%d]",
-			  adapter->vdev_id);
+			  adapter->deflink->vdev_id);
 		schedule_work(&adapter->sap_stop_bss_work);
 		return QDF_STATUS_SUCCESS;
 
@@ -2930,7 +2937,7 @@ QDF_STATUS hdd_hostapd_sap_event_cb(struct sap_event *sap_event,
 			hdd_unsafe_channel_restart_sap(hdd_ctx);
 		else if (ap_ctx->sap_context->csa_reason == CSA_REASON_DCS)
 			hdd_dcs_hostapd_set_chan(
-				hdd_ctx, adapter->vdev_id,
+				hdd_ctx, adapter->deflink->vdev_id,
 				ap_ctx->operating_chan_freq);
 
 		/* Added the sta cnt check as we don't support sta+sap+nan
@@ -2943,7 +2950,7 @@ QDF_STATUS hdd_hostapd_sap_event_cb(struct sap_event *sap_event,
 		if (!sta_cnt)
 			policy_mgr_nan_sap_post_enable_conc_check(hdd_ctx->psoc);
 		policy_mgr_check_sap_go_force_scc(
-				hdd_ctx->psoc, adapter->vdev,
+				hdd_ctx->psoc, adapter->deflink->vdev,
 				ap_ctx->sap_context->csa_reason);
 		qdf_status = qdf_event_set(&hostapd_state->qdf_event);
 		if (!QDF_IS_STATUS_SUCCESS(qdf_status))
@@ -3218,7 +3225,7 @@ bool hdd_is_any_sta_connecting(struct hdd_context *hdd_ctx)
 		    (adapter->device_mode == QDF_P2P_CLIENT_MODE)) {
 			if (hdd_cm_is_connecting(adapter)) {
 				hdd_debug("vdev_id %d: connecting",
-					  adapter->vdev_id);
+					  adapter->deflink->vdev_id);
 				hdd_adapter_dev_put_debug(adapter, dbgid);
 				if (next_adapter)
 					hdd_adapter_dev_put_debug(next_adapter,
@@ -3308,7 +3315,7 @@ int hdd_softap_set_channel_change(struct net_device *dev, int target_chan_freq,
 	}
 
 	if (!policy_mgr_is_sap_allowed_on_indoor(hdd_ctx->pdev,
-						 adapter->vdev_id,
+						 adapter->deflink->vdev_id,
 						 target_chan_freq)) {
 		hdd_debug("Channel switch is not allowed to indoor frequency %d",
 			  target_chan_freq);
@@ -3358,7 +3365,7 @@ int hdd_softap_set_channel_change(struct net_device *dev, int target_chan_freq,
 				policy_mgr_convert_device_mode_to_qdf_type(
 					adapter->device_mode),
 				target_chan_freq, policy_mgr_get_bw(target_bw),
-				adapter->vdev_id,
+				adapter->deflink->vdev_id,
 				forced,
 				sap_ctx->csa_reason)) {
 		hdd_err("Channel switch failed due to concurrency check failure");
@@ -3515,8 +3522,8 @@ void hdd_stop_sap_set_tx_power(struct wlan_objmgr_psoc *psoc,
 
 			if (QDF_STATUS_SUCCESS !=
 				sme_set_tx_power(hdd_ctx->mac_handle,
-						 adapter->vdev_id, bssid,
-						 adapter->device_mode,
+						 adapter->deflink->vdev_id,
+						 bssid, adapter->device_mode,
 						 set_tx_power)) {
 				hdd_err("Setting tx power failed");
 			}
@@ -4165,7 +4172,7 @@ QDF_STATUS hdd_init_ap_mode(struct hdd_adapter *adapter, bool reinit)
 	if (!QDF_IS_STATUS_SUCCESS(status))
 		hdd_err("Failed to get sifs burst value, use default");
 
-	ret = wma_cli_set_command(adapter->vdev_id,
+	ret = wma_cli_set_command(adapter->deflink->vdev_id,
 				  wmi_pdev_param_burst_enable,
 				  enable_sifs_burst,
 				  PDEV_CMD);
@@ -4282,7 +4289,7 @@ struct hdd_adapter *hdd_wlan_create_ap_dev(struct hdd_context *hdd_ctx,
 	adapter->deflink = &adapter->link_info[0];
 	adapter->hdd_ctx = hdd_ctx;
 	adapter->magic = WLAN_HDD_ADAPTER_MAGIC;
-	adapter->vdev_id = WLAN_UMAC_VDEV_ID_MAX;
+	adapter->deflink->vdev_id = WLAN_UMAC_VDEV_ID_MAX;
 
 	hdd_debug("dev = %pK, adapter = %pK, concurrency_mode=0x%x",
 		dev, adapter,
@@ -4306,7 +4313,7 @@ struct hdd_adapter *hdd_wlan_create_ap_dev(struct hdd_context *hdd_ctx,
 	adapter->wdev.wiphy = hdd_ctx->wiphy;
 	adapter->wdev.netdev = dev;
 
-	init_completion(&adapter->vdev_destroy_event);
+	init_completion(&adapter->deflink->vdev_destroy_event);
 
 	SET_NETDEV_DEV(dev, hdd_ctx->parent_dev);
 	spin_lock_init(&adapter->pause_map_lock);
@@ -4407,7 +4414,7 @@ int wlan_hdd_set_channel(struct wiphy *wiphy,
 
 	qdf_mtrace(QDF_MODULE_ID_HDD, QDF_MODULE_ID_HDD,
 		   TRACE_CODE_HDD_CFG80211_SET_CHANNEL,
-		   adapter->vdev_id, channel_type);
+		   adapter->deflink->vdev_id, channel_type);
 
 	hdd_debug("Dev_mode %s(%d) freq %d, ch_bw %d ccfs1 %d ccfs2 %d",
 		  qdf_opmode_str(adapter->device_mode),
@@ -4751,7 +4758,7 @@ wlan_hdd_cfg80211_alloc_new_beacon(struct hdd_adapter *adapter,
 
 	if (!params->head && !old) {
 		hdd_err("session: %d old and new heads points to NULL",
-		       adapter->vdev_id);
+		       adapter->deflink->vdev_id);
 		return -EINVAL;
 	}
 
@@ -4973,7 +4980,7 @@ int wlan_hdd_cfg80211_update_apies(struct hdd_adapter *adapter)
 	wlan_hdd_add_sap_obss_scan_ie(adapter, genie, &total_ielen);
 
 	qdf_copy_macaddr(&update_ie.bssid, &adapter->mac_addr);
-	update_ie.vdev_id = adapter->vdev_id;
+	update_ie.vdev_id = adapter->deflink->vdev_id;
 
 	/* Added for Probe Response IE */
 	proberesp_ies = qdf_mem_malloc(beacon->proberesp_ies_len +
@@ -5832,7 +5839,7 @@ static void wlan_hdd_set_dhcp_server_offload(struct hdd_adapter *adapter)
 		return;
 
 	srv_ip = hdd_ctx->config->dhcp_server_ip.dhcp_server_ip;
-	dhcp_srv_info.vdev_id = adapter->vdev_id;
+	dhcp_srv_info.vdev_id = adapter->deflink->vdev_id;
 	dhcp_srv_info.dhcp_offload_enabled = true;
 
 	status = ucfg_fwol_get_dhcp_max_num_clients(hdd_ctx->psoc,
@@ -5934,17 +5941,19 @@ static QDF_STATUS wlan_hdd_mlo_update(struct hdd_context *hdd_ctx,
 {
 	uint8_t link_id = 0;
 	uint8_t num_link = 0;
+	bool is_ml_ap;
 
 	if (config->SapHw_mode == eCSR_DOT11_MODE_11be ||
 	    config->SapHw_mode == eCSR_DOT11_MODE_11be_ONLY) {
 		wlan_hdd_get_mlo_link_id(beacon, &link_id, &num_link);
 		hdd_debug("MLO SAP vdev id %d, link id %d total link %d",
-			  adapter->vdev_id, link_id, num_link);
+			  adapter->deflink->vdev_id, link_id, num_link);
 		if (!num_link) {
 			hdd_debug("start 11be AP without mlo");
 			return QDF_STATUS_SUCCESS;
 		}
-		if (!mlo_ap_vdev_attach(adapter->vdev, link_id, num_link)) {
+		if (!mlo_ap_vdev_attach(adapter->deflink->vdev,
+					link_id, num_link)) {
 			hdd_err("MLO SAP attach fails");
 			return QDF_STATUS_E_INVAL;
 		}
@@ -5954,8 +5963,9 @@ static QDF_STATUS wlan_hdd_mlo_update(struct hdd_context *hdd_ctx,
 		config->num_link = num_link;
 	}
 
+	is_ml_ap = wlan_vdev_mlme_is_mlo_ap(adapter->deflink->vdev);
 	if (!policy_mgr_is_mlo_sap_concurrency_allowed(
-		hdd_ctx->psoc, wlan_vdev_mlme_is_mlo_ap(adapter->vdev))) {
+						hdd_ctx->psoc, is_ml_ap)) {
 		hdd_err("MLO SAP concurrency check fails");
 		return QDF_STATUS_E_INVAL;
 	}
@@ -5965,11 +5975,11 @@ static QDF_STATUS wlan_hdd_mlo_update(struct hdd_context *hdd_ctx,
 
 void wlan_hdd_mlo_reset(struct hdd_adapter *adapter)
 {
-	if (wlan_vdev_mlme_is_mlo_ap(adapter->vdev)) {
+	if (wlan_vdev_mlme_is_mlo_ap(adapter->deflink->vdev)) {
 		adapter->deflink->session.ap.sap_config.mlo_sap = false;
 		adapter->deflink->session.ap.sap_config.link_id = 0;
 		adapter->deflink->session.ap.sap_config.num_link = 0;
-		mlo_ap_vdev_detach(adapter->vdev);
+		mlo_ap_vdev_detach(adapter->deflink->vdev);
 	}
 }
 #else
@@ -6336,11 +6346,9 @@ int wlan_hdd_cfg80211_start_bss(struct hdd_adapter *adapter,
 					   config->akm_list.authType,
 					   config->akm_list.numEntries);
 
-			hdd_softap_update_pasn_vdev_params(hdd_ctx,
-							   adapter->vdev_id,
-							   beacon,
-							   mfp_capable,
-							   mfp_required);
+			hdd_softap_update_pasn_vdev_params(
+					hdd_ctx, adapter->deflink->vdev_id,
+					beacon, mfp_capable, mfp_required);
 		}
 	}
 
@@ -6646,7 +6654,7 @@ int wlan_hdd_cfg80211_start_bss(struct hdd_adapter *adapter,
 					adapter->device_mode),
 				config->chan_freq, HW_MODE_20_MHZ,
 				policy_mgr_get_conc_ext_flags(vdev, false),
-				adapter->vdev_id)) {
+				adapter->deflink->vdev_id)) {
 			mutex_unlock(&hdd_ctx->sap_lock);
 
 			hdd_err("This concurrency combination is not allowed");
@@ -6723,7 +6731,7 @@ int wlan_hdd_cfg80211_start_bss(struct hdd_adapter *adapter,
 	if (hostapd_state->bss_state == BSS_START) {
 		policy_mgr_incr_active_session(hdd_ctx->psoc,
 					adapter->device_mode,
-					adapter->vdev_id);
+					adapter->deflink->vdev_id);
 
 		hdd_green_ap_start_state_mc(hdd_ctx, adapter->device_mode,
 					    true);
@@ -6843,12 +6851,12 @@ static int __wlan_hdd_cfg80211_stop_ap(struct wiphy *wiphy,
 		goto exit;
 	}
 
-	if (wlan_hdd_validate_vdev_id(adapter->vdev_id))
+	if (wlan_hdd_validate_vdev_id(adapter->deflink->vdev_id))
 		goto exit;
 
 	qdf_mtrace(QDF_MODULE_ID_HDD, QDF_MODULE_ID_HDD,
 		   TRACE_CODE_HDD_CFG80211_STOP_AP,
-		   adapter->vdev_id, adapter->device_mode);
+		   adapter->deflink->vdev_id, adapter->device_mode);
 
 	if (!(adapter->device_mode == QDF_SAP_MODE ||
 	      adapter->device_mode == QDF_P2P_GO_MODE)) {
@@ -6913,14 +6921,14 @@ static int __wlan_hdd_cfg80211_stop_ap(struct wiphy *wiphy,
 		/*BSS stopped, clear the active sessions for this device mode*/
 		policy_mgr_decr_session_set_pcl(hdd_ctx->psoc,
 						adapter->device_mode,
-						adapter->vdev_id);
+						adapter->deflink->vdev_id);
 		hdd_green_ap_start_state_mc(hdd_ctx, adapter->device_mode,
 					    false);
 		wlan_twt_concurrency_update(hdd_ctx);
-		wlan_set_sap_user_config_freq(adapter->vdev, 0);
-		status = ucfg_if_mgr_deliver_event(adapter->vdev,
-				WLAN_IF_MGR_EV_AP_STOP_BSS_COMPLETE,
-				NULL);
+		wlan_set_sap_user_config_freq(adapter->deflink->vdev, 0);
+		status = ucfg_if_mgr_deliver_event(
+				adapter->deflink->vdev,
+				WLAN_IF_MGR_EV_AP_STOP_BSS_COMPLETE, NULL);
 		if (!QDF_IS_STATUS_SUCCESS(status)) {
 			hdd_err("Stopping the BSS failed");
 			goto exit;
@@ -6948,7 +6956,7 @@ static int __wlan_hdd_cfg80211_stop_ap(struct wiphy *wiphy,
 	}
 
 	qdf_copy_macaddr(&update_ie.bssid, &adapter->mac_addr);
-	update_ie.vdev_id = adapter->vdev_id;
+	update_ie.vdev_id = adapter->deflink->vdev_id;
 	update_ie.ieBufferlength = 0;
 	update_ie.pAdditionIEBuffer = NULL;
 	update_ie.append = true;
@@ -6968,8 +6976,8 @@ static int __wlan_hdd_cfg80211_stop_ap(struct wiphy *wiphy,
 	wlan_hdd_reset_prob_rspies(adapter);
 	hdd_destroy_acs_timer(adapter);
 
-	ucfg_p2p_status_stop_bss(adapter->vdev);
-	ucfg_ftm_time_sync_update_bss_state(adapter->vdev,
+	ucfg_p2p_status_stop_bss(adapter->deflink->vdev);
+	ucfg_ftm_time_sync_update_bss_state(adapter->deflink->vdev,
 					    FTM_TIME_SYNC_BSS_STOPPED);
 
 exit:
@@ -7415,7 +7423,7 @@ wlan_hdd_update_twt_responder(struct hdd_adapter *adapter,
 {
 	struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
 
-	adapter->session.ap.sap_config.cfg80211_twt_responder =
+	adapter->deflink->session.ap.sap_config.cfg80211_twt_responder =
 							params->twt_responder;
 	wlan_hdd_configure_twt_responder(hdd_ctx, params->twt_responder);
 }
@@ -7536,12 +7544,12 @@ static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy,
 		return -EINVAL;
 	}
 
-	if (wlan_hdd_validate_vdev_id(adapter->vdev_id))
+	if (wlan_hdd_validate_vdev_id(adapter->deflink->vdev_id))
 		return -EINVAL;
 
 	qdf_mtrace(QDF_MODULE_ID_HDD, QDF_MODULE_ID_HDD,
 		   TRACE_CODE_HDD_CFG80211_START_AP,
-		   adapter->vdev_id, params->beacon_interval);
+		   adapter->deflink->vdev_id, params->beacon_interval);
 
 	if (WLAN_HDD_ADAPTER_MAGIC != adapter->magic) {
 		hdd_err("HDD adapter magic is invalid");
@@ -7554,7 +7562,7 @@ static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy,
 		return status;
 
 	hdd_nofl_info("%s(vdevid-%d): START AP: mode %s(%d) %d bw %d sub20 %d",
-		      dev->name, adapter->vdev_id,
+		      dev->name, adapter->deflink->vdev_id,
 		      qdf_opmode_str(adapter->device_mode),
 		      adapter->device_mode,
 		      params->chandef.chan->center_freq,
@@ -7603,14 +7611,14 @@ static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy,
 
 	status = policy_mgr_is_sap_allowed_on_dfs_freq(
 						hdd_ctx->pdev,
-						adapter->vdev_id,
+						adapter->deflink->vdev_id,
 						chandef->chan->center_freq);
 	if (!status)
 		return -EINVAL;
 
 	status = policy_mgr_is_sap_allowed_on_indoor(
 						hdd_ctx->pdev,
-						adapter->vdev_id,
+						adapter->deflink->vdev_id,
 						chandef->chan->center_freq);
 	if (!status) {
 		hdd_debug("SAP start not allowed on indoor channel %d",
@@ -7627,7 +7635,7 @@ static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy,
 	if (!status)
 		return -EINVAL;
 
-	vdev_opmode = wlan_vdev_mlme_get_opmode(adapter->vdev);
+	vdev_opmode = wlan_vdev_mlme_get_opmode(adapter->deflink->vdev);
 	ucfg_mlme_get_srd_master_mode_for_vdev(hdd_ctx->psoc, vdev_opmode,
 					       &srd_channel_allowed);
 
@@ -7690,7 +7698,7 @@ static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy,
 			  sap_cnt, sta_cnt,
 			  (adapter->device_mode == QDF_P2P_GO_MODE));
 		for (i = 0; i < sta_cnt + sap_cnt; i++)
-			if (vdev_id_list[i] == adapter->vdev_id)
+			if (vdev_id_list[i] == adapter->deflink->vdev_id)
 				disable_nan = false;
 		if (disable_nan)
 			ucfg_nan_disable_concurrency(hdd_ctx->psoc);
@@ -7707,13 +7715,10 @@ static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy,
 
 	/* check if concurrency is allowed */
 	if (!policy_mgr_allow_concurrency(
-				hdd_ctx->psoc,
-				intf_pm_mode,
-				freq,
-				channel_width,
-				policy_mgr_get_conc_ext_flags(adapter->vdev,
-							      false),
-				adapter->vdev_id)) {
+			hdd_ctx->psoc, intf_pm_mode, freq, channel_width,
+			policy_mgr_get_conc_ext_flags(adapter->deflink->vdev,
+						      false),
+			adapter->deflink->vdev_id)) {
 		hdd_err("Connection failed due to concurrency check failure");
 		return -EINVAL;
 	}
@@ -7743,7 +7748,7 @@ static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy,
 	}
 
 	status = policy_mgr_current_connections_update(
-			hdd_ctx->psoc, adapter->vdev_id,
+			hdd_ctx->psoc, adapter->deflink->vdev_id,
 			freq,
 			POLICY_MGR_UPDATE_REASON_START_AP,
 			POLICY_MGR_DEF_REQ_ID);
@@ -7862,7 +7867,7 @@ static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy,
 		 * to application.
 		 */
 		if (sap_config->chan_freq &&
-		    policy_mgr_is_dnsc_set(adapter->vdev))
+		    policy_mgr_is_dnsc_set(adapter->deflink->vdev))
 			wlan_hdd_send_avoid_freq_for_dnbs(hdd_ctx,
 							  sap_config->chan_freq);
 
@@ -7874,9 +7879,10 @@ static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy,
 				status = QDF_STATUS_E_FAILURE;
 				goto err_start_bss;
 			}
-			sta_inactivity_timer->session_id = adapter->vdev_id;
+			sta_inactivity_timer->session_id =
+						adapter->deflink->vdev_id;
 			sta_inactivity_timer->sta_inactivity_timeout =
-				params->inactivity_timeout;
+						params->inactivity_timeout;
 			sme_update_sta_inactivity_timeout(hdd_ctx->mac_handle,
 							  sta_inactivity_timer);
 			qdf_mem_free(sta_inactivity_timer);
@@ -7948,12 +7954,12 @@ static int __wlan_hdd_cfg80211_change_beacon(struct wiphy *wiphy,
 		return -EINVAL;
 	}
 
-	if (wlan_hdd_validate_vdev_id(adapter->vdev_id))
+	if (wlan_hdd_validate_vdev_id(adapter->deflink->vdev_id))
 		return -EINVAL;
 
 	qdf_mtrace(QDF_MODULE_ID_HDD, QDF_MODULE_ID_HDD,
 		   TRACE_CODE_HDD_CFG80211_CHANGE_BEACON,
-		   adapter->vdev_id, adapter->device_mode);
+		   adapter->deflink->vdev_id, adapter->device_mode);
 
 	hdd_debug("Device_mode %s(%d)",
 		  qdf_opmode_str(adapter->device_mode), adapter->device_mode);
@@ -7973,7 +7979,7 @@ static int __wlan_hdd_cfg80211_change_beacon(struct wiphy *wiphy,
 
 	if (!old) {
 		hdd_err("session id: %d beacon data points to NULL",
-		       adapter->vdev_id);
+		       adapter->deflink->vdev_id);
 		return -EINVAL;
 	}
 
@@ -8123,7 +8129,7 @@ bool hdd_sap_is_acs_in_progress(struct wlan_objmgr_vdev *vdev)
 	}
 
 	if (!hdd_adapter_is_ap(adapter)) {
-		hdd_err("vdev id %d is not AP", adapter->vdev_id);
+		hdd_err("vdev id %d is not AP", adapter->deflink->vdev_id);
 		return in_progress;
 	}
 

+ 72 - 62
core/hdd/src/wlan_hdd_hostapd_wext.c

@@ -177,7 +177,8 @@ static int __iw_softap_set_two_ints_getnone(struct net_device *dev,
 
 		if (value[1] == CDP_TXRX_STATS_28) {
 			req.peer_addr = (char *)&adapter->mac_addr;
-			ret = cdp_txrx_stats_request(soc, adapter->vdev_id,
+			ret = cdp_txrx_stats_request(soc,
+						     adapter->deflink->vdev_id,
 						     &req);
 
 			hdd_for_each_sta_ref_safe(
@@ -190,14 +191,15 @@ static int __iw_softap_set_two_ints_getnone(struct net_device *dev,
 				req.peer_addr = (char *)
 					&sta_info->sta_mac;
 				ret = cdp_txrx_stats_request(
-					soc, adapter->vdev_id, &req);
+					soc, adapter->deflink->vdev_id, &req);
 				hdd_put_sta_info_ref(
 					&adapter->sta_info_list, &sta_info,
 					true,
 					STA_INFO_SAP_SET_TWO_INTS_GETNONE);
 			}
 		} else {
-			ret = cdp_txrx_stats_request(soc, adapter->vdev_id,
+			ret = cdp_txrx_stats_request(soc,
+						     adapter->deflink->vdev_id,
 						     &req);
 		}
 
@@ -216,15 +218,17 @@ static int __iw_softap_set_two_ints_getnone(struct net_device *dev,
 	case QCSAP_ENABLE_FW_PROFILE:
 		hdd_debug("QCSAP_ENABLE_FW_PROFILE: %d %d",
 		       value[1], value[2]);
-		ret = wma_cli_set2_command(adapter->vdev_id,
-				 WMI_WLAN_PROFILE_ENABLE_PROFILE_ID_CMDID,
-					value[1], value[2], DBG_CMD);
+		ret = wma_cli_set2_command(
+				adapter->deflink->vdev_id,
+				WMI_WLAN_PROFILE_ENABLE_PROFILE_ID_CMDID,
+				value[1], value[2], DBG_CMD);
 		break;
 
 	case QCSAP_SET_FW_PROFILE_HIST_INTVL:
 		hdd_debug("QCSAP_SET_FW_PROFILE_HIST_INTVL: %d %d",
 		       value[1], value[2]);
-		ret = wma_cli_set2_command(adapter->vdev_id,
+		ret = wma_cli_set2_command(
+					adapter->deflink->vdev_id,
 					WMI_WLAN_PROFILE_SET_HIST_INTVL_CMDID,
 					value[1], value[2], DBG_CMD);
 		break;
@@ -412,7 +416,7 @@ static __iw_softap_setparam(struct net_device *dev,
 		if ((QDF_SAP_MODE == adapter->device_mode) ||
 		   (QDF_P2P_GO_MODE == adapter->device_mode)) {
 			wlan_hdd_set_sap_csa_reason(hdd_ctx->psoc,
-						    adapter->vdev_id,
+						    adapter->deflink->vdev_id,
 						    CSA_REASON_USER_INITIATED);
 			hdd_debug("SET Channel Change to new channel= %d",
 			       set_value);
@@ -480,7 +484,7 @@ static __iw_softap_setparam(struct net_device *dev,
 		wlan_hdd_disable_roaming(adapter, RSO_START_BSS);
 
 		status = sme_update_session_param(mac_handle,
-				adapter->vdev_id,
+				adapter->deflink->vdev_id,
 				SIR_PARAM_SSID_HIDDEN, set_value);
 		if (QDF_STATUS_SUCCESS != status) {
 			hdd_err("QCSAP_PARAM_HIDE_SSID failed");
@@ -519,7 +523,7 @@ static __iw_softap_setparam(struct net_device *dev,
 	case QCSAP_PARAM_SET_TXRX_FW_STATS:
 	{
 		hdd_debug("QCSAP_PARAM_SET_TXRX_FW_STATS val %d", set_value);
-		ret = wma_cli_set_command(adapter->vdev_id,
+		ret = wma_cli_set_command(adapter->deflink->vdev_id,
 					  WMA_VDEV_TXRX_FWSTATS_ENABLE_CMDID,
 					  set_value, VDEV_CMD);
 		break;
@@ -529,7 +533,7 @@ static __iw_softap_setparam(struct net_device *dev,
 	case QCSAP_DBGLOG_LOG_LEVEL:
 	{
 		hdd_debug("QCSAP_DBGLOG_LOG_LEVEL val %d", set_value);
-		ret = wma_cli_set_command(adapter->vdev_id,
+		ret = wma_cli_set_command(adapter->deflink->vdev_id,
 					  WMI_DBGLOG_LOG_LEVEL,
 					  set_value, DBG_CMD);
 		break;
@@ -538,7 +542,7 @@ static __iw_softap_setparam(struct net_device *dev,
 	case QCSAP_DBGLOG_VAP_ENABLE:
 	{
 		hdd_debug("QCSAP_DBGLOG_VAP_ENABLE val %d", set_value);
-		ret = wma_cli_set_command(adapter->vdev_id,
+		ret = wma_cli_set_command(adapter->deflink->vdev_id,
 					  WMI_DBGLOG_VAP_ENABLE,
 					  set_value, DBG_CMD);
 		break;
@@ -547,7 +551,7 @@ static __iw_softap_setparam(struct net_device *dev,
 	case QCSAP_DBGLOG_VAP_DISABLE:
 	{
 		hdd_debug("QCSAP_DBGLOG_VAP_DISABLE val %d", set_value);
-		ret = wma_cli_set_command(adapter->vdev_id,
+		ret = wma_cli_set_command(adapter->deflink->vdev_id,
 					  WMI_DBGLOG_VAP_DISABLE,
 					  set_value, DBG_CMD);
 		break;
@@ -556,7 +560,7 @@ static __iw_softap_setparam(struct net_device *dev,
 	case QCSAP_DBGLOG_MODULE_ENABLE:
 	{
 		hdd_debug("QCSAP_DBGLOG_MODULE_ENABLE val %d", set_value);
-		ret = wma_cli_set_command(adapter->vdev_id,
+		ret = wma_cli_set_command(adapter->deflink->vdev_id,
 					  WMI_DBGLOG_MODULE_ENABLE,
 					  set_value, DBG_CMD);
 		break;
@@ -565,7 +569,7 @@ static __iw_softap_setparam(struct net_device *dev,
 	case QCSAP_DBGLOG_MODULE_DISABLE:
 	{
 		hdd_debug("QCSAP_DBGLOG_MODULE_DISABLE val %d", set_value);
-		ret = wma_cli_set_command(adapter->vdev_id,
+		ret = wma_cli_set_command(adapter->deflink->vdev_id,
 					  WMI_DBGLOG_MODULE_DISABLE,
 					  set_value, DBG_CMD);
 		break;
@@ -574,7 +578,7 @@ static __iw_softap_setparam(struct net_device *dev,
 	case QCSAP_DBGLOG_MOD_LOG_LEVEL:
 	{
 		hdd_debug("QCSAP_DBGLOG_MOD_LOG_LEVEL val %d", set_value);
-		ret = wma_cli_set_command(adapter->vdev_id,
+		ret = wma_cli_set_command(adapter->deflink->vdev_id,
 					  WMI_DBGLOG_MOD_LOG_LEVEL,
 					  set_value, DBG_CMD);
 		break;
@@ -583,7 +587,7 @@ static __iw_softap_setparam(struct net_device *dev,
 	case QCSAP_DBGLOG_TYPE:
 	{
 		hdd_debug("QCSAP_DBGLOG_TYPE val %d", set_value);
-		ret = wma_cli_set_command(adapter->vdev_id,
+		ret = wma_cli_set_command(adapter->deflink->vdev_id,
 					  WMI_DBGLOG_TYPE,
 					  set_value, DBG_CMD);
 		break;
@@ -591,7 +595,7 @@ static __iw_softap_setparam(struct net_device *dev,
 	case QCSAP_DBGLOG_REPORT_ENABLE:
 	{
 		hdd_debug("QCSAP_DBGLOG_REPORT_ENABLE val %d", set_value);
-		ret = wma_cli_set_command(adapter->vdev_id,
+		ret = wma_cli_set_command(adapter->deflink->vdev_id,
 					  WMI_DBGLOG_REPORT_ENABLE,
 					  set_value, DBG_CMD);
 		break;
@@ -614,7 +618,7 @@ static __iw_softap_setparam(struct net_device *dev,
 	case QCASAP_TXRX_FWSTATS_RESET:
 	{
 		hdd_debug("WE_TXRX_FWSTATS_RESET val %d", set_value);
-		ret = wma_cli_set_command(adapter->vdev_id,
+		ret = wma_cli_set_command(adapter->deflink->vdev_id,
 					  WMA_VDEV_TXRX_FWSTATS_RESET_CMDID,
 					  set_value, VDEV_CMD);
 		break;
@@ -622,7 +626,7 @@ static __iw_softap_setparam(struct net_device *dev,
 
 	case QCSAP_PARAM_RTSCTS:
 	{
-		ret = wma_cli_set_command(adapter->vdev_id,
+		ret = wma_cli_set_command(adapter->deflink->vdev_id,
 					  wmi_vdev_param_enable_rtscts,
 					  set_value, VDEV_CMD);
 		if (ret) {
@@ -688,7 +692,7 @@ static __iw_softap_setparam(struct net_device *dev,
 		}
 		hdd_debug("SET_HT_RATE val %d rix %d preamble %x nss %d",
 		       set_value, rix, preamble, nss);
-		ret = wma_cli_set_command(adapter->vdev_id,
+		ret = wma_cli_set_command(adapter->deflink->vdev_id,
 					  wmi_vdev_param_fixed_rate,
 					  set_value, VDEV_CMD);
 		break;
@@ -719,7 +723,7 @@ static __iw_softap_setparam(struct net_device *dev,
 		hdd_debug("SET_VHT_RATE val %d rix %d preamble %x nss %d",
 		       set_value, rix, preamble, nss);
 
-		ret = wma_cli_set_command(adapter->vdev_id,
+		ret = wma_cli_set_command(adapter->deflink->vdev_id,
 					  wmi_vdev_param_fixed_rate,
 					  set_value, VDEV_CMD);
 		break;
@@ -737,7 +741,7 @@ static __iw_softap_setparam(struct net_device *dev,
 	case QCSAP_SET_AMPDU:
 	{
 		hdd_debug("QCSAP_SET_AMPDU %d", set_value);
-		ret = wma_cli_set_command(adapter->vdev_id,
+		ret = wma_cli_set_command(adapter->deflink->vdev_id,
 					  GEN_VDEV_PARAM_AMPDU,
 					  set_value, GEN_CMD);
 		break;
@@ -746,7 +750,7 @@ static __iw_softap_setparam(struct net_device *dev,
 	case QCSAP_SET_AMSDU:
 	{
 		hdd_debug("QCSAP_SET_AMSDU %d", set_value);
-		ret = wma_cli_set_command(adapter->vdev_id,
+		ret = wma_cli_set_command(adapter->deflink->vdev_id,
 					  GEN_VDEV_PARAM_AMSDU,
 					  set_value, GEN_CMD);
 		break;
@@ -754,7 +758,7 @@ static __iw_softap_setparam(struct net_device *dev,
 	case QCSAP_GTX_HT_MCS:
 	{
 		hdd_debug("wmi_vdev_param_gtx_ht_mcs %d", set_value);
-		ret = wma_cli_set_command(adapter->vdev_id,
+		ret = wma_cli_set_command(adapter->deflink->vdev_id,
 					  wmi_vdev_param_gtx_ht_mcs,
 					  set_value, GTX_CMD);
 		break;
@@ -763,7 +767,7 @@ static __iw_softap_setparam(struct net_device *dev,
 	case QCSAP_GTX_VHT_MCS:
 	{
 		hdd_debug("wmi_vdev_param_gtx_vht_mcs %d", set_value);
-		ret = wma_cli_set_command(adapter->vdev_id,
+		ret = wma_cli_set_command(adapter->deflink->vdev_id,
 					  wmi_vdev_param_gtx_vht_mcs,
 						set_value, GTX_CMD);
 		break;
@@ -772,7 +776,7 @@ static __iw_softap_setparam(struct net_device *dev,
 	case QCSAP_GTX_USRCFG:
 	{
 		hdd_debug("wmi_vdev_param_gtx_usr_cfg %d", set_value);
-		ret = wma_cli_set_command(adapter->vdev_id,
+		ret = wma_cli_set_command(adapter->deflink->vdev_id,
 					  wmi_vdev_param_gtx_usr_cfg,
 					  set_value, GTX_CMD);
 		break;
@@ -781,7 +785,7 @@ static __iw_softap_setparam(struct net_device *dev,
 	case QCSAP_GTX_THRE:
 	{
 		hdd_debug("wmi_vdev_param_gtx_thre %d", set_value);
-		ret = wma_cli_set_command(adapter->vdev_id,
+		ret = wma_cli_set_command(adapter->deflink->vdev_id,
 					  wmi_vdev_param_gtx_thre,
 					  set_value, GTX_CMD);
 		break;
@@ -790,7 +794,7 @@ static __iw_softap_setparam(struct net_device *dev,
 	case QCSAP_GTX_MARGIN:
 	{
 		hdd_debug("wmi_vdev_param_gtx_margin %d", set_value);
-		ret = wma_cli_set_command(adapter->vdev_id,
+		ret = wma_cli_set_command(adapter->deflink->vdev_id,
 					  wmi_vdev_param_gtx_margin,
 					  set_value, GTX_CMD);
 		break;
@@ -799,7 +803,7 @@ static __iw_softap_setparam(struct net_device *dev,
 	case QCSAP_GTX_STEP:
 	{
 		hdd_debug("wmi_vdev_param_gtx_step %d", set_value);
-		ret = wma_cli_set_command(adapter->vdev_id,
+		ret = wma_cli_set_command(adapter->deflink->vdev_id,
 					  wmi_vdev_param_gtx_step,
 					  set_value, GTX_CMD);
 		break;
@@ -808,7 +812,7 @@ static __iw_softap_setparam(struct net_device *dev,
 	case QCSAP_GTX_MINTPC:
 	{
 		hdd_debug("wmi_vdev_param_gtx_mintpc %d", set_value);
-		ret = wma_cli_set_command(adapter->vdev_id,
+		ret = wma_cli_set_command(adapter->deflink->vdev_id,
 					  wmi_vdev_param_gtx_mintpc,
 					  set_value, GTX_CMD);
 		break;
@@ -817,7 +821,7 @@ static __iw_softap_setparam(struct net_device *dev,
 	case QCSAP_GTX_BWMASK:
 	{
 		hdd_debug("wmi_vdev_param_gtx_bw_mask%d", set_value);
-		ret = wma_cli_set_command(adapter->vdev_id,
+		ret = wma_cli_set_command(adapter->deflink->vdev_id,
 					  wmi_vdev_param_gtx_bw_mask,
 					  set_value, GTX_CMD);
 		break;
@@ -858,8 +862,9 @@ static __iw_softap_setparam(struct net_device *dev,
 		if (adapter->device_mode != QDF_SAP_MODE)
 			return -EINVAL;
 
-		status = sme_set_he_bss_color(mac_handle, adapter->vdev_id,
-				set_value);
+		status = sme_set_he_bss_color(mac_handle,
+					      adapter->deflink->vdev_id,
+					      set_value);
 		if (QDF_STATUS_SUCCESS != status) {
 			hdd_err("SET_HE_BSS_COLOR failed");
 			return -EIO;
@@ -903,7 +908,7 @@ static __iw_softap_setparam(struct net_device *dev,
 	case QCASAP_TX_CHAINMASK_CMD:
 	{
 		hdd_debug("QCASAP_TX_CHAINMASK_CMD val %d", set_value);
-		ret = wma_cli_set_command(adapter->vdev_id,
+		ret = wma_cli_set_command(adapter->deflink->vdev_id,
 					  wmi_pdev_param_tx_chain_mask,
 					  set_value, PDEV_CMD);
 		ret = hdd_set_antenna_mode(adapter, hdd_ctx, set_value);
@@ -913,7 +918,7 @@ static __iw_softap_setparam(struct net_device *dev,
 	case QCASAP_RX_CHAINMASK_CMD:
 	{
 		hdd_debug("QCASAP_RX_CHAINMASK_CMD val %d", set_value);
-		ret = wma_cli_set_command(adapter->vdev_id,
+		ret = wma_cli_set_command(adapter->deflink->vdev_id,
 					  wmi_pdev_param_rx_chain_mask,
 					  set_value, PDEV_CMD);
 		ret = hdd_set_antenna_mode(adapter, hdd_ctx, set_value);
@@ -924,7 +929,7 @@ static __iw_softap_setparam(struct net_device *dev,
 	{
 		hdd_debug("QCASAP_NSS_CMD val %d", set_value);
 		hdd_update_nss(adapter, set_value, set_value);
-		ret = wma_cli_set_command(adapter->vdev_id,
+		ret = wma_cli_set_command(adapter->deflink->vdev_id,
 					  wmi_vdev_param_nss,
 					  set_value, VDEV_CMD);
 		break;
@@ -994,7 +999,8 @@ static __iw_softap_setparam(struct net_device *dev,
 	}
 	case QCSAP_START_FW_PROFILING:
 		hdd_debug("QCSAP_START_FW_PROFILING %d", set_value);
-		ret = wma_cli_set_command(adapter->vdev_id,
+		ret = wma_cli_set_command(
+					adapter->deflink->vdev_id,
 					WMI_WLAN_PROFILE_TRIGGER_CMDID,
 					set_value, DBG_CMD);
 		break;
@@ -1014,25 +1020,27 @@ static __iw_softap_setparam(struct net_device *dev,
 		break;
 	case QCASAP_PARAM_DCM:
 		hdd_debug("Set wmi_vdev_param_he_dcm_enable: %d", set_value);
-		ret = wma_cli_set_command(adapter->vdev_id,
+		ret = wma_cli_set_command(adapter->deflink->vdev_id,
 					  wmi_vdev_param_he_dcm_enable,
 					  set_value, VDEV_CMD);
 		break;
 	case QCASAP_PARAM_RANGE_EXT:
 		hdd_debug("Set wmi_vdev_param_he_range_ext: %d", set_value);
-		ret = wma_cli_set_command(adapter->vdev_id,
+		ret = wma_cli_set_command(adapter->deflink->vdev_id,
 					  wmi_vdev_param_he_range_ext,
 					  set_value, VDEV_CMD);
 		break;
 	case QCSAP_SET_DEFAULT_AMPDU:
 		hdd_debug("QCSAP_SET_DEFAULT_AMPDU val %d", set_value);
-		ret = wma_cli_set_command((int)adapter->vdev_id,
+		ret = wma_cli_set_command(
+				(int)adapter->deflink->vdev_id,
 				(int)wmi_pdev_param_max_mpdus_in_ampdu,
 				set_value, PDEV_CMD);
 		break;
 	case QCSAP_ENABLE_RTS_BURSTING:
 		hdd_debug("QCSAP_ENABLE_RTS_BURSTING val %d", set_value);
-		ret = wma_cli_set_command((int)adapter->vdev_id,
+		ret = wma_cli_set_command(
+				(int)adapter->deflink->vdev_id,
 				(int)wmi_pdev_param_enable_rts_sifs_bursting,
 				set_value, PDEV_CMD);
 		break;
@@ -1187,7 +1195,7 @@ static __iw_softap_getparam(struct net_device *dev,
 
 	case QCSAP_PARAM_RTSCTS:
 	{
-		*value = wma_cli_get_command(adapter->vdev_id,
+		*value = wma_cli_get_command(adapter->deflink->vdev_id,
 					     wmi_vdev_param_enable_rtscts,
 					     VDEV_CMD);
 		break;
@@ -1195,7 +1203,7 @@ static __iw_softap_getparam(struct net_device *dev,
 
 	case QCASAP_SHORT_GI:
 	{
-		*value = wma_cli_get_command(adapter->vdev_id,
+		*value = wma_cli_get_command(adapter->deflink->vdev_id,
 					     wmi_vdev_param_sgi,
 					     VDEV_CMD);
 		break;
@@ -1204,7 +1212,7 @@ static __iw_softap_getparam(struct net_device *dev,
 	case QCSAP_GTX_HT_MCS:
 	{
 		hdd_debug("GET wmi_vdev_param_gtx_ht_mcs");
-		*value = wma_cli_get_command(adapter->vdev_id,
+		*value = wma_cli_get_command(adapter->deflink->vdev_id,
 					     wmi_vdev_param_gtx_ht_mcs,
 					     GTX_CMD);
 		break;
@@ -1213,7 +1221,7 @@ static __iw_softap_getparam(struct net_device *dev,
 	case QCSAP_GTX_VHT_MCS:
 	{
 		hdd_debug("GET wmi_vdev_param_gtx_vht_mcs");
-		*value = wma_cli_get_command(adapter->vdev_id,
+		*value = wma_cli_get_command(adapter->deflink->vdev_id,
 					     wmi_vdev_param_gtx_vht_mcs,
 					     GTX_CMD);
 		break;
@@ -1222,7 +1230,7 @@ static __iw_softap_getparam(struct net_device *dev,
 	case QCSAP_GTX_USRCFG:
 	{
 		hdd_debug("GET wmi_vdev_param_gtx_usr_cfg");
-		*value = wma_cli_get_command(adapter->vdev_id,
+		*value = wma_cli_get_command(adapter->deflink->vdev_id,
 					     wmi_vdev_param_gtx_usr_cfg,
 					     GTX_CMD);
 		break;
@@ -1231,7 +1239,7 @@ static __iw_softap_getparam(struct net_device *dev,
 	case QCSAP_GTX_THRE:
 	{
 		hdd_debug("GET wmi_vdev_param_gtx_thre");
-		*value = wma_cli_get_command(adapter->vdev_id,
+		*value = wma_cli_get_command(adapter->deflink->vdev_id,
 					     wmi_vdev_param_gtx_thre,
 					     GTX_CMD);
 		break;
@@ -1240,7 +1248,7 @@ static __iw_softap_getparam(struct net_device *dev,
 	case QCSAP_GTX_MARGIN:
 	{
 		hdd_debug("GET wmi_vdev_param_gtx_margin");
-		*value = wma_cli_get_command(adapter->vdev_id,
+		*value = wma_cli_get_command(adapter->deflink->vdev_id,
 					     wmi_vdev_param_gtx_margin,
 					     GTX_CMD);
 		break;
@@ -1249,7 +1257,7 @@ static __iw_softap_getparam(struct net_device *dev,
 	case QCSAP_GTX_STEP:
 	{
 		hdd_debug("GET wmi_vdev_param_gtx_step");
-		*value = wma_cli_get_command(adapter->vdev_id,
+		*value = wma_cli_get_command(adapter->deflink->vdev_id,
 					     wmi_vdev_param_gtx_step,
 					     GTX_CMD);
 		break;
@@ -1258,7 +1266,7 @@ static __iw_softap_getparam(struct net_device *dev,
 	case QCSAP_GTX_MINTPC:
 	{
 		hdd_debug("GET wmi_vdev_param_gtx_mintpc");
-		*value = wma_cli_get_command(adapter->vdev_id,
+		*value = wma_cli_get_command(adapter->deflink->vdev_id,
 					     wmi_vdev_param_gtx_mintpc,
 					     GTX_CMD);
 		break;
@@ -1267,7 +1275,7 @@ static __iw_softap_getparam(struct net_device *dev,
 	case QCSAP_GTX_BWMASK:
 	{
 		hdd_debug("GET wmi_vdev_param_gtx_bw_mask");
-		*value = wma_cli_get_command(adapter->vdev_id,
+		*value = wma_cli_get_command(adapter->deflink->vdev_id,
 					     wmi_vdev_param_gtx_bw_mask,
 					     GTX_CMD);
 		break;
@@ -1302,7 +1310,7 @@ static __iw_softap_getparam(struct net_device *dev,
 	case QCASAP_TX_CHAINMASK_CMD:
 	{
 		hdd_debug("QCASAP_TX_CHAINMASK_CMD");
-		*value = wma_cli_get_command(adapter->vdev_id,
+		*value = wma_cli_get_command(adapter->deflink->vdev_id,
 					     wmi_pdev_param_tx_chain_mask,
 					     PDEV_CMD);
 		break;
@@ -1311,7 +1319,7 @@ static __iw_softap_getparam(struct net_device *dev,
 	case QCASAP_RX_CHAINMASK_CMD:
 	{
 		hdd_debug("QCASAP_RX_CHAINMASK_CMD");
-		*value = wma_cli_get_command(adapter->vdev_id,
+		*value = wma_cli_get_command(adapter->deflink->vdev_id,
 					     wmi_pdev_param_rx_chain_mask,
 					     PDEV_CMD);
 		break;
@@ -1320,7 +1328,7 @@ static __iw_softap_getparam(struct net_device *dev,
 	case QCASAP_NSS_CMD:
 	{
 		hdd_debug("QCASAP_NSS_CMD");
-		*value = wma_cli_get_command(adapter->vdev_id,
+		*value = wma_cli_get_command(adapter->deflink->vdev_id,
 					     wmi_vdev_param_nss,
 					     VDEV_CMD);
 		break;
@@ -1336,7 +1344,8 @@ static __iw_softap_getparam(struct net_device *dev,
 	}
 	case QCSAP_GET_FW_PROFILE_DATA:
 		hdd_debug("QCSAP_GET_FW_PROFILE_DATA");
-		ret = wma_cli_set_command(adapter->vdev_id,
+		ret = wma_cli_set_command(
+				adapter->deflink->vdev_id,
 				WMI_WLAN_PROFILE_GET_PROFILE_DATA_CMDID,
 				0, DBG_CMD);
 		break;
@@ -1362,14 +1371,14 @@ static __iw_softap_getparam(struct net_device *dev,
 	}
 	case QCASAP_PARAM_DCM:
 	{
-		*value = wma_cli_get_command(adapter->vdev_id,
+		*value = wma_cli_get_command(adapter->deflink->vdev_id,
 					     wmi_vdev_param_he_dcm_enable,
 					     VDEV_CMD);
 		break;
 	}
 	case QCASAP_PARAM_RANGE_EXT:
 	{
-		*value = wma_cli_get_command(adapter->vdev_id,
+		*value = wma_cli_get_command(adapter->deflink->vdev_id,
 					     wmi_vdev_param_he_range_ext,
 					     VDEV_CMD);
 		break;
@@ -1679,9 +1688,10 @@ static __iw_softap_set_tx_power(struct net_device *dev,
 	qdf_copy_macaddr(&bssid, &adapter->mac_addr);
 
 	set_value = value[0];
-	if (QDF_STATUS_SUCCESS !=
-	    sme_set_tx_power(hdd_ctx->mac_handle, adapter->vdev_id, bssid,
-			     adapter->device_mode, set_value)) {
+	if (QDF_STATUS_SUCCESS != sme_set_tx_power(
+					hdd_ctx->mac_handle,
+					adapter->deflink->vdev_id, bssid,
+					adapter->device_mode, set_value)) {
 		hdd_err("Setting tx power failed");
 		return -EIO;
 	}
@@ -2182,7 +2192,7 @@ __iw_softap_stopbss(struct net_device *dev,
 		clear_bit(SOFTAP_BSS_STARTED, &adapter->event_flags);
 		policy_mgr_decr_session_set_pcl(hdd_ctx->psoc,
 					     adapter->device_mode,
-					     adapter->vdev_id);
+					     adapter->deflink->vdev_id);
 		hdd_green_ap_start_state_mc(hdd_ctx, adapter->device_mode,
 					    false);
 		ret = qdf_status_to_os_return(status);

+ 120 - 107
core/hdd/src/wlan_hdd_ioctl.c

@@ -576,9 +576,9 @@ static int hdd_parse_reassoc_v1(struct hdd_adapter *adapter, const char *command
 	struct qdf_mac_addr target_bssid;
 	struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
 	QDF_STATUS status;
+	struct wlan_objmgr_pdev *pdev;
 
-	struct wlan_objmgr_pdev *pdev = wlan_vdev_get_pdev(adapter->vdev);
-
+	pdev = wlan_vdev_get_pdev(adapter->deflink->vdev);
 	ret = hdd_parse_reassoc_command_v1_data(command, bssid, &freq, pdev);
 	if (ret) {
 		hdd_err("Failed to parse reassoc command data");
@@ -587,7 +587,7 @@ static int hdd_parse_reassoc_v1(struct hdd_adapter *adapter, const char *command
 
 	qdf_mem_copy(target_bssid.bytes, bssid, sizeof(tSirMacAddr));
 	status = ucfg_wlan_cm_roam_invoke(hdd_ctx->pdev,
-					  adapter->vdev_id,
+					  adapter->deflink->vdev_id,
 					  &target_bssid, freq,
 					  CM_ROAMING_HOST);
 	return qdf_status_to_os_return(status);
@@ -617,8 +617,9 @@ static int hdd_parse_reassoc_v2(struct hdd_adapter *adapter,
 	struct qdf_mac_addr target_bssid;
 	struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
 	QDF_STATUS status;
-	struct wlan_objmgr_pdev *pdev = wlan_vdev_get_pdev(adapter->vdev);
+	struct wlan_objmgr_pdev *pdev;
 
+	pdev = wlan_vdev_get_pdev(adapter->deflink->vdev);
 	if (total_len < sizeof(params) + 8) {
 		hdd_err("Invalid command length");
 		return -EINVAL;
@@ -642,7 +643,7 @@ static int hdd_parse_reassoc_v2(struct hdd_adapter *adapter,
 
 		qdf_mem_copy(target_bssid.bytes, bssid, sizeof(tSirMacAddr));
 		status = ucfg_wlan_cm_roam_invoke(hdd_ctx->pdev,
-						  adapter->vdev_id,
+						  adapter->deflink->vdev_id,
 						  &target_bssid, freq,
 						  CM_ROAMING_HOST);
 		ret = qdf_status_to_os_return(status);
@@ -789,8 +790,9 @@ hdd_sendactionframe(struct hdd_adapter *adapter, const uint8_t *bssid,
 				 * may cause long delays in sending action
 				 * frames.
 				 */
-				ucfg_cm_abort_roam_scan(hdd_ctx->pdev,
-							adapter->vdev_id);
+				ucfg_cm_abort_roam_scan(
+						hdd_ctx->pdev,
+						adapter->deflink->vdev_id);
 			} else {
 				/*
 				 * 0 is accepted as current home frequency,
@@ -872,8 +874,9 @@ hdd_parse_sendactionframe_v1(struct hdd_adapter *adapter, const char *command)
 	uint8_t *payload = NULL;
 	tSirMacAddr bssid;
 	int ret;
-	struct wlan_objmgr_pdev *pdev = wlan_vdev_get_pdev(adapter->vdev);
+	struct wlan_objmgr_pdev *pdev;
 
+	pdev = wlan_vdev_get_pdev(adapter->deflink->vdev);
 	ret = hdd_parse_send_action_frame_v1_data(command, bssid, &freq,
 						  &dwell_time, &payload,
 						  &payload_len, pdev);
@@ -911,7 +914,9 @@ hdd_parse_sendactionframe_v2(struct hdd_adapter *adapter,
 	int ret;
 	int len_wo_payload = 0;
 	qdf_freq_t freq = 0;
-	struct wlan_objmgr_pdev *pdev = wlan_vdev_get_pdev(adapter->vdev);
+	struct wlan_objmgr_pdev *pdev;
+
+	pdev = wlan_vdev_get_pdev(adapter->deflink->vdev);
 
 	/* The params are located after "SENDACTIONFRAME " */
 	total_len -= 16;
@@ -1582,7 +1587,7 @@ static int hdd_set_app_type1_parser(struct hdd_adapter *adapter,
 	}
 
 	memset(&params, 0, sizeof(tSirAppType1Params));
-	params.vdev_id = adapter->vdev_id;
+	params.vdev_id = adapter->deflink->vdev_id;
 	qdf_copy_macaddr(&params.wakee_mac_addr, &adapter->mac_addr);
 
 	params.id_length = strlen(id);
@@ -1671,7 +1676,7 @@ static int hdd_set_app_type2_parser(struct hdd_adapter *adapter,
 	params.rc4_key_len = strlen(rc4_key);
 	qdf_mem_copy(params.rc4_key, rc4_key, params.rc4_key_len);
 
-	params.vdev_id = adapter->vdev_id;
+	params.vdev_id = adapter->deflink->vdev_id;
 
 	if (!params.tcp_src_port)
 		params.tcp_src_port =
@@ -2018,7 +2023,7 @@ static int hdd_enable_unit_test_commands(struct hdd_adapter *adapter,
 	    hdd_get_conparam() == QDF_GLOBAL_MONITOR_MODE)
 		return -EPERM;
 
-	if (adapter->vdev_id >= WLAN_MAX_VDEVS) {
+	if (adapter->deflink->vdev_id >= WLAN_MAX_VDEVS) {
 		hdd_err_rl("Invalid vdev id");
 		return -EINVAL;
 	}
@@ -2027,7 +2032,7 @@ static int hdd_enable_unit_test_commands(struct hdd_adapter *adapter,
 		arg[0] = 360;
 		arg[1] = 1;
 
-		status = sme_send_unit_test_cmd(adapter->vdev_id,
+		status = sme_send_unit_test_cmd(adapter->deflink->vdev_id,
 						WLAN_MODULE_TX,
 						2,
 						arg);
@@ -2037,7 +2042,7 @@ static int hdd_enable_unit_test_commands(struct hdd_adapter *adapter,
 		arg[0] = 361;
 		arg[1] = 1;
 
-		status = sme_send_unit_test_cmd(adapter->vdev_id,
+		status = sme_send_unit_test_cmd(adapter->deflink->vdev_id,
 						WLAN_MODULE_TX,
 						2,
 						arg);
@@ -2048,7 +2053,7 @@ static int hdd_enable_unit_test_commands(struct hdd_adapter *adapter,
 		arg[1] = 1;
 		arg[2] = 1;
 
-		status = sme_send_unit_test_cmd(adapter->vdev_id,
+		status = sme_send_unit_test_cmd(adapter->deflink->vdev_id,
 						WLAN_MODULE_TX,
 						3,
 						arg);
@@ -2059,10 +2064,9 @@ static int hdd_enable_unit_test_commands(struct hdd_adapter *adapter,
 			arg[0] = 37;
 			arg[1] = 3000;
 
-			status = sme_send_unit_test_cmd(adapter->vdev_id,
-							WLAN_MODULE_RX,
-							2,
-							arg);
+			status = sme_send_unit_test_cmd(
+						adapter->deflink->vdev_id,
+						WLAN_MODULE_RX,	2, arg);
 			if (status != QDF_STATUS_SUCCESS)
 				return qdf_status_to_os_return(status);
 		}
@@ -2071,10 +2075,9 @@ static int hdd_enable_unit_test_commands(struct hdd_adapter *adapter,
 			arg[0] = 44;
 			arg[1] = 3000;
 
-			status = sme_send_unit_test_cmd(adapter->vdev_id,
-							WLAN_MODULE_RX,
-							2,
-							arg);
+			status = sme_send_unit_test_cmd(
+						adapter->deflink->vdev_id,
+						WLAN_MODULE_RX, 2, arg);
 			if (status != QDF_STATUS_SUCCESS)
 				return qdf_status_to_os_return(status);
 		}
@@ -2082,7 +2085,7 @@ static int hdd_enable_unit_test_commands(struct hdd_adapter *adapter,
 		arg[0] = 7;
 		arg[1] = 1;
 
-		status = sme_send_unit_test_cmd(adapter->vdev_id,
+		status = sme_send_unit_test_cmd(adapter->deflink->vdev_id,
 						0x44,
 						2,
 						arg);
@@ -2105,7 +2108,7 @@ static int hdd_disable_unit_test_commands(struct hdd_adapter *adapter,
 	    hdd_get_conparam() == QDF_GLOBAL_MONITOR_MODE)
 		return -EPERM;
 
-	if (adapter->vdev_id >= WLAN_MAX_VDEVS) {
+	if (adapter->deflink->vdev_id >= WLAN_MAX_VDEVS) {
 		hdd_err_rl("Invalid vdev id");
 		return -EINVAL;
 	}
@@ -2114,7 +2117,7 @@ static int hdd_disable_unit_test_commands(struct hdd_adapter *adapter,
 		arg[0] = 360;
 		arg[1] = 0;
 
-		status = sme_send_unit_test_cmd(adapter->vdev_id,
+		status = sme_send_unit_test_cmd(adapter->deflink->vdev_id,
 						WLAN_MODULE_TX,
 						2,
 						arg);
@@ -2124,7 +2127,7 @@ static int hdd_disable_unit_test_commands(struct hdd_adapter *adapter,
 		arg[0] = 361;
 		arg[1] = 0;
 
-		status = sme_send_unit_test_cmd(adapter->vdev_id,
+		status = sme_send_unit_test_cmd(adapter->deflink->vdev_id,
 						WLAN_MODULE_TX,
 						2,
 						arg);
@@ -2134,7 +2137,7 @@ static int hdd_disable_unit_test_commands(struct hdd_adapter *adapter,
 		arg[0] = 44;
 		arg[1] = 0;
 
-		status = sme_send_unit_test_cmd(adapter->vdev_id,
+		status = sme_send_unit_test_cmd(adapter->deflink->vdev_id,
 						WLAN_MODULE_RX,
 						2,
 						arg);
@@ -2144,7 +2147,7 @@ static int hdd_disable_unit_test_commands(struct hdd_adapter *adapter,
 		arg[0] = 84;
 		arg[1] = 0;
 
-		status = sme_send_unit_test_cmd(adapter->vdev_id,
+		status = sme_send_unit_test_cmd(adapter->deflink->vdev_id,
 						WLAN_MODULE_RX,
 						2,
 						arg);
@@ -2155,7 +2158,7 @@ static int hdd_disable_unit_test_commands(struct hdd_adapter *adapter,
 		arg[0] = 7;
 		arg[1] = 0;
 
-		status = sme_send_unit_test_cmd(adapter->vdev_id,
+		status = sme_send_unit_test_cmd(adapter->deflink->vdev_id,
 						0x44,
 						2,
 						arg);
@@ -2241,7 +2244,7 @@ static int wlan_hdd_get_link_status(struct hdd_adapter *adapter)
 
 	status = sme_get_link_status(adapter->hdd_ctx->mac_handle,
 				     hdd_get_link_status_cb,
-				     cookie, adapter->vdev_id);
+				     cookie, adapter->deflink->vdev_id);
 	if (QDF_STATUS_SUCCESS != status) {
 		hdd_err("Unable to retrieve link status");
 		/* return a cached value */
@@ -2549,7 +2552,7 @@ static int drv_cmd_p2p_dev_addr(struct hdd_adapter *adapter,
 
 	qdf_mtrace(QDF_MODULE_ID_HDD, QDF_MODULE_ID_HDD,
 		   TRACE_CODE_HDD_P2P_DEV_ADDR_IOCTL,
-		   adapter->vdev_id,
+		   adapter->deflink->vdev_id,
 		   (unsigned int)(*(addr->bytes + 2) << 24 |
 				*(addr->bytes + 3) << 16 |
 				*(addr->bytes + 4) << 8 |
@@ -2751,14 +2754,15 @@ static int drv_cmd_set_roam_trigger(struct hdd_adapter *adapter,
 
 	qdf_mtrace(QDF_MODULE_ID_HDD, QDF_MODULE_ID_HDD,
 		   TRACE_CODE_HDD_SETROAMTRIGGER_IOCTL,
-		   adapter->vdev_id, lookup_threshold);
+		   adapter->deflink->vdev_id, lookup_threshold);
 
 	hdd_debug("Set Roam trigger: Neighbor lookup threshold = %d",
 		  lookup_threshold);
 
-	status = sme_set_neighbor_lookup_rssi_threshold(hdd_ctx->mac_handle,
-							adapter->vdev_id,
-							lookup_threshold);
+	status = sme_set_neighbor_lookup_rssi_threshold(
+						    hdd_ctx->mac_handle,
+						    adapter->deflink->vdev_id,
+						    lookup_threshold);
 	if (QDF_STATUS_SUCCESS != status) {
 		hdd_err("Failed to set roam trigger, try again");
 		ret = -EPERM;
@@ -2782,18 +2786,19 @@ static int drv_cmd_get_roam_trigger(struct hdd_adapter *adapter,
 	uint8_t len = 0;
 	QDF_STATUS status;
 
-	status = ucfg_cm_get_neighbor_lookup_rssi_threshold(hdd_ctx->psoc,
-							    adapter->vdev_id,
-							    &lookup_threshold);
+	status = ucfg_cm_get_neighbor_lookup_rssi_threshold(
+						hdd_ctx->psoc,
+						adapter->deflink->vdev_id,
+						&lookup_threshold);
 	if (QDF_IS_STATUS_ERROR(status))
 		return qdf_status_to_os_return(status);
 
 	qdf_mtrace(QDF_MODULE_ID_HDD, QDF_MODULE_ID_HDD,
 		   TRACE_CODE_HDD_GETROAMTRIGGER_IOCTL,
-		   adapter->vdev_id, lookup_threshold);
+		   adapter->deflink->vdev_id, lookup_threshold);
 
 	hdd_debug("vdev_id: %u, lookup_threshold: %u",
-		  adapter->vdev_id, lookup_threshold);
+		  adapter->deflink->vdev_id, lookup_threshold);
 
 	rssi = (-1) * lookup_threshold;
 
@@ -2861,7 +2866,7 @@ static int drv_cmd_set_roam_scan_period(struct hdd_adapter *adapter,
 
 	qdf_mtrace(QDF_MODULE_ID_HDD, QDF_MODULE_ID_HDD,
 		   TRACE_CODE_HDD_SETROAMSCANPERIOD_IOCTL,
-		   adapter->vdev_id, roam_scan_period);
+		   adapter->deflink->vdev_id, roam_scan_period);
 
 	empty_scan_refresh_period = roam_scan_period * 1000;
 
@@ -2869,7 +2874,7 @@ static int drv_cmd_set_roam_scan_period(struct hdd_adapter *adapter,
 		  roam_scan_period);
 
 	sme_update_empty_scan_refresh_period(hdd_ctx->mac_handle,
-					     adapter->vdev_id,
+					     adapter->deflink->vdev_id,
 					     empty_scan_refresh_period);
 
 exit:
@@ -2889,17 +2894,18 @@ static int drv_cmd_get_roam_scan_period(struct hdd_adapter *adapter,
 	QDF_STATUS status;
 
 	status = ucfg_cm_get_empty_scan_refresh_period(
-						hdd_ctx->psoc, adapter->vdev_id,
+						hdd_ctx->psoc,
+						adapter->deflink->vdev_id,
 						&empty_scan_refresh_period);
 	if (QDF_IS_STATUS_ERROR(status))
 		return qdf_status_to_os_return(status);
 
 	hdd_debug("vdev_id: %u, empty_scan_refresh_period: %u",
-		  adapter->vdev_id, empty_scan_refresh_period);
+		  adapter->deflink->vdev_id, empty_scan_refresh_period);
 
 	qdf_mtrace(QDF_MODULE_ID_HDD, QDF_MODULE_ID_HDD,
 		   TRACE_CODE_HDD_GETROAMSCANPERIOD_IOCTL,
-		   adapter->vdev_id,
+		   adapter->deflink->vdev_id,
 		   empty_scan_refresh_period);
 
 	len = scnprintf(extra, sizeof(extra), "%s %d",
@@ -2964,7 +2970,7 @@ static int drv_cmd_set_roam_scan_refresh_period(struct hdd_adapter *adapter,
 		  neighbor_scan_refresh_period);
 
 	sme_set_neighbor_scan_refresh_period(hdd_ctx->mac_handle,
-					     adapter->vdev_id,
+					     adapter->deflink->vdev_id,
 					     neighbor_scan_refresh_period);
 
 exit:
@@ -3046,13 +3052,11 @@ static int drv_cmd_set_roam_mode(struct hdd_adapter *adapter,
 	if (roam_mode) {
 		ucfg_mlme_set_roam_scan_offload_enabled(hdd_ctx->psoc,
 							(bool)roam_mode);
-		sme_update_is_fast_roam_ini_feature_enabled(mac_handle,
-							    adapter->vdev_id,
-							    roam_mode);
+		sme_update_is_fast_roam_ini_feature_enabled(
+			    mac_handle, adapter->deflink->vdev_id, roam_mode);
 	} else {
-		sme_update_is_fast_roam_ini_feature_enabled(mac_handle,
-							    adapter->vdev_id,
-							    roam_mode);
+		sme_update_is_fast_roam_ini_feature_enabled(
+			    mac_handle, adapter->deflink->vdev_id, roam_mode);
 		ucfg_mlme_set_roam_scan_offload_enabled(hdd_ctx->psoc,
 							roam_mode);
 	}
@@ -3170,7 +3174,7 @@ static int drv_cmd_set_roam_delta(struct hdd_adapter *adapter,
 		  roam_rssi_diff);
 
 	sme_update_roam_rssi_diff(hdd_ctx->mac_handle,
-				  adapter->vdev_id,
+				  adapter->deflink->vdev_id,
 				  roam_rssi_diff);
 
 exit:
@@ -3189,16 +3193,18 @@ static int drv_cmd_get_roam_delta(struct hdd_adapter *adapter,
 	uint8_t len;
 	QDF_STATUS status;
 
-	status = ucfg_cm_get_roam_rssi_diff(hdd_ctx->psoc, adapter->vdev_id,
+	status = ucfg_cm_get_roam_rssi_diff(hdd_ctx->psoc,
+					    adapter->deflink->vdev_id,
 					    &rssi_diff);
 	if (QDF_IS_STATUS_ERROR(status))
 		return qdf_status_to_os_return(status);
 
-	hdd_debug("vdev_id: %u, rssi_diff: %u", adapter->vdev_id, rssi_diff);
+	hdd_debug("vdev_id: %u, rssi_diff: %u",
+		  adapter->deflink->vdev_id, rssi_diff);
 
 	qdf_mtrace(QDF_MODULE_ID_HDD, QDF_MODULE_ID_HDD,
 		   TRACE_CODE_HDD_GETROAMDELTA_IOCTL,
-		   adapter->vdev_id, rssi_diff);
+		   adapter->deflink->vdev_id, rssi_diff);
 	len = scnprintf(extra, sizeof(extra), "%s %d",
 			command, rssi_diff);
 	len = QDF_MIN(priv_data->total_len, len + 1);
@@ -3226,7 +3232,7 @@ static int drv_cmd_get_band(struct hdd_adapter *adapter,
 
 	qdf_mtrace(QDF_MODULE_ID_HDD, QDF_MODULE_ID_HDD,
 		   TRACE_CODE_HDD_GETBAND_IOCTL,
-		   adapter->vdev_id, band);
+		   adapter->deflink->vdev_id, band);
 
 	len = scnprintf(extra, sizeof(extra), "%s %d", command, band);
 	len = QDF_MIN(priv_data->total_len, len + 1);
@@ -3405,7 +3411,7 @@ hdd_get_roam_chan_from_fw(struct hdd_adapter *adapter, uint32_t *chan_list,
 	priv->roam_ch.chan_list = (uint32_t *)(p_roam_ch + 1);
 	cookie = osif_request_cookie(request);
 	status = sme_get_roam_scan_ch(hdd_ctx->mac_handle,
-				      adapter->vdev_id, cookie);
+				      adapter->deflink->vdev_id, cookie);
 
 	if (QDF_IS_STATUS_ERROR(status)) {
 		hdd_err("Unable to retrieve roam channels");
@@ -3452,8 +3458,8 @@ hdd_get_roam_scan_freq(struct hdd_adapter *adapter, mac_handle_t mac_handle,
 		return ret;
 	}
 
-	if (sme_get_roam_scan_channel_list(mac_handle, chan_list,
-					   num_channels, adapter->vdev_id) !=
+	if (sme_get_roam_scan_channel_list(mac_handle, chan_list, num_channels,
+					   adapter->deflink->vdev_id) !=
 					   QDF_STATUS_SUCCESS) {
 		hdd_err("failed to get roam scan channel list");
 		return -EFAULT;
@@ -3699,14 +3705,14 @@ static int drv_cmd_set_roam_scan_channel_min_time(struct hdd_adapter *adapter,
 
 	qdf_mtrace(QDF_MODULE_ID_HDD, QDF_MODULE_ID_HDD,
 		   TRACE_CODE_HDD_SETROAMSCANCHANNELMINTIME_IOCTL,
-		   adapter->vdev_id, min_time);
+		   adapter->deflink->vdev_id, min_time);
 
 	hdd_debug("Received Command to change channel min time = %d",
 		  min_time);
 
 	sme_set_neighbor_scan_min_chan_time(hdd_ctx->mac_handle,
 					    min_time,
-					    adapter->vdev_id);
+					    adapter->deflink->vdev_id);
 
 exit:
 	return ret;
@@ -3730,8 +3736,8 @@ static int drv_cmd_get_roam_scan_channel_min_time(struct hdd_adapter *adapter,
 {
 	int ret = 0;
 	uint16_t val = ucfg_cm_get_neighbor_scan_min_chan_time(
-							hdd_ctx->psoc,
-							adapter->vdev_id);
+						hdd_ctx->psoc,
+						adapter->deflink->vdev_id);
 	char extra[32];
 	uint8_t len = 0;
 
@@ -3742,7 +3748,7 @@ static int drv_cmd_get_roam_scan_channel_min_time(struct hdd_adapter *adapter,
 
 	qdf_mtrace(QDF_MODULE_ID_HDD, QDF_MODULE_ID_HDD,
 		   TRACE_CODE_HDD_GETROAMSCANCHANNELMINTIME_IOCTL,
-		   adapter->vdev_id, val);
+		   adapter->deflink->vdev_id, val);
 
 	if (copy_to_user(priv_data->buf, &extra, len)) {
 		hdd_err("failed to copy data to user buffer");
@@ -3792,7 +3798,7 @@ static int drv_cmd_set_scan_channel_time(struct hdd_adapter *adapter,
 		  max_time);
 
 	sme_set_neighbor_scan_max_chan_time(hdd_ctx->mac_handle,
-					    adapter->vdev_id,
+					    adapter->deflink->vdev_id,
 					    max_time);
 
 exit:
@@ -3807,12 +3813,13 @@ static int drv_cmd_get_scan_channel_time(struct hdd_adapter *adapter,
 {
 	int ret = 0;
 	uint16_t val = ucfg_cm_get_neighbor_scan_max_chan_time(
-							hdd_ctx->psoc,
-							adapter->vdev_id);
+						hdd_ctx->psoc,
+						adapter->deflink->vdev_id);
 	char extra[32];
 	uint8_t len = 0;
 
-	hdd_debug("vdev_id: %u, scan channel time: %u", adapter->vdev_id, val);
+	hdd_debug("vdev_id: %u, scan channel time: %u",
+		  adapter->deflink->vdev_id, val);
 
 	/* value is interms of msec */
 	len = scnprintf(extra, sizeof(extra), "%s %d",
@@ -3867,7 +3874,7 @@ static int drv_cmd_set_scan_home_time(struct hdd_adapter *adapter,
 		  val);
 
 	sme_set_neighbor_scan_period(hdd_ctx->mac_handle,
-				     adapter->vdev_id, val);
+				     adapter->deflink->vdev_id, val);
 
 exit:
 	return ret;
@@ -3880,12 +3887,14 @@ static int drv_cmd_get_scan_home_time(struct hdd_adapter *adapter,
 				      struct hdd_priv_data *priv_data)
 {
 	int ret = 0;
-	uint16_t val = ucfg_cm_get_neighbor_scan_period(hdd_ctx->psoc,
-							adapter->vdev_id);
+	uint16_t val = ucfg_cm_get_neighbor_scan_period(
+						hdd_ctx->psoc,
+						adapter->deflink->vdev_id);
 	char extra[32];
 	uint8_t len = 0;
 
-	hdd_debug("vdev_id: %u, scan home time: %u", adapter->vdev_id, val);
+	hdd_debug("vdev_id: %u, scan home time: %u",
+		  adapter->deflink->vdev_id, val);
 
 	/* value is interms of msec */
 	len = scnprintf(extra, sizeof(extra), "%s %d",
@@ -3933,15 +3942,15 @@ static int drv_cmd_set_roam_intra_band(struct hdd_adapter *adapter,
 	ucfg_mlme_set_roam_intra_band(hdd_ctx->psoc, (bool)val);
 
 	/* Disable roaming on Vdev before setting PCL */
-	sme_stop_roaming(hdd_ctx->mac_handle, adapter->vdev_id,
+	sme_stop_roaming(hdd_ctx->mac_handle, adapter->deflink->vdev_id,
 			 REASON_DRIVER_DISABLED,
 			 RSO_SET_PCL);
 
 	policy_mgr_set_pcl_for_existing_combo(hdd_ctx->psoc, PM_STA_MODE,
-					      adapter->vdev_id);
+					      adapter->deflink->vdev_id);
 
 	/* Enable roaming once SET pcl is done */
-	sme_start_roaming(hdd_ctx->mac_handle, adapter->vdev_id,
+	sme_start_roaming(hdd_ctx->mac_handle, adapter->deflink->vdev_id,
 			  REASON_DRIVER_ENABLED,
 			  RSO_SET_PCL);
 
@@ -4013,7 +4022,7 @@ static int drv_cmd_set_scan_n_probes(struct hdd_adapter *adapter,
 		  nprobes);
 
 	sme_update_roam_scan_n_probes(hdd_ctx->mac_handle,
-				      adapter->vdev_id, nprobes);
+				      adapter->deflink->vdev_id, nprobes);
 
 exit:
 	return ret;
@@ -4032,13 +4041,13 @@ static int drv_cmd_get_scan_n_probes(struct hdd_adapter *adapter,
 	QDF_STATUS status;
 
 	status = sme_get_roam_scan_n_probes(hdd_ctx->mac_handle,
-					    adapter->vdev_id,
+					    adapter->deflink->vdev_id,
 					    &val);
 	if (QDF_IS_STATUS_ERROR(status))
 		return qdf_status_to_os_return(status);
 
 	hdd_debug("vdev_id: %u, scan_n_probes: %u",
-		  adapter->vdev_id, val);
+		  adapter->deflink->vdev_id, val);
 
 	len = scnprintf(extra, sizeof(extra), "%s %d", command, val);
 	len = QDF_MIN(priv_data->total_len, len + 1);
@@ -4092,7 +4101,7 @@ static int drv_cmd_set_scan_home_away_time(struct hdd_adapter *adapter,
 		  home_away_time);
 
 	sme_update_roam_scan_home_away_time(hdd_ctx->mac_handle,
-					    adapter->vdev_id,
+					    adapter->deflink->vdev_id,
 					    home_away_time,
 					    true);
 
@@ -4113,13 +4122,13 @@ static int drv_cmd_get_scan_home_away_time(struct hdd_adapter *adapter,
 	QDF_STATUS status;
 
 	status = ucfg_cm_get_roam_scan_home_away_time(hdd_ctx->psoc,
-						      adapter->vdev_id,
+						      adapter->deflink->vdev_id,
 						      &val);
 	if (QDF_IS_STATUS_ERROR(status))
 		return qdf_status_to_os_return(status);
 
 	hdd_debug("vdev_id: %u, scan home away time: %u",
-		  adapter->vdev_id, val);
+		  adapter->deflink->vdev_id, val);
 
 	len = scnprintf(extra, sizeof(extra), "%s %d", command, val);
 	len = QDF_MIN(priv_data->total_len, len + 1);
@@ -4170,7 +4179,8 @@ static int drv_cmd_set_wes_mode(struct hdd_adapter *adapter,
 
 	hdd_debug("Received Command to Set WES Mode rssi diff = %d", wes_mode);
 
-	sme_update_wes_mode(hdd_ctx->mac_handle, wes_mode, adapter->vdev_id);
+	sme_update_wes_mode(hdd_ctx->mac_handle, wes_mode,
+			    adapter->deflink->vdev_id);
 
 exit:
 	return ret;
@@ -4226,9 +4236,9 @@ static int drv_cmd_set_opportunistic_rssi_diff(struct hdd_adapter *adapter,
 	hdd_debug("Received Command to Set Opportunistic Threshold diff = %d",
 		  diff);
 
-	sme_set_roam_opportunistic_scan_threshold_diff(hdd_ctx->mac_handle,
-						       adapter->vdev_id,
-						       diff);
+	sme_set_roam_opportunistic_scan_threshold_diff(
+					hdd_ctx->mac_handle,
+					adapter->deflink->vdev_id, diff);
 
 exit:
 	return ret;
@@ -4285,7 +4295,7 @@ static int drv_cmd_set_roam_rescan_rssi_diff(struct hdd_adapter *adapter,
 		  rescan_rssi_diff);
 
 	sme_set_roam_rescan_rssi_diff(hdd_ctx->mac_handle,
-				      adapter->vdev_id,
+				      adapter->deflink->vdev_id,
 				      rescan_rssi_diff);
 
 exit:
@@ -4346,7 +4356,7 @@ static int drv_cmd_set_fast_roam(struct hdd_adapter *adapter,
 
 	ucfg_mlme_set_lfr_enabled(hdd_ctx->psoc, (bool)lfr_mode);
 	sme_update_is_fast_roam_ini_feature_enabled(hdd_ctx->mac_handle,
-						    adapter->vdev_id,
+						    adapter->deflink->vdev_id,
 						    lfr_mode);
 
 exit:
@@ -4424,7 +4434,7 @@ static int drv_cmd_fast_reassoc(struct hdd_adapter *adapter,
 	}
 
 	qdf_mem_copy(target_bssid.bytes, bssid, sizeof(tSirMacAddr));
-	ucfg_wlan_cm_roam_invoke(hdd_ctx->pdev, adapter->vdev_id,
+	ucfg_wlan_cm_roam_invoke(hdd_ctx->pdev, adapter->deflink->vdev_id,
 				 &target_bssid, freq, CM_ROAMING_HOST);
 
 exit:
@@ -4631,7 +4641,7 @@ static int drv_cmd_miracast(struct hdd_adapter *adapter,
 	case MIRACAST_CONN_OPT_DISABLED:
 		{
 			wma_cli_set_command(
-				adapter->vdev_id,
+				adapter->deflink->vdev_id,
 				wmi_pdev_param_power_collapse_enable,
 				(filter_type == MIRACAST_CONN_OPT_ENABLED ?
 				 0 : 1), PDEV_CMD);
@@ -4645,7 +4655,8 @@ static int drv_cmd_miracast(struct hdd_adapter *adapter,
 
 	/* Filtertype value should be either 0-Disabled, 1-Source, 2-sink */
 	hdd_ctx->miracast_value = filter_type;
-	ucfg_mlme_set_vdev_traffic_low_latency(hdd_ctx->psoc, adapter->vdev_id,
+	ucfg_mlme_set_vdev_traffic_low_latency(hdd_ctx->psoc,
+					       adapter->deflink->vdev_id,
 					       filter_type !=
 					       MIRACAST_DISABLED);
 
@@ -4728,10 +4739,11 @@ static int drv_cmd_set_ccx_roam_scan_channels(struct hdd_adapter *adapter,
 		goto exit;
 	}
 
-	status = ucfg_cm_set_ese_roam_scan_channel_list(hdd_ctx->pdev,
-							adapter->vdev_id,
-							channel_freq_list,
-							num_channels);
+	status = ucfg_cm_set_ese_roam_scan_channel_list(
+						hdd_ctx->pdev,
+						adapter->deflink->vdev_id,
+						channel_freq_list,
+						num_channels);
 	if (QDF_STATUS_SUCCESS != status) {
 		hdd_err("Failed to update channel list information");
 		ret = -EINVAL;
@@ -4873,7 +4885,7 @@ static int drv_cmd_set_cckm_ie(struct hdd_adapter *adapter,
 		goto exit;
 	}
 
-	ucfg_cm_set_cckm_ie(hdd_ctx->psoc, adapter->vdev_id, cckm_ie,
+	ucfg_cm_set_cckm_ie(hdd_ctx->psoc, adapter->deflink->vdev_id, cckm_ie,
 			    cckm_ie_len);
 	if (cckm_ie) {
 		qdf_mem_free(cckm_ie);
@@ -4922,7 +4934,7 @@ static int drv_cmd_ccx_beacon_req(struct hdd_adapter *adapter,
 	}
 
 	status = sme_set_ese_beacon_request(hdd_ctx->mac_handle,
-					    adapter->vdev_id,
+					    adapter->deflink->vdev_id,
 					    &req);
 
 	if (QDF_STATUS_E_RESOURCES == status) {
@@ -4968,7 +4980,7 @@ static int drv_cmd_ccx_plm_req(struct hdd_adapter *adapter,
 
 	status = hdd_parse_plm_cmd(command, req);
 	if (QDF_IS_STATUS_SUCCESS(status)) {
-		req->vdev_id = adapter->vdev_id;
+		req->vdev_id = adapter->deflink->vdev_id;
 		status = sme_set_plm_request(hdd_ctx->mac_handle, req);
 	}
 	qdf_mem_free(req);
@@ -5034,7 +5046,7 @@ static int drv_cmd_set_ccx_mode(struct hdd_adapter *adapter,
 	hdd_debug("Received Command to change ese mode = %d", ese_mode);
 
 	sme_update_is_ese_feature_enabled(mac_handle,
-					  adapter->vdev_id,
+					  adapter->deflink->vdev_id,
 					  ese_mode);
 
 exit:
@@ -5168,7 +5180,7 @@ static int drv_cmd_set_dfs_scan_mode(struct hdd_adapter *adapter,
 		goto exit;
 	}
 
-	sme_update_dfs_scan_mode(hdd_ctx->mac_handle, adapter->vdev_id,
+	sme_update_dfs_scan_mode(hdd_ctx->mac_handle, adapter->deflink->vdev_id,
 				 dfs_scan_mode);
 
 exit:
@@ -5236,7 +5248,7 @@ static int drv_cmd_enable_ext_wow(struct hdd_adapter *adapter,
 	}
 
 	return hdd_enable_ext_wow_parser(adapter,
-					 adapter->vdev_id,
+					 adapter->deflink->vdev_id,
 					 set_value);
 }
 
@@ -5570,7 +5582,7 @@ static int hdd_set_rx_filter(struct hdd_adapter *adapter, bool action,
 		}
 		filter->ulMulticastAddrCnt = j;
 		/* Set rx filter */
-		sme_8023_multicast_list(mac_handle, adapter->vdev_id,
+		sme_8023_multicast_list(mac_handle, adapter->deflink->vdev_id,
 					filter);
 		qdf_mem_free(filter);
 	} else {
@@ -6080,7 +6092,7 @@ static int drv_cmd_invalid(struct hdd_adapter *adapter,
 {
 	qdf_mtrace(QDF_MODULE_ID_HDD, QDF_MODULE_ID_HDD,
 		   TRACE_CODE_HDD_UNSUPPORTED_IOCTL,
-		   adapter->vdev_id, 0);
+		   adapter->deflink->vdev_id, 0);
 
 	hdd_debug("%s: Unsupported driver command \"%s\"",
 		  adapter->dev->name, command);
@@ -6272,7 +6284,7 @@ static int drv_cmd_set_channel_switch(struct hdd_adapter *adapter,
 
 	hdd_debug("CH:%d BW:%d", chan_number, chan_bw);
 
-	wlan_hdd_set_sap_csa_reason(hdd_ctx->psoc, adapter->vdev_id,
+	wlan_hdd_set_sap_csa_reason(hdd_ctx->psoc, adapter->deflink->vdev_id,
 				    CSA_REASON_USER_INITIATED);
 
 	if (chan_number <= wlan_reg_max_5ghz_ch_num())
@@ -6394,8 +6406,9 @@ static void disconnect_sta_and_restart_sap(struct hdd_context *hdd_ctx,
 		    adapter->device_mode == QDF_SAP_MODE) {
 			if (check_disable_channels(hdd_ctx,
 			    adapter->deflink->session.ap.operating_chan_freq))
-				policy_mgr_check_sap_restart(hdd_ctx->psoc,
-							     adapter->vdev_id);
+				policy_mgr_check_sap_restart(
+						hdd_ctx->psoc,
+						adapter->deflink->vdev_id);
 		}
 
 		status = hdd_get_next_adapter(hdd_ctx, adapter, &next);

+ 2 - 2
core/hdd/src/wlan_hdd_ipa.c

@@ -202,7 +202,7 @@ void hdd_ipa_send_nbuf_to_network(qdf_nbuf_t nbuf, qdf_netdev_t dev)
 	qdf_dp_trace_set_track(nbuf, QDF_RX);
 
 	ucfg_dp_event_eapol_log(nbuf, QDF_RX);
-	qdf_dp_trace_log_pkt(adapter->vdev_id,
+	qdf_dp_trace_log_pkt(adapter->deflink->vdev_id,
 			     nbuf, QDF_RX, QDF_TRACE_DEFAULT_PDEV_ID);
 	DPTRACE(qdf_dp_trace(nbuf,
 			     QDF_DP_TRACE_RX_HDD_PACKET_PTR_RECORD,
@@ -264,7 +264,7 @@ void hdd_ipa_send_nbuf_to_network(qdf_nbuf_t nbuf, qdf_netdev_t dev)
 	 * Expectation here is vdev will be present during TX/RX processing
 	 * and also DP internally maintaining vdev ref count
 	 */
-	ucfg_dp_inc_rx_pkt_stats(adapter->vdev,
+	ucfg_dp_inc_rx_pkt_stats(adapter->deflink->vdev,
 				 len,
 				 delivered);
 	/*

+ 3 - 3
core/hdd/src/wlan_hdd_lpass.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2012-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
@@ -108,7 +108,7 @@ static int wlan_hdd_gen_wlan_status_pack(struct wlan_status_data *data,
 		return -EINVAL;
 	}
 
-	if (wlan_hdd_validate_vdev_id(adapter->vdev_id))
+	if (wlan_hdd_validate_vdev_id(adapter->deflink->vdev_id))
 		return -EINVAL;
 
 	hdd_ctx = WLAN_HDD_GET_CTX(adapter);
@@ -156,7 +156,7 @@ static int wlan_hdd_gen_wlan_status_pack(struct wlan_status_data *data,
 
 	wlan_reg_get_cc_and_src(hdd_ctx->psoc, data->country_code);
 	data->is_on = is_on;
-	data->vdev_id = adapter->vdev_id;
+	data->vdev_id = adapter->deflink->vdev_id;
 	data->vdev_mode = adapter->device_mode;
 	if (sta_ctx) {
 		data->is_connected = is_connected;

Dosya farkı çok büyük olduğundan ihmal edildi
+ 161 - 142
core/hdd/src/wlan_hdd_main.c


+ 4 - 4
core/hdd/src/wlan_hdd_mcc_quota.c

@@ -173,7 +173,7 @@ wlan_hdd_set_mcc_fixed_quota(struct hdd_context *hdd_ctx,
 			return -EINVAL;
 		}
 
-		if (wlan_hdd_validate_vdev_id(if_adapter->vdev_id))
+		if (wlan_hdd_validate_vdev_id(if_adapter->deflink->vdev_id))
 			return -EINVAL;
 
 		att_id = QCA_WLAN_VENDOR_ATTR_MCC_QUOTA_CHAN_TIME_PERCENTAGE;
@@ -182,7 +182,7 @@ wlan_hdd_set_mcc_fixed_quota(struct hdd_context *hdd_ctx,
 			return -EINVAL;
 		}
 		mcc_quota.quota = nla_get_u32(quota_entries[att_id]);
-		mcc_quota.vdev_id = if_adapter->vdev_id;
+		mcc_quota.vdev_id = if_adapter->deflink->vdev_id;
 		mcc_quota.op_mode = if_adapter->device_mode;
 
 		entries++;
@@ -256,7 +256,7 @@ static int wlan_hdd_set_mcc_low_latency_quota(
 	if (ll_enable)
 		ll_mode = 1;
 	hdd_debug("set conc ll mode 0x%08x", ll_mode);
-	rc = wma_cli_set_command(adapter->vdev_id,
+	rc = wma_cli_set_command(adapter->deflink->vdev_id,
 				 wmi_pdev_param_set_conc_low_latency_mode,
 				 ll_mode, PDEV_CMD);
 	if (rc)
@@ -325,7 +325,7 @@ int wlan_hdd_apply_user_mcc_quota(struct hdd_adapter *adapter)
 
 	if (quota_val == 0) {
 		hdd_debug("no mcc/quota for mode %d, vdev_id : %u",
-			  adapter->device_mode, adapter->vdev_id);
+			  adapter->device_mode, adapter->deflink->vdev_id);
 		return 0;
 	}
 

+ 2 - 2
core/hdd/src/wlan_hdd_mdns_offload.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 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 above
@@ -162,7 +162,7 @@ __wlan_hdd_cfg80211_set_mdns_offload(struct wiphy *wiphy,
 		return -ENOMEM;
 
 	mdns_info->enable = is_mdns_enable;
-	mdns_info->vdev_id = adapter->vdev_id;
+	mdns_info->vdev_id = adapter->deflink->vdev_id;
 
 	nla_for_each_nested(curr_attr, tb[MDNS_TABLE], rem) {
 		if (wlan_cfg80211_nla_parse(tb2,

+ 4 - 3
core/hdd/src/wlan_hdd_medium_assess.c

@@ -194,7 +194,7 @@ static int hdd_medium_assess_cca(struct hdd_context *hdd_ctx,
 		return -EINVAL;
 
 	status = policy_mgr_get_mac_id_by_session_id(hdd_ctx->psoc,
-						     adapter->vdev_id,
+						     adapter->deflink->vdev_id,
 						     &mac_id);
 	if (QDF_IS_STATUS_ERROR(status)) {
 		hdd_err_rl("Failed to get mac_id");
@@ -221,7 +221,8 @@ static int hdd_medium_assess_cca(struct hdd_context *hdd_ctx,
 		cca_period = DEFAULT_CCA_PERIOD;
 
 	ucfg_dcs_reset_user_stats(hdd_ctx->psoc, mac_id);
-	ucfg_dcs_register_user_cb(hdd_ctx->psoc, mac_id, adapter->vdev_id,
+	ucfg_dcs_register_user_cb(hdd_ctx->psoc, mac_id,
+				  adapter->deflink->vdev_id,
 				  hdd_cca_notification_cb);
 	/* dcs is already enabled and dcs event is reported every second
 	 * set the user request counter to collect user stats
@@ -435,7 +436,7 @@ static int hdd_medium_assess_congestion_report(struct hdd_context *hdd_ctx,
 	if (!vdev)
 		return -EINVAL;
 
-	vdev_id = adapter->vdev_id;
+	vdev_id = adapter->deflink->vdev_id;
 	status = policy_mgr_get_mac_id_by_session_id(hdd_ctx->psoc, vdev_id,
 						     &pdev_id);
 	if (QDF_IS_STATUS_ERROR(status)) {

+ 2 - 2
core/hdd/src/wlan_hdd_nan.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2012-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
@@ -98,7 +98,7 @@ static int __wlan_hdd_cfg80211_nan_ext_request(struct wiphy *wiphy,
 		return -EAGAIN;
 	}
 
-	return os_if_process_nan_req(hdd_ctx->pdev, adapter->vdev_id,
+	return os_if_process_nan_req(hdd_ctx->pdev, adapter->deflink->vdev_id,
 				     data, data_len);
 }
 

+ 21 - 18
core/hdd/src/wlan_hdd_nan_datapath.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-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
@@ -312,14 +312,14 @@ static int hdd_ndi_start_bss(struct hdd_adapter *adapter)
 		return -EINVAL;
 	}
 
-	dot11_cfg.vdev_id = adapter->vdev_id;
+	dot11_cfg.vdev_id = adapter->deflink->vdev_id;
 	dot11_cfg.bss_op_ch_freq = valid_freq;
 	dot11_cfg.phy_mode = eCSR_DOT11_MODE_AUTO;
-	if (!wlan_vdev_id_is_open_cipher(mac->pdev, adapter->vdev_id))
+	if (!wlan_vdev_id_is_open_cipher(mac->pdev, adapter->deflink->vdev_id))
 		dot11_cfg.privacy = 1;
 
 	sme_get_network_params(mac, &dot11_cfg);
-	ndi_bss_cfg.vdev_id = adapter->vdev_id;
+	ndi_bss_cfg.vdev_id = adapter->deflink->vdev_id;
 	ndi_bss_cfg.oper_ch_freq = dot11_cfg.bss_op_ch_freq;
 	ndi_bss_cfg.nwType = dot11_cfg.nw_type;
 	ndi_bss_cfg.dot11mode = dot11_cfg.dot11_mode;
@@ -340,12 +340,12 @@ static int hdd_ndi_start_bss(struct hdd_adapter *adapter)
 				dot11_cfg.ext_rates.numRates;
 	}
 
-	status = sme_start_bss(mac_handle, adapter->vdev_id,
+	status = sme_start_bss(mac_handle, adapter->deflink->vdev_id,
 			       &ndi_bss_cfg);
 
 	if (QDF_IS_STATUS_ERROR(status)) {
 		hdd_err("NDI sme_RoamConnect session %d failed with status %d -> NotConnected",
-			adapter->vdev_id, status);
+			adapter->deflink->vdev_id, status);
 		/* change back to NotConnected */
 		hdd_conn_set_connection_state(adapter,
 					      eConnectionState_NotConnected);
@@ -459,16 +459,18 @@ void hdd_ndp_event_handler(struct hdd_adapter *adapter,
 					NAN_DATAPATH_RSP_STATUS_SUCCESS);
 			hdd_debug("posting ndi create status: %d (%s) to umac",
 				  success, success ? "Success" : "Failure");
-			os_if_nan_post_ndi_create_rsp(psoc, adapter->vdev_id,
-							success);
+			os_if_nan_post_ndi_create_rsp(
+					psoc, adapter->deflink->vdev_id,
+					success);
 			return;
 		case eCSR_ROAM_RESULT_NDI_DELETE_RSP:
 			success = (roam_info->ndp.ndi_create_params.status ==
 					NAN_DATAPATH_RSP_STATUS_SUCCESS);
 			hdd_debug("posting ndi delete status: %d (%s) to umac",
 				  success, success ? "Success" : "Failure");
-			os_if_nan_post_ndi_delete_rsp(psoc, adapter->vdev_id,
-							success);
+			os_if_nan_post_ndi_delete_rsp(
+					psoc, adapter->deflink->vdev_id,
+					success);
 			return;
 		default:
 			hdd_err("in correct roam_result: %d", roam_result);
@@ -586,7 +588,7 @@ int hdd_init_nan_data_mode(struct hdd_adapter *adapter)
 		hdd_err("unable to get vht_enable2x2");
 
 	sme_set_pdev_ht_vht_ies(mac_handle, bval);
-	sme_set_vdev_ies_per_band(mac_handle, adapter->vdev_id,
+	sme_set_vdev_ies_per_band(mac_handle, adapter->deflink->vdev_id,
 				  adapter->device_mode);
 
 	hdd_roam_profile_init(adapter);
@@ -622,7 +624,7 @@ int hdd_init_nan_data_mode(struct hdd_adapter *adapter)
 	if (!QDF_IS_STATUS_SUCCESS(status))
 		hdd_err("Failed to get sifs burst value, use default");
 
-	ret_val = wma_cli_set_command((int)adapter->vdev_id,
+	ret_val = wma_cli_set_command((int)adapter->deflink->vdev_id,
 				      (int)wmi_pdev_param_burst_enable,
 				      enable_sifs_burst,
 				      PDEV_CMD);
@@ -634,7 +636,7 @@ int hdd_init_nan_data_mode(struct hdd_adapter *adapter)
 	if (QDF_IS_STATUS_ERROR(status))
 		hdd_err("FAILED TO GET RTSCTS Profile status:%d", status);
 
-	ret_val = sme_cli_set_command(adapter->vdev_id,
+	ret_val = sme_cli_set_command(adapter->deflink->vdev_id,
 				      wmi_vdev_param_enable_rtscts, rts_profile,
 				      VDEV_CMD);
 	if (ret_val)
@@ -1001,10 +1003,10 @@ void hdd_ndi_drv_ndi_create_rsp_handler(uint8_t vdev_id,
 				goto error;
 			}
 		}
-		status = sme_send_multi_pdev_vdev_set_params(MLME_VDEV_SETPARAM,
-							     adapter->vdev_id,
-							     setparam,
-							     index);
+		status = sme_send_multi_pdev_vdev_set_params(
+						    MLME_VDEV_SETPARAM,
+						    adapter->deflink->vdev_id,
+						    setparam, index);
 		if (QDF_IS_STATUS_ERROR(status))
 			hdd_err("failed to send vdev set params");
 	} else {
@@ -1255,7 +1257,8 @@ void hdd_ndp_peer_departed_handler(uint8_t vdev_id, uint16_t sta_id,
 
 	if (last_peer) {
 		hdd_debug("No more ndp peers.");
-		ucfg_nan_clear_peer_mc_list(hdd_ctx->psoc, adapter->vdev,
+		ucfg_nan_clear_peer_mc_list(hdd_ctx->psoc,
+					    adapter->deflink->vdev,
 					    peer_mac_addr);
 		hdd_cleanup_ndi(hdd_ctx, adapter);
 		qdf_event_set(&adapter->peer_cleanup_done);

+ 3 - 3
core/hdd/src/wlan_hdd_nud_tracking.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-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
@@ -44,7 +44,7 @@ hdd_handle_nud_fail_sta(struct hdd_context *hdd_ctx,
 	}
 
 	hdd_debug("nud fail detected, try roaming to better BSSID, vdev id: %d",
-		  adapter->vdev_id);
+		  adapter->deflink->vdev_id);
 
 	qdf_mem_zero(&ap_info, sizeof(struct reject_ap_info));
 	ap_info.bssid = sta_ctx->conn_info.bssid;
@@ -56,7 +56,7 @@ hdd_handle_nud_fail_sta(struct hdd_context *hdd_ctx,
 	if (roaming_offload_enabled(hdd_ctx)) {
 		qdf_zero_macaddr(&bssid);
 		ucfg_wlan_cm_roam_invoke(hdd_ctx->pdev,
-					 adapter->vdev_id,
+					 adapter->deflink->vdev_id,
 					 &bssid, 0, CM_ROAMING_NUD_FAILURE);
 	}
 }

+ 6 - 6
core/hdd/src/wlan_hdd_object_manager.c

@@ -284,15 +284,15 @@ __hdd_objmgr_get_vdev_by_user(struct hdd_adapter *adapter,
 		return NULL;
 	}
 
-	qdf_spin_lock_bh(&adapter->vdev_lock);
-	vdev = adapter->vdev;
+	qdf_spin_lock_bh(&adapter->deflink->vdev_lock);
+	vdev = adapter->deflink->vdev;
 	if (vdev) {
 		status = wlan_objmgr_vdev_try_get_ref_debug(vdev, id, func,
 							    line);
 		if (QDF_IS_STATUS_ERROR(status))
 			vdev = NULL;
 	}
-	qdf_spin_unlock_bh(&adapter->vdev_lock);
+	qdf_spin_unlock_bh(&adapter->deflink->vdev_lock);
 
 	if (!vdev)
 		hdd_debug("VDEV is NULL (via %s, id %d)", func, id);
@@ -313,14 +313,14 @@ __hdd_objmgr_get_vdev_by_user(struct hdd_adapter *adapter,
 		return NULL;
 	}
 
-	qdf_spin_lock_bh(&adapter->vdev_lock);
-	vdev = adapter->vdev;
+	qdf_spin_lock_bh(&adapter->deflink->vdev_lock);
+	vdev = adapter->deflink->vdev;
 	if (vdev) {
 		status = wlan_objmgr_vdev_try_get_ref(vdev, id);
 		if (QDF_IS_STATUS_ERROR(status))
 			vdev = NULL;
 	}
-	qdf_spin_unlock_bh(&adapter->vdev_lock);
+	qdf_spin_unlock_bh(&adapter->deflink->vdev_lock);
 
 	if (!vdev)
 		hdd_debug("VDEV is NULL (via %s, id %d)", func, id);

+ 17 - 17
core/hdd/src/wlan_hdd_ocb.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2011-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-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
@@ -489,7 +489,7 @@ static int __iw_set_dot11p_channel_sched(struct net_device *dev,
 	}
 
 	/* Identify the vdev interface */
-	config->vdev_id = adapter->vdev_id;
+	config->vdev_id = adapter->deflink->vdev_id;
 
 	/* Release all the mac addresses used for OCB */
 	for (i = 0; i < adapter->ocb_mac_addr_count; i++) {
@@ -864,7 +864,7 @@ static int __wlan_hdd_cfg80211_ocb_set_config(struct wiphy *wiphy,
 	    config->channels, nla_data(channel_array), channel_count);
 
 	/* Identify the vdev interface */
-	config->vdev_id = adapter->vdev_id;
+	config->vdev_id = adapter->deflink->vdev_id;
 
 	/* Release all the mac addresses used for OCB */
 	for (i = 0; i < adapter->ocb_mac_addr_count; i++) {
@@ -1003,7 +1003,7 @@ static int __wlan_hdd_cfg80211_ocb_set_utc_time(struct wiphy *wiphy,
 		return -EINVAL;
 	}
 
-	if (!wma_is_vdev_up(adapter->vdev_id)) {
+	if (!wma_is_vdev_up(adapter->deflink->vdev_id)) {
 		hdd_err("The device has not been started");
 		return -EINVAL;
 	}
@@ -1043,7 +1043,7 @@ static int __wlan_hdd_cfg80211_ocb_set_utc_time(struct wiphy *wiphy,
 	if (!utc)
 		return -ENOMEM;
 
-	utc->vdev_id = adapter->vdev_id;
+	utc->vdev_id = adapter->deflink->vdev_id;
 	qdf_mem_copy(utc->utc_time, nla_data(utc_attr), SIZE_UTC_TIME);
 	qdf_mem_copy(utc->time_error, nla_data(time_error_attr),
 		SIZE_UTC_TIME_ERROR);
@@ -1134,7 +1134,7 @@ __wlan_hdd_cfg80211_ocb_start_timing_advert(struct wiphy *wiphy,
 		return -EINVAL;
 	}
 
-	if (!wma_is_vdev_up(adapter->vdev_id)) {
+	if (!wma_is_vdev_up(adapter->deflink->vdev_id)) {
 		hdd_err("The device has not been started");
 		return -EINVAL;
 	}
@@ -1143,7 +1143,7 @@ __wlan_hdd_cfg80211_ocb_start_timing_advert(struct wiphy *wiphy,
 	if (!timing_advert)
 		return -ENOMEM;
 
-	timing_advert->vdev_id = adapter->vdev_id;
+	timing_advert->vdev_id = adapter->deflink->vdev_id;
 
 	/* Parse the netlink message */
 	if (wlan_cfg80211_nla_parse(tb,
@@ -1268,7 +1268,7 @@ __wlan_hdd_cfg80211_ocb_stop_timing_advert(struct wiphy *wiphy,
 		return -EINVAL;
 	}
 
-	if (!wma_is_vdev_up(adapter->vdev_id)) {
+	if (!wma_is_vdev_up(adapter->deflink->vdev_id)) {
 		hdd_err("The device has not been started");
 		return -EINVAL;
 	}
@@ -1277,7 +1277,7 @@ __wlan_hdd_cfg80211_ocb_stop_timing_advert(struct wiphy *wiphy,
 	if (!timing_advert)
 		return -ENOMEM;
 
-	timing_advert->vdev_id = adapter->vdev_id;
+	timing_advert->vdev_id = adapter->deflink->vdev_id;
 
 	/* Parse the netlink message */
 	if (wlan_cfg80211_nla_parse(tb,
@@ -1465,7 +1465,7 @@ __wlan_hdd_cfg80211_ocb_get_tsf_timer(struct wiphy *wiphy,
 		return -EINVAL;
 	}
 
-	if (!wma_is_vdev_up(adapter->vdev_id)) {
+	if (!wma_is_vdev_up(adapter->deflink->vdev_id)) {
 		hdd_err("The device has not been started");
 		return -EINVAL;
 	}
@@ -1483,7 +1483,7 @@ __wlan_hdd_cfg80211_ocb_get_tsf_timer(struct wiphy *wiphy,
 		goto end;
 	}
 
-	tsf_request.vdev_id = adapter->vdev_id;
+	tsf_request.vdev_id = adapter->deflink->vdev_id;
 	status = ucfg_ocb_get_tsf_timer(vdev, &tsf_request,
 					hdd_ocb_get_tsf_timer_callback,
 					cookie);
@@ -1703,7 +1703,7 @@ static int __wlan_hdd_cfg80211_dcc_get_stats(struct wiphy *wiphy,
 		return -EINVAL;
 	}
 
-	if (!wma_is_vdev_up(adapter->vdev_id)) {
+	if (!wma_is_vdev_up(adapter->deflink->vdev_id)) {
 		hdd_err("The device has not been started");
 		return -EINVAL;
 	}
@@ -1743,7 +1743,7 @@ static int __wlan_hdd_cfg80211_dcc_get_stats(struct wiphy *wiphy,
 	}
 	cookie = osif_request_cookie(request);
 
-	dcc_request.vdev_id = adapter->vdev_id;
+	dcc_request.vdev_id = adapter->deflink->vdev_id;
 	dcc_request.channel_count = channel_count;
 	dcc_request.request_array_len = request_array_len;
 	dcc_request.request_array = request_array;
@@ -1854,7 +1854,7 @@ static int __wlan_hdd_cfg80211_dcc_clear_stats(struct wiphy *wiphy,
 		return -EINVAL;
 	}
 
-	if (!wma_is_vdev_up(adapter->vdev_id)) {
+	if (!wma_is_vdev_up(adapter->deflink->vdev_id)) {
 		hdd_err("The device has not been started");
 		return -EINVAL;
 	}
@@ -1879,7 +1879,7 @@ static int __wlan_hdd_cfg80211_dcc_clear_stats(struct wiphy *wiphy,
 		return -EINVAL;
 
 	if (ucfg_ocb_dcc_clear_stats(
-		vdev, adapter->vdev_id,
+		vdev, adapter->deflink->vdev_id,
 		nla_get_u32(
 			tb[QCA_WLAN_VENDOR_ATTR_DCC_CLEAR_STATS_BITMAP])) !=
 			QDF_STATUS_SUCCESS) {
@@ -2003,7 +2003,7 @@ static int __wlan_hdd_cfg80211_dcc_update_ndl(struct wiphy *wiphy,
 		return -EINVAL;
 	}
 
-	if (!wma_is_vdev_up(adapter->vdev_id)) {
+	if (!wma_is_vdev_up(adapter->deflink->vdev_id)) {
 		hdd_err("The device has not been started");
 		return -EINVAL;
 	}
@@ -2049,7 +2049,7 @@ static int __wlan_hdd_cfg80211_dcc_update_ndl(struct wiphy *wiphy,
 	cookie = osif_request_cookie(request);
 
 	/* Copy the parameters to the request structure. */
-	dcc_request.vdev_id = adapter->vdev_id;
+	dcc_request.vdev_id = adapter->deflink->vdev_id;
 	dcc_request.channel_count = channel_count;
 	dcc_request.dcc_ndl_chan_list_len = ndl_channel_array_len;
 	dcc_request.dcc_ndl_chan_list = ndl_channel_array;

+ 14 - 13
core/hdd/src/wlan_hdd_oemdata.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2012-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
@@ -104,11 +104,11 @@ static int populate_oem_data_cap(struct hdd_adapter *adapter,
 	data_cap->allowed_dwell_time_min = neighbor_scan_min_chan_time;
 	data_cap->allowed_dwell_time_max = neighbor_scan_max_chan_time;
 	data_cap->curr_dwell_time_min =
-		ucfg_cm_get_neighbor_scan_min_chan_time(hdd_ctx->psoc,
-							adapter->vdev_id);
+		ucfg_cm_get_neighbor_scan_min_chan_time(
+				hdd_ctx->psoc, adapter->deflink->vdev_id);
 	data_cap->curr_dwell_time_max =
-		ucfg_cm_get_neighbor_scan_max_chan_time(hdd_ctx->psoc,
-							adapter->vdev_id);
+		ucfg_cm_get_neighbor_scan_max_chan_time(
+				hdd_ctx->psoc, adapter->deflink->vdev_id);
 	data_cap->supported_bands = band_capability;
 
 	/* request for max num of channels */
@@ -230,7 +230,7 @@ static void send_oem_reg_rsp_nlink_msg(void)
 		device_mode = buf++;
 		vdev_id = buf++;
 		*device_mode = adapter->device_mode;
-		*vdev_id = adapter->vdev_id;
+		*vdev_id = adapter->deflink->vdev_id;
 		(*num_interfaces)++;
 		hdd_debug("num_interfaces: %d, device_mode: %d, vdev_id: %d",
 			  *num_interfaces, *device_mode,
@@ -1259,7 +1259,7 @@ void hdd_oem_event_handler_cb(const struct oem_data *oem_event_data,
 
 		qdf_mem_copy(oem_data->data, oem_event_data->data,
 			     oem_data->data_len);
-		oem_data->vdev_id = hdd_adapter->vdev_id;
+		oem_data->vdev_id = hdd_adapter->deflink->vdev_id;
 		osif_request_complete(request);
 		osif_request_put(request);
 	} else {
@@ -1377,9 +1377,10 @@ __wlan_hdd_cfg80211_oem_data_handler(struct wiphy *wiphy,
 			nla_get_u8(tb[QCA_WLAN_VENDOR_ATTR_OEM_DEVICE_INFO]);
 
 	if (oem_data.pdev_vdev_flag) {
-		status = policy_mgr_get_mac_id_by_session_id(hdd_ctx->psoc,
-							     adapter->vdev_id,
-							     &mac_id);
+		status = policy_mgr_get_mac_id_by_session_id(
+						    hdd_ctx->psoc,
+						    adapter->deflink->vdev_id,
+						    &mac_id);
 		if (QDF_IS_STATUS_ERROR(status)) {
 			hdd_err("get mac id failed");
 			return -EINVAL;
@@ -1393,7 +1394,7 @@ __wlan_hdd_cfg80211_oem_data_handler(struct wiphy *wiphy,
 		hdd_err("oem data len is 0!");
 		return -EINVAL;
 	}
-	oem_data.vdev_id = adapter->vdev_id;
+	oem_data.vdev_id = adapter->deflink->vdev_id;
 	oem_data.data = nla_data(tb[QCA_WLAN_VENDOR_ATTR_OEM_DATA_CMD_DATA]);
 
 	if (tb[QCA_WLAN_VENDOR_ATTR_OEM_DATA_RESPONSE_EXPECTED])
@@ -1416,7 +1417,7 @@ __wlan_hdd_cfg80211_oem_data_handler(struct wiphy *wiphy,
 
 		status = sme_oem_data_cmd(hdd_ctx->mac_handle,
 					  hdd_oem_event_handler_cb,
-					  &oem_data, adapter->vdev_id);
+					  &oem_data, adapter->deflink->vdev_id);
 		if (QDF_IS_STATUS_ERROR(status)) {
 			hdd_err("Failure while sending command to fw");
 			ret = -EAGAIN;
@@ -1456,7 +1457,7 @@ __wlan_hdd_cfg80211_oem_data_handler(struct wiphy *wiphy,
 	} else {
 		status = sme_oem_data_cmd(hdd_ctx->mac_handle,
 					  hdd_oem_event_handler_cb,
-					  &oem_data, adapter->vdev_id);
+					  &oem_data, adapter->deflink->vdev_id);
 		return qdf_status_to_os_return(status);
 	}
 

+ 7 - 6
core/hdd/src/wlan_hdd_ota_test.c

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2012-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
@@ -92,16 +93,16 @@ static int __wlan_hdd_cfg80211_set_ota_test(struct wiphy *wiphy,
 	}
 
 	mac_handle = hdd_ctx->mac_handle;
-	current_roam_state =
-		sme_get_current_roam_state(mac_handle, adapter->vdev_id);
-	status = sme_stop_roaming(mac_handle, adapter->vdev_id,
+	current_roam_state = sme_get_current_roam_state(
+					mac_handle, adapter->deflink->vdev_id);
+	status = sme_stop_roaming(mac_handle, adapter->deflink->vdev_id,
 				  REASON_SME_ISSUED, RSO_INVALID_REQUESTOR);
 	if (status != QDF_STATUS_SUCCESS) {
 		hdd_err("Enable/Disable roaming failed");
 		return -EINVAL;
 	}
 
-	status = sme_ps_enable_disable(mac_handle, adapter->vdev_id,
+	status = sme_ps_enable_disable(mac_handle, adapter->deflink->vdev_id,
 				       SME_PS_DISABLE);
 	if (status != QDF_STATUS_SUCCESS) {
 		hdd_err("Enable/Disable power save failed");
@@ -109,13 +110,13 @@ static int __wlan_hdd_cfg80211_set_ota_test(struct wiphy *wiphy,
 		if (current_roam_state == eCSR_ROAMING_STATE_JOINING ||
 		    current_roam_state == eCSR_ROAMING_STATE_JOINED)
 			status = sme_start_roaming(mac_handle,
-						 adapter->vdev_id,
+						 adapter->deflink->vdev_id,
 						 REASON_SME_ISSUED,
 						 RSO_INVALID_REQUESTOR);
 		else if (current_roam_state == eCSR_ROAMING_STATE_STOP ||
 			 current_roam_state == eCSR_ROAMING_STATE_IDLE)
 			status = sme_stop_roaming(mac_handle,
-						 adapter->vdev_id,
+						 adapter->deflink->vdev_id,
 						 REASON_SME_ISSUED,
 						 RSO_INVALID_REQUESTOR);
 

+ 18 - 15
core/hdd/src/wlan_hdd_p2p.c

@@ -149,7 +149,7 @@ static int __wlan_hdd_cfg80211_remain_on_channel(struct wiphy *wiphy,
 	if (policy_mgr_is_sta_mon_concurrency(hdd_ctx->psoc))
 		return -EINVAL;
 
-	if (wlan_hdd_validate_vdev_id(adapter->vdev_id))
+	if (wlan_hdd_validate_vdev_id(adapter->deflink->vdev_id))
 		return -EINVAL;
 
 	vdev = hdd_objmgr_get_vdev_by_user(adapter, WLAN_OSIF_P2P_ID);
@@ -206,7 +206,7 @@ __wlan_hdd_cfg80211_cancel_remain_on_channel(struct wiphy *wiphy,
 		return -EINVAL;
 	}
 
-	if (wlan_hdd_validate_vdev_id(adapter->vdev_id))
+	if (wlan_hdd_validate_vdev_id(adapter->deflink->vdev_id))
 		return -EINVAL;
 
 	vdev = hdd_objmgr_get_vdev_by_user(adapter, WLAN_OSIF_P2P_ID);
@@ -268,7 +268,7 @@ static int __wlan_hdd_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
 		return -EINVAL;
 	}
 
-	if (wlan_hdd_validate_vdev_id(adapter->vdev_id))
+	if (wlan_hdd_validate_vdev_id(adapter->deflink->vdev_id))
 		return -EINVAL;
 
 	ret = wlan_hdd_validate_context(hdd_ctx);
@@ -308,10 +308,12 @@ static int __wlan_hdd_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
 		}
 
 		qdf_mtrace(QDF_MODULE_ID_HDD, QDF_MODULE_ID_SME,
-			   TRACE_CODE_HDD_SEND_MGMT_TX, adapter->vdev_id, 0);
+			   TRACE_CODE_HDD_SEND_MGMT_TX,
+			   adapter->deflink->vdev_id, 0);
 
 		qdf_status = sme_send_mgmt_tx(hdd_ctx->mac_handle,
-					      adapter->vdev_id, buf, len);
+					      adapter->deflink->vdev_id,
+					      buf, len);
 
 		if (QDF_IS_STATUS_SUCCESS(qdf_status))
 			return qdf_status_to_os_return(qdf_status);
@@ -423,7 +425,7 @@ static int __wlan_hdd_cfg80211_mgmt_tx_cancel_wait(struct wiphy *wiphy,
 		return -EINVAL;
 	}
 
-	if (wlan_hdd_validate_vdev_id(adapter->vdev_id))
+	if (wlan_hdd_validate_vdev_id(adapter->deflink->vdev_id))
 		return -EINVAL;
 
 	vdev = hdd_objmgr_get_vdev_by_user(adapter, WLAN_OSIF_P2P_ID);
@@ -523,7 +525,7 @@ int hdd_set_p2p_noa(struct net_device *dev, uint8_t *command)
 	}
 	noa.interval = interval;
 	noa.count = count;
-	noa.vdev_id = adapter->vdev_id;
+	noa.vdev_id = adapter->deflink->vdev_id;
 
 	hdd_debug("P2P_PS_ATTR:opp ps %d ct window %d duration %d "
 		  "interval %d count %d single noa duration %d "
@@ -627,7 +629,7 @@ int hdd_set_p2p_opps(struct net_device *dev, uint8_t *command)
 		noa.interval = 0;
 		noa.count = 0;
 		noa.ps_selection = P2P_POWER_SAVE_TYPE_OPPORTUNISTIC;
-		noa.vdev_id = adapter->vdev_id;
+		noa.vdev_id = adapter->deflink->vdev_id;
 
 		hdd_debug("P2P_PS_ATTR: opp ps %d ct window %d duration %d interval %d count %d single noa duration %d ps selection %x",
 			noa.opp_ps, noa.ct_window,
@@ -654,7 +656,7 @@ int hdd_set_p2p_ps(struct net_device *dev, void *msgData)
 	noa.count = pappnoa->count;
 	noa.single_noa_duration = pappnoa->single_noa_duration;
 	noa.ps_selection = pappnoa->ps_selection;
-	noa.vdev_id = adapter->vdev_id;
+	noa.vdev_id = adapter->deflink->vdev_id;
 
 	return wlan_hdd_set_power_save(adapter, &noa);
 }
@@ -732,13 +734,13 @@ struct wireless_dev *__wlan_hdd_add_virtual_intf(struct wiphy *wiphy,
 	create_params.is_add_virtual_iface = 1;
 
 	adapter = hdd_get_adapter(hdd_ctx, QDF_STA_MODE);
-	if (adapter && !wlan_hdd_validate_vdev_id(adapter->vdev_id)) {
+	if (adapter && !wlan_hdd_validate_vdev_id(adapter->deflink->vdev_id)) {
 		vdev = hdd_objmgr_get_vdev_by_user(adapter, WLAN_OSIF_P2P_ID);
 		if (vdev) {
 			if (ucfg_scan_get_vdev_status(vdev) !=
 							SCAN_NOT_IN_PROGRESS) {
 				wlan_abort_scan(hdd_ctx->pdev, INVAL_PDEV_ID,
-						adapter->vdev_id,
+						adapter->deflink->vdev_id,
 						INVALID_SCAN_ID, false);
 			}
 			hdd_objmgr_put_vdev_by_user(vdev, WLAN_OSIF_P2P_ID);
@@ -931,7 +933,7 @@ int __wlan_hdd_del_virtual_intf(struct wiphy *wiphy, struct wireless_dev *wdev)
 
 	qdf_mtrace(QDF_MODULE_ID_HDD, QDF_MODULE_ID_HDD,
 		   TRACE_CODE_HDD_DEL_VIRTUAL_INTF,
-		   adapter->vdev_id, adapter->device_mode);
+		   adapter->deflink->vdev_id, adapter->device_mode);
 
 	hdd_debug("Device_mode %s(%d)",
 		  qdf_opmode_str(adapter->device_mode), adapter->device_mode);
@@ -1156,7 +1158,7 @@ __hdd_indicate_mgmt_frame_to_user(struct hdd_adapter *adapter,
 	if (hdd_is_qos_action_frame(pb_frames, frm_len))
 		sme_update_dsc_pto_up_mapping(hdd_ctx->mac_handle,
 					      adapter->dscp_to_up_map,
-					      adapter->vdev_id);
+					      adapter->deflink->vdev_id);
 
 	assoc_adapter = adapter;
 	ucfg_psoc_mlme_get_11be_capab(hdd_ctx->psoc, &eht_capab);
@@ -1171,7 +1173,8 @@ __hdd_indicate_mgmt_frame_to_user(struct hdd_adapter *adapter,
 
 	/* Indicate Frame Over Normal Interface */
 	hdd_debug("Indicate Frame over NL80211 sessionid : %d, idx :%d",
-		   assoc_adapter->vdev_id, assoc_adapter->dev->ifindex);
+		   assoc_adapter->deflink->vdev_id,
+		   assoc_adapter->dev->ifindex);
 
 	wlan_hdd_cfg80211_convert_rxmgmt_flags(rx_flags, &nl80211_flag);
 
@@ -1476,7 +1479,7 @@ int wlan_hdd_set_mcc_p2p_quota(struct hdd_adapter *adapter,
 			hdd_ctx, set_value, adapter->device_mode);
 
 		set_value = set_second_connection_operating_channel(
-			hdd_ctx, set_value, adapter->vdev_id);
+			hdd_ctx, set_value, adapter->deflink->vdev_id);
 
 		ret = wlan_hdd_send_mcc_vdev_quota(adapter, set_value);
 	} else {

+ 3 - 2
core/hdd/src/wlan_hdd_p2p_listen_offload.c

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2012-2020 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
@@ -176,7 +177,7 @@ static int __wlan_hdd_cfg80211_p2p_lo_start(struct wiphy *wiphy,
 		return -EINVAL;
 	}
 
-	params.vdev_id = adapter->vdev_id;
+	params.vdev_id = adapter->deflink->vdev_id;
 	params.freq = nla_get_u32(tb
 		[QCA_WLAN_VENDOR_ATTR_P2P_LISTEN_OFFLOAD_CHANNEL]);
 	if ((params.freq != 2412) && (params.freq != 2437) &&
@@ -286,7 +287,7 @@ static int wlan_hdd_listen_offload_stop(struct hdd_adapter *adapter)
 		return -EINVAL;
 	}
 
-	vdev_id = (uint32_t)adapter->vdev_id;
+	vdev_id = (uint32_t)adapter->deflink->vdev_id;
 	hdd_ctx = WLAN_HDD_GET_CTX(adapter);
 	psoc = hdd_ctx->psoc;
 	if (!psoc) {

+ 3 - 2
core/hdd/src/wlan_hdd_packet_filter.c

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2017-2020 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
@@ -51,7 +52,7 @@ int hdd_enable_default_pkt_filters(struct hdd_adapter *adapter)
 			packet_filter_default_rules[i].filter_id = filter_id;
 			wlan_hdd_set_filter(hdd_ctx,
 					    &packet_filter_default_rules[i],
-					    adapter->vdev_id);
+					    adapter->deflink->vdev_id);
 			filter_id++;
 		}
 		filters = filters >> 1;
@@ -90,7 +91,7 @@ int hdd_disable_default_pkt_filters(struct hdd_adapter *adapter)
 			packet_filter_default_rules.filter_id = filter_id;
 			wlan_hdd_set_filter(hdd_ctx,
 					    &packet_filter_default_rules,
-					    adapter->vdev_id);
+					    adapter->deflink->vdev_id);
 			filter_id++;
 		}
 		filters = filters >> 1;

+ 2 - 2
core/hdd/src/wlan_hdd_peer_txq_flush.c

@@ -1,5 +1,5 @@
 /*
- * 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 above
@@ -108,7 +108,7 @@ static int hdd_peer_txq_flush_config(struct hdd_adapter *adapter,
 		return -EINVAL;
 	}
 
-	return cdp_set_peer_txq_flush_config(dp_soc, adapter->vdev_id,
+	return cdp_set_peer_txq_flush_config(dp_soc, adapter->deflink->vdev_id,
 					     addr, ac, tid, cdp_policy);
 }
 

+ 56 - 47
core/hdd/src/wlan_hdd_power.c

@@ -407,7 +407,8 @@ static void __wlan_hdd_ipv6_changed(struct net_device *net_dev,
 	    (adapter->device_mode == QDF_STA_MODE ||
 	     adapter->device_mode == QDF_P2P_CLIENT_MODE)) {
 		hdd_debug("invoking sme_dhcp_done_ind");
-		sme_dhcp_done_ind(hdd_ctx->mac_handle, adapter->vdev_id);
+		sme_dhcp_done_ind(hdd_ctx->mac_handle,
+				  adapter->deflink->vdev_id);
 		schedule_work(&adapter->ipv6_notifier_work);
 	}
 
@@ -564,7 +565,7 @@ void hdd_enable_ns_offload(struct hdd_adapter *adapter,
 		goto out;
 
 	ns_req->psoc = psoc;
-	ns_req->vdev_id = adapter->vdev_id;
+	ns_req->vdev_id = adapter->deflink->vdev_id;
 	ns_req->trigger = trigger;
 	ns_req->count = 0;
 
@@ -575,7 +576,8 @@ void hdd_enable_ns_offload(struct hdd_adapter *adapter,
 	}
 
 	/* check if offload cache and send is required or not */
-	status = ucfg_pmo_ns_offload_check(psoc, trigger, adapter->vdev_id);
+	status = ucfg_pmo_ns_offload_check(psoc, trigger,
+					   adapter->deflink->vdev_id);
 	if (QDF_IS_STATUS_ERROR(status)) {
 		hdd_debug("NS offload is not required");
 		goto put_vdev;
@@ -642,7 +644,7 @@ void hdd_disable_ns_offload(struct hdd_adapter *adapter,
 	hdd_enter();
 
 	status = ucfg_pmo_ns_offload_check(hdd_ctx->psoc, trigger,
-					   adapter->vdev_id);
+					   adapter->deflink->vdev_id);
 	if (status != QDF_STATUS_SUCCESS) {
 		hdd_debug("Flushing of NS offload not required");
 		goto out;
@@ -686,7 +688,8 @@ static void hdd_send_mlo_ps_to_fw(struct hdd_adapter *adapter,
 		link_adapter = mlo_adapter_info->link_adapter[i];
 		if (!link_adapter)
 			continue;
-		sme_ps_update(hdd_ctx->mac_handle, link_adapter->vdev_id);
+		sme_ps_update(hdd_ctx->mac_handle,
+			      link_adapter->deflink->vdev_id);
 	}
 }
 #else
@@ -714,10 +717,10 @@ static void hdd_send_ps_config_to_fw(struct hdd_adapter *adapter)
 
 	hdd_ctx = WLAN_HDD_GET_CTX(adapter);
 
-	is_mlo_vdev = wlan_vdev_mlme_is_mlo_vdev(adapter->vdev);
+	is_mlo_vdev = wlan_vdev_mlme_is_mlo_vdev(adapter->deflink->vdev);
 
 	if (!is_mlo_vdev) {
-		sme_ps_update(hdd_ctx->mac_handle, adapter->vdev_id);
+		sme_ps_update(hdd_ctx->mac_handle, adapter->deflink->vdev_id);
 		return;
 	}
 
@@ -1052,7 +1055,7 @@ int hdd_set_grat_arp_keepalive(struct hdd_adapter *adapter)
 
 	qdf_copy_macaddr(&req.bssid, &sta_ctx->conn_info.bssid);
 	ucfg_mlme_get_sta_keep_alive_period(hdd_ctx->psoc, &req.timePeriod);
-	req.sessionId = adapter->vdev_id;
+	req.sessionId = adapter->deflink->vdev_id;
 
 	hdd_debug("Setting gratuitous ARP keepalive; ipv4_addr:%u.%u.%u.%u",
 		 req.hostIpv4Addr[0], req.hostIpv4Addr[1],
@@ -1113,7 +1116,8 @@ static void __hdd_ipv4_notifier_work_queue(struct hdd_adapter *adapter)
 
 	ifa = hdd_lookup_ifaddr(adapter);
 	if (ifa && hdd_ctx->is_fils_roaming_supported)
-		sme_send_hlp_ie_info(hdd_ctx->mac_handle, adapter->vdev_id,
+		sme_send_hlp_ie_info(hdd_ctx->mac_handle,
+				     adapter->deflink->vdev_id,
 				     ifa->ifa_local);
 	hdd_send_ps_config_to_fw(adapter);
 exit:
@@ -1165,7 +1169,8 @@ static void __wlan_hdd_ipv4_changed(struct net_device *net_dev)
 	if (adapter->device_mode == QDF_STA_MODE ||
 	    adapter->device_mode == QDF_P2P_CLIENT_MODE) {
 		hdd_debug("invoking sme_dhcp_done_ind");
-		sme_dhcp_done_ind(hdd_ctx->mac_handle, adapter->vdev_id);
+		sme_dhcp_done_ind(hdd_ctx->mac_handle,
+				  adapter->deflink->vdev_id);
 
 		if (!ucfg_pmo_is_arp_offload_enabled(hdd_ctx->psoc)) {
 			hdd_debug("Offload not enabled");
@@ -1334,10 +1339,11 @@ void hdd_enable_arp_offload(struct hdd_adapter *adapter,
 	}
 
 	arp_req->psoc = psoc;
-	arp_req->vdev_id = adapter->vdev_id;
+	arp_req->vdev_id = adapter->deflink->vdev_id;
 	arp_req->trigger = trigger;
 
-	status = ucfg_pmo_check_arp_offload(psoc, trigger, adapter->vdev_id);
+	status = ucfg_pmo_check_arp_offload(psoc, trigger,
+					    adapter->deflink->vdev_id);
 	if (QDF_IS_STATUS_ERROR(status)) {
 		hdd_debug("ARP offload not required");
 		goto put_vdev;
@@ -1495,11 +1501,11 @@ void hdd_enable_icmp_offload(struct hdd_adapter *adapter,
 		goto free_req;
 	}
 
-	status = ucfg_pmo_check_icmp_offload(psoc, adapter->vdev_id);
+	status = ucfg_pmo_check_icmp_offload(psoc, adapter->deflink->vdev_id);
 	if (QDF_IS_STATUS_ERROR(status))
 		goto put_vdev;
 
-	pmo_icmp_req->vdev_id = adapter->vdev_id;
+	pmo_icmp_req->vdev_id = adapter->deflink->vdev_id;
 	pmo_icmp_req->enable = is_icmp_enable;
 	pmo_icmp_req->trigger = trigger;
 
@@ -1544,7 +1550,7 @@ void hdd_disable_arp_offload(struct hdd_adapter *adapter,
 	hdd_enter();
 
 	status = ucfg_pmo_check_arp_offload(hdd_ctx->psoc, trigger,
-					    adapter->vdev_id);
+					    adapter->deflink->vdev_id);
 	if (status != QDF_STATUS_SUCCESS) {
 		hdd_debug("Flushing of ARP offload not required");
 		return;
@@ -1584,9 +1590,10 @@ void hdd_enable_mc_addr_filtering(struct hdd_adapter *adapter,
 	if (!hdd_cm_is_vdev_associated(adapter))
 		return;
 
-	status = ucfg_pmo_enable_mc_addr_filtering_in_fwr(hdd_ctx->psoc,
-							  adapter->vdev_id,
-							  trigger);
+	status = ucfg_pmo_enable_mc_addr_filtering_in_fwr(
+						hdd_ctx->psoc,
+						adapter->deflink->vdev_id,
+						trigger);
 	if (QDF_IS_STATUS_ERROR(status))
 		hdd_debug("failed to enable mc list; status:%d", status);
 
@@ -1604,9 +1611,10 @@ void hdd_disable_mc_addr_filtering(struct hdd_adapter *adapter,
 	if (!hdd_cm_is_vdev_associated(adapter))
 		return;
 
-	status = ucfg_pmo_disable_mc_addr_filtering_in_fwr(hdd_ctx->psoc,
-							   adapter->vdev_id,
-							   trigger);
+	status = ucfg_pmo_disable_mc_addr_filtering_in_fwr(
+						hdd_ctx->psoc,
+						adapter->deflink->vdev_id,
+						trigger);
 	if (QDF_IS_STATUS_ERROR(status))
 		hdd_err("failed to disable mc list; status:%d", status);
 }
@@ -1630,15 +1638,16 @@ void hdd_disable_and_flush_mc_addr_list(struct hdd_adapter *adapter,
 		goto flush_mc_list;
 
 	/* disable mc list first because the mc list is cached in PMO */
-	status = ucfg_pmo_disable_mc_addr_filtering_in_fwr(hdd_ctx->psoc,
-							   adapter->vdev_id,
-							   trigger);
+	status = ucfg_pmo_disable_mc_addr_filtering_in_fwr(
+						hdd_ctx->psoc,
+						adapter->deflink->vdev_id,
+						trigger);
 	if (QDF_IS_STATUS_ERROR(status))
 		hdd_debug("failed to disable mc list; status:%d", status);
 
 flush_mc_list:
 	status = ucfg_pmo_flush_mc_addr_list(hdd_ctx->psoc,
-					     adapter->vdev_id);
+					     adapter->deflink->vdev_id);
 	if (QDF_IS_STATUS_ERROR(status))
 		hdd_debug("failed to flush mc list; status:%d", status);
 
@@ -1655,7 +1664,7 @@ static void hdd_update_conn_state_mask(struct hdd_adapter *adapter,
 				       uint32_t *conn_state_mask)
 {
 	if (hdd_cm_is_vdev_associated(adapter))
-		*conn_state_mask |= (1 << adapter->vdev_id);
+		*conn_state_mask |= (1 << adapter->deflink->vdev_id);
 }
 
 /**
@@ -1685,7 +1694,7 @@ hdd_suspend_wlan(void)
 
 	hdd_for_each_adapter_dev_held_safe(hdd_ctx, adapter, next_adapter,
 					   NET_DEV_HOLD_SUSPEND_WLAN) {
-		if (wlan_hdd_validate_vdev_id(adapter->vdev_id)) {
+		if (wlan_hdd_validate_vdev_id(adapter->deflink->vdev_id)) {
 			hdd_adapter_dev_put_debug(adapter,
 						  NET_DEV_HOLD_SUSPEND_WLAN);
 			continue;
@@ -1745,7 +1754,7 @@ static int hdd_resume_wlan(void)
 	/*loop through all adapters. Concurrency */
 	hdd_for_each_adapter_dev_held_safe(hdd_ctx, adapter, next_adapter,
 					   NET_DEV_HOLD_RESUME_WLAN) {
-		if (wlan_hdd_validate_vdev_id(adapter->vdev_id)) {
+		if (wlan_hdd_validate_vdev_id(adapter->deflink->vdev_id)) {
 			hdd_adapter_dev_put_debug(adapter,
 						  NET_DEV_HOLD_RESUME_WLAN);
 			continue;
@@ -1793,7 +1802,7 @@ static int hdd_pause_ns(struct hdd_context *hdd_ctx)
 
 	hdd_for_each_adapter_dev_held_safe(hdd_ctx, adapter, next_adapter,
 					   NET_DEV_HOLD_SUSPEND_WLAN) {
-		if (wlan_hdd_validate_vdev_id(adapter->vdev_id)) {
+		if (wlan_hdd_validate_vdev_id(adapter->deflink->vdev_id)) {
 			hdd_adapter_dev_put_debug(adapter,
 						  NET_DEV_HOLD_SUSPEND_WLAN);
 			continue;
@@ -1833,7 +1842,7 @@ static int hdd_unpause_ns(struct hdd_context *hdd_ctx)
 	/*loop through all adapters. Concurrency */
 	hdd_for_each_adapter_dev_held_safe(hdd_ctx, adapter, next_adapter,
 					   NET_DEV_HOLD_RESUME_WLAN) {
-		if (wlan_hdd_validate_vdev_id(adapter->vdev_id)) {
+		if (wlan_hdd_validate_vdev_id(adapter->deflink->vdev_id)) {
 			hdd_adapter_dev_put_debug(adapter,
 						  NET_DEV_HOLD_RESUME_WLAN);
 			continue;
@@ -2090,7 +2099,7 @@ static void hdd_send_default_scan_ies(struct hdd_context *hdd_ctx)
 		    adapter->device_mode == QDF_P2P_DEVICE_MODE) &&
 		    adapter->scan_info.default_scan_ies) {
 			sme_set_default_scan_ie(hdd_ctx->mac_handle,
-				      adapter->vdev_id,
+				      adapter->deflink->vdev_id,
 				      adapter->scan_info.default_scan_ies,
 				      adapter->scan_info.default_scan_ies_len);
 		}
@@ -2273,14 +2282,14 @@ int wlan_hdd_set_powersave(struct hdd_adapter *adapter,
 	}
 
 	status = sme_ps_set_powersave(
-		hdd_ctx->mac_handle, adapter->vdev_id,
+		hdd_ctx->mac_handle, adapter->deflink->vdev_id,
 		allow_power_save, timeout,
 		hdd_sta_ctx->ap_supports_immediate_power_save);
 	if (!allow_power_save) {
 		if (adapter->device_mode == QDF_STA_MODE)
 			hdd_twt_del_dialog_in_ps_disable(hdd_ctx,
 						&hdd_sta_ctx->conn_info.bssid,
-						adapter->vdev_id);
+						adapter->deflink->vdev_id);
 	}
 
 	return qdf_status_to_os_return(status);
@@ -2566,7 +2575,7 @@ static int __wlan_hdd_cfg80211_suspend_wlan(struct wiphy *wiphy,
 	 */
 	hdd_for_each_adapter_dev_held_safe(hdd_ctx, adapter, next_adapter,
 					   dbgid) {
-		if (wlan_hdd_validate_vdev_id(adapter->vdev_id)) {
+		if (wlan_hdd_validate_vdev_id(adapter->deflink->vdev_id)) {
 			hdd_adapter_dev_put_debug(adapter, dbgid);
 			continue;
 		}
@@ -2645,12 +2654,12 @@ static int __wlan_hdd_cfg80211_suspend_wlan(struct wiphy *wiphy,
 	/* flush any pending powersave timers */
 	hdd_for_each_adapter_dev_held_safe(hdd_ctx, adapter, next_adapter,
 					   dbgid) {
-		if (wlan_hdd_validate_vdev_id(adapter->vdev_id)) {
+		if (wlan_hdd_validate_vdev_id(adapter->deflink->vdev_id)) {
 			hdd_adapter_dev_put_debug(adapter, dbgid);
 			continue;
 		}
 
-		sme_ps_timer_flush_sync(mac_handle, adapter->vdev_id);
+		sme_ps_timer_flush_sync(mac_handle, adapter->deflink->vdev_id);
 		hdd_adapter_dev_put_debug(adapter, dbgid);
 	}
 
@@ -2856,7 +2865,7 @@ static void hdd_stop_dhcp_ind(struct hdd_adapter *adapter)
 	hdd_debug("DHCP stop indicated through power save");
 	sme_dhcp_stop_ind(hdd_ctx->mac_handle, adapter->device_mode,
 			  adapter->mac_addr.bytes,
-			  adapter->vdev_id);
+			  adapter->deflink->vdev_id);
 	hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_DHCP);
 	qdf_runtime_pm_allow_suspend(&hdd_ctx->runtime_context.connect);
 }
@@ -2880,7 +2889,7 @@ static void hdd_start_dhcp_ind(struct hdd_adapter *adapter)
 				    WIFI_POWER_EVENT_WAKELOCK_DHCP);
 	sme_dhcp_start_ind(hdd_ctx->mac_handle, adapter->device_mode,
 			   adapter->mac_addr.bytes,
-			   adapter->vdev_id);
+			   adapter->deflink->vdev_id);
 }
 
 static int wlan_hdd_set_ps(struct wlan_objmgr_psoc *psoc,
@@ -2893,12 +2902,12 @@ static int wlan_hdd_set_ps(struct wlan_objmgr_psoc *psoc,
 
 	if (!hdd_cm_is_vdev_associated(adapter)) {
 		hdd_debug("vdev[%d] mode %d disconnected ignore dhcp protection",
-			  adapter->vdev_id, adapter->device_mode);
+			  adapter->deflink->vdev_id, adapter->device_mode);
 		return status;
 	}
 
 	hdd_debug("vdev[%d] mode %d enable dhcp protection",
-		  adapter->vdev_id, adapter->device_mode);
+		  adapter->deflink->vdev_id, adapter->device_mode);
 	allow_power_save ? hdd_stop_dhcp_ind(adapter) :
 			   hdd_start_dhcp_ind(adapter);
 
@@ -2970,12 +2979,12 @@ static int __wlan_hdd_cfg80211_set_power_mgmt(struct wiphy *wiphy,
 		return -EINVAL;
 	}
 
-	if (wlan_hdd_validate_vdev_id(adapter->vdev_id))
+	if (wlan_hdd_validate_vdev_id(adapter->deflink->vdev_id))
 		return -EINVAL;
 
 	qdf_mtrace(QDF_MODULE_ID_HDD, QDF_MODULE_ID_HDD,
 		   TRACE_CODE_HDD_CFG80211_SET_POWER_MGMT,
-		   adapter->vdev_id, timeout);
+		   adapter->deflink->vdev_id, timeout);
 
 	hdd_ctx = WLAN_HDD_GET_CTX(adapter);
 	status = wlan_hdd_validate_context(hdd_ctx);
@@ -3084,7 +3093,7 @@ static int __wlan_hdd_cfg80211_set_txpower(struct wiphy *wiphy,
 	if (errno)
 		return errno;
 
-	if (wlan_hdd_validate_vdev_id(adapter->vdev_id))
+	if (wlan_hdd_validate_vdev_id(adapter->deflink->vdev_id))
 		return -EINVAL;
 
 	if (adapter->device_mode == QDF_SAP_MODE ||
@@ -3134,7 +3143,7 @@ static int __wlan_hdd_cfg80211_set_txpower(struct wiphy *wiphy,
 		break;
 
 	case NL80211_TX_POWER_FIXED:    /* Fix TX power to the mBm parameter */
-		status = sme_set_tx_power(mac_handle, adapter->vdev_id,
+		status = sme_set_tx_power(mac_handle, adapter->deflink->vdev_id,
 					  bssid, adapter->device_mode, dbm);
 		if (QDF_IS_STATUS_ERROR(status)) {
 			hdd_err("Setting tx power failed, %d", status);
@@ -3325,7 +3334,7 @@ static int __wlan_hdd_cfg80211_get_txpower(struct wiphy *wiphy,
 		return status;
 
 	/* Validate adapter sessionId */
-	status = wlan_hdd_validate_vdev_id(adapter->vdev_id);
+	status = wlan_hdd_validate_vdev_id(adapter->deflink->vdev_id);
 	if (status)
 		return status;
 	switch (adapter->device_mode) {
@@ -3371,7 +3380,7 @@ static int __wlan_hdd_cfg80211_get_txpower(struct wiphy *wiphy,
 
 	qdf_mtrace(QDF_MODULE_ID_HDD, QDF_MODULE_ID_HDD,
 		   TRACE_CODE_HDD_CFG80211_GET_TXPOWER,
-		   adapter->vdev_id, adapter->device_mode);
+		   adapter->deflink->vdev_id, adapter->device_mode);
 
 	wlan_hdd_get_tx_power(adapter, dbm);
 	hdd_debug("power: %d", *dbm);
@@ -3421,7 +3430,7 @@ int hdd_set_power_config(struct hdd_context *hddctx,
 		power = PMO_PS_ADVANCED_POWER_SAVE_DISABLE;
 	}
 
-	status = wma_set_power_config(adapter->vdev_id, power);
+	status = wma_set_power_config(adapter->deflink->vdev_id, power);
 	if (status != QDF_STATUS_SUCCESS) {
 		hdd_err("failed to configure power: %d", status);
 		return -EINVAL;

+ 12 - 10
core/hdd/src/wlan_hdd_pre_cac.c

@@ -89,17 +89,17 @@ static void wlan_hdd_pre_cac_success(struct hdd_adapter *adapter)
 	 * Setting of the pre cac complete status will ensure that on channel
 	 * switch to the pre CAC DFS channel, there is no CAC again.
 	 */
-	ucfg_pre_cac_complete_set(ap_adapter->vdev, true);
+	ucfg_pre_cac_complete_set(ap_adapter->deflink->vdev, true);
 
-	wlan_hdd_set_sap_csa_reason(hdd_ctx->psoc, ap_adapter->vdev_id,
+	wlan_hdd_set_sap_csa_reason(hdd_ctx->psoc, ap_adapter->deflink->vdev_id,
 				    CSA_REASON_PRE_CAC_SUCCESS);
-	chan_freq = ucfg_pre_cac_get_freq(ap_adapter->vdev);
+	chan_freq = ucfg_pre_cac_get_freq(ap_adapter->deflink->vdev);
 	i = hdd_softap_set_channel_change(ap_adapter->dev,
 					  chan_freq,
 					  pre_cac_ch_width, false);
 	if (i) {
 		hdd_err("failed to change channel");
-		ucfg_pre_cac_complete_set(ap_adapter->vdev, false);
+		ucfg_pre_cac_complete_set(ap_adapter->deflink->vdev, false);
 	}
 
 	hdd_exit();
@@ -386,8 +386,10 @@ static int __wlan_hdd_request_pre_cac(struct hdd_context *hdd_ctx,
 	 * connection update should result in DBS mode
 	 */
 	status = policy_mgr_update_and_wait_for_connection_update(
-			hdd_ctx->psoc, ap_adapter->vdev_id, pre_cac_chan_freq,
-			POLICY_MGR_UPDATE_REASON_PRE_CAC);
+					    hdd_ctx->psoc,
+					    ap_adapter->deflink->vdev_id,
+					    pre_cac_chan_freq,
+					    POLICY_MGR_UPDATE_REASON_PRE_CAC);
 	if (QDF_IS_STATUS_ERROR(status)) {
 		hdd_err("error in moving to DBS mode");
 		goto stop_close_pre_cac_adapter;
@@ -414,16 +416,16 @@ static int __wlan_hdd_request_pre_cac(struct hdd_context *hdd_ctx,
 	 * anywhere, since after the pre cac success/failure, the pre cac
 	 * adapter itself would be removed.
 	 */
-	ret = ucfg_pre_cac_set_status(pre_cac_adapter->vdev, true);
+	ret = ucfg_pre_cac_set_status(pre_cac_adapter->deflink->vdev, true);
 	if (ret != 0) {
 		hdd_err("failed to set pre cac status");
 		goto stop_close_pre_cac_adapter;
 	}
 
-	ucfg_pre_cac_set_freq_before_pre_cac(ap_adapter->vdev,
+	ucfg_pre_cac_set_freq_before_pre_cac(ap_adapter->deflink->vdev,
 					     hdd_ap_ctx->operating_chan_freq);
-	ucfg_pre_cac_set_freq(ap_adapter->vdev, pre_cac_chan_freq);
-	ucfg_pre_cac_adapter_set(pre_cac_adapter->vdev, true);
+	ucfg_pre_cac_set_freq(ap_adapter->deflink->vdev, pre_cac_chan_freq);
+	ucfg_pre_cac_adapter_set(pre_cac_adapter->deflink->vdev, true);
 	*out_adapter = pre_cac_adapter;
 
 	return 0;

+ 9 - 8
core/hdd/src/wlan_hdd_regulatory.c

@@ -952,7 +952,8 @@ int hdd_reg_set_band(struct net_device *dev, uint32_t band_bitmap)
 		return -EINVAL;
 	}
 
-	status = ucfg_cm_set_roam_band_update(hdd_ctx->psoc, adapter->vdev_id);
+	status = ucfg_cm_set_roam_band_update(hdd_ctx->psoc,
+					      adapter->deflink->vdev_id);
 	if (QDF_IS_STATUS_ERROR(status))
 		hdd_err("Failed to send RSO update to fw on set band");
 
@@ -1681,8 +1682,8 @@ static void hdd_country_change_update_sta(struct hdd_context *hdd_ctx)
 				} else {
 					hdd_debug("Remain on current channel but update tx power");
 					wlan_reg_update_tx_power_on_ctry_change(
-							pdev,
-							adapter->vdev_id);
+						    pdev,
+						    adapter->deflink->vdev_id);
 				}
 			}
 			break;
@@ -1792,7 +1793,7 @@ static void hdd_country_change_update_sap(struct hdd_context *hdd_ctx)
 		switch (adapter->device_mode) {
 		case QDF_P2P_GO_MODE:
 			policy_mgr_check_sap_restart(hdd_ctx->psoc,
-						     adapter->vdev_id);
+						     adapter->deflink->vdev_id);
 			break;
 		case QDF_SAP_MODE:
 			if (!test_bit(SOFTAP_INIT_DONE,
@@ -1817,12 +1818,12 @@ static void hdd_country_change_update_sap(struct hdd_context *hdd_ctx)
 								 sap_config,
 								 csr_phy_mode);
 			else
-				policy_mgr_check_sap_restart(hdd_ctx->psoc,
-							     adapter->vdev_id);
+				policy_mgr_check_sap_restart(
+						hdd_ctx->psoc,
+						adapter->deflink->vdev_id);
 				hdd_debug("Update tx power due to ctry change");
 				wlan_reg_update_tx_power_on_ctry_change(
-							pdev,
-							adapter->vdev_id);
+					    pdev, adapter->deflink->vdev_id);
 			break;
 		default:
 			break;

+ 3 - 3
core/hdd/src/wlan_hdd_rssi_monitor.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2012-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
@@ -83,7 +83,7 @@ __wlan_hdd_cfg80211_monitor_rssi(struct wiphy *wiphy,
 		return -EPERM;
 	}
 
-	if (wlan_hdd_validate_vdev_id(adapter->vdev_id))
+	if (wlan_hdd_validate_vdev_id(adapter->deflink->vdev_id))
 		return -EINVAL;
 
 	ret = wlan_hdd_validate_context(hdd_ctx);
@@ -112,7 +112,7 @@ __wlan_hdd_cfg80211_monitor_rssi(struct wiphy *wiphy,
 	}
 
 	req.request_id = nla_get_u32(tb[PARAM_REQUEST_ID]);
-	req.vdev_id = adapter->vdev_id;
+	req.vdev_id = adapter->deflink->vdev_id;
 	control = nla_get_u32(tb[PARAM_CONTROL]);
 
 	if (control == QCA_WLAN_RSSI_MONITORING_START) {

+ 8 - 7
core/hdd/src/wlan_hdd_scan.c

@@ -470,7 +470,7 @@ static int __wlan_hdd_cfg80211_scan(struct wiphy *wiphy,
 		return -EINVAL;
 	}
 
-	if (wlan_hdd_validate_vdev_id(adapter->vdev_id))
+	if (wlan_hdd_validate_vdev_id(adapter->deflink->vdev_id))
 		return -EINVAL;
 
 	status = wlan_hdd_validate_context(hdd_ctx);
@@ -479,9 +479,10 @@ static int __wlan_hdd_cfg80211_scan(struct wiphy *wiphy,
 
 	qdf_mtrace(QDF_MODULE_ID_HDD, QDF_MODULE_ID_HDD,
 		   TRACE_CODE_HDD_CFG80211_SCAN,
-		   adapter->vdev_id, request->n_channels);
+		   adapter->deflink->vdev_id, request->n_channels);
 
-	if (!sme_is_session_id_valid(hdd_ctx->mac_handle, adapter->vdev_id))
+	if (!sme_is_session_id_valid(hdd_ctx->mac_handle,
+				     adapter->deflink->vdev_id))
 		return -EINVAL;
 
 	qdf_status = ucfg_mlme_get_self_recovery(hdd_ctx->psoc, &self_recovery);
@@ -1262,7 +1263,7 @@ int wlan_hdd_scan_abort(struct hdd_adapter *adapter)
 	struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
 
 	wlan_abort_scan(hdd_ctx->pdev, INVAL_PDEV_ID,
-			adapter->vdev_id, INVALID_SCAN_ID, true);
+			adapter->deflink->vdev_id, INVALID_SCAN_ID, true);
 
 	return 0;
 }
@@ -1299,7 +1300,7 @@ static int __wlan_hdd_cfg80211_sched_scan_start(struct wiphy *wiphy,
 		return -EINVAL;
 	}
 
-	if (wlan_hdd_validate_vdev_id(adapter->vdev_id))
+	if (wlan_hdd_validate_vdev_id(adapter->deflink->vdev_id))
 		return -EINVAL;
 
 	if (adapter->device_mode != QDF_STA_MODE) {
@@ -1378,7 +1379,7 @@ int wlan_hdd_sched_scan_stop(struct net_device *dev)
 		return -EINVAL;
 	}
 
-	if (wlan_hdd_validate_vdev_id(adapter->vdev_id))
+	if (wlan_hdd_validate_vdev_id(adapter->deflink->vdev_id))
 		return -EINVAL;
 
 	hdd_ctx = WLAN_HDD_GET_CTX(adapter);
@@ -1549,7 +1550,7 @@ static void __wlan_hdd_cfg80211_abort_scan(struct wiphy *wiphy,
 		return;
 	}
 
-	if (wlan_hdd_validate_vdev_id(adapter->vdev_id))
+	if (wlan_hdd_validate_vdev_id(adapter->deflink->vdev_id))
 		return;
 
 	ret = wlan_hdd_validate_context(hdd_ctx);

+ 6 - 4
core/hdd/src/wlan_hdd_softap_tx_rx.c

@@ -212,7 +212,8 @@ static void __hdd_softap_hard_start_xmit(struct sk_buff *skb,
 	ac = hdd_qdisc_ac_to_tl_ac[skb->queue_mapping];
 	++stats->per_cpu[cpu].tx_classified_ac[ac];
 
-	status = ucfg_dp_softap_start_xmit((qdf_nbuf_t)skb, adapter->vdev);
+	status = ucfg_dp_softap_start_xmit((qdf_nbuf_t)skb,
+					   adapter->deflink->vdev);
 	if (QDF_IS_STATUS_ERROR(status))
 		++stats->per_cpu[cpu].tx_dropped_ac[ac];
 
@@ -486,7 +487,7 @@ QDF_STATUS hdd_softap_deregister_sta(struct hdd_adapter *adapter,
 	if (ucfg_ipa_is_enabled()) {
 		if (ucfg_ipa_wlan_evt(hdd_ctx->pdev, adapter->dev,
 				      adapter->device_mode,
-				      adapter->vdev_id,
+				      adapter->deflink->vdev_id,
 				      WLAN_IPA_CLIENT_DISCONNECT,
 				      mac_addr->bytes,
 				      false) != QDF_STATUS_SUCCESS)
@@ -718,7 +719,7 @@ QDF_STATUS hdd_softap_stop_bss(struct hdd_adapter *adapter)
 		if (ucfg_ipa_wlan_evt(hdd_ctx->pdev,
 				      adapter->dev,
 				      adapter->device_mode,
-				      adapter->vdev_id,
+				      adapter->deflink->vdev_id,
 				      WLAN_IPA_AP_DISCONNECT,
 				      adapter->dev->dev_addr,
 				      false) != QDF_STATUS_SUCCESS)
@@ -726,7 +727,8 @@ QDF_STATUS hdd_softap_stop_bss(struct hdd_adapter *adapter)
 	}
 
 	/* Setting the RTS profile to original value */
-	if (sme_cli_set_command(adapter->vdev_id, wmi_vdev_param_enable_rtscts,
+	if (sme_cli_set_command(adapter->deflink->vdev_id,
+				wmi_vdev_param_enable_rtscts,
 				cfg_get(hdd_ctx->psoc,
 					CFG_ENABLE_FW_RTS_PROFILE),
 				VDEV_CMD))

+ 13 - 12
core/hdd/src/wlan_hdd_son.c

@@ -88,7 +88,7 @@ static uint32_t hdd_son_is_acs_in_progress(struct wlan_objmgr_vdev *vdev)
 	}
 
 	if (!hdd_adapter_is_ap(adapter)) {
-		hdd_err("vdev id %d is not AP", adapter->vdev_id);
+		hdd_err("vdev id %d is not AP", adapter->deflink->vdev_id);
 		return in_progress;
 	}
 
@@ -291,7 +291,7 @@ static int hdd_son_set_chan_ext_offset(
 		return retval;
 	}
 	if (!hdd_adapter_is_ap(adapter)) {
-		hdd_err("vdev id %d is not AP", adapter->vdev_id);
+		hdd_err("vdev id %d is not AP", adapter->deflink->vdev_id);
 		return retval;
 	}
 
@@ -356,7 +356,7 @@ static enum sec20_chan_offset hdd_son_get_chan_ext_offset(
 		return 0;
 	}
 	if (!hdd_adapter_is_ap(adapter)) {
-		hdd_err("vdev id %d is not AP", adapter->vdev_id);
+		hdd_err("vdev id %d is not AP", adapter->deflink->vdev_id);
 		return 0;
 	}
 
@@ -566,7 +566,8 @@ static uint32_t hdd_son_get_bandwidth(struct wlan_objmgr_vdev *vdev)
 		return NONHT;
 	}
 
-	chwidth = wma_cli_get_command(adapter->vdev_id, wmi_vdev_param_chwidth,
+	chwidth = wma_cli_get_command(adapter->deflink->vdev_id,
+				      wmi_vdev_param_chwidth,
 				      VDEV_CMD);
 
 	if (chwidth < 0) {
@@ -638,7 +639,7 @@ static int hdd_son_set_chan(struct wlan_objmgr_vdev *vdev, int chan,
 		return -EINVAL;
 	}
 	if (!hdd_adapter_is_ap(adapter)) {
-		hdd_err("vdev id %d is not AP", adapter->vdev_id);
+		hdd_err("vdev id %d is not AP", adapter->deflink->vdev_id);
 		return -ENOTSUPP;
 	}
 
@@ -655,13 +656,13 @@ static int hdd_son_set_chan(struct wlan_objmgr_vdev *vdev, int chan,
 	}
 
 	freq = wlan_reg_chan_band_to_freq(pdev, chan, BIT(band));
-	status = policy_mgr_is_sap_allowed_on_dfs_freq(pdev, adapter->vdev_id,
-						       freq);
+	status = policy_mgr_is_sap_allowed_on_dfs_freq(
+					pdev, adapter->deflink->vdev_id, freq);
 	if (!status) {
 		hdd_err("sap_allowed_on_dfs_freq check fails");
 		return -EINVAL;
 	}
-	wlan_hdd_set_sap_csa_reason(psoc, adapter->vdev_id,
+	wlan_hdd_set_sap_csa_reason(psoc, adapter->deflink->vdev_id,
 				    CSA_REASON_USER_INITIATED);
 
 	return hdd_softap_set_channel_change(adapter->dev, freq, CH_WIDTH_MAX,
@@ -723,7 +724,7 @@ static int hdd_son_set_candidate_freq(struct wlan_objmgr_vdev *vdev,
 		return -EINVAL;
 	}
 	if (!hdd_adapter_is_ap(adapter)) {
-		hdd_err("vdev id %d is not AP", adapter->vdev_id);
+		hdd_err("vdev id %d is not AP", adapter->deflink->vdev_id);
 		return -EINVAL;
 	}
 
@@ -760,7 +761,7 @@ static qdf_freq_t hdd_son_get_candidate_freq(struct wlan_objmgr_vdev *vdev)
 		return freq;
 	}
 	if (!hdd_adapter_is_ap(adapter)) {
-		hdd_err("vdev id %d is not AP", adapter->vdev_id);
+		hdd_err("vdev id %d is not AP", adapter->deflink->vdev_id);
 		return freq;
 	}
 
@@ -905,7 +906,7 @@ static int hdd_son_set_phymode(struct wlan_objmgr_vdev *vdev,
 	}
 
 	if (!hdd_adapter_is_ap(adapter)) {
-		hdd_err("vdev id %d is not AP", adapter->vdev_id);
+		hdd_err("vdev id %d is not AP", adapter->deflink->vdev_id);
 		return -EINVAL;
 	}
 
@@ -1878,7 +1879,7 @@ static QDF_STATUS hdd_son_init_acs_channels(struct hdd_adapter *adapter,
 				   acs_cfg->pcl_chan_freq,
 				   &acs_cfg->pcl_ch_count,
 				   acs_cfg->pcl_channels_weight_list,
-				   NUM_CHANNELS, adapter->vdev_id);
+				   NUM_CHANNELS, adapter->deflink->vdev_id);
 		wlan_hdd_trim_acs_channel_list(acs_cfg->pcl_chan_freq,
 					       acs_cfg->pcl_ch_count,
 					       acs_cfg->freq_list,

+ 13 - 10
core/hdd/src/wlan_hdd_station_info.c

@@ -1508,9 +1508,9 @@ static int hdd_get_connected_station_info(struct hdd_context *hdd_ctx,
 	if (status != QDF_STATUS_SUCCESS)
 		hdd_err("Unable to fetch sap ger peer info");
 	if (value) {
-		stats = wlan_cfg80211_mc_cp_stats_get_peer_stats(adapter->vdev,
-								 mac_addr.bytes,
-								 &ret);
+		stats = wlan_cfg80211_mc_cp_stats_get_peer_stats(
+					adapter->deflink->vdev, mac_addr.bytes,
+					&ret);
 		if (ret || !stats) {
 			hdd_err("fail to get tx/rx rate");
 			wlan_cfg80211_mc_cp_stats_free_stats_event(stats);
@@ -1762,7 +1762,7 @@ static int hdd_get_peer_stats(struct hdd_adapter *adapter,
 	if (!peer_stats)
 		return -ENOMEM;
 
-	status = cdp_host_get_peer_stats(soc, adapter->vdev_id,
+	status = cdp_host_get_peer_stats(soc, adapter->deflink->vdev_id,
 					 stainfo->sta_mac.bytes, peer_stats);
 	if (status != QDF_STATUS_SUCCESS) {
 		hdd_err("cdp_host_get_peer_stats failed");
@@ -1781,7 +1781,7 @@ static int hdd_get_peer_stats(struct hdd_adapter *adapter,
 	qdf_mem_free(peer_stats);
 	peer_stats = NULL;
 
-	stats = wlan_cfg80211_mc_cp_stats_get_peer_stats(adapter->vdev,
+	stats = wlan_cfg80211_mc_cp_stats_get_peer_stats(adapter->deflink->vdev,
 							 stainfo->sta_mac.bytes,
 							 &ret);
 	if (ret || !stats) {
@@ -1790,7 +1790,7 @@ static int hdd_get_peer_stats(struct hdd_adapter *adapter,
 		return -EINVAL;
 	}
 
-	if (cds_dp_get_vdev_stats(adapter->vdev_id, &dp_stats))
+	if (cds_dp_get_vdev_stats(adapter->deflink->vdev_id, &dp_stats))
 		stainfo->tx_retry_succeed =
 					dp_stats.tx_mpdu_success_with_retries;
 	else
@@ -2070,13 +2070,15 @@ hdd_big_data_pack_resp_nlmsg(struct sk_buff *skb,
 	}
 	if (nla_put_u32(skb,
 			QCA_WLAN_VENDOR_ATTR_GET_STA_INFO_ROAM_TRIGGER_REASON,
-			wlan_cm_get_roam_states(hdd_ctx->psoc, adapter->vdev_id,
+			wlan_cm_get_roam_states(hdd_ctx->psoc,
+						adapter->deflink->vdev_id,
 						ROAM_TRIGGER_REASON))){
 		hdd_err("roam trigger reason put fail");
 		return -EINVAL;
 	}
 	if (nla_put_u32(skb, QCA_WLAN_VENDOR_ATTR_GET_STA_INFO_ROAM_FAIL_REASON,
-			wlan_cm_get_roam_states(hdd_ctx->psoc, adapter->vdev_id,
+			wlan_cm_get_roam_states(hdd_ctx->psoc,
+						adapter->deflink->vdev_id,
 						ROAM_FAIL_REASON))){
 		hdd_err("roam fail reason put fail");
 		return -EINVAL;
@@ -2084,7 +2086,8 @@ hdd_big_data_pack_resp_nlmsg(struct sk_buff *skb,
 	if (nla_put_u32(
 		      skb,
 		      QCA_WLAN_VENDOR_ATTR_GET_STA_INFO_ROAM_INVOKE_FAIL_REASON,
-		      wlan_cm_get_roam_states(hdd_ctx->psoc, adapter->vdev_id,
+		      wlan_cm_get_roam_states(hdd_ctx->psoc,
+					      adapter->deflink->vdev_id,
 					      ROAM_INVOKE_FAIL_REASON))){
 		hdd_err("roam invoke fail reason put fail");
 		return -EINVAL;
@@ -2493,7 +2496,7 @@ static int hdd_get_station_info_ex(struct hdd_context *hdd_ctx,
 	}
 
 	ret = wlan_cfg80211_vendor_cmd_reply(skb);
-	hdd_reset_roam_params(hdd_ctx->psoc, adapter->vdev_id);
+	hdd_reset_roam_params(hdd_ctx->psoc, adapter->deflink->vdev_id);
 	return ret;
 }
 

+ 41 - 35
core/hdd/src/wlan_hdd_stats.c

@@ -891,7 +891,7 @@ bool hdd_get_interface_info(struct hdd_adapter *adapter,
 		}
 		if (hdd_cm_is_connecting(adapter)) {
 			hdd_debug("Session ID %d, Connection is in progress",
-				  adapter->vdev_id);
+				  adapter->deflink->vdev_id);
 			info->state = WIFI_ASSOCIATING;
 		}
 		if (hdd_cm_is_vdev_associated(adapter) &&
@@ -1093,7 +1093,7 @@ hdd_link_layer_process_iface_stats(struct hdd_adapter *adapter,
 	struct sk_buff *skb;
 	struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
 
-	if (if_stat->vdev_id != adapter->vdev_id) {
+	if (if_stat->vdev_id != adapter->deflink->vdev_id) {
 		hdd_cache_ll_iface_stats(hdd_ctx, if_stat);
 		return;
 	}
@@ -1906,7 +1906,7 @@ __wlan_hdd_cfg80211_ll_stats_set(struct wiphy *wiphy,
 		nla_get_u32(tb_vendor
 			    [QCA_WLAN_VENDOR_ATTR_LL_STATS_SET_CONFIG_AGGRESSIVE_STATS_GATHERING]);
 
-	req.staId = adapter->vdev_id;
+	req.staId = adapter->deflink->vdev_id;
 
 	hdd_debug("LL_STATS_SET reqId = %d, staId = %d, mpduSizeThreshold = %d, Statistics Gathering = %d",
 		req.reqId, req.staId,
@@ -2088,7 +2088,7 @@ static void cache_station_stats_cb(struct stats_event *ev, void *cookie)
 
 	hdd_for_each_adapter_dev_held_safe(hdd_ctx, adapter, next_adapter,
 					   dbgid) {
-		if (adapter->vdev_id != vdev_id) {
+		if (adapter->deflink->vdev_id != vdev_id) {
 			hdd_adapter_dev_put_debug(adapter, dbgid);
 			continue;
 		}
@@ -2116,9 +2116,10 @@ wlan_hdd_get_mlo_vdev_params(struct hdd_adapter *adapter,
 	uint32_t bmap = 0;
 	QDF_STATUS status;
 
-	req->is_mlo_req = wlan_vdev_mlme_get_is_mlo_vdev(psoc,
-							 adapter->vdev_id);
-	status = mlo_get_mlstats_vdev_params(psoc, info, adapter->vdev_id);
+	req->is_mlo_req = wlan_vdev_mlme_get_is_mlo_vdev(
+					psoc, adapter->deflink->vdev_id);
+	status = mlo_get_mlstats_vdev_params(psoc, info,
+					     adapter->deflink->vdev_id);
 	if (QDF_IS_STATUS_ERROR(status))
 		return status;
 	for (i = 0; i < info->ml_vdev_count; i++) {
@@ -2180,8 +2181,9 @@ wlan_hdd_set_station_stats_request_pending(struct hdd_adapter *adapter,
 
 	info.cookie = adapter;
 	info.u.get_station_stats_cb = cache_station_stats_cb;
-	info.vdev_id = adapter->vdev_id;
-	is_mlo_vdev = wlan_vdev_mlme_get_is_mlo_vdev(psoc, adapter->vdev_id);
+	info.vdev_id = adapter->deflink->vdev_id;
+	is_mlo_vdev = wlan_vdev_mlme_get_is_mlo_vdev(
+					psoc, adapter->deflink->vdev_id);
 	if (is_mlo_vdev) {
 		status = wlan_hdd_get_mlo_vdev_params(adapter, &info, req);
 		if (QDF_IS_STATUS_ERROR(status)) {
@@ -2330,9 +2332,9 @@ static int wlan_hdd_send_ll_stats_req(struct hdd_adapter *adapter,
 
 	priv->request_id = req->reqId;
 	priv->request_bitmap = req->paramIdMask;
-	priv->vdev_id = adapter->vdev_id;
-	priv->is_mlo_req = wlan_vdev_mlme_get_is_mlo_vdev(hdd_ctx->psoc,
-							  adapter->vdev_id);
+	priv->vdev_id = adapter->deflink->vdev_id;
+	priv->is_mlo_req = wlan_vdev_mlme_get_is_mlo_vdev(
+				hdd_ctx->psoc, adapter->deflink->vdev_id);
 	if (priv->is_mlo_req)
 		priv->mlo_vdev_id_bitmap = req->mlo_vdev_id_bitmap;
 
@@ -2415,14 +2417,14 @@ int wlan_hdd_ll_stats_get(struct hdd_adapter *adapter, uint32_t req_id,
 
 	get_req.reqId = req_id;
 	get_req.paramIdMask = req_mask;
-	get_req.staId = adapter->vdev_id;
+	get_req.staId = adapter->deflink->vdev_id;
 
 	rtnl_lock();
 	errno = wlan_hdd_send_ll_stats_req(adapter, &get_req);
 	rtnl_unlock();
 	if (errno)
 		hdd_err("Send LL stats req failed, id:%u, mask:%d, session:%d",
-			req_id, req_mask, adapter->vdev_id);
+			req_id, req_mask, adapter->deflink->vdev_id);
 
 	hdd_exit();
 
@@ -2498,9 +2500,9 @@ __wlan_hdd_cfg80211_ll_stats_get(struct wiphy *wiphy,
 		nla_get_u32(tb_vendor
 			    [QCA_WLAN_VENDOR_ATTR_LL_STATS_GET_CONFIG_REQ_MASK]);
 
-	LinkLayerStatsGetReq.staId = adapter->vdev_id;
+	LinkLayerStatsGetReq.staId = adapter->deflink->vdev_id;
 
-	if (wlan_hdd_validate_vdev_id(adapter->vdev_id))
+	if (wlan_hdd_validate_vdev_id(adapter->deflink->vdev_id))
 		return -EINVAL;
 
 	ret = wlan_hdd_send_ll_stats_req(adapter, &LinkLayerStatsGetReq);
@@ -2635,7 +2637,7 @@ __wlan_hdd_cfg80211_ll_stats_clear(struct wiphy *wiphy,
 	 */
 	LinkLayerStatsClearReq.reqId = 1;
 
-	LinkLayerStatsClearReq.staId = adapter->vdev_id;
+	LinkLayerStatsClearReq.staId = adapter->deflink->vdev_id;
 
 	hdd_debug("LL_STATS_CLEAR reqId = %d, staId = %d, statsClearReqMask = 0x%X, stopReq = %d",
 		LinkLayerStatsClearReq.reqId,
@@ -2731,7 +2733,7 @@ void wlan_hdd_clear_link_layer_stats(struct hdd_adapter *adapter)
 		WIFI_STATS_IFACE_ALL_PEER | WIFI_STATS_IFACE_CONTENTION;
 	link_layer_stats_clear_req.stopReq = 0;
 	link_layer_stats_clear_req.reqId = 1;
-	link_layer_stats_clear_req.staId = adapter->vdev_id;
+	link_layer_stats_clear_req.staId = adapter->deflink->vdev_id;
 	sme_ll_stats_clear_req(mac_handle, &link_layer_stats_clear_req);
 }
 
@@ -3895,7 +3897,7 @@ set_thresh:
 
 set_period:
 	hdd_info("send period to target");
-	errno = wma_cli_set_command(adapter->vdev_id,
+	errno = wma_cli_set_command(adapter->deflink->vdev_id,
 				    wmi_pdev_param_stats_observation_period,
 				    period, PDEV_CMD);
 	if (errno) {
@@ -3982,7 +3984,8 @@ static int __wlan_hdd_cfg80211_stats_ext_request(struct wiphy *wiphy,
 	txrx_req.stats = 2;
 	/* default value of secondary parameter is 0(mac_id) */
 	txrx_req.mac_id = 0;
-	status = cdp_txrx_stats_request(soc, adapter->vdev_id, &txrx_req);
+	status = cdp_txrx_stats_request(soc, adapter->deflink->vdev_id,
+					&txrx_req);
 	if (QDF_STATUS_SUCCESS != status) {
 		hdd_err_rl("Failed to get hw stats: %u", status);
 		ret_val = -EINVAL;
@@ -3991,14 +3994,15 @@ static int __wlan_hdd_cfg80211_stats_ext_request(struct wiphy *wiphy,
 	stats_ext_req.request_data_len = data_len;
 	stats_ext_req.request_data = (void *)data;
 
-	status = cdp_request_rx_hw_stats(soc, adapter->vdev_id);
+	status = cdp_request_rx_hw_stats(soc, adapter->deflink->vdev_id);
 
 	if (QDF_STATUS_SUCCESS != status) {
 		hdd_err_rl("Failed to get hw stats: %u", status);
 		ret_val = -EINVAL;
 	}
 
-	status = sme_stats_ext_request(adapter->vdev_id, &stats_ext_req);
+	status = sme_stats_ext_request(adapter->deflink->vdev_id,
+				       &stats_ext_req);
 
 	if (QDF_STATUS_SUCCESS != status) {
 		hdd_err_rl("Failed to get fw stats: %u", status);
@@ -4584,7 +4588,7 @@ wlan_hdd_get_sap_stats(struct hdd_adapter *adapter, struct station_info *info)
 
 	wlan_hdd_fill_summary_stats(&adapter->hdd_stats.summary_stat,
 				    info,
-				    adapter->vdev_id);
+				    adapter->deflink->vdev_id);
 
 	return 0;
 }
@@ -5210,7 +5214,7 @@ static void wlan_hdd_fill_station_info(struct wlan_objmgr_psoc *psoc,
 
 	status =
 		cdp_host_get_peer_stats(cds_get_context(QDF_MODULE_ID_SOC),
-					adapter->vdev_id,
+					adapter->deflink->vdev_id,
 					stainfo->sta_mac.bytes,
 					peer_stats);
 
@@ -5492,8 +5496,9 @@ static int wlan_hdd_get_station_remote(struct wiphy *wiphy,
 	struct hdd_fw_txrx_stats txrx_stats;
 	int i, status;
 
-	stats = wlan_cfg80211_mc_cp_stats_get_peer_stats(adapter->vdev,
-					stainfo->sta_mac.bytes, &status);
+	stats = wlan_cfg80211_mc_cp_stats_get_peer_stats(adapter->deflink->vdev,
+							 stainfo->sta_mac.bytes,
+							 &status);
 	if (status || !stats) {
 		wlan_cfg80211_mc_cp_stats_free_stats_event(stats);
 		hdd_err("fail to get peer info from fw");
@@ -5870,7 +5875,7 @@ bool hdd_report_max_rate(struct hdd_adapter *adapter,
 			max_mcs_idx = (max_mcs_idx > mcs_index) ?
 				max_mcs_idx : mcs_index;
 		} else {
-			mcs_len = ucfg_mlme_get_mcs_rate(adapter->vdev,
+			mcs_len = ucfg_mlme_get_mcs_rate(adapter->deflink->vdev,
 							 mcs_rates,
 							 sizeof(mcs_rates));
 			if (!mcs_len) {
@@ -5993,7 +5998,8 @@ void hdd_wlan_fill_per_chain_rssi_stats(struct station_info *sinfo,
 			sinfo->signal_avg = sinfo->chain_signal_avg[i];
 
 		hdd_debug("RSSI for chain %d, vdev_id %d is %d",
-			  i, adapter->vdev_id, sinfo->chain_signal_avg[i]);
+			  i, adapter->deflink->vdev_id,
+			  sinfo->chain_signal_avg[i]);
 
 		if (!rssi_stats_valid && sinfo->chain_signal_avg[i])
 			rssi_stats_valid = true;
@@ -6245,7 +6251,7 @@ static int wlan_hdd_get_sta_stats(struct wiphy *wiphy,
 
 	qdf_mtrace(QDF_MODULE_ID_HDD, QDF_MODULE_ID_HDD,
 		   TRACE_CODE_HDD_CFG80211_GET_STA,
-		   adapter->vdev_id, 0);
+		   adapter->deflink->vdev_id, 0);
 
 	if (!hdd_cm_is_vdev_associated(adapter)) {
 		hdd_debug("Not associated");
@@ -6449,7 +6455,7 @@ static int wlan_hdd_get_sta_stats(struct wiphy *wiphy,
 
 	wlan_hdd_fill_summary_stats(&adapter->hdd_stats.summary_stat,
 				    sinfo,
-				    adapter->vdev_id);
+				    adapter->deflink->vdev_id);
 
 	ucfg_dp_get_net_dev_stats(vdev, &stats);
 	sinfo->tx_bytes = stats.tx_bytes;
@@ -6551,7 +6557,7 @@ static int __wlan_hdd_cfg80211_get_station(struct wiphy *wiphy,
 	if (wlan_hdd_validate_context(hdd_ctx))
 		return -EINVAL;
 
-	if (wlan_hdd_validate_vdev_id(adapter->vdev_id))
+	if (wlan_hdd_validate_vdev_id(adapter->deflink->vdev_id))
 		return -EINVAL;
 	if (!mac) {
 		hdd_err("Received NULL mac address");
@@ -6708,7 +6714,7 @@ static int __wlan_hdd_cfg80211_dump_station(struct wiphy *wiphy,
 	if (wlan_hdd_validate_context(hdd_ctx))
 		return -EINVAL;
 
-	if (wlan_hdd_validate_vdev_id(adapter->vdev_id))
+	if (wlan_hdd_validate_vdev_id(adapter->deflink->vdev_id))
 		return -EINVAL;
 
 	if (adapter->device_mode == QDF_SAP_MODE ||
@@ -6884,7 +6890,7 @@ static bool wlan_hdd_update_survey_info(struct wiphy *wiphy,
 
 	hdd_ctx = WLAN_HDD_GET_CTX(adapter);
 	sme_get_operation_channel(hdd_ctx->mac_handle, &opfreq,
-				  adapter->vdev_id);
+				  adapter->deflink->vdev_id);
 
 	mutex_lock(&hdd_ctx->chan_info_lock);
 
@@ -7193,7 +7199,7 @@ int wlan_hdd_get_rcpi(struct hdd_adapter *adapter,
 	cookie = osif_request_cookie(request);
 
 	rcpi_req->mac_addr = mac_addr;
-	rcpi_req->session_id = adapter->vdev_id;
+	rcpi_req->session_id = adapter->deflink->vdev_id;
 	rcpi_req->measurement_type = measurement_type;
 	rcpi_req->rcpi_callback = wlan_hdd_get_rcpi_cb;
 	rcpi_req->rcpi_context = cookie;
@@ -7582,7 +7588,7 @@ void wlan_hdd_get_peer_rx_rate_stats(struct hdd_adapter *adapter)
 	peer_mac_addr = adapter->deflink->session.station.conn_info.bssid.bytes;
 
 	status = cdp_host_get_peer_stats(soc,
-					 adapter->vdev_id,
+					 adapter->deflink->vdev_id,
 					 peer_mac_addr,
 					 peer_stats);
 	if (QDF_IS_STATUS_ERROR(status)) {

+ 2 - 2
core/hdd/src/wlan_hdd_subnet_detect.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2015-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-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
@@ -151,7 +151,7 @@ static int __wlan_hdd_cfg80211_set_gateway_params(struct wiphy *wiphy,
 
 	req.max_retries = 3;
 	req.timeout = 100;   /* in milliseconds */
-	req.vdev_id = adapter->vdev_id;
+	req.vdev_id = adapter->deflink->vdev_id;
 
 	hdd_debug("Configuring gateway for session %d", req.vdev_id);
 	hdd_debug("mac:"QDF_MAC_ADDR_FMT", ipv4:%pI4 (type %d), ipv6:%pI6c (type %d)",

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

@@ -436,7 +436,7 @@ static ssize_t __show_beacon_reception_stats(struct net_device *net_dev,
 	cookie = osif_request_cookie(request);
 
 	status = sme_beacon_debug_stats_req(hdd_ctx->mac_handle,
-					    adapter->vdev_id,
+					    adapter->deflink->vdev_id,
 					   hdd_beacon_debugstats_cb,
 					   cookie);
 	if (QDF_IS_STATUS_ERROR(status)) {

+ 2 - 2
core/hdd/src/wlan_hdd_sysfs_bmiss.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021, 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
@@ -41,7 +41,7 @@ wlan_hdd_get_bmiss(struct hdd_adapter *adapter)
 	}
 	qdf_mem_copy(peer_mac, hdd_sta_ctx->conn_info.bssid.bytes,
 		     QDF_MAC_ADDR_SIZE);
-	return wlan_cfg80211_mc_bmiss_get_infra_cp_stats(adapter->vdev,
+	return wlan_cfg80211_mc_bmiss_get_infra_cp_stats(adapter->deflink->vdev,
 							 peer_mac, &errno);
 }
 

+ 3 - 3
core/hdd/src/wlan_hdd_sysfs_dcm.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 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 above
@@ -64,7 +64,7 @@ __wlan_hdd_sysfs_dcm_store(struct net_device *net_dev, char const *buf,
 
 	hdd_debug("dcm %d", value);
 
-	ret = wma_cli_set_command(adapter->vdev_id,
+	ret = wma_cli_set_command(adapter->deflink->vdev_id,
 				  wmi_vdev_param_he_dcm_enable,
 				  value, VDEV_CMD);
 	if (ret) {
@@ -112,7 +112,7 @@ __wlan_hdd_sysfs_dcm_show(struct net_device *net_dev, char *buf)
 	if (!wlan_hdd_validate_modules_state(hdd_ctx))
 		return -EINVAL;
 
-	value = wma_cli_get_command(adapter->vdev_id,
+	value = wma_cli_get_command(adapter->deflink->vdev_id,
 				    wmi_vdev_param_he_dcm_enable,
 				    VDEV_CMD);
 

+ 3 - 1
core/hdd/src/wlan_hdd_sysfs_dl_modes.c

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2011-2020 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
@@ -36,7 +37,8 @@ static int hdd_sysfs_set_dbg(struct hdd_adapter *adapter,
 	int errno;
 
 	hdd_debug("%s %d", id_string, value);
-	errno = wma_cli_set_command(adapter->vdev_id, id, value, DBG_CMD);
+	errno = wma_cli_set_command(adapter->deflink->vdev_id,
+				    id, value, DBG_CMD);
 	if (errno)
 		hdd_err("Failed to set firmware, errno %d", errno);
 

+ 3 - 3
core/hdd/src/wlan_hdd_sysfs_dp_traffic_end_indication.c

@@ -1,5 +1,5 @@
 /*
- * 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 above
@@ -59,7 +59,7 @@ __hdd_sysfs_dp_traffic_end_indication_show(struct net_device *net_dev,
 		return -EINVAL;
 
 	hdd_debug("vdev_id:%u traffic end indication:%u defdscp:%u spldscp:%u",
-		  adapter->vdev_id, info.enabled,
+		  adapter->deflink->vdev_id, info.enabled,
 		  info.def_dscp, info.spl_dscp);
 
 	ret = scnprintf(buf, PAGE_SIZE, "%u %u %u\n",
@@ -159,7 +159,7 @@ __hdd_sysfs_dp_traffic_end_indication_store(struct net_device *net_dev,
 	}
 
 	hdd_debug("vdev_id:%u traffic end indication:%u defdscp:%u spldscp:%u",
-		  adapter->vdev_id, value, defdscp, spldscp);
+		  adapter->deflink->vdev_id, value, defdscp, spldscp);
 
 	ucfg_dp_traffic_end_indication_set(vdev, info);
 	wlan_objmgr_vdev_release_ref(vdev, WLAN_DP_ID);

+ 10 - 5
core/hdd/src/wlan_hdd_sysfs_dp_tx_delay_stats.c

@@ -1,5 +1,5 @@
 /*
- * 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 above
@@ -47,9 +47,11 @@ __hdd_sysfs_dp_tx_delay_stats_show(struct net_device *net_dev,
 	if (!wlan_hdd_validate_modules_state(adapter->hdd_ctx))
 		return -EINVAL;
 
-	value = cdp_vdev_is_tx_delay_stats_enabled(dp_soc, adapter->vdev_id);
+	value = cdp_vdev_is_tx_delay_stats_enabled(dp_soc,
+						   adapter->deflink->vdev_id);
 
-	hdd_debug("vdev_id: %d tx_delay_stats: %d", adapter->vdev_id, value);
+	hdd_debug("vdev_id: %d tx_delay_stats: %d",
+		  adapter->deflink->vdev_id, value);
 
 	return scnprintf(buf, PAGE_SIZE, "%d\n", value);
 }
@@ -109,9 +111,12 @@ __hdd_sysfs_dp_tx_delay_stats_store(struct net_device *net_dev, const char *buf,
 	if (kstrtou8(token, 0, &value))
 		return -EINVAL;
 
-	hdd_debug("vdev_id: %d tx_delay_stats: %d", adapter->vdev_id, value);
+	hdd_debug("vdev_id: %d tx_delay_stats: %d",
+		  adapter->deflink->vdev_id, value);
 
-	cdp_enable_disable_vdev_tx_delay_stats(dp_soc, adapter->vdev_id, value);
+	cdp_enable_disable_vdev_tx_delay_stats(dp_soc,
+					       adapter->deflink->vdev_id,
+					       value);
 
 	return count;
 }

+ 4 - 3
core/hdd/src/wlan_hdd_sysfs_gtx_bw_mask.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2011-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 above
@@ -36,7 +36,8 @@ static int hdd_sysfs_set_green_tx_param(struct hdd_adapter *adapter,
 	int errno;
 
 	hdd_debug("%s %d", id_string, value);
-	errno = wma_cli_set_command(adapter->vdev_id, id, value, GTX_CMD);
+	errno = wma_cli_set_command(adapter->deflink->vdev_id,
+				    id, value, GTX_CMD);
 	if (errno)
 		hdd_err("Failed to set firmware, errno %d", errno);
 
@@ -52,7 +53,7 @@ static int hdd_sysfs_get_green_tx_param(struct hdd_adapter *adapter,
 {
 	int value;
 
-	value = wma_cli_get_command(adapter->vdev_id, id, GTX_CMD);
+	value = wma_cli_get_command(adapter->deflink->vdev_id, id, GTX_CMD);
 
 	hdd_debug("%s %d", id_string, value);
 

+ 3 - 1
core/hdd/src/wlan_hdd_sysfs_he_bss_color.c

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2011-2020, 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
@@ -63,7 +64,8 @@ __hdd_sysfs_he_bss_color_store(struct net_device *net_dev,
 	if (kstrtou32(token, 0, &value))
 		return -EINVAL;
 
-	status = sme_set_he_bss_color(hdd_ctx->mac_handle, adapter->vdev_id,
+	status = sme_set_he_bss_color(hdd_ctx->mac_handle,
+				      adapter->deflink->vdev_id,
 				      value);
 	if (QDF_IS_STATUS_ERROR(status)) {
 		hdd_err_rl("Failed to set HE BSS color, status %d", status);

+ 5 - 5
core/hdd/src/wlan_hdd_sysfs_motion_detection.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2011-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 above
@@ -97,7 +97,7 @@ __hdd_sysfs_mt_bl_config_store(struct net_device *net_dev,
 	if (kstrtou32(token, 0, &bl_num_meas))
 		return -EINVAL;
 
-	motion_det_base_line_cfg.vdev_id = adapter->vdev_id;
+	motion_det_base_line_cfg.vdev_id = adapter->deflink->vdev_id;
 	motion_det_base_line_cfg.bl_time_t = bl_time_t;
 	motion_det_base_line_cfg.bl_packet_gap = bl_packet_gap;
 	motion_det_base_line_cfg.bl_n = bl_n;
@@ -182,7 +182,7 @@ __hdd_sysfs_mt_bl_start_store(struct net_device *net_dev,
 		return -EINVAL;
 	}
 
-	motion_det_base_line.vdev_id = adapter->vdev_id;
+	motion_det_base_line.vdev_id = adapter->deflink->vdev_id;
 	motion_det_base_line.enable = value;
 	status = sme_motion_det_base_line_enable(hdd_ctx->mac_handle,
 						 &motion_det_base_line);
@@ -266,7 +266,7 @@ __hdd_sysfs_mt_config_store(struct net_device *net_dev,
 		}
 	}
 
-	motion_det_cfg.vdev_id = adapter->vdev_id;
+	motion_det_cfg.vdev_id = adapter->deflink->vdev_id;
 	motion_det_cfg.time_t1 = val_32[0];
 	motion_det_cfg.time_t2 = val_32[1];
 	motion_det_cfg.n1 = val_32[2];
@@ -365,7 +365,7 @@ __hdd_sysfs_mt_start_store(struct net_device *net_dev,
 		return -EAGAIN;
 	}
 
-	motion_det.vdev_id = adapter->vdev_id;
+	motion_det.vdev_id = adapter->deflink->vdev_id;
 	motion_det.enable = value;
 
 	if (value) {

+ 3 - 3
core/hdd/src/wlan_hdd_sysfs_range_ext.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2011-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 above
@@ -47,7 +47,7 @@ __hdd_sysfs_range_ext_show(struct net_device *net_dev, char *buf)
 		return -EINVAL;
 
 	hdd_debug("GET wmi_vdev_param_he_range_ext");
-	value = wma_cli_get_command(adapter->vdev_id,
+	value = wma_cli_get_command(adapter->deflink->vdev_id,
 				    wmi_vdev_param_he_range_ext, VDEV_CMD);
 
 	return scnprintf(buf, PAGE_SIZE, "%d\n", value);
@@ -114,7 +114,7 @@ static ssize_t __hdd_sysfs_range_ext_store(struct net_device *net_dev,
 		return -EINVAL;
 
 	hdd_debug("wmi_vdev_param_he_range_ext %d", value);
-	errno = wma_cli_set_command(adapter->vdev_id,
+	errno = wma_cli_set_command(adapter->deflink->vdev_id,
 				    wmi_vdev_param_he_range_ext,
 				    value, VDEV_CMD);
 	if (errno)

+ 4 - 3
core/hdd/src/wlan_hdd_sysfs_reassoc.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
@@ -50,11 +51,11 @@ __wlan_hdd_store_reassoc_sysfs(struct net_device *net_dev, char const *buf,
 		return -EINVAL;
 
 	mac_handle = hdd_ctx->mac_handle;
-	operating_ch = wlan_get_operation_chan_freq(adapter->vdev);
-	wlan_mlme_get_bssid_vdev_id(hdd_ctx->pdev, adapter->vdev_id,
+	operating_ch = wlan_get_operation_chan_freq(adapter->deflink->vdev);
+	wlan_mlme_get_bssid_vdev_id(hdd_ctx->pdev, adapter->deflink->vdev_id,
 				    &target_bssid);
 	hdd_debug("reassoc: net_devname %s", net_dev->name);
-	ucfg_wlan_cm_roam_invoke(hdd_ctx->pdev, adapter->vdev_id,
+	ucfg_wlan_cm_roam_invoke(hdd_ctx->pdev, adapter->deflink->vdev_id,
 				 &target_bssid, operating_ch, CM_ROAMING_HOST);
 
 	return count;

+ 2 - 2
core/hdd/src/wlan_hdd_sysfs_rts_cts.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 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 above
@@ -87,7 +87,7 @@ __hdd_sysfs_rts_cts_store(struct net_device *net_dev,
 		return -EINVAL;
 	}
 
-	ret = wma_cli_set_command(adapter->vdev_id,
+	ret = wma_cli_set_command(adapter->deflink->vdev_id,
 				  wmi_vdev_param_enable_rtscts,
 				  value, VDEV_CMD);
 	if (ret) {

+ 3 - 2
core/hdd/src/wlan_hdd_sysfs_stats.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2011-2021, The Linux Foundation. All rights reserved.
- * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-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
@@ -144,7 +144,8 @@ static void hdd_sysfs_get_stats(struct hdd_adapter *adapter, ssize_t *length,
 		stats->txflow_unpause_cnt);
 
 	len += cdp_stats(cds_get_context(QDF_MODULE_ID_SOC),
-			 adapter->vdev_id, &buffer[len], (buf_len - len));
+			 adapter->deflink->vdev_id, &buffer[len],
+			 (buf_len - len));
 	*length = len + 1;
 	qdf_mem_free(dp_stats);
 }

+ 2 - 1
core/hdd/src/wlan_hdd_sysfs_tx_stbc.c

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2011-2020 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
@@ -32,7 +33,7 @@ static int hdd_sysfs_get_tx_stbc(struct hdd_adapter *adapter, int *value)
 	int ret;
 
 	hdd_enter();
-	ret = sme_get_ht_config(mac_handle, adapter->vdev_id,
+	ret = sme_get_ht_config(mac_handle, adapter->deflink->vdev_id,
 				WNI_CFG_HT_CAP_INFO_TX_STBC);
 	if (ret < 0) {
 		hdd_err("Failed to get TX STBC value");

+ 3 - 1
core/hdd/src/wlan_hdd_sysfs_txrx_fw_st_rst.c

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2011-2020 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
@@ -34,7 +35,8 @@ static int hdd_sysfs_set_vdev(struct hdd_adapter *adapter,
 	int errno;
 
 	hdd_debug("%s %d", id_string, value);
-	errno = wma_cli_set_command(adapter->vdev_id, id, value, VDEV_CMD);
+	errno = wma_cli_set_command(adapter->deflink->vdev_id,
+				    id, value, VDEV_CMD);
 	if (errno)
 		hdd_err("Failed to set firmware, errno %d", errno);
 

+ 3 - 1
core/hdd/src/wlan_hdd_sysfs_txrx_fw_stats.c

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2011-2020 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
@@ -34,7 +35,8 @@ static int hdd_sysfs_set_vdev(struct hdd_adapter *adapter,
 	int errno;
 
 	hdd_debug("%s %d", id_string, value);
-	errno = wma_cli_set_command(adapter->vdev_id, id, value, VDEV_CMD);
+	errno = wma_cli_set_command(adapter->deflink->vdev_id,
+				    id, value, VDEV_CMD);
 	if (errno)
 		hdd_err("Failed to set firmware, errno %d", errno);
 

+ 2 - 1
core/hdd/src/wlan_hdd_sysfs_txrx_stats.c

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2011-2020 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
@@ -99,7 +100,7 @@ __hdd_sysfs_txrx_stats_store(struct net_device *net_dev,
 				(char *)&sta_ctx->conn_info.bssid;
 		}
 	}
-	ret = cdp_txrx_stats_request(soc, adapter->vdev_id, &req);
+	ret = cdp_txrx_stats_request(soc, adapter->deflink->vdev_id, &req);
 
 	if (ret) {
 		hdd_err_rl("failed to set txrx stats: %d", ret);

+ 2 - 2
core/hdd/src/wlan_hdd_sysfs_unit_test.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2020-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021, 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
@@ -110,7 +110,7 @@ static ssize_t __hdd_sysfs_unit_test_target_store(
 	if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam())
 		vdev_id = 0;
 	else
-		vdev_id = adapter->vdev_id;
+		vdev_id = adapter->deflink->vdev_id;
 
 	status = sme_send_unit_test_cmd(vdev_id,
 					module_id,

+ 5 - 5
core/hdd/src/wlan_hdd_tdls.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2012-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
@@ -479,12 +479,12 @@ static int __wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy,
 		return -EINVAL;
 	}
 
-	if (wlan_hdd_validate_vdev_id(adapter->vdev_id))
+	if (wlan_hdd_validate_vdev_id(adapter->deflink->vdev_id))
 		return -EINVAL;
 
 	qdf_mtrace(QDF_MODULE_ID_HDD, QDF_MODULE_ID_HDD,
 		   TRACE_CODE_HDD_CFG80211_TDLS_MGMT,
-		   adapter->vdev_id, action_code);
+		   adapter->deflink->vdev_id, action_code);
 
 	if (wlan_hdd_validate_context(hdd_ctx))
 		return -EINVAL;
@@ -742,7 +742,7 @@ static int __wlan_hdd_cfg80211_tdls_oper(struct wiphy *wiphy,
 		return -EINVAL;
 	}
 
-	if (wlan_hdd_validate_vdev_id(adapter->vdev_id))
+	if (wlan_hdd_validate_vdev_id(adapter->deflink->vdev_id))
 		return -EINVAL;
 
 	cfg_tdls_get_support_enable(hdd_ctx->psoc, &tdls_support);
@@ -754,7 +754,7 @@ static int __wlan_hdd_cfg80211_tdls_oper(struct wiphy *wiphy,
 
 	qdf_mtrace(QDF_MODULE_ID_HDD, QDF_MODULE_ID_HDD,
 		   TRACE_CODE_HDD_CFG80211_TDLS_OPER,
-		   adapter->vdev_id, oper);
+		   adapter->deflink->vdev_id, oper);
 
 	if (!peer) {
 		hdd_err("Invalid arguments");

+ 19 - 16
core/hdd/src/wlan_hdd_tsf.c

@@ -209,9 +209,9 @@ static int hdd_tsf_reset_gpio(struct hdd_adapter *adapter)
 {
 	int ret;
 
-	ret = wma_cli_set_command((int)adapter->vdev_id,
+	ret = wma_cli_set_command((int)adapter->deflink->vdev_id,
 				  (int)GEN_PARAM_RESET_TSF_GPIO,
-				  adapter->vdev_id,
+				  adapter->deflink->vdev_id,
 				  GEN_CMD);
 
 	if (ret != 0) {
@@ -430,9 +430,9 @@ void hdd_tsf_ext_gpio_sync_work(void *data)
 	usleep_range(50, 100);
 	gpio_set_value(tsf_sync_gpio_pin, OUTPUT_LOW);
 
-	status = wma_cli_set_command((int)adapter->vdev_id,
+	status = wma_cli_set_command((int)adapter->deflink->vdev_id,
 				     (int)GEN_PARAM_CAPTURE_TSF,
-				     adapter->vdev_id, GEN_CMD);
+				     adapter->deflink->vdev_id, GEN_CMD);
 	if (status != QDF_STATUS_SUCCESS) {
 		hdd_err("cap tsf fail");
 		qdf_mc_timer_stop(&adapter->tsf.host_capture_req_timer);
@@ -549,9 +549,9 @@ hdd_capture_tsf_internal_via_wmi(struct hdd_adapter *adapter, uint32_t *buf,
 	int ret;
 	struct hdd_context *hddctx = adapter->hdd_ctx;
 
-	ret = wma_cli_set_command((int)adapter->vdev_id,
+	ret = wma_cli_set_command((int)adapter->deflink->vdev_id,
 				  (int)GEN_PARAM_CAPTURE_TSF,
-				  adapter->vdev_id, GEN_CMD);
+				  adapter->deflink->vdev_id, GEN_CMD);
 	if (ret != QDF_STATUS_SUCCESS) {
 		hdd_err("cap tsf fail");
 		buf[0] = TSF_CAPTURE_FAIL;
@@ -591,7 +591,7 @@ wlan_hdd_tsf_reg_update_details(struct hdd_adapter *adapter, struct stsf *ptsf)
 		qdf_atomic_set(&adapter->tsf.tsf_details_valid, 1);
 	}
 	hdd_info("vdev_id %u tsf_id %u tsf_id_valid %u mac_id %u",
-		 adapter->vdev_id, ptsf->tsf_id, ptsf->tsf_id_valid,
+		 adapter->deflink->vdev_id, ptsf->tsf_id, ptsf->tsf_id_valid,
 		 ptsf->mac_id);
 }
 
@@ -666,7 +666,8 @@ wlan_hdd_tsf_reg_process_report(struct hdd_adapter *adapter,
 
 	qdf_event_set(&tsf_sync_get_completion_evt);
 	hdd_update_tsf(adapter, tsf->cur_target_time);
-	hdd_info("vdev id=%u, tsf=%llu", adapter->vdev_id, tsf_report->tsf);
+	hdd_info("vdev id=%u, tsf=%llu", adapter->deflink->vdev_id,
+		 tsf_report->tsf);
 	return HDD_TSF_OP_SUCC;
 }
 
@@ -682,7 +683,7 @@ hdd_capture_tsf_internal_via_reg(struct hdd_adapter *adapter, uint32_t *buf,
 	}
 
 	qdf_mem_zero(&tsf_report, sizeof(tsf_report));
-	tsf_report.vdev_id = adapter->vdev_id;
+	tsf_report.vdev_id = adapter->deflink->vdev_id;
 	tsf_report.tsf_id = adapter->tsf.tsf_id;
 	tsf_report.mac_id = adapter->tsf.tsf_mac_id;
 
@@ -3024,14 +3025,15 @@ static int hdd_set_tsf_auto_report(struct hdd_adapter *adapter, bool ena)
 	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 	int ret;
 
-	if (QDF_IS_STATUS_ERROR(cdp_set_tsf_ul_delay_report(soc,
-							    adapter->vdev_id,
-							    ena))) {
+	if (QDF_IS_STATUS_ERROR(cdp_set_tsf_ul_delay_report(
+						soc,
+						adapter->deflink->vdev_id,
+						ena))) {
 		hdd_err_rl("Set tsf report uplink delay failed");
 		return -EPERM;
 	}
 
-	ret = wma_cli_set_command((int)adapter->vdev_id,
+	ret = wma_cli_set_command((int)adapter->deflink->vdev_id,
 				  ena ? (int)GEN_PARAM_TSF_AUTO_REPORT_ENABLE :
 				  (int)GEN_PARAM_TSF_AUTO_REPORT_DISABLE,
 				  ena, GEN_CMD);
@@ -3097,7 +3099,7 @@ static QDF_STATUS hdd_set_delta_tsf(struct hdd_adapter *adapter,
 	 */
 	if (!qdf_atomic_read(&adapter->tsf.tsf_auto_report)) {
 		hdd_debug_rl("adapter %u tsf_auto_report disabled",
-			     adapter->vdev_id);
+			     adapter->deflink->vdev_id);
 		goto exit_with_success;
 	}
 
@@ -3108,7 +3110,7 @@ static QDF_STATUS hdd_set_delta_tsf(struct hdd_adapter *adapter,
 	/* Pass delta_tsf to DP layer to report uplink delay
 	 * on a per vdev basis
 	 */
-	cdp_set_delta_tsf(soc, adapter->vdev_id, delta_tsf);
+	cdp_set_delta_tsf(soc, adapter->deflink->vdev_id, delta_tsf);
 
 exit_with_success:
 	return QDF_STATUS_SUCCESS;
@@ -3133,7 +3135,8 @@ QDF_STATUS hdd_add_uplink_delay(struct hdd_adapter *adapter,
 		return QDF_STATUS_SUCCESS;
 
 	if (qdf_atomic_read(&adapter->tsf.tsf_auto_report)) {
-		status = cdp_get_uplink_delay(soc, adapter->vdev_id, &ul_delay);
+		status = cdp_get_uplink_delay(soc, adapter->deflink->vdev_id,
+					      &ul_delay);
 		if (QDF_IS_STATUS_ERROR(status))
 			ul_delay = 0;
 	} else {

+ 24 - 23
core/hdd/src/wlan_hdd_twt.c

@@ -603,13 +603,13 @@ int hdd_test_config_twt_setup_session(struct hdd_adapter *adapter,
 	hdd_sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter);
 	if (!hdd_cm_is_vdev_associated(adapter)) {
 		hdd_err_rl("Invalid state, vdev %d mode %d",
-			   adapter->vdev_id, adapter->device_mode);
+			   adapter->deflink->vdev_id, adapter->device_mode);
 		return -EINVAL;
 	}
 
 	qdf_mem_copy(params.peer_macaddr, hdd_sta_ctx->conn_info.bssid.bytes,
 		     QDF_MAC_ADDR_SIZE);
-	params.vdev_id = adapter->vdev_id;
+	params.vdev_id = adapter->deflink->vdev_id;
 
 	cmd_id = QCA_WLAN_VENDOR_ATTR_WIFI_TEST_CONFIG_TWT_SETUP;
 	nla_for_each_nested(twt_session, tb[cmd_id], tmp) {
@@ -670,14 +670,14 @@ int hdd_test_config_twt_terminate_session(struct hdd_adapter *adapter,
 	hdd_sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter);
 	if (!hdd_cm_is_vdev_associated(adapter)) {
 		hdd_err_rl("Invalid state, vdev %d mode %d",
-			   adapter->vdev_id, adapter->device_mode);
+			   adapter->deflink->vdev_id, adapter->device_mode);
 		return -EINVAL;
 	}
 
 	qdf_mem_copy(params.peer_macaddr,
 		     hdd_sta_ctx->conn_info.bssid.bytes,
 		     QDF_MAC_ADDR_SIZE);
-	params.vdev_id = adapter->vdev_id;
+	params.vdev_id = adapter->deflink->vdev_id;
 	params.dialog_id = 0;
 	hdd_debug("twt_terminate: vdev_id %d", params.vdev_id);
 
@@ -1019,7 +1019,7 @@ static int hdd_is_twt_command_allowed(struct hdd_adapter *adapter)
 
 	if (!hdd_cm_is_vdev_associated(adapter)) {
 		hdd_err_rl("Invalid state, vdev %d mode %d",
-			   adapter->vdev_id, adapter->device_mode);
+			   adapter->deflink->vdev_id, adapter->device_mode);
 		return -EAGAIN;
 	}
 
@@ -1118,7 +1118,7 @@ static int hdd_sap_twt_get_session_params(struct hdd_adapter *adapter,
 	if (!params)
 		return -ENOMEM;
 
-	params[0].vdev_id = adapter->vdev_id;
+	params[0].vdev_id = adapter->deflink->vdev_id;
 	id = QCA_WLAN_VENDOR_ATTR_TWT_SETUP_FLOW_ID;
 	id1 = QCA_WLAN_VENDOR_ATTR_TWT_SETUP_MAC_ADDR;
 
@@ -1188,7 +1188,7 @@ static int hdd_sta_twt_get_session_params(struct hdd_adapter *adapter,
 	if (ret)
 		return ret;
 
-	params[0].vdev_id = adapter->vdev_id;
+	params[0].vdev_id = adapter->deflink->vdev_id;
 	/*
 	 * Currently twt_get_params nl cmd is sending only dialog_id(STA), fill
 	 * mac_addr of STA in params and call hdd_twt_get_peer_session_params.
@@ -1218,7 +1218,7 @@ static int hdd_sta_twt_get_session_params(struct hdd_adapter *adapter,
 					 &hdd_sta_ctx->conn_info.bssid,
 					 params[0].dialog_id)) {
 		hdd_debug("vdev%d: TWT session %d setup incomplete",
-			  adapter->vdev_id, params[0].dialog_id);
+			  adapter->deflink->vdev_id, params[0].dialog_id);
 		qdf_status = hdd_send_inactive_session_reply(adapter, params);
 
 		return qdf_status_to_os_return(qdf_status);
@@ -2068,7 +2068,7 @@ static int hdd_twt_setup_session(struct hdd_adapter *adapter,
 	if (ret)
 		return ret;
 
-	if (hdd_twt_setup_conc_allowed(hdd_ctx, adapter->vdev_id)) {
+	if (hdd_twt_setup_conc_allowed(hdd_ctx, adapter->deflink->vdev_id)) {
 		hdd_err_rl("TWT setup reject: SCC or MCC concurrency exists");
 		return -EAGAIN;
 	}
@@ -2076,7 +2076,7 @@ static int hdd_twt_setup_session(struct hdd_adapter *adapter,
 	qdf_mem_copy(params.peer_macaddr,
 		     hdd_sta_ctx->conn_info.bssid.bytes,
 		     QDF_MAC_ADDR_SIZE);
-	params.vdev_id = adapter->vdev_id;
+	params.vdev_id = adapter->deflink->vdev_id;
 
 	ret = wlan_cfg80211_nla_parse_nested(tb2,
 					     QCA_WLAN_VENDOR_ATTR_TWT_SETUP_MAX,
@@ -2172,7 +2172,7 @@ static int hdd_twt_add_ac_config(struct hdd_adapter *adapter,
 	ucfg_mlme_get_twt_responder(hdd_ctx->psoc, &is_responder_en);
 
 	if (adapter->device_mode == QDF_SAP_MODE && is_responder_en) {
-		ret = sme_cli_set_command(adapter->vdev_id,
+		ret = sme_cli_set_command(adapter->deflink->vdev_id,
 					  wmi_pdev_param_twt_ac_config,
 					  twt_ac_param, PDEV_CMD);
 	} else {
@@ -2394,7 +2394,7 @@ hdd_send_twt_del_all_sessions_to_userspace(struct hdd_adapter *adapter)
 	hdd_sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter);
 	if (!hdd_cm_is_vdev_associated(adapter)) {
 		hdd_debug("Not associated, vdev %d mode %d",
-			   adapter->vdev_id, adapter->device_mode);
+			   adapter->deflink->vdev_id, adapter->device_mode);
 		return;
 	}
 
@@ -2402,12 +2402,13 @@ hdd_send_twt_del_all_sessions_to_userspace(struct hdd_adapter *adapter)
 					 &hdd_sta_ctx->conn_info.bssid,
 					 TWT_ALL_SESSIONS_DIALOG_ID)) {
 		hdd_debug("No active TWT sessions, vdev_id: %d dialog_id: %d",
-			  adapter->vdev_id, TWT_ALL_SESSIONS_DIALOG_ID);
+			  adapter->deflink->vdev_id,
+			  TWT_ALL_SESSIONS_DIALOG_ID);
 		return;
 	}
 
 	qdf_mem_zero(&params, sizeof(params));
-	params.vdev_id = adapter->vdev_id;
+	params.vdev_id = adapter->deflink->vdev_id;
 	params.dialog_id = TWT_ALL_SESSIONS_DIALOG_ID;
 	params.status = WMI_HOST_DEL_TWT_STATUS_UNKNOWN_ERROR;
 	qdf_mem_copy(params.peer_macaddr, hdd_sta_ctx->conn_info.bssid.bytes,
@@ -2544,7 +2545,7 @@ static int hdd_sap_twt_terminate_session(struct hdd_adapter *adapter,
 	bool is_associated;
 	struct qdf_mac_addr mac_addr;
 
-	params.vdev_id = adapter->vdev_id;
+	params.vdev_id = adapter->deflink->vdev_id;
 
 	ret = wlan_cfg80211_nla_parse_nested(tb,
 					     QCA_WLAN_VENDOR_ATTR_TWT_SETUP_MAX,
@@ -2624,7 +2625,7 @@ static int hdd_sta_twt_terminate_session(struct hdd_adapter *adapter,
 	hdd_sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter);
 	if (!hdd_cm_is_vdev_associated(adapter)) {
 		hdd_err_rl("Invalid state, vdev %d mode %d",
-			   adapter->vdev_id, adapter->device_mode);
+			   adapter->deflink->vdev_id, adapter->device_mode);
 
 		/*
 		 * Return success, since STA is not associated and there is
@@ -2644,7 +2645,7 @@ static int hdd_sta_twt_terminate_session(struct hdd_adapter *adapter,
 	qdf_mem_copy(params.peer_macaddr,
 		     hdd_sta_ctx->conn_info.bssid.bytes,
 		     QDF_MAC_ADDR_SIZE);
-	params.vdev_id = adapter->vdev_id;
+	params.vdev_id = adapter->deflink->vdev_id;
 
 	ret = wlan_cfg80211_nla_parse_nested(tb,
 					     QCA_WLAN_VENDOR_ATTR_TWT_SETUP_MAX,
@@ -3075,7 +3076,7 @@ static int hdd_twt_pause_session(struct hdd_adapter *adapter,
 
 	qdf_mem_copy(params.peer_macaddr, hdd_sta_ctx->conn_info.bssid.bytes,
 		     QDF_MAC_ADDR_SIZE);
-	params.vdev_id = adapter->vdev_id;
+	params.vdev_id = adapter->deflink->vdev_id;
 	params.dialog_id = 0;
 
 	if (twt_param_attr) {
@@ -3240,7 +3241,7 @@ static int hdd_twt_nudge_session(struct hdd_adapter *adapter,
 		return -EOPNOTSUPP;
 	}
 
-	params.vdev_id = adapter->vdev_id;
+	params.vdev_id = adapter->deflink->vdev_id;
 
 	ret = wlan_cfg80211_nla_parse_nested(tb,
 				      QCA_WLAN_VENDOR_ATTR_TWT_NUDGE_MAX,
@@ -3631,7 +3632,7 @@ static int hdd_twt_get_capabilities(struct hdd_adapter *adapter,
 
 	if (!hdd_cm_is_vdev_associated(adapter)) {
 		hdd_err_rl("vdev %d not in connected state, mode %d",
-			   adapter->vdev_id, adapter->device_mode);
+			   adapter->deflink->vdev_id, adapter->device_mode);
 		return -EAGAIN;
 	}
 
@@ -3672,7 +3673,7 @@ static int hdd_twt_resume_session(struct hdd_adapter *adapter,
 
 	qdf_mem_copy(params.peer_macaddr, hdd_sta_ctx->conn_info.bssid.bytes,
 		     QDF_MAC_ADDR_SIZE);
-	params.vdev_id = adapter->vdev_id;
+	params.vdev_id = adapter->deflink->vdev_id;
 
 	ret = wlan_cfg80211_nla_parse_nested(tb,
 					     QCA_WLAN_VENDOR_ATTR_TWT_RESUME_MAX,
@@ -3969,7 +3970,7 @@ static int hdd_twt_clear_session_traffic_stats(struct hdd_adapter *adapter,
 		return -EAGAIN;
 	}
 
-	ret = wlan_cfg80211_mc_twt_clear_infra_cp_stats(adapter->vdev,
+	ret = wlan_cfg80211_mc_twt_clear_infra_cp_stats(adapter->deflink->vdev,
 							dialog_id, peer_mac);
 
 	return ret;
@@ -3997,7 +3998,7 @@ hdd_twt_request_session_traffic_stats(struct hdd_adapter *adapter,
 	if (!adapter || !peer_mac)
 		return status;
 
-	event = wlan_cfg80211_mc_twt_get_infra_cp_stats(adapter->vdev,
+	event = wlan_cfg80211_mc_twt_get_infra_cp_stats(adapter->deflink->vdev,
 							dialog_id,
 							peer_mac,
 							&errno);

+ 3 - 3
core/hdd/src/wlan_hdd_tx_power.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2012-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
@@ -94,7 +94,7 @@ static int __wlan_hdd_cfg80211_txpower_scale(struct wiphy *wiphy,
 		return -EINVAL;
 	}
 
-	status = wma_set_tx_power_scale(adapter->vdev_id, scale_value);
+	status = wma_set_tx_power_scale(adapter->deflink->vdev_id, scale_value);
 
 	if (status != QDF_STATUS_SUCCESS) {
 		hdd_err("Set tx power scale failed");
@@ -180,7 +180,7 @@ __wlan_hdd_cfg80211_txpower_scale_decr_db(struct wiphy *wiphy,
 	scale_value = nla_get_u8(tb
 		    [QCA_WLAN_VENDOR_ATTR_TXPOWER_SCALE_DECR_DB]);
 
-	status = wma_set_tx_power_scale_decr_db(adapter->vdev_id,
+	status = wma_set_tx_power_scale_decr_db(adapter->deflink->vdev_id,
 						scale_value);
 
 	if (status != QDF_STATUS_SUCCESS) {

+ 15 - 15
core/hdd/src/wlan_hdd_tx_rx.c

@@ -195,7 +195,7 @@ void hdd_tx_resume_timer_expired_handler(void *adapter_context)
 					     WLAN_NETIF_PRIORITY_QUEUE_ON,
 					     WLAN_DATA_FLOW_CONTROL_PRIORITY);
 		cdp_hl_fc_set_os_queue_status(soc,
-					      adapter->vdev_id,
+					      adapter->deflink->vdev_id,
 					      WLAN_NETIF_PRIORITY_QUEUE_ON);
 	}
 	if (np_qpaused) {
@@ -203,7 +203,7 @@ void hdd_tx_resume_timer_expired_handler(void *adapter_context)
 					     WLAN_WAKE_NON_PRIORITY_QUEUE,
 					     WLAN_DATA_FLOW_CONTROL);
 		cdp_hl_fc_set_os_queue_status(soc,
-					      adapter->vdev_id,
+					      adapter->deflink->vdev_id,
 					      WLAN_WAKE_NON_PRIORITY_QUEUE);
 	}
 }
@@ -335,7 +335,7 @@ void hdd_register_tx_flow_control(struct hdd_adapter *adapter,
 		adapter->tx_flow_timer_initialized = true;
 	}
 	cdp_fc_register(cds_get_context(QDF_MODULE_ID_SOC),
-		adapter->vdev_id, flow_control_fp, adapter,
+		adapter->deflink->vdev_id, flow_control_fp, adapter,
 		flow_control_is_pause_fp);
 }
 
@@ -348,7 +348,7 @@ void hdd_register_tx_flow_control(struct hdd_adapter *adapter,
 void hdd_deregister_tx_flow_control(struct hdd_adapter *adapter)
 {
 	cdp_fc_deregister(cds_get_context(QDF_MODULE_ID_SOC),
-			adapter->vdev_id);
+			adapter->deflink->vdev_id);
 	if (adapter->tx_flow_timer_initialized == true) {
 		qdf_mc_timer_stop(&adapter->tx_flow_control_timer);
 		qdf_mc_timer_destroy(&adapter->tx_flow_control_timer);
@@ -593,13 +593,13 @@ static void __hdd_hard_start_xmit(struct sk_buff *skb,
 	}
 
 	/*
-	 * adapter->vdev is directly dereferenced because this is per packet
-	 * path, hdd_get_vdev_by_user() usage will be very costly as it
-	 * involves lock access.
+	 * vdev in link_info is directly dereferenced because this is per
+	 * packet path, hdd_get_vdev_by_user() usage will be very costly
+	 * as it involves lock access.
 	 * Expectation here is vdev will be present during TX/RX processing
 	 * and also DP internally maintaining vdev ref count
 	 */
-	status = ucfg_dp_start_xmit((qdf_nbuf_t)skb, adapter->vdev);
+	status = ucfg_dp_start_xmit((qdf_nbuf_t)skb, adapter->deflink->vdev);
 	if (QDF_IS_STATUS_SUCCESS(status)) {
 		netif_trans_update(dev);
 		wlan_hdd_sar_unsolicited_timer_start(adapter->hdd_ctx);
@@ -1058,7 +1058,7 @@ void wlan_hdd_netif_queue_control(struct hdd_adapter *adapter,
 		return;
 
 	hdd_debug("netif_control's vdev_id: %d, action: %d, reason: %d",
-		  adapter->vdev_id, action, reason);
+		  adapter->deflink->vdev_id, action, reason);
 
 	switch (action) {
 
@@ -1341,7 +1341,7 @@ int hdd_set_mon_rx_cb(struct net_device *dev)
 
 	qdf_status = sme_create_mon_session(hdd_ctx->mac_handle,
 					    adapter->mac_addr.bytes,
-					    adapter->vdev_id);
+					    adapter->deflink->vdev_id);
 	if (QDF_STATUS_SUCCESS != qdf_status) {
 		hdd_err("sme_create_mon_session() failed to register. Status= %d [0x%08X]",
 			qdf_status, qdf_status);
@@ -1515,7 +1515,7 @@ static void hdd_set_tx_flow_info(struct hdd_adapter *adapter,
 		adapter->tx_flow_hi_watermark_offset =
 			hdd_ctx->config->tx_flow_hi_watermark_offset;
 		cdp_fc_ll_set_tx_pause_q_depth(soc,
-				adapter->vdev_id,
+				adapter->deflink->vdev_id,
 				hdd_ctx->config->tx_flow_max_queue_depth);
 		hdd_debug("MODE %d,CH %d,LWM %d,HWM %d,TXQDEP %d",
 			  adapter->device_mode,
@@ -1539,7 +1539,7 @@ static void hdd_set_tx_flow_info(struct hdd_adapter *adapter,
 			adapter->tx_flow_low_watermark = 0;
 			adapter->tx_flow_hi_watermark_offset = 0;
 			cdp_fc_ll_set_tx_pause_q_depth(soc,
-				adapter->vdev_id,
+				adapter->deflink->vdev_id,
 				hdd_ctx->config->tx_hbw_flow_max_queue_depth);
 			hdd_debug("SCC: MODE %s(%d), CH %d, LWM %d, HWM %d, TXQDEP %d",
 			          qdf_opmode_str(adapter->device_mode),
@@ -1560,7 +1560,7 @@ static void hdd_set_tx_flow_info(struct hdd_adapter *adapter,
 			(*pre_adp_ctx)->tx_flow_low_watermark = 0;
 			(*pre_adp_ctx)->tx_flow_hi_watermark_offset = 0;
 			cdp_fc_ll_set_tx_pause_q_depth(soc,
-				(*pre_adp_ctx)->vdev_id,
+				(*pre_adp_ctx)->deflink->vdev_id,
 				hdd_ctx->config->tx_hbw_flow_max_queue_depth);
 			hdd_debug("SCC: MODE %s(%d), CH %d, LWM %d, HWM %d, TXQDEP %d",
 				  qdf_opmode_str((*pre_adp_ctx)->device_mode),
@@ -1600,7 +1600,7 @@ static void hdd_set_tx_flow_info(struct hdd_adapter *adapter,
 			adapter5->tx_flow_hi_watermark_offset =
 				hdd_ctx->config->tx_hbw_flow_hi_watermark_offset;
 			cdp_fc_ll_set_tx_pause_q_depth(soc,
-				adapter5->vdev_id,
+				adapter5->deflink->vdev_id,
 				hdd_ctx->config->tx_hbw_flow_max_queue_depth);
 			hdd_debug("MCC: MODE %s(%d), CH %d, LWM %d, HWM %d, TXQDEP %d",
 				  qdf_opmode_str(adapter5->device_mode),
@@ -1621,7 +1621,7 @@ static void hdd_set_tx_flow_info(struct hdd_adapter *adapter,
 			adapter2_4->tx_flow_hi_watermark_offset =
 				hdd_ctx->config->tx_lbw_flow_hi_watermark_offset;
 			cdp_fc_ll_set_tx_pause_q_depth(soc,
-				adapter2_4->vdev_id,
+				adapter2_4->deflink->vdev_id,
 				hdd_ctx->config->tx_lbw_flow_max_queue_depth);
 			hdd_debug("MCC: MODE %s(%d), CH %d, LWM %d, HWM %d, TXQDEP %d",
 				  qdf_opmode_str(adapter2_4->device_mode),

+ 2 - 2
core/hdd/src/wlan_hdd_wds.c

@@ -1,5 +1,5 @@
 /*
- * 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
@@ -65,7 +65,7 @@ hdd_wds_replace_peer_mac(void *soc, struct hdd_adapter *adapter,
 	QDF_STATUS status;
 
 	if (!cdp_find_peer_exist(soc, OL_TXRX_PDEV_ID, mac_addr)) {
-		status = cdp_txrx_get_vdev_param(soc, adapter->vdev_id,
+		status = cdp_txrx_get_vdev_param(soc, adapter->deflink->vdev_id,
 						 CDP_ENABLE_WDS, &val);
 		if (!QDF_IS_STATUS_SUCCESS(status))
 			return;

+ 115 - 97
core/hdd/src/wlan_hdd_wext.c

@@ -2802,7 +2802,7 @@ void hdd_wlan_get_stats(struct hdd_adapter *adapter, uint16_t *length,
 		return;
 	}
 
-	if (ucfg_dp_get_txrx_stats(adapter->vdev, dp_stats)) {
+	if (ucfg_dp_get_txrx_stats(adapter->deflink->vdev, dp_stats)) {
 		hdd_objmgr_put_vdev_by_user(vdev, WLAN_DP_ID);
 		hdd_err("Unable to get stats from DP component");
 		qdf_mem_free(dp_stats);
@@ -2883,7 +2883,8 @@ void hdd_wlan_get_stats(struct hdd_adapter *adapter, uint16_t *length,
 		stats->txflow_unpause_cnt);
 
 	len += cdp_stats(cds_get_context(QDF_MODULE_ID_SOC),
-			 adapter->vdev_id, &buffer[len], (buf_len - len));
+			 adapter->deflink->vdev_id, &buffer[len],
+			 (buf_len - len));
 	*length = len + 1;
 	qdf_mem_free(dp_stats);
 }
@@ -3092,7 +3093,7 @@ static int wlan_get_wlm_stats(struct hdd_adapter *adapter, uint32_t bitmask,
 		return -ENOMEM;
 	}
 	cookie = osif_request_cookie(request);
-	errno = wma_wlm_stats_req(adapter->vdev_id, bitmask,
+	errno = wma_wlm_stats_req(adapter->deflink->vdev_id, bitmask,
 				  params.priv_size,
 				  wlan_get_wlm_stats_cb, cookie);
 	if (errno) {
@@ -3364,7 +3365,7 @@ static int hdd_handle_pdev_reset(struct hdd_adapter *adapter, int value)
 	if (ret)
 		return ret;
 
-	ret = wma_cli_set_command(adapter->vdev_id,
+	ret = wma_cli_set_command(adapter->deflink->vdev_id,
 				  wmi_pdev_param_pdev_reset,
 				  value, PDEV_CMD);
 
@@ -3412,21 +3413,23 @@ static int hdd_we_set_power(struct hdd_adapter *adapter, int value)
 	switch (value) {
 	case 1:
 		/* Enable PowerSave */
-		sme_ps_set_powersave(hdd_ctx->mac_handle, adapter->vdev_id,
+		sme_ps_set_powersave(hdd_ctx->mac_handle,
+				     adapter->deflink->vdev_id,
 				     true, 0, true);
 		return 0;
 	case 2:
 		/* Disable PowerSave */
-		sme_ps_set_powersave(hdd_ctx->mac_handle, adapter->vdev_id,
+		sme_ps_set_powersave(hdd_ctx->mac_handle,
+				     adapter->deflink->vdev_id,
 				     false, 0, true);
 		return 0;
 	case 3:
 		/* Enable UASPD */
-		sme_ps_uapsd_enable(mac_handle, adapter->vdev_id);
+		sme_ps_uapsd_enable(mac_handle, adapter->deflink->vdev_id);
 		return 0;
 	case 4:
 		/* Disable UASPD */
-		sme_ps_uapsd_disable(mac_handle, adapter->vdev_id);
+		sme_ps_uapsd_disable(mac_handle, adapter->deflink->vdev_id);
 		return 0;
 	default:
 		hdd_err("Invalid value %d", value);
@@ -3483,7 +3486,7 @@ static int hdd_we_set_tx_power(struct hdd_adapter *adapter, int value)
 	if (!mac_handle)
 		return -EINVAL;
 
-	status = sme_set_tx_power(mac_handle, adapter->vdev_id,
+	status = sme_set_tx_power(mac_handle, adapter->deflink->vdev_id,
 				  sta_ctx->conn_info.bssid,
 				  adapter->device_mode, value);
 
@@ -3709,11 +3712,11 @@ int hdd_we_set_short_gi(struct hdd_adapter *adapter, int sgi)
 
 	if (sgi & HDD_AUTO_RATE_SGI)
 		errno = sme_set_auto_rate_he_sgi(mac_handle,
-						 adapter->vdev_id,
+						 adapter->deflink->vdev_id,
 						 sgi);
 	else
 		errno = sme_update_ht_config(mac_handle,
-					     adapter->vdev_id,
+					     adapter->deflink->vdev_id,
 					     WNI_CFG_HT_CAP_INFO_SHORT_GI_20MHZ,
 					     sgi);
 	if (errno)
@@ -3755,7 +3758,7 @@ static int hdd_we_set_rtscts(struct hdd_adapter *adapter, int rtscts)
 		return -EINVAL;
 	}
 
-	errno = wma_cli_set_command(adapter->vdev_id,
+	errno = wma_cli_set_command(adapter->deflink->vdev_id,
 				    wmi_vdev_param_enable_rtscts,
 				    rtscts, VDEV_CMD);
 	if (errno) {
@@ -3821,7 +3824,7 @@ static int hdd_we_set_11n_rate(struct hdd_adapter *adapter, int rate_code)
 	hdd_debug("wmi_vdev_param_fixed_rate val %d rix %d preamble %x nss %d",
 		  rate_code, rix, preamble, nss);
 
-	errno = wma_cli_set_command(adapter->vdev_id,
+	errno = wma_cli_set_command(adapter->deflink->vdev_id,
 				    wmi_vdev_param_fixed_rate,
 				    rate_code, VDEV_CMD);
 	if (errno)
@@ -3847,7 +3850,7 @@ static int hdd_we_set_vht_rate(struct hdd_adapter *adapter, int rate_code)
 	hdd_debug("wmi_vdev_param_fixed_rate val %d rix %d preamble %x nss %d",
 		  rate_code, rix, preamble, nss);
 
-	errno = wma_cli_set_command(adapter->vdev_id,
+	errno = wma_cli_set_command(adapter->deflink->vdev_id,
 				    wmi_vdev_param_fixed_rate,
 				    rate_code, VDEV_CMD);
 	if (errno)
@@ -3860,7 +3863,7 @@ static int hdd_we_set_ampdu(struct hdd_adapter *adapter, int ampdu)
 {
 	hdd_debug("AMPDU %d", ampdu);
 
-	return wma_cli_set_command(adapter->vdev_id,
+	return wma_cli_set_command(adapter->deflink->vdev_id,
 				   GEN_VDEV_PARAM_AMPDU,
 				   ampdu, GEN_CMD);
 }
@@ -3891,7 +3894,7 @@ static int hdd_we_set_amsdu(struct hdd_adapter *adapter, int amsdu)
 	else
 		sme_set_amsdu(mac_handle, false);
 
-	errno = wma_cli_set_command(adapter->vdev_id,
+	errno = wma_cli_set_command(adapter->deflink->vdev_id,
 				    GEN_VDEV_PARAM_AMSDU,
 				    amsdu, GEN_CMD);
 	if (errno) {
@@ -3915,7 +3918,8 @@ static int hdd_we_set_green_tx_param(struct hdd_adapter *adapter,
 	int errno;
 
 	hdd_debug("%s %d", id_string, value);
-	errno = wma_cli_set_command(adapter->vdev_id, id, value, GTX_CMD);
+	errno = wma_cli_set_command(adapter->deflink->vdev_id,
+				    id, value, GTX_CMD);
 	if (errno)
 		hdd_err("Failed to set firmware, errno %d", errno);
 
@@ -3994,7 +3998,8 @@ static int hdd_we_packet_power_save(struct hdd_adapter *adapter,
 	}
 
 	hdd_debug("%s %d", id_string, value);
-	errno = wma_cli_set_command(adapter->vdev_id, id, value, PPS_CMD);
+	errno = wma_cli_set_command(adapter->deflink->vdev_id,
+				    id, value, PPS_CMD);
 	if (errno)
 		hdd_err("Failed to set firmware, errno %d", errno);
 
@@ -4082,7 +4087,8 @@ static int hdd_we_set_qpower(struct hdd_adapter *adapter,
 	int errno;
 
 	hdd_debug("%s %d", id_string, value);
-	errno = wma_cli_set_command(adapter->vdev_id, id, value, QPOWER_CMD);
+	errno = wma_cli_set_command(adapter->deflink->vdev_id,
+				    id, value, QPOWER_CMD);
 	if (errno)
 		hdd_err("Failed to set firmware, errno %d", errno);
 
@@ -4138,7 +4144,8 @@ static int hdd_we_set_pdev(struct hdd_adapter *adapter,
 	int errno;
 
 	hdd_debug("%s %d", id_string, value);
-	errno = wma_cli_set_command(adapter->vdev_id, id, value, PDEV_CMD);
+	errno = wma_cli_set_command(adapter->deflink->vdev_id,
+				    id, value, PDEV_CMD);
 	if (errno)
 		hdd_err("Failed to set firmware, errno %d", errno);
 
@@ -4245,7 +4252,8 @@ static int hdd_we_set_vdev(struct hdd_adapter *adapter,
 	int errno;
 
 	hdd_debug("%s %d", id_string, value);
-	errno = wma_cli_set_command(adapter->vdev_id, id, value, VDEV_CMD);
+	errno = wma_cli_set_command(adapter->deflink->vdev_id,
+				    id, value, VDEV_CMD);
 	if (errno)
 		hdd_err("Failed to set firmware, errno %d", errno);
 
@@ -4374,7 +4382,7 @@ static int hdd_we_set_range_ext(struct hdd_adapter *adapter, int value)
 	}
 
 	status = wma_send_multi_pdev_vdev_set_params(MLME_VDEV_SETPARAM,
-						     adapter->vdev_id,
+						     adapter->deflink->vdev_id,
 						     setparam, index);
 	if (QDF_IS_STATUS_ERROR(status))
 		hdd_err("Failed to send vdev set params");
@@ -4391,7 +4399,8 @@ static int hdd_we_set_dbg(struct hdd_adapter *adapter,
 	int errno;
 
 	hdd_debug("%s %d", id_string, value);
-	errno = wma_cli_set_command(adapter->vdev_id, id, value, DBG_CMD);
+	errno = wma_cli_set_command(adapter->deflink->vdev_id,
+				    id, value, DBG_CMD);
 	if (errno)
 		hdd_err("Failed to set firmware, errno %d", errno);
 
@@ -4471,7 +4480,7 @@ static int hdd_we_set_channel(struct hdd_adapter *adapter, int channel)
 	QDF_STATUS status;
 
 	hdd_debug("Set Channel %d Session ID %d mode %d", channel,
-		  adapter->vdev_id, adapter->device_mode);
+		  adapter->deflink->vdev_id, adapter->device_mode);
 
 	if (!hdd_ctx->mac_handle)
 		return -EINVAL;
@@ -4489,7 +4498,7 @@ static int hdd_we_set_channel(struct hdd_adapter *adapter, int channel)
 	ch_freq = wlan_reg_legacy_chan_to_freq(hdd_ctx->pdev,
 					       channel);
 	status = sme_ext_change_freq(hdd_ctx->mac_handle, ch_freq,
-				     adapter->vdev_id);
+				     adapter->deflink->vdev_id);
 	if (status != QDF_STATUS_SUCCESS)
 		hdd_err("Error in change channel status %d", status);
 
@@ -4609,7 +4618,7 @@ static int hdd_we_motion_det_start_stop(struct hdd_adapter *adapter, int value)
 		return -EAGAIN;
 	}
 
-	motion_det.vdev_id = adapter->vdev_id;
+	motion_det.vdev_id = adapter->deflink->vdev_id;
 	motion_det.enable = value;
 
 	if (value) {
@@ -4650,7 +4659,7 @@ static int hdd_we_motion_det_base_line_start_stop(struct hdd_adapter *adapter,
 		return -EAGAIN;
 	}
 
-	motion_det_base_line.vdev_id = adapter->vdev_id;
+	motion_det_base_line.vdev_id = adapter->deflink->vdev_id;
 	motion_det_base_line.enable = value;
 	sme_motion_det_base_line_enable(hdd_ctx->mac_handle,
 					&motion_det_base_line);
@@ -4665,7 +4674,7 @@ int wlan_hdd_set_btcoex_mode(struct hdd_adapter *adapter, int value)
 
 	coex_cfg_params.config_type = WMI_COEX_CONFIG_BTC_MODE;
 	coex_cfg_params.config_arg1 = value;
-	coex_cfg_params.vdev_id     = adapter->vdev_id;
+	coex_cfg_params.vdev_id     = adapter->deflink->vdev_id;
 
 	if (value < cfg_min(CFG_BTC_MODE) || value > cfg_max(CFG_BTC_MODE)) {
 		hdd_err_rl("Invalid value %d", value);
@@ -4686,7 +4695,7 @@ int wlan_hdd_set_btcoex_rssi_threshold(struct hdd_adapter *adapter, int value)
 
 	coex_cfg_params.config_type =  WMI_COEX_CONFIG_BT_LOW_RSSI_THRESHOLD;
 	coex_cfg_params.config_arg1 = value;
-	coex_cfg_params.vdev_id     = adapter->vdev_id;
+	coex_cfg_params.vdev_id     = adapter->deflink->vdev_id;
 
 	if (value < cfg_min(CFG_WLAN_LOW_RSSI_THRESHOLD) ||
 	    value > cfg_max(CFG_WLAN_LOW_RSSI_THRESHOLD)) {
@@ -5077,7 +5086,7 @@ static int __iw_setchar_getnone(struct net_device *dev,
 			callback.timeout = 5000; /* 5 seconds */
 			sme_neighbor_report_request(
 					hdd_ctx->mac_handle,
-					adapter->vdev_id,
+					adapter->deflink->vdev_id,
 					&request,
 					&callback);
 		} else {
@@ -5227,7 +5236,7 @@ static int __iw_setnone_getint(struct net_device *dev,
 	case WE_GET_GTX_HT_MCS:
 	{
 		hdd_debug("GET wmi_vdev_param_gtx_ht_mcs");
-		*value = wma_cli_get_command(adapter->vdev_id,
+		*value = wma_cli_get_command(adapter->deflink->vdev_id,
 					     wmi_vdev_param_gtx_ht_mcs,
 					     GTX_CMD);
 		break;
@@ -5236,7 +5245,7 @@ static int __iw_setnone_getint(struct net_device *dev,
 	case WE_GET_GTX_VHT_MCS:
 	{
 		hdd_debug("GET wmi_vdev_param_gtx_vht_mcs");
-		*value = wma_cli_get_command(adapter->vdev_id,
+		*value = wma_cli_get_command(adapter->deflink->vdev_id,
 					     wmi_vdev_param_gtx_vht_mcs,
 					     GTX_CMD);
 		break;
@@ -5245,7 +5254,7 @@ static int __iw_setnone_getint(struct net_device *dev,
 	case WE_GET_GTX_USRCFG:
 	{
 		hdd_debug("GET wmi_vdev_param_gtx_usr_cfg");
-		*value = wma_cli_get_command(adapter->vdev_id,
+		*value = wma_cli_get_command(adapter->deflink->vdev_id,
 					     wmi_vdev_param_gtx_usr_cfg,
 					     GTX_CMD);
 		break;
@@ -5254,7 +5263,7 @@ static int __iw_setnone_getint(struct net_device *dev,
 	case WE_GET_GTX_THRE:
 	{
 		hdd_debug("GET wmi_vdev_param_gtx_thre");
-		*value = wma_cli_get_command(adapter->vdev_id,
+		*value = wma_cli_get_command(adapter->deflink->vdev_id,
 					     wmi_vdev_param_gtx_thre,
 					     GTX_CMD);
 		break;
@@ -5263,7 +5272,7 @@ static int __iw_setnone_getint(struct net_device *dev,
 	case WE_GET_GTX_MARGIN:
 	{
 		hdd_debug("GET wmi_vdev_param_gtx_margin");
-		*value = wma_cli_get_command(adapter->vdev_id,
+		*value = wma_cli_get_command(adapter->deflink->vdev_id,
 					     wmi_vdev_param_gtx_margin,
 					     GTX_CMD);
 		break;
@@ -5272,7 +5281,7 @@ static int __iw_setnone_getint(struct net_device *dev,
 	case WE_GET_GTX_STEP:
 	{
 		hdd_debug("GET wmi_vdev_param_gtx_step");
-		*value = wma_cli_get_command(adapter->vdev_id,
+		*value = wma_cli_get_command(adapter->deflink->vdev_id,
 					     wmi_vdev_param_gtx_step,
 					     GTX_CMD);
 		break;
@@ -5281,7 +5290,7 @@ static int __iw_setnone_getint(struct net_device *dev,
 	case WE_GET_GTX_MINTPC:
 	{
 		hdd_debug("GET wmi_vdev_param_gtx_mintpc");
-		*value = wma_cli_get_command(adapter->vdev_id,
+		*value = wma_cli_get_command(adapter->deflink->vdev_id,
 					     wmi_vdev_param_gtx_mintpc,
 					     GTX_CMD);
 		break;
@@ -5290,7 +5299,7 @@ static int __iw_setnone_getint(struct net_device *dev,
 	case WE_GET_GTX_BWMASK:
 	{
 		hdd_debug("GET wmi_vdev_param_gtx_bw_mask");
-		*value = wma_cli_get_command(adapter->vdev_id,
+		*value = wma_cli_get_command(adapter->deflink->vdev_id,
 					     wmi_vdev_param_gtx_bw_mask,
 					     GTX_CMD);
 		break;
@@ -5317,7 +5326,7 @@ static int __iw_setnone_getint(struct net_device *dev,
 	case WE_GET_SHORT_GI:
 	{
 		hdd_debug("GET wmi_vdev_param_sgi");
-		*value = wma_cli_get_command(adapter->vdev_id,
+		*value = wma_cli_get_command(adapter->deflink->vdev_id,
 					     wmi_vdev_param_sgi,
 					     VDEV_CMD);
 		break;
@@ -5326,7 +5335,7 @@ static int __iw_setnone_getint(struct net_device *dev,
 	case WE_GET_RTSCTS:
 	{
 		hdd_debug("GET wmi_vdev_param_enable_rtscts");
-		*value = wma_cli_get_command(adapter->vdev_id,
+		*value = wma_cli_get_command(adapter->deflink->vdev_id,
 					     wmi_vdev_param_enable_rtscts,
 					     VDEV_CMD);
 		break;
@@ -5335,7 +5344,7 @@ static int __iw_setnone_getint(struct net_device *dev,
 	case WE_GET_CHWIDTH:
 	{
 		hdd_debug("GET wmi_vdev_param_chwidth");
-		*value = wma_cli_get_command(adapter->vdev_id,
+		*value = wma_cli_get_command(adapter->deflink->vdev_id,
 					     wmi_vdev_param_chwidth,
 					     VDEV_CMD);
 		break;
@@ -5344,7 +5353,7 @@ static int __iw_setnone_getint(struct net_device *dev,
 	case WE_GET_ANI_EN_DIS:
 	{
 		hdd_debug("GET wmi_pdev_param_ani_enable");
-		*value = wma_cli_get_command(adapter->vdev_id,
+		*value = wma_cli_get_command(adapter->deflink->vdev_id,
 					     wmi_pdev_param_ani_enable,
 					     PDEV_CMD);
 		break;
@@ -5353,7 +5362,7 @@ static int __iw_setnone_getint(struct net_device *dev,
 	case WE_GET_ANI_POLL_PERIOD:
 	{
 		hdd_debug("GET wmi_pdev_param_ani_poll_period");
-		*value = wma_cli_get_command(adapter->vdev_id,
+		*value = wma_cli_get_command(adapter->deflink->vdev_id,
 					     wmi_pdev_param_ani_poll_period,
 					     PDEV_CMD);
 		break;
@@ -5362,7 +5371,7 @@ static int __iw_setnone_getint(struct net_device *dev,
 	case WE_GET_ANI_LISTEN_PERIOD:
 	{
 		hdd_debug("GET wmi_pdev_param_ani_listen_period");
-		*value = wma_cli_get_command(adapter->vdev_id,
+		*value = wma_cli_get_command(adapter->deflink->vdev_id,
 					     wmi_pdev_param_ani_listen_period,
 					     PDEV_CMD);
 		break;
@@ -5371,7 +5380,7 @@ static int __iw_setnone_getint(struct net_device *dev,
 	case WE_GET_ANI_OFDM_LEVEL:
 	{
 		hdd_debug("GET wmi_pdev_param_ani_ofdm_level");
-		*value = wma_cli_get_command(adapter->vdev_id,
+		*value = wma_cli_get_command(adapter->deflink->vdev_id,
 					     wmi_pdev_param_ani_ofdm_level,
 					     PDEV_CMD);
 		break;
@@ -5380,7 +5389,7 @@ static int __iw_setnone_getint(struct net_device *dev,
 	case WE_GET_ANI_CCK_LEVEL:
 	{
 		hdd_debug("GET wmi_pdev_param_ani_cck_level");
-		*value = wma_cli_get_command(adapter->vdev_id,
+		*value = wma_cli_get_command(adapter->deflink->vdev_id,
 					     wmi_pdev_param_ani_cck_level,
 					     PDEV_CMD);
 		break;
@@ -5389,7 +5398,7 @@ static int __iw_setnone_getint(struct net_device *dev,
 	case WE_GET_DYNAMIC_BW:
 	{
 		hdd_debug("GET wmi_pdev_param_ani_cck_level");
-		*value = wma_cli_get_command(adapter->vdev_id,
+		*value = wma_cli_get_command(adapter->deflink->vdev_id,
 					     wmi_pdev_param_dynamic_bw,
 					     PDEV_CMD);
 		break;
@@ -5398,7 +5407,7 @@ static int __iw_setnone_getint(struct net_device *dev,
 	case WE_GET_11N_RATE:
 	{
 		hdd_debug("GET wmi_vdev_param_fixed_rate");
-		*value = wma_cli_get_command(adapter->vdev_id,
+		*value = wma_cli_get_command(adapter->deflink->vdev_id,
 					     wmi_vdev_param_fixed_rate,
 					     VDEV_CMD);
 		break;
@@ -5407,7 +5416,7 @@ static int __iw_setnone_getint(struct net_device *dev,
 	case WE_GET_AMPDU:
 	{
 		hdd_debug("GET AMPDU");
-		*value = wma_cli_get_command(adapter->vdev_id,
+		*value = wma_cli_get_command(adapter->deflink->vdev_id,
 					     GEN_VDEV_PARAM_AMPDU,
 					     GEN_CMD);
 		break;
@@ -5416,7 +5425,7 @@ static int __iw_setnone_getint(struct net_device *dev,
 	case WE_GET_AMSDU:
 	{
 		hdd_debug("GET AMSDU");
-		*value = wma_cli_get_command(adapter->vdev_id,
+		*value = wma_cli_get_command(adapter->deflink->vdev_id,
 					     GEN_VDEV_PARAM_AMSDU,
 					     GEN_CMD);
 		break;
@@ -5425,7 +5434,7 @@ static int __iw_setnone_getint(struct net_device *dev,
 	case WE_GET_ROAM_SYNCH_DELAY:
 	{
 		hdd_debug("GET ROAM SYNCH DELAY");
-		*value = wma_cli_get_command(adapter->vdev_id,
+		*value = wma_cli_get_command(adapter->deflink->vdev_id,
 					     GEN_VDEV_ROAM_SYNCH_DELAY,
 					     GEN_CMD);
 		break;
@@ -5434,7 +5443,7 @@ static int __iw_setnone_getint(struct net_device *dev,
 	case WE_GET_TX_CHAINMASK:
 	{
 		hdd_debug("GET wmi_pdev_param_tx_chain_mask");
-		*value = wma_cli_get_command(adapter->vdev_id,
+		*value = wma_cli_get_command(adapter->deflink->vdev_id,
 					     wmi_pdev_param_tx_chain_mask,
 					     PDEV_CMD);
 		break;
@@ -5443,7 +5452,7 @@ static int __iw_setnone_getint(struct net_device *dev,
 	case WE_GET_RX_CHAINMASK:
 	{
 		hdd_debug("GET wmi_pdev_param_rx_chain_mask");
-		*value = wma_cli_get_command(adapter->vdev_id,
+		*value = wma_cli_get_command(adapter->deflink->vdev_id,
 					     wmi_pdev_param_rx_chain_mask,
 					     PDEV_CMD);
 		break;
@@ -5454,7 +5463,7 @@ static int __iw_setnone_getint(struct net_device *dev,
 		uint8_t txpow2g = 0;
 
 		hdd_debug("GET wmi_pdev_param_txpower_limit2g");
-		*value = wma_cli_get_command(adapter->vdev_id,
+		*value = wma_cli_get_command(adapter->deflink->vdev_id,
 					     wmi_pdev_param_txpower_limit2g,
 					     PDEV_CMD);
 		ucfg_mlme_get_current_tx_power_level(hdd_ctx->psoc, &txpow2g);
@@ -5467,7 +5476,7 @@ static int __iw_setnone_getint(struct net_device *dev,
 		uint8_t txpow5g = 0;
 
 		hdd_debug("GET wmi_pdev_param_txpower_limit5g");
-		*value = wma_cli_get_command(adapter->vdev_id,
+		*value = wma_cli_get_command(adapter->deflink->vdev_id,
 					     wmi_pdev_param_txpower_limit5g,
 					     PDEV_CMD);
 		ucfg_mlme_get_current_tx_power_level(hdd_ctx->psoc, &txpow5g);
@@ -5478,7 +5487,7 @@ static int __iw_setnone_getint(struct net_device *dev,
 	case WE_GET_PPS_PAID_MATCH:
 	{
 		hdd_debug("GET WMI_VDEV_PPS_PAID_MATCH");
-		*value = wma_cli_get_command(adapter->vdev_id,
+		*value = wma_cli_get_command(adapter->deflink->vdev_id,
 					     WMI_VDEV_PPS_PAID_MATCH,
 					     PPS_CMD);
 		break;
@@ -5487,7 +5496,7 @@ static int __iw_setnone_getint(struct net_device *dev,
 	case WE_GET_PPS_GID_MATCH:
 	{
 		hdd_debug("GET WMI_VDEV_PPS_GID_MATCH");
-		*value = wma_cli_get_command(adapter->vdev_id,
+		*value = wma_cli_get_command(adapter->deflink->vdev_id,
 					     WMI_VDEV_PPS_GID_MATCH,
 					     PPS_CMD);
 		break;
@@ -5496,7 +5505,7 @@ static int __iw_setnone_getint(struct net_device *dev,
 	case WE_GET_PPS_EARLY_TIM_CLEAR:
 	{
 		hdd_debug("GET WMI_VDEV_PPS_EARLY_TIM_CLEAR");
-		*value = wma_cli_get_command(adapter->vdev_id,
+		*value = wma_cli_get_command(adapter->deflink->vdev_id,
 					     WMI_VDEV_PPS_EARLY_TIM_CLEAR,
 					     PPS_CMD);
 		break;
@@ -5505,7 +5514,7 @@ static int __iw_setnone_getint(struct net_device *dev,
 	case WE_GET_PPS_EARLY_DTIM_CLEAR:
 	{
 		hdd_debug("GET WMI_VDEV_PPS_EARLY_DTIM_CLEAR");
-		*value = wma_cli_get_command(adapter->vdev_id,
+		*value = wma_cli_get_command(adapter->deflink->vdev_id,
 					     WMI_VDEV_PPS_EARLY_DTIM_CLEAR,
 					     PPS_CMD);
 		break;
@@ -5514,7 +5523,7 @@ static int __iw_setnone_getint(struct net_device *dev,
 	case WE_GET_PPS_EOF_PAD_DELIM:
 	{
 		hdd_debug("GET WMI_VDEV_PPS_EOF_PAD_DELIM");
-		*value = wma_cli_get_command(adapter->vdev_id,
+		*value = wma_cli_get_command(adapter->deflink->vdev_id,
 					     WMI_VDEV_PPS_EOF_PAD_DELIM,
 					     PPS_CMD);
 		break;
@@ -5523,7 +5532,7 @@ static int __iw_setnone_getint(struct net_device *dev,
 	case WE_GET_PPS_MACADDR_MISMATCH:
 	{
 		hdd_debug("GET WMI_VDEV_PPS_MACADDR_MISMATCH");
-		*value = wma_cli_get_command(adapter->vdev_id,
+		*value = wma_cli_get_command(adapter->deflink->vdev_id,
 					     WMI_VDEV_PPS_MACADDR_MISMATCH,
 					     PPS_CMD);
 		break;
@@ -5532,7 +5541,7 @@ static int __iw_setnone_getint(struct net_device *dev,
 	case WE_GET_PPS_DELIM_CRC_FAIL:
 	{
 		hdd_debug("GET WMI_VDEV_PPS_DELIM_CRC_FAIL");
-		*value = wma_cli_get_command(adapter->vdev_id,
+		*value = wma_cli_get_command(adapter->deflink->vdev_id,
 					     WMI_VDEV_PPS_DELIM_CRC_FAIL,
 					     PPS_CMD);
 		break;
@@ -5541,7 +5550,7 @@ static int __iw_setnone_getint(struct net_device *dev,
 	case WE_GET_PPS_GID_NSTS_ZERO:
 	{
 		hdd_debug("GET WMI_VDEV_PPS_GID_NSTS_ZERO");
-		*value = wma_cli_get_command(adapter->vdev_id,
+		*value = wma_cli_get_command(adapter->deflink->vdev_id,
 					     WMI_VDEV_PPS_GID_NSTS_ZERO,
 					     PPS_CMD);
 		break;
@@ -5551,7 +5560,7 @@ static int __iw_setnone_getint(struct net_device *dev,
 	{
 
 		hdd_debug("GET WMI_VDEV_PPS_RSSI_CHECK");
-		*value = wma_cli_get_command(adapter->vdev_id,
+		*value = wma_cli_get_command(adapter->deflink->vdev_id,
 					     WMI_VDEV_PPS_RSSI_CHECK,
 					     PPS_CMD);
 		break;
@@ -5560,7 +5569,7 @@ static int __iw_setnone_getint(struct net_device *dev,
 	case WE_GET_QPOWER_MAX_PSPOLL_COUNT:
 	{
 		hdd_debug("WE_GET_QPOWER_MAX_PSPOLL_COUNT");
-		*value = wma_cli_get_command(adapter->vdev_id,
+		*value = wma_cli_get_command(adapter->deflink->vdev_id,
 					     WMI_STA_PS_PARAM_QPOWER_PSPOLL_COUNT,
 					     QPOWER_CMD);
 		break;
@@ -5569,7 +5578,7 @@ static int __iw_setnone_getint(struct net_device *dev,
 	case WE_GET_QPOWER_MAX_TX_BEFORE_WAKE:
 	{
 		hdd_debug("WE_GET_QPOWER_MAX_TX_BEFORE_WAKE");
-		*value = wma_cli_get_command(adapter->vdev_id,
+		*value = wma_cli_get_command(adapter->deflink->vdev_id,
 					     WMI_STA_PS_PARAM_QPOWER_MAX_TX_BEFORE_WAKE,
 					     QPOWER_CMD);
 		break;
@@ -5578,7 +5587,7 @@ static int __iw_setnone_getint(struct net_device *dev,
 	case WE_GET_QPOWER_SPEC_PSPOLL_WAKE_INTERVAL:
 	{
 		hdd_debug("WE_GET_QPOWER_SPEC_PSPOLL_WAKE_INTERVAL");
-		*value = wma_cli_get_command(adapter->vdev_id,
+		*value = wma_cli_get_command(adapter->deflink->vdev_id,
 					     WMI_STA_PS_PARAM_QPOWER_SPEC_PSPOLL_WAKE_INTERVAL,
 					     QPOWER_CMD);
 		break;
@@ -5587,7 +5596,7 @@ static int __iw_setnone_getint(struct net_device *dev,
 	case WE_GET_QPOWER_SPEC_MAX_SPEC_NODATA_PSPOLL:
 	{
 		hdd_debug("WE_GET_QPOWER_MAX_PSPOLL_COUNT");
-		*value = wma_cli_get_command(adapter->vdev_id,
+		*value = wma_cli_get_command(adapter->deflink->vdev_id,
 					     WMI_STA_PS_PARAM_QPOWER_SPEC_MAX_SPEC_NODATA_PSPOLL,
 					     QPOWER_CMD);
 		break;
@@ -5603,13 +5612,13 @@ static int __iw_setnone_getint(struct net_device *dev,
 	}
 	case WE_GET_DCM:
 		hdd_debug("GET wmi_vdev_param_he_dcm");
-		*value = wma_cli_get_command(adapter->vdev_id,
+		*value = wma_cli_get_command(adapter->deflink->vdev_id,
 					     wmi_vdev_param_he_dcm_enable,
 					     VDEV_CMD);
 		break;
 	case WE_GET_RANGE_EXT:
 		hdd_debug("GET wmi_vdev_param_he_range_ext");
-		*value = wma_cli_get_command(adapter->vdev_id,
+		*value = wma_cli_get_command(adapter->deflink->vdev_id,
 					     wmi_vdev_param_he_range_ext,
 					     VDEV_CMD);
 		break;
@@ -5860,7 +5869,8 @@ static int hdd_get_sta_cxn_info(struct hdd_context *hdd_ctx,
 {
 	QDF_STATUS status;
 
-	status = sme_get_sta_cxn_info(hdd_ctx->mac_handle, adapter->vdev_id,
+	status = sme_get_sta_cxn_info(hdd_ctx->mac_handle,
+				      adapter->deflink->vdev_id,
 				      extra, WE_MAX_STR_LEN);
 	if (status != QDF_STATUS_SUCCESS)
 		qdf_scnprintf(extra, WE_MAX_STR_LEN,
@@ -5954,6 +5964,7 @@ static int __iw_get_char_setnone(struct net_device *dev,
 		int buf = 0, len = 0;
 		int adapter_num = 0;
 		int count = 0, check = 1;
+		uint8_t stat_vdev_id;
 
 		struct hdd_station_ctx *sta_ctx = NULL;
 
@@ -6016,7 +6027,7 @@ static int __iw_get_char_setnone(struct net_device *dev,
 			sta_ctx =
 				WLAN_HDD_GET_STATION_CTX_PTR(stat_adapter);
 
-
+			stat_vdev_id = stat_adapter->deflink->vdev_id;
 			buf =
 				scnprintf(extra + len, WE_MAX_STR_LEN - len,
 					  "\n HDD Conn State - %s "
@@ -6024,13 +6035,13 @@ static int __iw_get_char_setnone(struct net_device *dev,
 					  "\n CSR State - %s"
 					  "\n CSR Substate - %s",
 					  hdd_connection_state_string
-						  (sta_ctx->conn_info.conn_state),
+						(sta_ctx->conn_info.conn_state),
 					  mac_trace_getcsr_roam_state
-						  (sme_get_current_roam_state
-							  (mac_handle, stat_adapter->vdev_id)),
+						(sme_get_current_roam_state
+						   (mac_handle, stat_vdev_id)),
 					  mac_trace_getcsr_roam_sub_state
-						  (sme_get_current_roam_sub_state
-							  (mac_handle, stat_adapter->vdev_id))
+						(sme_get_current_roam_sub_state
+						   (mac_handle, stat_vdev_id))
 					  );
 			len += buf;
 			adapter_num++;
@@ -6196,7 +6207,8 @@ static int __iw_get_char_setnone(struct net_device *dev,
 	{
 		struct qdf_mac_addr connected_bssid;
 
-		wlan_mlme_get_bssid_vdev_id(hdd_ctx->pdev, adapter->vdev_id,
+		wlan_mlme_get_bssid_vdev_id(hdd_ctx->pdev,
+					    adapter->deflink->vdev_id,
 					    &connected_bssid);
 		snprintf(extra, WE_MAX_STR_LEN,
 			 "\n BSSID %02X:%02X:%02X:%02X:%02X:%02X"
@@ -6458,7 +6470,8 @@ static int __iw_setnone_getnone(struct net_device *dev,
 	mac_handle = hdd_ctx->mac_handle;
 	switch (sub_cmd) {
 	case WE_GET_FW_PROFILE_DATA:
-		ret = wma_cli_set_command(adapter->vdev_id,
+		ret = wma_cli_set_command(
+				adapter->deflink->vdev_id,
 				WMI_WLAN_PROFILE_GET_PROFILE_DATA_CMDID,
 				0, DBG_CMD);
 		break;
@@ -6467,12 +6480,14 @@ static int __iw_setnone_getnone(struct net_device *dev,
 	{
 		struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
 		qdf_freq_t chan_freq =
-			wlan_get_operation_chan_freq(adapter->vdev);
+			wlan_get_operation_chan_freq(adapter->deflink->vdev);
 		struct qdf_mac_addr target_bssid;
 
-		wlan_mlme_get_bssid_vdev_id(hdd_ctx->pdev, adapter->vdev_id,
+		wlan_mlme_get_bssid_vdev_id(hdd_ctx->pdev,
+					    adapter->deflink->vdev_id,
 					    &target_bssid);
-		ucfg_wlan_cm_roam_invoke(hdd_ctx->pdev, adapter->vdev_id,
+		ucfg_wlan_cm_roam_invoke(hdd_ctx->pdev,
+					 adapter->deflink->vdev_id,
 					 &target_bssid, chan_freq,
 					 CM_ROAMING_HOST);
 		return 0;
@@ -6488,7 +6503,7 @@ static int __iw_setnone_getnone(struct net_device *dev,
 			hdd_err("mac_handle context is NULL");
 			return -EINVAL;
 		}
-		sme_ht40_stop_obss_scan(mac_handle, adapter->vdev_id);
+		sme_ht40_stop_obss_scan(mac_handle, adapter->deflink->vdev_id);
 		break;
 
 	default:
@@ -6738,7 +6753,7 @@ static int __iw_set_var_ints_getnone(struct net_device *dev,
 		if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam())
 			vdev_id = 0;
 		else
-			vdev_id = adapter->vdev_id;
+			vdev_id = adapter->deflink->vdev_id;
 
 		if (vdev_id >= WLAN_MAX_VDEVS) {
 			hdd_err_rl("Invalid vdev id %d", vdev_id);
@@ -6825,7 +6840,7 @@ static int __iw_set_var_ints_getnone(struct net_device *dev,
 
 		if (QDF_STATUS_SUCCESS !=
 			sme_process_mac_pwr_dbg_cmd(mac_handle,
-						    adapter->vdev_id,
+						    adapter->deflink->vdev_id,
 						    &mac_pwr_dbg_args)) {
 			return -EINVAL;
 		}
@@ -6857,7 +6872,8 @@ static int __iw_set_var_ints_getnone(struct net_device *dev,
 					(char *)&sta_ctx->conn_info.bssid;
 			}
 		}
-		ret = cdp_txrx_stats_request(soc, adapter->vdev_id, &req);
+		ret = cdp_txrx_stats_request(soc, adapter->deflink->vdev_id,
+					     &req);
 		break;
 	}
 #ifdef WLAN_FEATURE_MOTION_DETECTION
@@ -6870,7 +6886,7 @@ static int __iw_set_var_ints_getnone(struct net_device *dev,
 			return -EINVAL;
 		}
 
-		motion_det_cfg.vdev_id = adapter->vdev_id;
+		motion_det_cfg.vdev_id = adapter->deflink->vdev_id;
 		motion_det_cfg.time_t1 = apps_args[0];
 		motion_det_cfg.time_t2 = apps_args[1];
 		motion_det_cfg.n1 = apps_args[2];
@@ -6899,7 +6915,7 @@ static int __iw_set_var_ints_getnone(struct net_device *dev,
 			return -EINVAL;
 		}
 
-		motion_det_base_line_cfg.vdev_id = adapter->vdev_id;
+		motion_det_base_line_cfg.vdev_id = adapter->deflink->vdev_id;
 		motion_det_base_line_cfg.bl_time_t = apps_args[0];
 		motion_det_base_line_cfg.bl_packet_gap = apps_args[1];
 		motion_det_base_line_cfg.bl_n = apps_args[2];
@@ -7449,7 +7465,7 @@ static int __iw_set_fties(struct net_device *dev, struct iw_request_info *info,
 	hdd_debug("called with Ie of length = %d", wrqu->data.length);
 
 	/* Pass the received FT IEs to SME */
-	ucfg_cm_set_ft_ies(hdd_ctx->pdev, adapter->vdev_id,
+	ucfg_cm_set_ft_ies(hdd_ctx->pdev, adapter->deflink->vdev_id,
 			   extra, wrqu->data.length);
 	hdd_exit();
 	return 0;
@@ -7591,7 +7607,7 @@ static int __iw_set_host_offload(struct net_device *dev,
 
 	if (QDF_STATUS_SUCCESS !=
 	    sme_set_host_offload(hdd_ctx->mac_handle,
-				 adapter->vdev_id, &offload_request)) {
+				 adapter->deflink->vdev_id, &offload_request)) {
 		hdd_err("Failure to execute host offload request");
 		return -EINVAL;
 	}
@@ -7696,7 +7712,7 @@ static int __iw_set_keepalive_params(struct net_device *dev,
 
 	if (QDF_STATUS_SUCCESS !=
 	    sme_set_keep_alive(hdd_ctx->mac_handle,
-			       adapter->vdev_id, request)) {
+			       adapter->deflink->vdev_id, request)) {
 		hdd_err("Failure to execute Keep Alive");
 		return -EINVAL;
 	}
@@ -7844,7 +7860,7 @@ static int __iw_set_packet_filter_params(struct net_device *dev,
 		hdd_ctx->user_configured_pkt_filter_rules &=
 					~(1 << request->filter_id);
 
-	ret = wlan_hdd_set_filter(hdd_ctx, request, adapter->vdev_id);
+	ret = wlan_hdd_set_filter(hdd_ctx, request, adapter->deflink->vdev_id);
 
 	qdf_mem_free(request);
 	hdd_exit();
@@ -8480,7 +8496,7 @@ static int __iw_set_two_ints_getnone(struct net_device *dev,
 	switch (sub_cmd) {
 	case WE_SET_SMPS_PARAM:
 		hdd_debug("WE_SET_SMPS_PARAM val %d %d", value[1], value[2]);
-		ret = wma_cli_set_command(adapter->vdev_id,
+		ret = wma_cli_set_command(adapter->deflink->vdev_id,
 					  WMI_STA_SMPS_PARAM_CMDID,
 					  value[1] << WMA_SMPS_PARAM_VALUE_S
 					      | value[2],
@@ -8492,14 +8508,16 @@ static int __iw_set_two_ints_getnone(struct net_device *dev,
 	case WE_ENABLE_FW_PROFILE:
 		hdd_err("WE_ENABLE_FW_PROFILE: %d %d",
 		       value[1], value[2]);
-		ret = wma_cli_set2_command(adapter->vdev_id,
-				 WMI_WLAN_PROFILE_ENABLE_PROFILE_ID_CMDID,
-					value[1], value[2], DBG_CMD);
+		ret = wma_cli_set2_command(
+				adapter->deflink->vdev_id,
+				WMI_WLAN_PROFILE_ENABLE_PROFILE_ID_CMDID,
+				value[1], value[2], DBG_CMD);
 		break;
 	case WE_SET_FW_PROFILE_HIST_INTVL:
 		hdd_err("WE_SET_FW_PROFILE_HIST_INTVL: %d %d",
 		       value[1], value[2]);
-		ret = wma_cli_set2_command(adapter->vdev_id,
+		ret = wma_cli_set2_command(
+					adapter->deflink->vdev_id,
 					WMI_WLAN_PROFILE_SET_HIST_INTVL_CMDID,
 					value[1], value[2], DBG_CMD);
 		break;

+ 7 - 7
core/hdd/src/wlan_hdd_wifi_pos_pasn.c

@@ -1,5 +1,5 @@
 /*
- * 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 above
@@ -89,7 +89,7 @@ wlan_hdd_cfg80211_send_pasn_auth_status(struct wiphy *wiphy,
 		return -EPERM;
 	}
 
-	if (wlan_hdd_validate_vdev_id(adapter->vdev_id))
+	if (wlan_hdd_validate_vdev_id(adapter->deflink->vdev_id))
 		return -EINVAL;
 
 	ret = wlan_hdd_validate_context(hdd_ctx);
@@ -112,7 +112,7 @@ wlan_hdd_cfg80211_send_pasn_auth_status(struct wiphy *wiphy,
 	if (!pasn_data)
 		return -ENOMEM;
 
-	pasn_data->vdev_id = adapter->vdev_id;
+	pasn_data->vdev_id = adapter->deflink->vdev_id;
 	nla_for_each_nested(curr_attr, tb[QCA_WLAN_VENDOR_ATTR_PASN_PEERS],
 			    rem) {
 		if (wlan_cfg80211_nla_parse_nested(
@@ -299,7 +299,7 @@ static int wlan_cfg80211_set_pasn_key(struct hdd_adapter *adapter,
 	if (!pasn_status)
 		return -ENOMEM;
 
-	pasn_status->vdev_id = adapter->vdev_id;
+	pasn_status->vdev_id = adapter->deflink->vdev_id;
 	pasn_status->num_peers = 1;
 
 	qdf_mem_copy(pasn_status->auth_status[0].peer_mac.bytes,
@@ -442,7 +442,7 @@ wlan_hdd_cfg80211_send_set_ltf_keyseed(struct wiphy *wiphy,
 		return -EPERM;
 	}
 
-	if (wlan_hdd_validate_vdev_id(adapter->vdev_id))
+	if (wlan_hdd_validate_vdev_id(adapter->deflink->vdev_id))
 		return -EINVAL;
 
 	ret = wlan_hdd_validate_context(hdd_ctx);
@@ -453,7 +453,7 @@ wlan_hdd_cfg80211_send_set_ltf_keyseed(struct wiphy *wiphy,
 	if (!data)
 		return -ENOMEM;
 
-	data->vdev_id = adapter->vdev_id;
+	data->vdev_id = adapter->deflink->vdev_id;
 	vdev = wlan_objmgr_get_vdev_by_id_from_psoc(hdd_ctx->psoc,
 						    data->vdev_id,
 						    WLAN_WIFI_POS_OSIF_ID);
@@ -560,7 +560,7 @@ wlan_hdd_cfg80211_send_set_ltf_keyseed(struct wiphy *wiphy,
 		goto err;
 	}
 
-	pasn_auth_status->vdev_id = adapter->vdev_id;
+	pasn_auth_status->vdev_id = adapter->deflink->vdev_id;
 	pasn_auth_status->num_peers = 1;
 	qdf_mem_copy(pasn_auth_status->auth_status[0].peer_mac.bytes,
 		     data->peer_mac_addr.bytes, QDF_MAC_ADDR_SIZE);

+ 17 - 15
core/hdd/src/wlan_hdd_wmm.c

@@ -233,7 +233,8 @@ static void hdd_wmm_enable_tl_uapsd(struct hdd_wmm_qos_context *qos_context)
 		sme_enable_uapsd_for_ac(ac_type, ac->tspec.ts_info.tid,
 					ac->tspec.ts_info.up,
 					service_interval, suspension_interval,
-					direction, psb, adapter->vdev_id,
+					direction, psb,
+					adapter->deflink->vdev_id,
 					delayed_trgr_frm_int);
 
 	if (!QDF_IS_STATUS_SUCCESS(status)) {
@@ -269,7 +270,8 @@ static void hdd_wmm_disable_tl_uapsd(struct hdd_wmm_qos_context *qos_context)
 
 	/* have we previously enabled UAPSD? */
 	if (ac->is_uapsd_info_valid == true) {
-		status = sme_disable_uapsd_for_ac(ac_type, adapter->vdev_id);
+		status = sme_disable_uapsd_for_ac(ac_type,
+						  adapter->deflink->vdev_id);
 
 		if (!QDF_IS_STATUS_SUCCESS(status)) {
 			hdd_err("Failed to disable U-APSD for AC=%d", ac_type);
@@ -1434,8 +1436,9 @@ static void __hdd_wmm_do_implicit_qos(struct hdd_wmm_qos_context *qos_context)
 
 	if (tspec.ts_info.ack_policy ==
 	    SME_QOS_WMM_TS_ACK_POLICY_HT_IMMEDIATE_BLOCK_ACK) {
-		if (!sme_qos_is_ts_info_ack_policy_valid(mac_handle, &tspec,
-							 adapter->vdev_id)) {
+		if (!sme_qos_is_ts_info_ack_policy_valid(
+					mac_handle, &tspec,
+					adapter->deflink->vdev_id)) {
 			tspec.ts_info.ack_policy =
 				SME_QOS_WMM_TS_ACK_POLICY_NORMAL_ACK;
 		}
@@ -1447,7 +1450,7 @@ static void __hdd_wmm_do_implicit_qos(struct hdd_wmm_qos_context *qos_context)
 
 #ifndef WLAN_MDM_CODE_REDUCTION_OPT
 	sme_status = sme_qos_setup_req(mac_handle,
-				       adapter->vdev_id,
+				       adapter->deflink->vdev_id,
 				       &tspec,
 				       hdd_wmm_sme_callback,
 				       qos_context,
@@ -2014,9 +2017,8 @@ void hdd_wmm_get_user_priority_from_ip_tos(struct hdd_adapter *adapter,
 	dscp = (tos >> 2) & 0x3f;
 	if (hdd_wmm_traffic_end_indication_is_enable(adapter)) {
 		psoc = adapter->hdd_ctx->psoc;
-		ucfg_dp_traffic_end_indication_update_dscp(psoc,
-							   adapter->vdev_id,
-							   &dscp);
+		ucfg_dp_traffic_end_indication_update_dscp(
+				psoc, adapter->deflink->vdev_id, &dscp);
 	}
 	*user_pri = adapter->dscp_to_up_map[dscp];
 
@@ -2478,7 +2480,7 @@ QDF_STATUS hdd_wmm_assoc(struct hdd_adapter *adapter,
 		status = sme_enable_uapsd_for_ac(
 				SME_AC_VO, 7, 7, srv_value, sus_value,
 				SME_QOS_WMM_TS_DIR_BOTH, 1,
-				adapter->vdev_id,
+				adapter->deflink->vdev_id,
 				delayed_trgr_frm_int);
 
 		QDF_ASSERT(QDF_IS_STATUS_SUCCESS(status));
@@ -2501,7 +2503,7 @@ QDF_STATUS hdd_wmm_assoc(struct hdd_adapter *adapter,
 		status = sme_enable_uapsd_for_ac(
 				SME_AC_VI, 5, 5, srv_value, sus_value,
 				SME_QOS_WMM_TS_DIR_BOTH, 1,
-				adapter->vdev_id,
+				adapter->deflink->vdev_id,
 				delayed_trgr_frm_int);
 
 		QDF_ASSERT(QDF_IS_STATUS_SUCCESS(status));
@@ -2524,7 +2526,7 @@ QDF_STATUS hdd_wmm_assoc(struct hdd_adapter *adapter,
 		status = sme_enable_uapsd_for_ac(
 				SME_AC_BK, 2, 2, srv_value, sus_value,
 				SME_QOS_WMM_TS_DIR_BOTH, 1,
-				adapter->vdev_id,
+				adapter->deflink->vdev_id,
 				delayed_trgr_frm_int);
 
 		QDF_ASSERT(QDF_IS_STATUS_SUCCESS(status));
@@ -2547,7 +2549,7 @@ QDF_STATUS hdd_wmm_assoc(struct hdd_adapter *adapter,
 		status = sme_enable_uapsd_for_ac(
 				SME_AC_BE, 3, 3, srv_value, sus_value,
 				SME_QOS_WMM_TS_DIR_BOTH, 1,
-				adapter->vdev_id,
+				adapter->deflink->vdev_id,
 				delayed_trgr_frm_int);
 
 		QDF_ASSERT(QDF_IS_STATUS_SUCCESS(status));
@@ -2555,7 +2557,7 @@ QDF_STATUS hdd_wmm_assoc(struct hdd_adapter *adapter,
 
 	status = sme_update_dsc_pto_up_mapping(hdd_ctx->mac_handle,
 					       adapter->dscp_to_up_map,
-					       adapter->vdev_id);
+					       adapter->deflink->vdev_id);
 
 	if (!QDF_IS_STATUS_SUCCESS(status))
 		hdd_wmm_dscp_initial_state(adapter);
@@ -2754,7 +2756,7 @@ hdd_wlan_wmm_status_e hdd_wmm_addts(struct hdd_adapter *adapter,
 
 #ifndef WLAN_MDM_CODE_REDUCTION_OPT
 	sme_status = sme_qos_setup_req(mac_handle,
-				       adapter->vdev_id,
+				       adapter->deflink->vdev_id,
 				       tspec,
 				       hdd_wmm_sme_callback,
 				       qos_context,
@@ -2868,7 +2870,7 @@ hdd_wlan_wmm_status_e hdd_wmm_delts(struct hdd_adapter *adapter,
 		 handle, flow_id, ac_type);
 
 #ifndef WLAN_MDM_CODE_REDUCTION_OPT
-	sme_status = sme_qos_release_req(mac_handle, adapter->vdev_id,
+	sme_status = sme_qos_release_req(mac_handle, adapter->deflink->vdev_id,
 					 flow_id);
 
 	hdd_debug("SME flow %d released, SME status %d", flow_id, sme_status);

Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor