diff options
author | Srinivas Dasari <dasaris@codeaurora.org> | 2020-04-04 00:27:45 +0530 |
---|---|---|
committer | Paul Chen <chenpaul@google.com> | 2020-04-09 05:18:30 +0000 |
commit | 9c997fa54dcc97dc7b11ce4793d674268f645c65 (patch) | |
tree | 3b6a6f30d40170c9d5018c1193152192a8fdcd0e | |
parent | 60428eafe6d6525337128f2a7278627cae09f7a7 (diff) | |
download | qcacld-android-msm-coral-4.14-android10.tar.gz |
qcacld-3.0: Extract NDI sta_id and send it to ndi_create_rspandroid-10.0.0_r0.74android-10.0.0_r0.67android-msm-coral-4.14-android10
Currently, sta_id of NDI is not extracted properly
from ndp_event_handler and thus ndi_create_rsp uses
sta_id 0 always. So extract NDI sta_id and send it to
ndi_create_rsp.
Also add the changes removed as part of the
commit 858ee87b632e ("qcacld-3.0: Don't add/remove peer for NDIs")
to support sta_id for NDI. The main usecase of this sta_id is to
send MC/BC traffic over this sta_id when an NDP is latched on
to this NDI.
Bug: 152385205
Change-Id: I7215f07978323535ac6c1078aec8634ff4950a66
CRs-Fixed: 2656936
-rw-r--r-- | core/hdd/src/wlan_hdd_nan_datapath.c | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/core/hdd/src/wlan_hdd_nan_datapath.c b/core/hdd/src/wlan_hdd_nan_datapath.c index d3214371d3..ff469e5f4d 100644 --- a/core/hdd/src/wlan_hdd_nan_datapath.c +++ b/core/hdd/src/wlan_hdd_nan_datapath.c @@ -314,6 +314,7 @@ void hdd_ndp_event_handler(struct hdd_adapter *adapter, { bool success; struct wlan_objmgr_psoc *psoc = wlan_vdev_get_psoc(adapter->vdev); + uint8_t sta_id; if (roam_status == eCSR_ROAM_NDP_STATUS_UPDATE) { switch (roam_result) { @@ -322,8 +323,10 @@ 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"); + + sta_id = roam_info->ndp.ndi_create_params.sta_id; os_if_nan_post_ndi_create_rsp(psoc, adapter->session_id, - success); + success, sta_id); return; case eCSR_ROAM_RESULT_NDI_DELETE_RSP: success = (roam_info->ndp.ndi_create_params.status == @@ -650,6 +653,10 @@ void hdd_ndi_drv_ndi_create_rsp_handler(uint8_t vdev_id, struct hdd_context *hdd_ctx; struct hdd_adapter *adapter; struct hdd_station_ctx *sta_ctx; + struct csr_roam_info roam_info = {0}; + struct bss_description tmp_bss_descp = {0}; + struct qdf_mac_addr bc_mac_addr = QDF_MAC_ADDR_BCAST_INIT; + uint8_t sta_id; hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD); if (!hdd_ctx) { @@ -669,6 +676,12 @@ void hdd_ndi_drv_ndi_create_rsp_handler(uint8_t vdev_id, return; } + sta_id = ndi_rsp->sta_id; + if (sta_id >= HDD_MAX_ADAPTERS) { + hdd_err("Error: Invalid sta id %u", sta_id); + return; + } + if (ndi_rsp->status == QDF_STATUS_SUCCESS) { hdd_alert("NDI interface successfully created"); os_if_nan_set_ndp_create_transaction_id(adapter->vdev, 0); @@ -682,6 +695,11 @@ void hdd_ndi_drv_ndi_create_rsp_handler(uint8_t vdev_id, ndi_rsp->reason /* create_reason */); } + sta_ctx->broadcast_staid = sta_id; + hdd_save_peer(sta_ctx, sta_id, &bc_mac_addr); + hdd_roam_register_sta(adapter, &roam_info, sta_id, + &bc_mac_addr, &tmp_bss_descp); + hdd_ctx->sta_to_adapter[sta_id] = adapter; } void hdd_ndi_close(uint8_t vdev_id) @@ -709,6 +727,7 @@ void hdd_ndi_drv_ndi_delete_rsp_handler(uint8_t vdev_id) struct hdd_context *hdd_ctx; struct hdd_adapter *adapter; struct hdd_station_ctx *sta_ctx; + uint8_t sta_id; hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD); if (!hdd_ctx) { @@ -728,6 +747,14 @@ void hdd_ndi_drv_ndi_delete_rsp_handler(uint8_t vdev_id) return; } + sta_id = sta_ctx->broadcast_staid; + if (sta_id < HDD_MAX_ADAPTERS) { + hdd_ctx->sta_to_adapter[sta_id] = NULL; + hdd_roam_deregister_sta(adapter, sta_id); + hdd_delete_peer(sta_ctx, sta_id); + sta_ctx->broadcast_staid = HDD_WLAN_INVALID_STA_ID; + } + wlan_hdd_netif_queue_control(adapter, WLAN_STOP_ALL_NETIF_QUEUE_N_CARRIER, WLAN_CONTROL_PATH); |