mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-11-10 04:42:22 -05:00
Merge "qcacmn: wlan_serialization_activate_cmd activates first cmd only"
This commit is contained in:
commit
4cf0744280
4 changed files with 72 additions and 54 deletions
|
|
@ -209,6 +209,7 @@ wlan_serialization_request(struct wlan_serialization_command *cmd)
|
|||
union wlan_serialization_rules_info info;
|
||||
struct wlan_serialization_pdev_priv_obj *ser_pdev_obj = NULL;
|
||||
struct wlan_objmgr_pdev *pdev = NULL;
|
||||
struct wlan_serialization_command_list *cmd_list = NULL;
|
||||
|
||||
serialization_enter();
|
||||
if (!cmd) {
|
||||
|
|
@ -256,9 +257,9 @@ wlan_serialization_request(struct wlan_serialization_command *cmd)
|
|||
|
||||
is_active_cmd_allowed = wlan_serialization_is_active_cmd_allowed(cmd);
|
||||
serialization_status = wlan_serialization_enqueue_cmd(
|
||||
cmd, is_active_cmd_allowed);
|
||||
cmd, is_active_cmd_allowed, &cmd_list);
|
||||
if (WLAN_SER_CMD_ACTIVE == serialization_status)
|
||||
wlan_serialization_activate_cmd(cmd->cmd_type, ser_pdev_obj);
|
||||
wlan_serialization_activate_cmd(cmd_list, ser_pdev_obj);
|
||||
return serialization_status;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ void wlan_serialization_move_pending_to_active(
|
|||
{
|
||||
qdf_list_t *pending_queue;
|
||||
struct wlan_serialization_command_list *cmd_list;
|
||||
struct wlan_serialization_command_list *active_cmd_list = NULL;
|
||||
enum wlan_serialization_status status;
|
||||
qdf_list_node_t *nnode = NULL;
|
||||
|
||||
|
|
@ -68,7 +69,9 @@ void wlan_serialization_move_pending_to_active(
|
|||
* By doing this way, we will make sure that command will be removed
|
||||
* from pending queue only when it was able to make it to active queue
|
||||
*/
|
||||
status = wlan_serialization_enqueue_cmd(&cmd_list->cmd, true);
|
||||
status = wlan_serialization_enqueue_cmd(&cmd_list->cmd,
|
||||
true,
|
||||
&active_cmd_list);
|
||||
if (WLAN_SER_CMD_ACTIVE != status) {
|
||||
serialization_err("Can't move cmd to activeQ id-%d type-%d",
|
||||
cmd_list->cmd.cmd_id, cmd_list->cmd.cmd_type);
|
||||
|
|
@ -76,7 +79,8 @@ void wlan_serialization_move_pending_to_active(
|
|||
} else {
|
||||
wlan_serialization_put_back_to_global_list(pending_queue,
|
||||
ser_pdev_obj, cmd_list);
|
||||
wlan_serialization_activate_cmd(cmd_type, ser_pdev_obj);
|
||||
wlan_serialization_activate_cmd(active_cmd_list,
|
||||
ser_pdev_obj);
|
||||
}
|
||||
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -33,7 +33,8 @@ wlan_serialization_add_cmd_to_given_queue(qdf_list_t *queue,
|
|||
struct wlan_serialization_command *cmd,
|
||||
struct wlan_objmgr_psoc *psoc,
|
||||
struct wlan_serialization_pdev_priv_obj *ser_pdev_obj,
|
||||
uint8_t is_cmd_for_active_queue)
|
||||
uint8_t is_cmd_for_active_queue,
|
||||
struct wlan_serialization_command_list **pcmd_list)
|
||||
{
|
||||
struct wlan_serialization_command_list *cmd_list;
|
||||
enum wlan_serialization_status status;
|
||||
|
|
@ -76,7 +77,7 @@ wlan_serialization_add_cmd_to_given_queue(qdf_list_t *queue,
|
|||
}
|
||||
return WLAN_SER_CMD_DENIED_UNSPECIFIED;
|
||||
}
|
||||
|
||||
*pcmd_list = cmd_list;
|
||||
if (is_cmd_for_active_queue)
|
||||
status = WLAN_SER_CMD_ACTIVE;
|
||||
else
|
||||
|
|
@ -85,16 +86,20 @@ wlan_serialization_add_cmd_to_given_queue(qdf_list_t *queue,
|
|||
return status;
|
||||
}
|
||||
|
||||
void wlan_serialization_activate_cmd(enum wlan_serialization_cmd_type cmd_type,
|
||||
void wlan_serialization_activate_cmd(
|
||||
struct wlan_serialization_command_list *cmd_list,
|
||||
struct wlan_serialization_pdev_priv_obj *ser_pdev_obj)
|
||||
{
|
||||
QDF_STATUS qdf_status = QDF_STATUS_SUCCESS;
|
||||
qdf_list_t *queue = NULL;
|
||||
qdf_list_node_t *nnode = NULL;
|
||||
struct wlan_serialization_command_list *cmd_list = NULL;
|
||||
struct wlan_objmgr_psoc *psoc = NULL;
|
||||
|
||||
if (cmd_type < WLAN_SER_CMD_NONSCAN)
|
||||
if (!cmd_list) {
|
||||
serialization_err("invalid cmd_list");
|
||||
QDF_ASSERT(0);
|
||||
return;
|
||||
}
|
||||
if (cmd_list->cmd.cmd_type < WLAN_SER_CMD_NONSCAN)
|
||||
queue = &ser_pdev_obj->active_scan_list;
|
||||
else
|
||||
queue = &ser_pdev_obj->active_list;
|
||||
|
|
@ -103,57 +108,56 @@ void wlan_serialization_activate_cmd(enum wlan_serialization_cmd_type cmd_type,
|
|||
QDF_ASSERT(0);
|
||||
return;
|
||||
}
|
||||
if (QDF_STATUS_SUCCESS != qdf_list_peek_front(queue, &nnode)) {
|
||||
serialization_err("can't read from active queue");
|
||||
serialization_debug("cmd_type - %d", cmd_type);
|
||||
if (!cmd_list->cmd.cmd_cb) {
|
||||
serialization_err("no cmd_cb for cmd type:%d, id: %d",
|
||||
cmd_list->cmd.cmd_type,
|
||||
cmd_list->cmd.cmd_id);
|
||||
QDF_ASSERT(0);
|
||||
return;
|
||||
}
|
||||
cmd_list = qdf_container_of(nnode,
|
||||
struct wlan_serialization_command_list, node);
|
||||
|
||||
if (cmd_list->cmd.vdev) {
|
||||
psoc = wlan_vdev_get_psoc(cmd_list->cmd.vdev);
|
||||
if (psoc == NULL) {
|
||||
serialization_err("invalid psoc");
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
serialization_err("invalid cmd.vdev");
|
||||
return;
|
||||
}
|
||||
/*
|
||||
* command is already pushed to active queue above
|
||||
* now start the timer and notify requestor
|
||||
*/
|
||||
wlan_serialization_find_and_start_timer(psoc,
|
||||
&cmd_list->cmd);
|
||||
if (cmd_list && cmd_list->cmd.cmd_cb) {
|
||||
if (cmd_list->cmd.vdev) {
|
||||
psoc = wlan_vdev_get_psoc(cmd_list->cmd.vdev);
|
||||
if (psoc == NULL) {
|
||||
serialization_err("invalid psoc");
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
serialization_err("invalid cmd.vdev");
|
||||
return;
|
||||
}
|
||||
/*
|
||||
* Remember that serialization module may send
|
||||
* this callback in same context through which it
|
||||
* received the serialization request. Due to which
|
||||
* it is caller's responsibility to ensure acquiring
|
||||
* and releasing its own lock appropriately.
|
||||
*/
|
||||
qdf_status = cmd_list->cmd.cmd_cb(&cmd_list->cmd,
|
||||
&cmd_list->cmd);
|
||||
/*
|
||||
* Remember that serialization module may send
|
||||
* this callback in same context through which it
|
||||
* received the serialization request. Due to which
|
||||
* it is caller's responsibility to ensure acquiring
|
||||
* and releasing its own lock appropriately.
|
||||
*/
|
||||
qdf_status = cmd_list->cmd.cmd_cb(&cmd_list->cmd,
|
||||
WLAN_SER_CB_ACTIVATE_CMD);
|
||||
if (qdf_status != QDF_STATUS_SUCCESS) {
|
||||
wlan_serialization_find_and_stop_timer(psoc,
|
||||
&cmd_list->cmd);
|
||||
cmd_list->cmd.cmd_cb(&cmd_list->cmd,
|
||||
WLAN_SER_CB_RELEASE_MEM_CMD);
|
||||
wlan_serialization_put_back_to_global_list(
|
||||
queue, ser_pdev_obj, cmd_list);
|
||||
wlan_serialization_move_pending_to_active(
|
||||
cmd_list->cmd.cmd_type,
|
||||
ser_pdev_obj);
|
||||
}
|
||||
if (qdf_status != QDF_STATUS_SUCCESS) {
|
||||
wlan_serialization_find_and_stop_timer(psoc,
|
||||
&cmd_list->cmd);
|
||||
cmd_list->cmd.cmd_cb(&cmd_list->cmd,
|
||||
WLAN_SER_CB_RELEASE_MEM_CMD);
|
||||
wlan_serialization_put_back_to_global_list(
|
||||
queue, ser_pdev_obj, cmd_list);
|
||||
wlan_serialization_move_pending_to_active(
|
||||
cmd_list->cmd.cmd_type,
|
||||
ser_pdev_obj);
|
||||
}
|
||||
}
|
||||
|
||||
enum wlan_serialization_status
|
||||
wlan_serialization_enqueue_cmd(struct wlan_serialization_command *cmd,
|
||||
uint8_t is_cmd_for_active_queue)
|
||||
uint8_t is_cmd_for_active_queue,
|
||||
struct wlan_serialization_command_list **pcmd_list)
|
||||
{
|
||||
enum wlan_serialization_status status = WLAN_SER_CMD_DENIED_UNSPECIFIED;
|
||||
struct wlan_objmgr_pdev *pdev;
|
||||
|
|
@ -190,6 +194,12 @@ wlan_serialization_enqueue_cmd(struct wlan_serialization_command *cmd,
|
|||
serialization_err("NULL command");
|
||||
return status;
|
||||
}
|
||||
if (!cmd->cmd_cb) {
|
||||
serialization_err("no cmd_cb for cmd type:%d, id: %d",
|
||||
cmd->cmd_type,
|
||||
cmd->cmd_id);
|
||||
return status;
|
||||
}
|
||||
pdev = wlan_serialization_get_pdev_from_cmd(cmd);
|
||||
if (pdev == NULL) {
|
||||
serialization_err("invalid pdev");
|
||||
|
|
@ -231,5 +241,5 @@ wlan_serialization_enqueue_cmd(struct wlan_serialization_command *cmd,
|
|||
}
|
||||
|
||||
return wlan_serialization_add_cmd_to_given_queue(queue, cmd, psoc,
|
||||
ser_pdev_obj, is_cmd_for_active_queue);
|
||||
ser_pdev_obj, is_cmd_for_active_queue, pcmd_list);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -216,12 +216,14 @@ wlan_serialization_find_and_cancel_cmd(
|
|||
* wlan_serialization_enqueue_cmd() - Enqueue the cmd to pending/active Queue
|
||||
* @cmd: Command information
|
||||
* @is_cmd_for_active_queue: whether command is for active queue
|
||||
*
|
||||
* @cmd_list: command which needs to be inserted in active queue
|
||||
* Return: Status of the serialization request
|
||||
*/
|
||||
enum wlan_serialization_status
|
||||
wlan_serialization_enqueue_cmd(struct wlan_serialization_command *cmd,
|
||||
uint8_t is_cmd_for_active_queue);
|
||||
wlan_serialization_enqueue_cmd(
|
||||
struct wlan_serialization_command *cmd,
|
||||
uint8_t is_cmd_for_active_queue,
|
||||
struct wlan_serialization_command_list **pcmd_list);
|
||||
|
||||
/**
|
||||
* wlan_serialization_dequeue_cmd() - dequeue the cmd to pending/active Queue
|
||||
|
|
@ -400,12 +402,13 @@ bool wlan_serialization_is_cmd_present_queue(
|
|||
uint8_t is_active_queue);
|
||||
|
||||
/**
|
||||
* wlan_serialization_activate_cmd() - activate first cmd in active queue
|
||||
* @cmd_type: Command Type
|
||||
* wlan_serialization_activate_cmd() - activate cmd in active queue
|
||||
* @cmd_list: Command needs to be activated
|
||||
* @ser_pdev_obj: Serialization private pdev object
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
void wlan_serialization_activate_cmd(enum wlan_serialization_cmd_type cmd_type,
|
||||
void wlan_serialization_activate_cmd(
|
||||
struct wlan_serialization_command_list *cmd_list,
|
||||
struct wlan_serialization_pdev_priv_obj *ser_pdev_obj);
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in a new issue