qcacld-3.0: Add vdev start check before sending arp_ns stats cmd to fw

Add vdev start check such that host does not send ARP_NS stats command
to FW when vdev is already stopped.

Change-Id: I94c0b4c26db3f48c7b2de1ad3003c0f0520fa396
CRs-Fixed: 2621587
This commit is contained in:
Alan Chen 2020-02-13 11:54:35 -08:00 committed by nshrivas
parent 4a63e6fdbb
commit a3de1a56ee
3 changed files with 31 additions and 0 deletions

View File

@ -1798,6 +1798,16 @@ int wma_fill_beacon_interval_reset_req(tp_wma_handle wma, uint8_t vdev_id,
*/
bool wma_is_vdev_valid(uint32_t vdev_id);
/*
* wma_is_vdev_started() - check whether vdev is started or not
* @vdev: pointer to vdev object
*
* This function verifies the vdev is started nor not
*
* Return: 'true' if vdev is started else 'false'
*/
bool wma_is_vdev_started(struct wlan_objmgr_vdev *vdev);
/**
* wma_vdev_obss_detection_info_handler - event handler to handle obss detection
* @handle: the wma handle

View File

@ -1344,6 +1344,14 @@ bool wma_is_vdev_valid(uint32_t vdev_id)
return wma_handle->interfaces[vdev_id].vdev_active;
}
bool wma_is_vdev_started(struct wlan_objmgr_vdev *vdev)
{
if (WLAN_VDEV_S_START == wlan_vdev_mlme_get_state(vdev))
return true;
else
return false;
}
/**
* wma_vdev_set_param() - set per vdev params in fw
* @wmi_handle: wmi handle

View File

@ -7541,22 +7541,35 @@ static void wma_set_arp_req_stats(WMA_HANDLE handle,
QDF_STATUS status;
struct set_arp_stats *arp_stats;
tp_wma_handle wma_handle = (tp_wma_handle) handle;
struct wlan_objmgr_vdev *vdev;
if (!wma_handle || !wma_handle->wmi_handle) {
WMA_LOGE("%s: WMA is closed, cannot send per roam config",
__func__);
return;
}
if (!wma_is_vdev_valid(req_buf->vdev_id)) {
WMA_LOGE("vdev id:%d is not active", req_buf->vdev_id);
return;
}
vdev = wlan_objmgr_get_vdev_by_id_from_psoc(wma_handle->psoc,
req_buf->vdev_id,
WLAN_LEGACY_WMA_ID);
if (!wma_is_vdev_started(vdev)) {
WMA_LOGD("vdev id:%d is not started", req_buf->vdev_id);
goto release_ref;
}
arp_stats = (struct set_arp_stats *)req_buf;
status = wmi_unified_set_arp_stats_req(wma_handle->wmi_handle,
arp_stats);
if (QDF_IS_STATUS_ERROR(status))
wma_err("failed to set arp stats to FW");
release_ref:
wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_WMA_ID);
}
/**