diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index 75bcf96cdbef..49c3a5ad1614 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -1059,6 +1059,8 @@ struct hdd_connect_pm_context { #endif #endif +struct hdd_context; + struct hdd_adapter { /* Magic cookie for adapter sanity verification. Note that this * needs to be at the beginning of the private data structure so @@ -1067,7 +1069,7 @@ struct hdd_adapter { */ uint32_t magic; - void *pHddCtx; + struct hdd_context *hdd_ctx; struct wlan_objmgr_vdev *hdd_vdev; void *txrx_vdev; @@ -1316,8 +1318,8 @@ struct hdd_adapter { #define WLAN_HDD_GET_STATION_CTX_PTR(pAdapter) (&(pAdapter)->sessionCtx.station) #define WLAN_HDD_GET_AP_CTX_PTR(pAdapter) (&(pAdapter)->sessionCtx.ap) #define WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter) (&(pAdapter)->sessionCtx.station.WextState) -#define WLAN_HDD_GET_CTX(pAdapter) ((struct hdd_context *)pAdapter->pHddCtx) -#define WLAN_HDD_GET_HAL_CTX(pAdapter) (((struct hdd_context *)(pAdapter->pHddCtx))->hHal) +#define WLAN_HDD_GET_CTX(adapter) ((adapter)->hdd_ctx) +#define WLAN_HDD_GET_HAL_CTX(adapter) ((adapter)->hdd_ctx->hHal) #define WLAN_HDD_GET_HOSTAP_STATE_PTR(pAdapter) (&(pAdapter)->sessionCtx.ap.HostapdState) #define WLAN_HDD_GET_CFG_STATE_PTR(pAdapter) (&(pAdapter)->cfg80211State) #define WLAN_HDD_GET_SAP_CTX_PTR(pAdapter) (pAdapter->sessionCtx.ap.sapContext) diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index 78f264921d90..18852733136a 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -6672,7 +6672,7 @@ struct hdd_adapter *hdd_wlan_create_ap_dev(struct hdd_context *pHddCtx, /* Initialize the adapter context to zeros. */ qdf_mem_zero(pHostapdAdapter, sizeof(struct hdd_adapter)); pHostapdAdapter->dev = pWlanHostapdDev; - pHostapdAdapter->pHddCtx = pHddCtx; + pHostapdAdapter->hdd_ctx = pHddCtx; pHostapdAdapter->magic = WLAN_HDD_ADAPTER_MAGIC; pHostapdAdapter->sessionId = HDD_SESSION_ID_INVALID; diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 47a001edbf28..5c8c96492d7b 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -3014,7 +3014,7 @@ static struct hdd_adapter *hdd_alloc_station_adapter(struct hdd_context *hdd_ctx sizeof(sta_ctx->conn_info.staId), HDD_WLAN_INVALID_STA_ID); adapter->dev = pWlanDev; - adapter->pHddCtx = hdd_ctx; + adapter->hdd_ctx = hdd_ctx; adapter->magic = WLAN_HDD_ADAPTER_MAGIC; adapter->sessionId = HDD_SESSION_ID_INVALID;