qcacmn: Enhance serialization cancel command API

Current wlan_serialization_cancel_request API cancels commands which
are in pending queue but it doesn't cancel command which are in active
queue.

Enhance the API to allow requester to cancel the commands from active
queue as well.

Change-Id: Id303c59cbb2a36f6c358f34b4885a0af66f5dac1
CRs-Fixed: 2123090
This commit is contained in:
Krunal Soni 2017-10-09 11:11:13 -07:00 • committed by Nandini Suresh
commit fe33ab5fde
2 changed files with 33 additions and 4 deletions

View file

@ -80,7 +80,6 @@ void wlan_serialization_move_pending_to_active(
return;
}
enum wlan_serialization_cmd_status
wlan_serialization_remove_all_cmd_from_queue(qdf_list_t *queue,
struct wlan_serialization_pdev_priv_obj *ser_pdev_obj,
@ -91,8 +90,18 @@ wlan_serialization_remove_all_cmd_from_queue(qdf_list_t *queue,
struct wlan_serialization_command_list *cmd_list;
qdf_list_node_t *nnode = NULL, *pnode = NULL;
enum wlan_serialization_cmd_status status = WLAN_SER_CMD_NOT_FOUND;
struct wlan_objmgr_psoc *psoc = NULL;
QDF_STATUS qdf_status;
if (pdev)
psoc = wlan_pdev_get_psoc(pdev);
else if (vdev)
psoc = wlan_vdev_get_psoc(vdev);
else if (cmd && cmd->vdev)
psoc = wlan_vdev_get_psoc(cmd->vdev);
else
serialization_debug("Can't find psoc");
qsize = qdf_list_size(queue);
while (qsize--) {
if (wlan_serialization_get_cmd_from_queue(queue, &nnode)
@ -111,14 +120,29 @@ wlan_serialization_remove_all_cmd_from_queue(qdf_list_t *queue,
pnode = nnode;
continue;
}
/*
* active queue can't be removed directly, requester needs to
* wait for active command response and send remove request for
* active command seperately
*/
if (is_active_queue) {
if (!psoc || !cmd_list) {
serialization_err("Can't find cmd psoc:0x%p",
psoc);
serialization_err("Can't find cmd cmd_list:0x%p",
cmd_list);
status = WLAN_SER_CMD_NOT_FOUND;
break;
}
qdf_status = wlan_serialization_find_and_stop_timer(
psoc, &cmd_list->cmd);
if (QDF_STATUS_SUCCESS != qdf_status) {
serialization_err("Can't fix timer for active cmd");
status = WLAN_SER_CMD_NOT_FOUND;
break;
}
status = WLAN_SER_CMD_IN_ACTIVE_LIST;
break;
}
/*
* call pending cmd's callback to notify that
@ -141,8 +165,9 @@ wlan_serialization_remove_all_cmd_from_queue(qdf_list_t *queue,
break;
}
nnode = pnode;
/* If cmd was on active list then we wouldn't have come here */
status = WLAN_SER_CMD_IN_PENDING_LIST;
if (!is_active_queue)
status = WLAN_SER_CMD_IN_PENDING_LIST;
}
return status;

View file

@ -69,6 +69,10 @@ wlan_serialization_get_pdev_from_cmd(struct wlan_serialization_command *cmd)
serialization_err("invalid cmd");
return pdev;
}
if (!cmd->vdev) {
serialization_err("invalid cmd->vdev");
return pdev;
}
pdev = wlan_vdev_get_pdev(cmd->vdev);
return pdev;