qcacmn: Refactor wmi_unified_get_pdev_handle for target stop/start
Target stop and (re)start will free htc_handle and re-negotiate endpoint ids. Change wmi_unified_get_pdev_handle to update htc_handle and endpoint data in wmi_handle to reflect latest values. Change-Id: I2385a73bd1d61a6f36db8bdaca4a22115f6bf68c CRs-Fixed: 2062439
This commit is contained in:

committed by
snandini

parent
86287dcf2e
commit
f13e82a3b2
@@ -2605,10 +2605,7 @@ void *wmi_unified_get_pdev_handle(struct wmi_soc *soc, uint32_t pdev_idx)
|
||||
if (pdev_idx >= WMI_MAX_RADIOS)
|
||||
return NULL;
|
||||
|
||||
/* If wmi pdev is already allocated, just return the handle */
|
||||
if (soc->wmi_pdev[pdev_idx] != NULL)
|
||||
return soc->wmi_pdev[pdev_idx];
|
||||
|
||||
if (soc->wmi_pdev[pdev_idx] == NULL) {
|
||||
wmi_handle =
|
||||
(struct wmi_unified *) qdf_mem_malloc(
|
||||
sizeof(struct wmi_unified));
|
||||
@@ -2639,13 +2636,16 @@ void *wmi_unified_get_pdev_handle(struct wmi_soc *soc, uint32_t pdev_idx)
|
||||
qdf_atomic_init(&wmi_handle->pending_cmds);
|
||||
qdf_atomic_init(&wmi_handle->is_target_suspended);
|
||||
wmi_handle->target_type = soc->target_type;
|
||||
wmi_handle->soc = soc;
|
||||
|
||||
soc->wmi_pdev[pdev_idx] = wmi_handle;
|
||||
} else
|
||||
wmi_handle = soc->wmi_pdev[pdev_idx];
|
||||
|
||||
wmi_handle->wmi_stopinprogress = 0;
|
||||
wmi_handle->wmi_endpoint_id = soc->wmi_endpoint_id[pdev_idx];
|
||||
wmi_handle->htc_handle = soc->htc_handle;
|
||||
wmi_handle->max_msg_len = soc->max_msg_len[pdev_idx];
|
||||
wmi_handle->soc = soc;
|
||||
|
||||
soc->wmi_pdev[pdev_idx] = wmi_handle;
|
||||
|
||||
return wmi_handle;
|
||||
|
||||
|
Reference in New Issue
Block a user