diff --git a/core/hdd/inc/wlan_hdd_assoc.h b/core/hdd/inc/wlan_hdd_assoc.h index 190e756a7cb8..b9a95785e119 100644 --- a/core/hdd/inc/wlan_hdd_assoc.h +++ b/core/hdd/inc/wlan_hdd_assoc.h @@ -51,10 +51,6 @@ /* Timeout (in ms) for Link to Up before Registering Station */ #define ASSOC_LINKUP_TIMEOUT 60 -/* In pronto case, IBSS owns the first peer for bss peer. - In Rome case, IBSS uses the 2nd peer as bss peer */ -#define IBSS_BROADCAST_STAID 1 - /* Type Declarations */ /** * typedef eConnectionState - Connection states diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index 7a311c2515ef..ec3e66d064d2 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -657,6 +657,8 @@ struct hdd_station_ctx { /* STA ctx debug variables */ int staDebugState; + + uint8_t broadcast_ibss_staid; }; #define BSS_STOP 0 diff --git a/core/hdd/src/wlan_hdd_assoc.c b/core/hdd/src/wlan_hdd_assoc.c index a23efed55b9d..4912c80661fe 100644 --- a/core/hdd/src/wlan_hdd_assoc.c +++ b/core/hdd/src/wlan_hdd_assoc.c @@ -1093,12 +1093,11 @@ static CDF_STATUS hdd_dis_connect_handler(hdd_adapter_t *pAdapter, #endif if (eCSR_ROAM_IBSS_LEAVE == roamStatus) { uint8_t i; - sta_id = IBSS_BROADCAST_STAID; + sta_id = pHddStaCtx->broadcast_ibss_staid; vstatus = hdd_roam_deregister_sta(pAdapter, sta_id); if (!CDF_IS_STATUS_SUCCESS(vstatus)) { - hddLog(LOGE, - FL("hdd_roam_deregister_sta() failed for staID %d Status=%d [0x%x]"), - sta_id, status, status); + hdd_err("hdd_roam_deregister_sta() failed for staID %d Status=%d [0x%x]", + sta_id, status, status); status = CDF_STATUS_E_FAILURE; } pHddCtx->sta_to_adapter[sta_id] = NULL; @@ -2346,6 +2345,8 @@ static void hdd_roam_ibss_indication_handler(hdd_adapter_t *pAdapter, { hdd_context_t *pHddCtx = (hdd_context_t *) pAdapter->pHddCtx; + hdd_station_ctx_t *hdd_sta_ctx = + WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); struct cdf_mac_addr broadcastMacAddr = CDF_MAC_ADDR_BROADCAST_INITIALIZER; @@ -2365,10 +2366,13 @@ static void hdd_roam_ibss_indication_handler(hdd_adapter_t *pAdapter, /* notify wmm */ hdd_wmm_connect(pAdapter, pRoamInfo, eCSR_BSS_TYPE_IBSS); - pHddCtx->sta_to_adapter[IBSS_BROADCAST_STAID] = + + hdd_sta_ctx->broadcast_ibss_staid = pRoamInfo->staId; + + pHddCtx->sta_to_adapter[pRoamInfo->staId] = pAdapter; hdd_roam_register_sta(pAdapter, pRoamInfo, - IBSS_BROADCAST_STAID, + pRoamInfo->staId, &broadcastMacAddr, pRoamInfo->pBssDesc); @@ -2705,9 +2709,6 @@ roam_roam_connect_status_update_handler(hdd_adapter_t *pAdapter, pHddCtx->sta_to_adapter[pRoamInfo->staId] = pAdapter; - pHddCtx->sta_to_adapter[IBSS_BROADCAST_STAID] = - pAdapter; - /* Register the Station with TL for the new peer. */ cdf_status = hdd_roam_register_sta(pAdapter, pRoamInfo, diff --git a/core/hdd/src/wlan_hdd_tx_rx.c b/core/hdd/src/wlan_hdd_tx_rx.c index e6abd5346252..c7ed41ddae87 100644 --- a/core/hdd/src/wlan_hdd_tx_rx.c +++ b/core/hdd/src/wlan_hdd_tx_rx.c @@ -333,7 +333,7 @@ int hdd_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) if ((STAId == HDD_WLAN_INVALID_STA_ID) && (cdf_is_macaddr_broadcast(pDestMacAddress) || cdf_is_macaddr_group(pDestMacAddress))) { - STAId = IBSS_BROADCAST_STAID; + STAId = pHddStaCtx->broadcast_ibss_staid; CDF_TRACE(CDF_MODULE_ID_HDD_DATA, CDF_TRACE_LEVEL_INFO_LOW, "%s: BC/MC packet", __func__);