qcacmn: Add serialization API to update timers
Add a new API to update serialization timer value for a give command in the active queue. Change-Id: I725a35822e881facd9e2f4a51e41ea5ee8d6bbd8 CRs-Fixed: 2352317
这个提交包含在:
@@ -784,6 +784,16 @@ void wlan_serialization_remove_cmd(
|
||||
*/
|
||||
void wlan_serialization_flush_cmd(
|
||||
struct wlan_serialization_queued_cmd_info *cmd);
|
||||
|
||||
/**
|
||||
* wlan_serialization_update_timer() -Update timer for an active command
|
||||
* @cmd: Command information
|
||||
*
|
||||
* Return: Status of the timer update
|
||||
*/
|
||||
QDF_STATUS
|
||||
wlan_serialization_update_timer(struct wlan_serialization_command *cmd);
|
||||
|
||||
/**
|
||||
* wlan_serialization_request() - Request to serialize a command
|
||||
* @cmd: Command information
|
||||
|
@@ -799,6 +799,36 @@ error:
|
||||
return serialization_status;
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
wlan_serialization_update_timer(struct wlan_serialization_command *cmd)
|
||||
{
|
||||
QDF_STATUS status = QDF_STATUS_E_FAILURE;
|
||||
struct wlan_objmgr_pdev *pdev;
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
|
||||
if (!cmd) {
|
||||
ser_err("NULL command");
|
||||
goto error;
|
||||
}
|
||||
|
||||
pdev = wlan_serialization_get_pdev_from_cmd(cmd);
|
||||
if (!pdev) {
|
||||
ser_err("invalid pdev");
|
||||
goto error;
|
||||
}
|
||||
|
||||
psoc = wlan_pdev_get_psoc(pdev);
|
||||
if (!psoc) {
|
||||
ser_err("invalid psoc");
|
||||
goto error;
|
||||
}
|
||||
|
||||
status = wlan_serialization_find_and_update_timer(psoc, cmd);
|
||||
|
||||
error:
|
||||
return status;
|
||||
}
|
||||
|
||||
enum wlan_serialization_cmd_status
|
||||
wlan_serialization_vdev_scan_status(struct wlan_objmgr_vdev *vdev)
|
||||
{
|
||||
|
@@ -614,6 +614,55 @@ static void wlan_serialization_timer_handler(void *arg)
|
||||
}
|
||||
#endif
|
||||
|
||||
QDF_STATUS
|
||||
wlan_serialization_find_and_update_timer(
|
||||
struct wlan_objmgr_psoc *psoc,
|
||||
struct wlan_serialization_command *cmd)
|
||||
{
|
||||
struct wlan_ser_psoc_obj *psoc_ser_obj;
|
||||
struct wlan_serialization_timer *ser_timer;
|
||||
QDF_STATUS status = QDF_STATUS_E_FAILURE;
|
||||
int i = 0;
|
||||
|
||||
if (!psoc || !cmd) {
|
||||
ser_err("invalid param");
|
||||
goto exit;
|
||||
}
|
||||
|
||||
psoc_ser_obj = wlan_serialization_get_psoc_obj(psoc);
|
||||
/*
|
||||
* Here cmd_id and cmd_type are used to locate the timer being
|
||||
* associated with command.
|
||||
*/
|
||||
wlan_serialization_acquire_lock(&psoc_ser_obj->timer_lock);
|
||||
|
||||
for (i = 0; psoc_ser_obj->max_active_cmds > i; i++) {
|
||||
ser_timer = &psoc_ser_obj->timers[i];
|
||||
if (!(ser_timer->cmd) ||
|
||||
(ser_timer->cmd->cmd_id != cmd->cmd_id) ||
|
||||
(ser_timer->cmd->cmd_type != cmd->cmd_type) ||
|
||||
(ser_timer->cmd->vdev != cmd->vdev))
|
||||
continue;
|
||||
|
||||
status = QDF_STATUS_SUCCESS;
|
||||
break;
|
||||
}
|
||||
|
||||
wlan_serialization_release_lock(&psoc_ser_obj->timer_lock);
|
||||
|
||||
if (QDF_IS_STATUS_SUCCESS(status)) {
|
||||
qdf_timer_mod(&ser_timer->timer,
|
||||
cmd->cmd_timeout_duration);
|
||||
ser_debug("Updating the timer for cmd type:%d, id: %d",
|
||||
cmd->cmd_type, cmd->cmd_id);
|
||||
} else {
|
||||
ser_err("Can't find timer for cmd_type[%d]", cmd->cmd_type);
|
||||
}
|
||||
|
||||
exit:
|
||||
return status;
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
wlan_serialization_find_and_stop_timer(struct wlan_objmgr_psoc *psoc,
|
||||
struct wlan_serialization_command *cmd)
|
||||
|
@@ -143,6 +143,20 @@ QDF_STATUS
|
||||
wlan_serialization_find_and_start_timer(struct wlan_objmgr_psoc *psoc,
|
||||
struct wlan_serialization_command *cmd);
|
||||
|
||||
/**
|
||||
* wlan_serialization_find_and_update_timer() - to find and update the timer
|
||||
* @psoc: pointer to psoc
|
||||
* @cmd: pointer to command attributes
|
||||
*
|
||||
* Find the timer associated with command, and update it
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS
|
||||
wlan_serialization_find_and_update_timer(
|
||||
struct wlan_objmgr_psoc *psoc,
|
||||
struct wlan_serialization_command *cmd);
|
||||
|
||||
/**
|
||||
* wlan_serialization_find_and_stop_timer() - to find and stop the timer
|
||||
* @psoc: pointer to psoc
|
||||
|
在新工单中引用
屏蔽一个用户