From e55f42cfe7aa8d69328df743dff8e5270e0afbf0 Mon Sep 17 00:00:00 2001 From: Ravi Joshi Date: Mon, 3 Apr 2017 11:07:01 -0700 Subject: [PATCH] qcacld-3.0: Enable support for multiple NAN peers per NDI Enable support for multiple NAN data path peers from host. FW already supports multiple NAN peers. CRs-Fixed: 2121121 Change-Id: I23307c5f56114084a93b3afae0e23a07251c5013 --- core/mac/src/pe/nan/nan_datapath.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/core/mac/src/pe/nan/nan_datapath.c b/core/mac/src/pe/nan/nan_datapath.c index 7cd27a62763b..b95db10efba1 100644 --- a/core/mac/src/pe/nan/nan_datapath.c +++ b/core/mac/src/pe/nan/nan_datapath.c @@ -133,7 +133,13 @@ static QDF_STATUS lim_add_ndi_peer(tpAniSirGlobal mac_ctx, } pe_info("Need to create NDI Peer :" MAC_ADDRESS_STR, MAC_ADDR_ARRAY(peer_mac_addr.bytes)); + peer_idx = lim_assign_peer_idx(mac_ctx, session); + if (!peer_idx) { + pe_err("Invalid peer_idx: %d", peer_idx); + return QDF_STATUS_SUCCESS; + } + sta_ds = dph_add_hash_entry(mac_ctx, peer_mac_addr.bytes, peer_idx, &session->dph.dphHashTable); if (sta_ds == NULL) { @@ -141,6 +147,7 @@ static QDF_STATUS lim_add_ndi_peer(tpAniSirGlobal mac_ctx, /* couldn't add dph entry */ return QDF_STATUS_E_FAILURE; } + /* wma decides NDI mode from wma->inferface struct */ sta_ds->staType = STA_ENTRY_NDI_PEER; status = lim_add_sta(mac_ctx, sta_ds, false, session); @@ -150,6 +157,7 @@ static QDF_STATUS lim_add_ndi_peer(tpAniSirGlobal mac_ctx, status); return QDF_STATUS_E_FAILURE; } + return QDF_STATUS_SUCCESS; } @@ -804,6 +812,9 @@ void lim_process_ndi_mlm_add_bss_rsp(tpAniSirGlobal mac_ctx, /* Apply previously set configuration at HW */ lim_apply_configuration(mac_ctx, session_entry); mlm_start_cnf.resultCode = eSIR_SME_SUCCESS; + + /* Initialize peer ID pool */ + lim_init_peer_idxpool(mac_ctx, session_entry); } else { pe_err("WDA_ADD_BSS_REQ failed with status %d", add_bss_params->status);