diff options
| author | Ravi Joshi <ravij@codeaurora.org> | 2016-09-26 12:40:24 -0700 |
|---|---|---|
| committer | Anjaneedevi Kapparapu <akappa@codeaurora.org> | 2016-10-13 12:14:21 +0530 |
| commit | 0d7cced3f5fd8aa94fd620dcddbe3c59920508be (patch) | |
| tree | 2da7c903f4c01cfa2bcb15923deb465c85b840f4 | |
| parent | 0eefd141e5380ab25d82ebb603fa688b6d266d6d (diff) | |
qcacld-2.0: Fix hardcoded broadcast station id for NDP
For historical reasons, the broadcast station id has always
been hardcoded to 1 for any peer-to-peer network. Providing
an implementation to extract broadcast station id from
association indication indicated by the PE layer.
CRs-Fixed: 1071279
Change-Id: I0df0962405a24a49d8829c563b051373e1b97b45
| -rw-r--r-- | CORE/HDD/inc/wlan_hdd_main.h | 2 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_nan_datapath.c | 36 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_tx_rx.c | 2 | ||||
| -rw-r--r-- | CORE/MAC/inc/sirApi.h | 1 | ||||
| -rw-r--r-- | CORE/MAC/src/pe/nan/nan_datapath.c | 1 | ||||
| -rw-r--r-- | CORE/SME/src/csr/csrApiRoam.c | 5 | ||||
| -rw-r--r-- | CORE/SME/src/nan/nan_datapath_api.c | 1 |
7 files changed, 38 insertions, 10 deletions
diff --git a/CORE/HDD/inc/wlan_hdd_main.h b/CORE/HDD/inc/wlan_hdd_main.h index 7a2298c25fb3..de9ca053f13a 100644 --- a/CORE/HDD/inc/wlan_hdd_main.h +++ b/CORE/HDD/inc/wlan_hdd_main.h @@ -756,6 +756,8 @@ struct hdd_station_ctx #ifdef WLAN_FEATURE_NAN_DATAPATH struct nan_datapath_ctx ndp_ctx; #endif + + uint8_t broadcast_staid; }; #define BSS_STOP 0 diff --git a/CORE/HDD/src/wlan_hdd_nan_datapath.c b/CORE/HDD/src/wlan_hdd_nan_datapath.c index 2879442bc7e9..96f54e74b1d3 100644 --- a/CORE/HDD/src/wlan_hdd_nan_datapath.c +++ b/CORE/HDD/src/wlan_hdd_nan_datapath.c @@ -387,6 +387,7 @@ static int hdd_ndi_delete_req_handler(hdd_context_t *hdd_ctx, uint16_t transaction_id; struct nan_datapath_ctx *ndp_ctx; int ret; + hdd_station_ctx_t *sta_ctx; ENTER(); @@ -426,6 +427,12 @@ static int hdd_ndi_delete_req_handler(hdd_context_t *hdd_ctx, return -EINVAL; } + sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); + if (!sta_ctx) { + hddLog(LOGE, FL("sta_ctx is NULL")); + return -EINVAL; + } + /* check if there are active peers on the adapter */ if (ndp_ctx->active_ndp_peers > 0) { hddLog(LOGE, FL("NDP peers active: %d, cannot delete NDI"), @@ -433,6 +440,12 @@ static int hdd_ndi_delete_req_handler(hdd_context_t *hdd_ctx, return -EINVAL; } + /* + * Since, the interface is being deleted, remove the + */ + hdd_ctx->sta_to_adapter[sta_ctx->broadcast_staid] = 0; + sta_ctx->broadcast_staid = HDD_WLAN_INVALID_STA_ID; + ndp_ctx->ndp_delete_transaction_id = transaction_id; ndp_ctx->state = NAN_DATA_NDI_DELETING_STATE; @@ -762,6 +775,10 @@ static void hdd_ndp_iface_create_rsp_handler(hdd_adapter_t *adapter, uint8_t create_transaction_id = 0; uint32_t create_status = NDP_RSP_STATUS_ERROR; uint32_t create_reason = NDP_NAN_DATA_IFACE_CREATE_FAILED; + hdd_station_ctx_t *sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); + v_MACADDR_t bc_mac_addr = VOS_MAC_ADDR_BROADCAST_INITIALIZER; + tCsrRoamInfo roam_info = {0}; + tSirBssDescription tmp_bss_descp = {0}; ENTER(); @@ -784,6 +801,11 @@ static void hdd_ndp_iface_create_rsp_handler(hdd_adapter_t *adapter, create_fail = true; } + if (!sta_ctx) { + hddLog(LOGE, FL("ndp_ctx is NULL")); + create_fail = true; + } + /* notify response to the upper layer */ vendor_event = cfg80211_vendor_event_alloc(hdd_ctx->wiphy, NULL, @@ -857,6 +879,13 @@ static void hdd_ndp_iface_create_rsp_handler(hdd_adapter_t *adapter, if (create_fail) goto close_ndi; + sta_ctx->broadcast_staid = ndi_rsp->sta_id; + hdd_save_peer(sta_ctx, sta_ctx->broadcast_staid, &bc_mac_addr); + hdd_roamRegisterSTA(adapter, &roam_info, + sta_ctx->broadcast_staid, + &bc_mac_addr, &tmp_bss_descp); + hdd_ctx->sta_to_adapter[sta_ctx->broadcast_staid] = adapter; + EXIT(); return; @@ -1136,7 +1165,6 @@ static void hdd_ndp_new_peer_ind_handler(hdd_adapter_t *adapter, tCsrRoamInfo roam_info = {0}; struct nan_datapath_ctx *ndp_ctx = WLAN_HDD_GET_NDP_CTX_PTR(adapter); hdd_station_ctx_t *sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); - v_MACADDR_t bc_mac_addr = VOS_MAC_ADDR_BROADCAST_INITIALIZER; ENTER(); @@ -1159,16 +1187,11 @@ static void hdd_ndp_new_peer_ind_handler(hdd_adapter_t *adapter, ndp_ctx->active_ndp_peers++; hddLog(LOG1, FL("vdev_id: %d, num_peers: %d"), adapter->sessionId, ndp_ctx->active_ndp_peers); - hdd_roamRegisterSTA(adapter, &roam_info, new_peer_ind->sta_id, &new_peer_ind->peer_mac_addr, &tmp_bss_descp); hdd_ctx->sta_to_adapter[new_peer_ind->sta_id] = adapter; /* perform following steps for first new peer ind */ if (ndp_ctx->active_ndp_peers == 1) { - hdd_ctx->sta_to_adapter[NDP_BROADCAST_STAID] = adapter; - hdd_save_peer(sta_ctx, NDP_BROADCAST_STAID, &bc_mac_addr); - hdd_roamRegisterSTA(adapter, &roam_info, NDP_BROADCAST_STAID, - &bc_mac_addr, &tmp_bss_descp); hddLog(LOG1, FL("Set ctx connection state to connected")); sta_ctx->conn_info.connState = eConnectionState_NdiConnected; hdd_wmm_connect(adapter, &roam_info, eCSR_BSS_TYPE_NDI); @@ -1176,6 +1199,7 @@ static void hdd_ndp_new_peer_ind_handler(hdd_adapter_t *adapter, WLAN_WAKE_ALL_NETIF_QUEUE, WLAN_CONTROL_PATH); } + EXIT(); } /** diff --git a/CORE/HDD/src/wlan_hdd_tx_rx.c b/CORE/HDD/src/wlan_hdd_tx_rx.c index 68f2a6922b93..4547299f904b 100644 --- a/CORE/HDD/src/wlan_hdd_tx_rx.c +++ b/CORE/HDD/src/wlan_hdd_tx_rx.c @@ -435,7 +435,7 @@ static void hdd_get_transmit_sta_id(hdd_adapter_t *adapter, * overwritten for UC traffic in NAN data mode */ if (mcbc_addr) - *station_id = NDP_BROADCAST_STAID; + *station_id = sta_ctx->broadcast_staid; } else { /* For the rest, traffic is directed to AP/P2P GO */ if (eConnectionState_Associated == sta_ctx->conn_info.connState) diff --git a/CORE/MAC/inc/sirApi.h b/CORE/MAC/inc/sirApi.h index 1f98554d7eb8..e13304241c93 100644 --- a/CORE/MAC/inc/sirApi.h +++ b/CORE/MAC/inc/sirApi.h @@ -7285,6 +7285,7 @@ struct ndp_app_info { struct ndi_create_rsp { uint32_t status; uint32_t reason; + uint8_t sta_id; }; /** diff --git a/CORE/MAC/src/pe/nan/nan_datapath.c b/CORE/MAC/src/pe/nan/nan_datapath.c index de83345062e1..074fb2cb341c 100644 --- a/CORE/MAC/src/pe/nan/nan_datapath.c +++ b/CORE/MAC/src/pe/nan/nan_datapath.c @@ -729,6 +729,7 @@ void lim_process_ndi_mlm_add_bss_rsp(tpAniSirGlobal mac_ctx, tpSirMsgQ lim_msgq, session_entry->bssIdx = (uint8_t) add_bss_params->bssIdx; session_entry->limSystemRole = eLIM_NDI_ROLE; session_entry->statypeForBss = STA_ENTRY_SELF; + session_entry->staId = add_bss_params->staContext.staIdx; /* Apply previously set configuration at HW */ limApplyConfiguration(mac_ctx, session_entry); mlm_start_cnf.resultCode = eSIR_SME_SUCCESS; diff --git a/CORE/SME/src/csr/csrApiRoam.c b/CORE/SME/src/csr/csrApiRoam.c index ba50fa7dd968..9a6139775798 100644 --- a/CORE/SME/src/csr/csrApiRoam.c +++ b/CORE/SME/src/csr/csrApiRoam.c @@ -6262,6 +6262,8 @@ static tANI_BOOLEAN csrRoamProcessResults( tpAniSirGlobal pMac, tSmeCmd *pComman else pSession->connectState = eCSR_ASSOC_STATE_TYPE_WDS_DISCONNECTED; + roamInfo.staId = (uint8_t)pSmeStartBssRsp->staId; + if (CSR_IS_NDI(pProfile)) { csrRoamStateChange(pMac, eCSR_ROAMING_STATE_JOINED, sessionId); pSirBssDesc = &pSmeStartBssRsp->bssDescription; @@ -6395,9 +6397,6 @@ static tANI_BOOLEAN csrRoamProcessResults( tpAniSirGlobal pMac, tSmeCmd *pComman &roamStatus, &roamResult, &roamInfo); } - //Only tell upper layer is we start the BSS because Vista doesn't like multiple connection - //indications. If we don't start the BSS ourself, handler of eSIR_SME_JOINED_NEW_BSS will - //trigger the connection start indication in Vista roamInfo.statusCode = pSession->joinFailStatusCode.statusCode; roamInfo.reasonCode = pSession->joinFailStatusCode.reasonCode; //We start the IBSS (didn't find any matched IBSS out there) diff --git a/CORE/SME/src/nan/nan_datapath_api.c b/CORE/SME/src/nan/nan_datapath_api.c index 2f0af8f65bf0..a8fa921cda7d 100644 --- a/CORE/SME/src/nan/nan_datapath_api.c +++ b/CORE/SME/src/nan/nan_datapath_api.c @@ -362,6 +362,7 @@ void csr_roam_update_ndp_return_params(tpAniSirGlobal mac_ctx, switch (result) { case eCsrStartBssSuccess: roam_info->ndp.ndi_create_params.reason = 0; + roam_info->ndp.ndi_create_params.sta_id = roam_info->staId; roam_info->ndp.ndi_create_params.status = NDP_RSP_STATUS_SUCCESS; *roam_status = eCSR_ROAM_NDP_STATUS_UPDATE; |
