ソースを参照

qcacmn: Remove code of CONFIG_SERIALIZATION_V1 part

Remove legacy code of CONFIG_SERIALIZATION_V1 part

Change-Id: I281d6ae911858c9212317c7e3a895db66511699b
CRs-Fixed: 2386843
Jianmin Zhu 6 年 前
コミット
91308cc532

+ 0 - 471
umac/cmn_services/serialization/inc/wlan_serialization_api.h

@@ -27,476 +27,6 @@
 #ifndef __WLAN_SERIALIZATION_API_H
 #define __WLAN_SERIALIZATION_API_H
 
-#ifdef CONFIG_SERIALIZATION_V1
-#include "qdf_status.h"
-#include "wlan_objmgr_cmn.h"
-
-/* Preprocessor Definitions and Constants */
-
-/*
- * struct wlan_serialization_queued_cmd_info member queue_type specifies the
- * below values to cancel the commands in these queues. Setting both the
- * bits will cancel the commands in both the queues.
- */
-#define WLAN_SERIALIZATION_ACTIVE_QUEUE  0x1
-#define WLAN_SERIALIZATION_PENDING_QUEUE 0x2
-
-/**
- * enum wlan_serialization_cb_reason - reason for calling the callback
- * @WLAN_SERIALIZATION_REASON_ACTIVATE_CMD: activate the cmd by sending it to FW
- * @WLAN_SERIALIZATION_REASON_CANCEL_CMD: Cancel the cmd in the pending list
- * @WLAN_SERIALIZATION_REASON_RELEASE_MEM_CMD:cmd execution complete. Release
- *                                           the memory allocated while
- *                                           building the command
- * @WLAN_SER_CB_ACTIVE_CMD_TIMEOUT: active cmd has been timeout.
- */
-enum wlan_serialization_cb_reason {
-	WLAN_SER_CB_ACTIVATE_CMD,
-	WLAN_SER_CB_CANCEL_CMD,
-	WLAN_SER_CB_RELEASE_MEM_CMD,
-	WLAN_SER_CB_ACTIVE_CMD_TIMEOUT,
-};
-
-/**
- * struct wlan_serialization_scan_info - Information needed for scan cmd
- * @is_cac_in_progress: boolean to check the cac status
- * @is_tdls_in_progress: boolean to check the tdls status
- * @is_mlme_op_in_progress: boolean to check the mlme op status
- *
- * This information is needed for scan command from other components
- * to apply the rules and check whether the cmd is allowed or not
- */
-struct wlan_serialization_scan_info {
-	bool is_cac_in_progress;
-	bool is_tdls_in_progress;
-	bool is_mlme_op_in_progress;
-};
-
-/**
- * union wlan_serialization_rules_info - union of all rules info structures
- * @scan_info: information needed to apply rules on scan command
- */
-union wlan_serialization_rules_info {
-	struct wlan_serialization_scan_info scan_info;
-};
-
-/**
- * wlan_serialization_cmd_callback() - Callback registered by the component
- * @wlan_cmd: Command passed by the component for serialization
- * @reason: Reason code for which the callback is being called
- *
- * Reason specifies the reason for which the callback is being called. callback
- * should return success or failure based up on overall success of callback.
- * if callback returns failure then serialization will remove the command from
- * active queue and proceed for next pending command.
- *
- * Return: QDF_STATUS_SUCCESS or QDF_STATUS_E_FAILURE
- */
-typedef QDF_STATUS (*wlan_serialization_cmd_callback) (void *wlan_cmd,
-				 enum wlan_serialization_cb_reason reason);
-
-/**
- * wlan_serialization_comp_info_cb() - callback to fill the rules information
- * @vdev: VDEV object for which the command has been received
- * @comp_info: Information filled by the component
- *
- * This callback is registered dynamically by the component with the
- * serialization component. Serialization component invokes the callback
- * while applying the rules for a particular command and the component
- * fills in the required information to apply the rules
- *
- * Return: None
- */
-typedef void (*wlan_serialization_comp_info_cb)(struct wlan_objmgr_vdev *vdev,
-		union wlan_serialization_rules_info *comp_info);
-
-/**
- * wlan_serialization_apply_rules_cb() - callback per command to apply rules
- * @comp_info: information needed to apply the rules
- *
- * The rules are applied using this callback and decided whether to
- * allow or deny the command
- *
- * Return: true, if rules are successful and cmd can be queued
- *         false, if rules failed and cmd should not be queued
- */
-typedef bool (*wlan_serialization_apply_rules_cb)(
-		union wlan_serialization_rules_info *comp_info,
-		uint8_t comp_id);
-
-/**
- * enum wlan_umac_cmd_id - Command Type
- * @WLAN_SER_CMD_SCAN:     Scan command
- */
-enum wlan_serialization_cmd_type {
-	/* all scan command before non-scan */
-	WLAN_SER_CMD_SCAN,
-	/* all non-scan command below */
-	WLAN_SER_CMD_NONSCAN,
-	WLAN_SER_CMD_FORCE_DISASSOC,
-	WLAN_SER_CMD_HDD_ISSUED,
-	WLAN_SER_CMD_FORCE_DISASSOC_MIC_FAIL,
-	WLAN_SER_CMD_HDD_ISSUE_REASSOC_SAME_AP,
-	WLAN_SER_CMD_SME_ISSUE_REASSOC_SAME_AP,
-	WLAN_SER_CMD_FORCE_DEAUTH,
-	WLAN_SER_CMD_SME_ISSUE_DISASSOC_FOR_HANDOFF,
-	WLAN_SER_CMD_SME_ISSUE_ASSOC_TO_SIMILAR_AP,
-	WLAN_SER_CMD_FORCE_IBSS_LEAVE,
-	WLAN_SER_CMD_STOP_BSS,
-	WLAN_SER_CMD_SME_ISSUE_FT_REASSOC,
-	WLAN_SER_CMD_FORCE_DISASSOC_STA,
-	WLAN_SER_CMD_FORCE_DEAUTH_STA,
-	WLAN_SER_CMD_PERFORM_PRE_AUTH,
-	WLAN_SER_CMD_WM_STATUS_CHANGE,
-	WLAN_SER_CMD_NDP_INIT_REQ,
-	WLAN_SER_CMD_NDP_RESP_REQ,
-	WLAN_SER_CMD_NDP_DATA_END_INIT_REQ,
-	WLAN_SER_CMD_ADDTS,
-	WLAN_SER_CMD_DELTS,
-	WLAN_SER_CMD_TDLS_SEND_MGMT,
-	WLAN_SER_CMD_TDLS_ADD_PEER,
-	WLAN_SER_CMD_TDLS_DEL_PEER,
-	WLAN_SER_CMD_SET_HW_MODE,
-	WLAN_SER_CMD_NSS_UPDATE,
-	WLAN_SER_CMD_SET_DUAL_MAC_CONFIG,
-	WLAN_SER_CMD_SET_ANTENNA_MODE,
-	WLAN_SER_CMD_DEL_STA_SESSION,
-	WLAN_SER_CMD_MAX
-};
-
-/**
- * enum wlan_serialization_cancel_type - Type of commands to be cancelled
- * @WLAN_SER_CANCEL_SINGLE_SCAN: Cancel a single scan with a given ID
- * @WLAN_SER_CANCEL_PDEV_SCANS: Cancel all the scans on a given pdev
- * @WLAN_SER_CANCEL_VDEV_SCANS: Cancel all the scans on given vdev
- * @WLAN_SER_CANCEL_NON_SCAN_CMD: Cancel the given non scan command
- */
-enum wlan_serialization_cancel_type {
-	WLAN_SER_CANCEL_SINGLE_SCAN,
-	WLAN_SER_CANCEL_PDEV_SCANS,
-	WLAN_SER_CANCEL_VDEV_SCANS,
-	WLAN_SER_CANCEL_NON_SCAN_CMD,
-	WLAN_SER_CANCEL_MAX,
-};
-
-/**
- * enum wlan_serialization_status - Return status of cmd serialization request
- * @WLAN_SER_CMD_PENDING: Command is put into the pending queue
- * @WLAN_SER_CMD_ACTIVE: Command is activated and put in active queue
- * @WLAN_SER_CMD_DENIED_RULES_FAILED: Command denied as the rules fail
- * @WLAN_SER_CMD_DENIED_LIST_FULL: Command denied as the pending list is full
- * @WLAN_SER_CMD_DENIED_UNSPECIFIED: Command denied due to unknown reason
- */
-enum wlan_serialization_status {
-	WLAN_SER_CMD_PENDING,
-	WLAN_SER_CMD_ACTIVE,
-	WLAN_SER_CMD_DENIED_RULES_FAILED,
-	WLAN_SER_CMD_DENIED_LIST_FULL,
-	WLAN_SER_CMD_DENIED_UNSPECIFIED,
-};
-
-/**
- * enum wlan_serialization_cmd_status - Return status for a cancel request
- * @WLAN_SER_CMD_IN_PENDING_LIST: Command cancelled from pending list
- * @WLAN_SER_CMD_IN_ACTIVE_LIST: Command cancelled from active list
- * @WLAN_SER_CMDS_IN_ALL_LISTS: Command cancelled from all lists
- * @WLAN_SER_CMD_NOT_FOUND: Specified command to be cancelled
- *                                    not found in the lists
- */
-enum wlan_serialization_cmd_status {
-	WLAN_SER_CMD_IN_PENDING_LIST,
-	WLAN_SER_CMD_IN_ACTIVE_LIST,
-	WLAN_SER_CMDS_IN_ALL_LISTS,
-	WLAN_SER_CMD_NOT_FOUND,
-};
-
-/**
- * struct wlan_serialization_command - Command to be serialized
- * @wlan_serialization_cmd_type: Type of command
- * @cmd_id: Command Identifier
- * @cmd_cb: Command callback
- * @source: component ID of the source of the command
- * @is_high_priority: Normal/High Priority at which the cmd has to be queued
- * @cmd_timeout_cb: Command timeout callback
- * @cmd_timeout_duration: Timeout duration in milliseconds
- * @vdev: VDEV object associated to the command
- * @umac_cmd: Actual command that needs to be sent to WMI/firmware
- *
- * Note: Unnamed union has been used in this structure, so that in future if
- * somebody wants to add pdev or psoc structure then that person can add without
- * modifying existing code.
- */
-struct wlan_serialization_command {
-	enum wlan_serialization_cmd_type cmd_type;
-	uint32_t cmd_id;
-	wlan_serialization_cmd_callback cmd_cb;
-	enum wlan_umac_comp_id source;
-	bool is_high_priority;
-	uint16_t cmd_timeout_duration;
-	union {
-		struct wlan_objmgr_vdev *vdev;
-	};
-	void *umac_cmd;
-};
-
-/**
- * struct wlan_serialization_queued_cmd_info  - cmd that has to be cancelled
- * @requestor: component ID of the source requesting this action
- * @cmd_type: Command type
- * @cmd_id: Command ID
- * @req_type: Commands that need to be cancelled
- * @vdev: VDEV object associated to the command
- * @queue_type: Queues from which the command to be cancelled
- */
-struct wlan_serialization_queued_cmd_info {
-	enum wlan_umac_comp_id requestor;
-	enum wlan_serialization_cmd_type cmd_type;
-	uint32_t cmd_id;
-	enum wlan_serialization_cancel_type req_type;
-	union {
-		struct wlan_objmgr_vdev *vdev;
-	};
-	uint8_t queue_type;
-};
-
-/**
- * wlan_serialization_cancel_request() - Request to cancel a command
- * @req: Request information
- *
- * This API is used by external components to cancel a command
- * that is either in the pending or active queue. Based on the
- * req_type, it is decided whether to use pdev or vdev
- * object. For all non-scan commands, it will be pdev.
- *
- * Return: Status specifying the removal of a command from a certain queue
- */
-enum wlan_serialization_cmd_status
-wlan_serialization_cancel_request(
-		struct wlan_serialization_queued_cmd_info *req);
-
-/**
- * wlan_serialization_remove_cmd() - Request to release a command
- * @cmd: Command information
- *
- * This API is used to release a command sitting in the active
- * queue upon successful completion of the command
- *
- * Return: None
- */
-void wlan_serialization_remove_cmd(
-		struct wlan_serialization_queued_cmd_info *cmd);
-
-/**
- * wlan_serialization_flush_cmd() - Request to flush command
- * @cmd: Command information
- *
- * This API is used to flush a cmd sitting in the queue. It
- * simply flushes the cmd from the queue and does not call
- * any callbacks in between. If the request is for active
- * queue, and if the active queue becomes empty upon flush,
- * then it will pick the next pending cmd and put in the active
- * queue before returning.
- *
- * Return: None
- */
-void wlan_serialization_flush_cmd(
-		struct wlan_serialization_queued_cmd_info *cmd);
-/**
- * wlan_serialization_request() - Request to serialize a command
- * @cmd: Command information
- *
- * Return: Status of the serialization request
- */
-enum wlan_serialization_status
-wlan_serialization_request(struct wlan_serialization_command *cmd);
-
-/**
- * wlan_serialization_register_comp_info_cb() - Register component's info
- * 						callback
- * @psoc: PSOC object information
- * @comp_id: Component ID
- * @cmd_type: Command Type
- * @cb: Callback
- *
- * This is called from component during its initialization.It initializes
- * callback handler for given comp_id/cmd_id in a 2-D array.
- *
- * Return: QDF Status
- */
-QDF_STATUS
-wlan_serialization_register_comp_info_cb(struct wlan_objmgr_psoc *psoc,
-		enum wlan_umac_comp_id comp_id,
-		enum wlan_serialization_cmd_type cmd_type,
-		wlan_serialization_comp_info_cb cb);
-
-/**
- * wlan_serialization_deregister_comp_info_cb() - Deregister component's info
- *						callback
- * @psoc: PSOC object information
- * @comp_id: Component ID
- * @cmd_type: Command Type
- *
- * This routine is called from other component during its de-initialization.
- *
- * Return: QDF Status
- */
-QDF_STATUS
-wlan_serialization_deregister_comp_info_cb(struct wlan_objmgr_psoc *psoc,
-		enum wlan_umac_comp_id comp_id,
-		enum wlan_serialization_cmd_type cmd_type);
-
-/**
- * wlan_serialization_register_apply_rules_cb() - Register component's rules
- *						callback
- * @psoc: PSOC object information
- * @cmd_type: Command Type
- * @cb: Callback
- *
- * This is called from component during its initialization.It initializes
- * callback handler for given cmd_type in a 1-D array.
- *
- * Return: QDF Status
- */
-QDF_STATUS
-wlan_serialization_register_apply_rules_cb(struct wlan_objmgr_psoc *psoc,
-		enum wlan_serialization_cmd_type cmd_type,
-		wlan_serialization_apply_rules_cb apply_rules_cb);
-
-/**
- * wlan_serialization_deregister_apply_rules_cb() - Deregister component's rules
- *						callback
- * @psoc: PSOC object information
- * @cmd_type: Command Type
- *
- * This routine is called from other component during its de-initialization.
- *
- * Return: QDF Status
- */
-QDF_STATUS
-wlan_serialization_deregister_apply_rules_cb(struct wlan_objmgr_psoc *psoc,
-		enum wlan_serialization_cmd_type cmd_type);
-
-/**
- * @wlan_serialization_init() - Serialization component initialization routine
- *
- * Return - QDF Status
- */
-QDF_STATUS wlan_serialization_init(void);
-
-/**
- * @wlan_serialization_deinit() - Serialization component de-init routine
- *
- * Return - QDF Status
- */
-QDF_STATUS wlan_serialization_deinit(void);
-
-/**
- * @wlan_serialization_psoc_open() - Serialization component open routine
- *
- * Return - QDF Status
- */
-QDF_STATUS wlan_serialization_psoc_open(struct wlan_objmgr_psoc *psoc);
-
-/**
- * @wlan_serialization_psoc_close() - Serialization component close routine
- *
- * Return - QDF Status
- */
-QDF_STATUS wlan_serialization_psoc_close(struct wlan_objmgr_psoc *psoc);
-
-/**
- * wlan_serialization_vdev_scan_status() - Return the status of the vdev scan
- * @vdev: VDEV Object
- *
- * Return: Status of the scans for the corresponding vdev
- */
-enum wlan_serialization_cmd_status
-wlan_serialization_vdev_scan_status(struct wlan_objmgr_vdev *vdev);
-
-/**
- * wlan_serialization_pdev_scan_status() - Return the status of the pdev scan
- * @pdev: PDEV Object
- *
- * Return: Status of the scans for the corresponding pdev
- */
-enum wlan_serialization_cmd_status
-wlan_serialization_pdev_scan_status(struct wlan_objmgr_pdev *pdev);
-
-/**
- * wlan_serialization_non_scan_cmd_status() - Return status of pdev non-scan cmd
- * @pdev: PDEV Object
- * @cmd_id: ID of the command for which the status has to be checked
- *
- * Return: Status of the command for the corresponding pdev
- */
-enum wlan_serialization_cmd_status
-wlan_serialization_non_scan_cmd_status(struct wlan_objmgr_pdev *pdev,
-		enum wlan_serialization_cmd_type cmd_id);
-
-/**
- * wlan_serialization_is_cmd_present_in_pending_queue() - Return if the command
- *				is already present in pending queue
- * @cmd: pointer to serialization command to check
- *
- * This API will check if command is present in pending queue. If present
- * then return true, so use know that it is duplicated command
- *
- * Return: true or false
- */
-bool wlan_serialization_is_cmd_present_in_pending_queue(
-		struct wlan_objmgr_psoc *psoc,
-		struct wlan_serialization_command *cmd);
-/**
- * wlan_serialization_is_cmd_present_in_active_queue() - Return if the command
- *			is already present in active queue
- * @cmd: pointer to serialization command to check
- *
- * This API will check if command is present in active queue. If present
- * then return true, so use know that it is duplicated command
- *
- * Return: true or false
- */
-bool wlan_serialization_is_cmd_present_in_active_queue(
-		struct wlan_objmgr_psoc *psoc,
-		struct wlan_serialization_command *cmd);
-
-/**
- * wlan_serialization_get_scan_cmd_using_scan_id() - Return command which
- *					matches vdev_id and scan_id
- * @psoc: pointer to soc
- * @vdev_id: vdev id to pull vdev object
- * @scan_id: scan id to match
- * @is_scan_cmd_from_active_queue: to indicate active or pending queue
- *
- * This API fetches vdev/pdev object based on vdev_id, loops through scan
- * command queue and find the command which matches scan id as well as vdev
- * object.
- *
- * Return: pointer to serialization command
- */
-struct wlan_serialization_command*
-wlan_serialization_get_scan_cmd_using_scan_id(
-		struct wlan_objmgr_psoc *psoc,
-		uint8_t vdev_id, uint16_t scan_id,
-		uint8_t is_scan_cmd_from_active_queue);
-/**
- * wlan_serialization_get_active_cmd() - Return active umac command which
- *  matches vdev and cmd type
- * @psoc: pointer to soc
- * @vdev_id: vdev id to pull vdev object
- * @cmd_type: cmd type to match
- *
- * This API fetches vdev/pdev object based on vdev_id, loops through active
- * command queue and find the active command which matches cmd_type as well
- * as vdev object.
- *
- * Return: Pointer to umac command. NULL is returned if active command of given
- *  type is not found.
- */
-void *wlan_serialization_get_active_cmd(struct wlan_objmgr_psoc *psoc,
-				     uint8_t vdev_id,
-				     enum wlan_serialization_cmd_type cmd_type);
-#else /* New serialization code*/
 #include <qdf_status.h>
 #include <wlan_objmgr_cmn.h>
 
@@ -1030,4 +560,3 @@ void *wlan_serialization_get_active_cmd(
 enum wlan_serialization_cmd_type
 wlan_serialization_get_vdev_active_cmd_type(struct wlan_objmgr_vdev *vdev);
 #endif
-#endif

+ 2 - 418
umac/cmn_services/serialization/src/wlan_serialization_api.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2019 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -15,6 +15,7 @@
  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  * PERFORMANCE OF THIS SOFTWARE.
  */
+
 /**
  * DOC: wlan_serialization_api.c
  * This file provides an interface for the external components
@@ -22,422 +23,6 @@
  * component.
  */
 
-#ifdef CONFIG_SERIALIZATION_V1
-/* Include files */
-#include "wlan_objmgr_psoc_obj.h"
-#include "wlan_objmgr_pdev_obj.h"
-#include "wlan_objmgr_vdev_obj.h"
-#include "wlan_serialization_main_i.h"
-#include "wlan_serialization_utils_i.h"
-
-bool wlan_serialization_is_cmd_present_in_pending_queue(
-		struct wlan_objmgr_psoc *psoc,
-		struct wlan_serialization_command *cmd)
-{
-	if (!cmd) {
-		serialization_err("invalid cmd");
-		return false;
-	}
-	return wlan_serialization_is_cmd_present_queue(cmd, false);
-}
-
-bool wlan_serialization_is_cmd_present_in_active_queue(
-		struct wlan_objmgr_psoc *psoc,
-		struct wlan_serialization_command *cmd)
-{
-	if (!cmd) {
-		serialization_err("invalid cmd");
-		return false;
-	}
-	return wlan_serialization_is_cmd_present_queue(cmd, true);
-}
-
-QDF_STATUS
-wlan_serialization_register_apply_rules_cb(struct wlan_objmgr_psoc *psoc,
-		enum wlan_serialization_cmd_type cmd_type,
-		wlan_serialization_apply_rules_cb cb)
-{
-	struct wlan_serialization_psoc_priv_obj *ser_soc_obj;
-	QDF_STATUS status;
-
-	status = wlan_serialization_validate_cmdtype(cmd_type);
-	if (status != QDF_STATUS_SUCCESS) {
-		serialization_err("invalid cmd_type %d",
-				cmd_type);
-		return status;
-	}
-	ser_soc_obj = wlan_serialization_get_psoc_priv_obj(psoc);
-	if (!ser_soc_obj) {
-		serialization_err("invalid ser_soc_obj");
-		return QDF_STATUS_E_FAILURE;
-	}
-	ser_soc_obj->apply_rules_cb[cmd_type] = cb;
-
-	return QDF_STATUS_SUCCESS;
-}
-
-QDF_STATUS
-wlan_serialization_deregister_apply_rules_cb(struct wlan_objmgr_psoc *psoc,
-		enum wlan_serialization_cmd_type cmd_type)
-{
-	struct wlan_serialization_psoc_priv_obj *ser_soc_obj;
-	QDF_STATUS status;
-
-	status = wlan_serialization_validate_cmdtype(cmd_type);
-	if (status != QDF_STATUS_SUCCESS) {
-		serialization_err("invalid cmd_type %d",
-				cmd_type);
-		return status;
-	}
-	ser_soc_obj = wlan_serialization_get_psoc_priv_obj(psoc);
-	if (!ser_soc_obj) {
-		serialization_err("invalid ser_soc_obj");
-		return QDF_STATUS_E_FAILURE;
-	}
-	ser_soc_obj->apply_rules_cb[cmd_type] = NULL;
-
-	return QDF_STATUS_SUCCESS;
-}
-
-QDF_STATUS
-wlan_serialization_register_comp_info_cb(struct wlan_objmgr_psoc *psoc,
-		enum wlan_umac_comp_id comp_id,
-		enum wlan_serialization_cmd_type cmd_type,
-		wlan_serialization_comp_info_cb cb)
-{
-	struct wlan_serialization_psoc_priv_obj *ser_soc_obj;
-	QDF_STATUS status;
-
-	status = wlan_serialization_validate_cmd(comp_id, cmd_type);
-	if (status != QDF_STATUS_SUCCESS) {
-		serialization_err("invalid comp_id %d or cmd_type %d",
-				comp_id, cmd_type);
-		return status;
-	}
-	ser_soc_obj = wlan_serialization_get_psoc_priv_obj(psoc);
-	if (!ser_soc_obj) {
-		serialization_err("invalid ser_soc_obj");
-		return QDF_STATUS_E_FAILURE;
-	}
-	ser_soc_obj->comp_info_cb[cmd_type][comp_id] = cb;
-
-	return QDF_STATUS_SUCCESS;
-}
-
-QDF_STATUS
-wlan_serialization_deregister_comp_info_cb(struct wlan_objmgr_psoc *psoc,
-		enum wlan_umac_comp_id comp_id,
-		enum wlan_serialization_cmd_type cmd_type)
-{
-	struct wlan_serialization_psoc_priv_obj *ser_soc_obj;
-	QDF_STATUS status;
-
-	status = wlan_serialization_validate_cmd(comp_id, cmd_type);
-	if (status != QDF_STATUS_SUCCESS) {
-		serialization_err("invalid comp_id %d or cmd_type %d",
-				comp_id, cmd_type);
-		return status;
-	}
-	ser_soc_obj = wlan_serialization_get_psoc_priv_obj(psoc);
-	if (!ser_soc_obj) {
-		serialization_err("invalid ser_soc_obj");
-		return QDF_STATUS_E_FAILURE;
-	}
-	ser_soc_obj->comp_info_cb[cmd_type][comp_id] = NULL;
-
-	return QDF_STATUS_SUCCESS;
-}
-
-enum wlan_serialization_cmd_status
-wlan_serialization_non_scan_cmd_status(struct wlan_objmgr_pdev *pdev,
-		enum wlan_serialization_cmd_type cmd_id)
-{
-	serialization_enter();
-
-	return WLAN_SER_CMD_NOT_FOUND;
-}
-
-enum wlan_serialization_cmd_status
-wlan_serialization_cancel_request(
-		struct wlan_serialization_queued_cmd_info *req)
-{
-	QDF_STATUS status;
-
-	serialization_enter();
-	if (!req) {
-		serialization_err("given request is empty");
-		return WLAN_SER_CMD_NOT_FOUND;
-	}
-	status = wlan_serialization_validate_cmd(req->requestor, req->cmd_type);
-	if (status != QDF_STATUS_SUCCESS) {
-		serialization_err("req is not valid");
-		return WLAN_SER_CMD_NOT_FOUND;
-	}
-
-	return wlan_serialization_find_and_cancel_cmd(req);
-}
-
-void wlan_serialization_remove_cmd(
-		struct wlan_serialization_queued_cmd_info *cmd)
-{
-	QDF_STATUS status;
-
-	serialization_enter();
-	if (!cmd) {
-		serialization_err("given request is empty");
-		QDF_ASSERT(0);
-		return;
-	}
-	status = wlan_serialization_validate_cmd(cmd->requestor, cmd->cmd_type);
-	if (status != QDF_STATUS_SUCCESS) {
-		serialization_err("cmd is not valid");
-		QDF_ASSERT(0);
-		return;
-	}
-	wlan_serialization_find_and_remove_cmd(cmd);
-
-	return;
-}
-
-enum wlan_serialization_status
-wlan_serialization_request(struct wlan_serialization_command *cmd)
-{
-	bool is_active_cmd_allowed;
-	QDF_STATUS status;
-	enum wlan_serialization_status serialization_status;
-	uint8_t comp_id;
-	struct wlan_serialization_psoc_priv_obj *ser_soc_obj;
-	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) {
-		serialization_err("serialization cmd is null");
-		return WLAN_SER_CMD_DENIED_UNSPECIFIED;
-	}
-	status = wlan_serialization_validate_cmd(cmd->source, cmd->cmd_type);
-	if (status != QDF_STATUS_SUCCESS) {
-		serialization_err("cmd is not valid");
-		return WLAN_SER_CMD_DENIED_UNSPECIFIED;
-	}
-
-	ser_soc_obj = wlan_serialization_get_psoc_obj(cmd);
-	if (!ser_soc_obj) {
-		serialization_err("ser_soc_obj is invalid");
-		return WLAN_SER_CMD_DENIED_UNSPECIFIED;
-	}
-
-	pdev = wlan_serialization_get_pdev_from_cmd(cmd);
-	if (!pdev) {
-		serialization_err("pdev is invalid");
-		return WLAN_SER_CMD_DENIED_UNSPECIFIED;
-	}
-
-	ser_pdev_obj = wlan_objmgr_pdev_get_comp_private_obj(pdev,
-			WLAN_UMAC_COMP_SERIALIZATION);
-	if (!ser_pdev_obj) {
-		serialization_err("Invalid ser_pdev_obj");
-		return WLAN_SER_CMD_DENIED_UNSPECIFIED;
-	}
-	/*
-	 * Get Component Info callback by calling
-	 * each registered module
-	 */
-	for (comp_id = 0; comp_id < WLAN_UMAC_COMP_ID_MAX; comp_id++) {
-		if (!ser_soc_obj->comp_info_cb[cmd->cmd_type][comp_id])
-			continue;
-		(ser_soc_obj->comp_info_cb[cmd->cmd_type][comp_id])(cmd->vdev,
-			&info);
-		if (!ser_soc_obj->apply_rules_cb[cmd->cmd_type])
-			continue;
-		if (!ser_soc_obj->apply_rules_cb[cmd->cmd_type](&info, comp_id))
-			return WLAN_SER_CMD_DENIED_RULES_FAILED;
-	}
-
-	is_active_cmd_allowed = wlan_serialization_is_active_cmd_allowed(cmd);
-	serialization_status = wlan_serialization_enqueue_cmd(
-				cmd, is_active_cmd_allowed, &cmd_list);
-	if (WLAN_SER_CMD_ACTIVE == serialization_status)
-		wlan_serialization_activate_cmd(cmd_list, ser_pdev_obj);
-
-	return serialization_status;
-}
-
-enum wlan_serialization_cmd_status
-wlan_serialization_vdev_scan_status(struct wlan_objmgr_vdev *vdev)
-{
-	bool cmd_in_active, cmd_in_pending;
-	struct wlan_objmgr_pdev *pdev = wlan_vdev_get_pdev(vdev);
-	struct wlan_serialization_pdev_priv_obj *ser_pdev_obj =
-		wlan_serialization_get_pdev_priv_obj(pdev);
-
-	cmd_in_active =
-	wlan_serialization_is_cmd_in_vdev_list(
-			vdev, &ser_pdev_obj->active_scan_list);
-
-	cmd_in_pending =
-	wlan_serialization_is_cmd_in_vdev_list(
-			vdev, &ser_pdev_obj->pending_scan_list);
-
-	return wlan_serialization_is_cmd_in_active_pending(
-			cmd_in_active, cmd_in_pending);
-}
-
-void wlan_serialization_flush_cmd(
-		struct wlan_serialization_queued_cmd_info *cmd)
-{
-	serialization_enter();
-	if (!cmd) {
-		serialization_err("cmd is null, can't flush");
-		return;
-	}
-	/* TODO: discuss and fill this API later */
-
-	return;
-}
-
-enum wlan_serialization_cmd_status
-wlan_serialization_pdev_scan_status(struct wlan_objmgr_pdev *pdev)
-{
-	bool cmd_in_active, cmd_in_pending;
-	struct wlan_serialization_pdev_priv_obj *ser_pdev_obj =
-		wlan_serialization_get_pdev_priv_obj(pdev);
-
-	cmd_in_active = !qdf_list_empty(&ser_pdev_obj->active_scan_list);
-	cmd_in_pending = !qdf_list_empty(&ser_pdev_obj->pending_scan_list);
-
-	return wlan_serialization_is_cmd_in_active_pending(
-			cmd_in_active, cmd_in_pending);
-}
-
-struct wlan_serialization_command*
-wlan_serialization_get_scan_cmd_using_scan_id(
-		struct wlan_objmgr_psoc *psoc,
-		uint8_t vdev_id, uint16_t scan_id,
-		uint8_t is_scan_cmd_from_active_queue)
-{
-	uint32_t qlen;
-	struct wlan_objmgr_vdev *vdev;
-	struct wlan_objmgr_pdev *pdev;
-	struct wlan_serialization_pdev_priv_obj *ser_pdev_obj;
-	struct wlan_serialization_command *cmd = NULL;
-	qdf_list_node_t *nnode = NULL;
-	qdf_list_t *queue;
-
-	if (!psoc) {
-		serialization_err("invalid psoc");
-		return cmd;
-	}
-	vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc, vdev_id,
-						WLAN_SERIALIZATION_ID);
-	if (!vdev) {
-		serialization_err("invalid vdev");
-		return cmd;
-	}
-
-	pdev = wlan_vdev_get_pdev(vdev);
-	if (!pdev) {
-		serialization_err("invalid pdev");
-		goto release_vdev_ref;
-	}
-
-	ser_pdev_obj = wlan_serialization_get_pdev_priv_obj(pdev);
-	if (!ser_pdev_obj) {
-		serialization_err("invalid ser_pdev_obj");
-		goto release_vdev_ref;
-	}
-	if (is_scan_cmd_from_active_queue)
-		queue = &ser_pdev_obj->active_scan_list;
-	else
-		queue = &ser_pdev_obj->pending_scan_list;
-	qlen = wlan_serialization_list_size(queue, ser_pdev_obj);
-	while (qlen--) {
-		if (QDF_STATUS_SUCCESS != wlan_serialization_get_cmd_from_queue(
-						queue, &nnode, ser_pdev_obj)) {
-			serialization_debug("Node not found");
-			break;
-		}
-		if (wlan_serialization_match_cmd_scan_id(nnode, &cmd, scan_id,
-							 vdev, ser_pdev_obj)) {
-			serialization_debug("Cmd matched with the scan_id");
-			break;
-		}
-	}
-release_vdev_ref:
-	wlan_objmgr_vdev_release_ref(vdev, WLAN_SERIALIZATION_ID);
-
-	return cmd;
-}
-
-void *wlan_serialization_get_active_cmd(struct wlan_objmgr_psoc *psoc,
-				      uint8_t vdev_id,
-				      enum wlan_serialization_cmd_type cmd_type)
-{
-	uint32_t qlen;
-	struct wlan_objmgr_vdev *vdev;
-	struct wlan_objmgr_pdev *pdev;
-	struct wlan_serialization_pdev_priv_obj *ser_pdev_obj;
-	struct wlan_serialization_command_list *cmd_list = NULL;
-	void *umac_cmd = NULL;
-	qdf_list_node_t *nnode = NULL;
-	qdf_list_t *queue;
-
-	if (!psoc) {
-		serialization_err("invalid psoc");
-		return umac_cmd;
-	}
-	vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc, vdev_id,
-						    WLAN_SERIALIZATION_ID);
-	if (!vdev) {
-		serialization_err("invalid vdev");
-		return umac_cmd;
-	}
-
-	pdev = wlan_vdev_get_pdev(vdev);
-	if (!pdev) {
-		serialization_err("invalid pdev");
-		goto release_vdev_ref;
-	}
-
-	ser_pdev_obj = wlan_serialization_get_pdev_priv_obj(pdev);
-	if (!ser_pdev_obj) {
-		serialization_err("invalid ser_pdev_obj");
-		goto release_vdev_ref;
-	}
-
-	queue = &ser_pdev_obj->active_list;
-
-	qlen = qdf_list_size(queue);
-	if (!qlen) {
-		serialization_err("Empty Queue");
-		goto release_vdev_ref;
-	}
-	while (qlen--) {
-		if (QDF_STATUS_SUCCESS != wlan_serialization_get_cmd_from_queue(
-							queue, &nnode,
-							ser_pdev_obj)) {
-			serialization_err("unsuccessful attempt");
-			break;
-		}
-		cmd_list = qdf_container_of(nnode,
-					 struct wlan_serialization_command_list,
-					 node);
-		if (cmd_list->cmd.cmd_type == cmd_type &&
-		    cmd_list->cmd.vdev == vdev) {
-			serialization_debug("cmd_type[%d] matched", cmd_type);
-			umac_cmd = cmd_list->cmd.umac_cmd;
-			break;
-		}
-	}
-release_vdev_ref:
-	wlan_objmgr_vdev_release_ref(vdev, WLAN_SERIALIZATION_ID);
-
-	return umac_cmd;
-}
-#else /* New serialization code*/
-/* Include files */
 #include <wlan_objmgr_psoc_obj.h>
 #include <wlan_objmgr_pdev_obj.h>
 #include <wlan_objmgr_vdev_obj.h>
@@ -1086,4 +671,3 @@ wlan_serialization_get_vdev_active_cmd_type(struct wlan_objmgr_vdev *vdev)
 error:
 	return cmd_type;
 }
-#endif

+ 0 - 661
umac/cmn_services/serialization/src/wlan_serialization_dequeue.c

@@ -1,661 +0,0 @@
-/*
- * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
- *
- * Permission to use, copy, modify, and/or distribute this software for
- * any purpose with or without fee is hereby granted, provided that the
- * above copyright notice and this permission notice appear in all
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-/**
- * DOC: wlan_serialization_dequeue.c
- * This file defines the routines which are pertinent
- * to the dequeue of commands.
- */
-#ifdef CONFIG_SERIALIZATION_V1
-#include <wlan_serialization_api.h>
-#include "wlan_serialization_main_i.h"
-#include "wlan_serialization_utils_i.h"
-#include <wlan_objmgr_vdev_obj.h>
-#include <wlan_objmgr_pdev_obj.h>
-#include <wlan_objmgr_psoc_obj.h>
-#include <qdf_list.h>
-#include <qdf_status.h>
-
-void wlan_serialization_move_pending_to_active(
-		enum wlan_serialization_cmd_type cmd_type,
-		struct wlan_serialization_pdev_priv_obj *ser_pdev_obj)
-{
-	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;
-	QDF_STATUS list_peek_status;
-
-	if (!ser_pdev_obj) {
-		serialization_err("Can't find ser_pdev_obj");
-		return;
-	}
-
-	if (cmd_type < WLAN_SER_CMD_NONSCAN)
-		pending_queue = &ser_pdev_obj->pending_scan_list;
-	else
-		pending_queue = &ser_pdev_obj->pending_list;
-	if (wlan_serialization_list_empty(pending_queue, ser_pdev_obj)) {
-		serialization_debug("nothing to move from pend to active que");
-		serialization_debug("cmd_type - %d", cmd_type);
-		return;
-	}
-	list_peek_status = wlan_serialization_peek_front(pending_queue, &nnode,
-							 ser_pdev_obj);
-	if (QDF_STATUS_SUCCESS != list_peek_status) {
-		serialization_err("can't read from pending queue");
-		serialization_debug("cmd_type - %d", cmd_type);
-		return;
-	}
-	cmd_list = qdf_container_of(nnode,
-			struct wlan_serialization_command_list, node);
-	/*
-	 * Idea is to peek command from pending queue, and try to
-	 * push to active queue. If command goes to active queue
-	 * successfully then remove the command from pending queue which
-	 * we previously peeked.
-	 *
-	 * 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,
-						&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);
-		return;
-	} else {
-		/*
-		 * Before removing the cmd from pending list and putting it
-		 * back in the global list, check if someone has already
-		 * deleted it. if so, do not do it again. if not, continue with
-		 * removing the node. if the CMD_MARKED_FOR_DELETE is
-		 * cleared after deletion, then inside the below API,
-		 * it is checked if the command is active and in use or
-		 * not before removing.
-		 */
-		if (!qdf_atomic_test_and_set_bit(CMD_MARKED_FOR_DELETE,
-						 &cmd_list->cmd_in_use)) {
-			serialization_debug("SER_CMD marked for removal");
-			wlan_serialization_put_back_to_global_list(
-					pending_queue, ser_pdev_obj, cmd_list);
-		} else {
-			serialization_debug("SER_CMD already being deleted");
-		}
-		wlan_serialization_activate_cmd(active_cmd_list,
-						ser_pdev_obj);
-	}
-
-	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,
-		struct wlan_objmgr_pdev *pdev, struct wlan_objmgr_vdev *vdev,
-		struct wlan_serialization_command *cmd, uint8_t is_active_queue)
-{
-	uint32_t qsize;
-	struct wlan_serialization_command_list *cmd_list = NULL;
-	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 = wlan_serialization_list_size(queue, ser_pdev_obj);
-	while (!wlan_serialization_list_empty(queue, ser_pdev_obj) && qsize--) {
-		if (wlan_serialization_get_cmd_from_queue(
-					queue, &nnode,
-					ser_pdev_obj) != QDF_STATUS_SUCCESS) {
-			serialization_err("can't read cmd from queue");
-			status = WLAN_SER_CMD_NOT_FOUND;
-			break;
-		}
-		cmd_list = qdf_container_of(nnode,
-				struct wlan_serialization_command_list, node);
-		if (cmd && !wlan_serialization_match_cmd_id_type(
-							nnode, cmd,
-							ser_pdev_obj)) {
-			pnode = nnode;
-			continue;
-		}
-		if (vdev && !wlan_serialization_match_cmd_vdev(nnode, vdev)) {
-			pnode = nnode;
-			continue;
-		}
-		if (pdev && !wlan_serialization_match_cmd_pdev(nnode, pdev)) {
-			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 separately
-		 */
-		if (is_active_queue) {
-			if (!psoc || !cmd_list) {
-				serialization_err("psoc:0x%pK, cmd_list:0x%pK",
-						  psoc, 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;
-		}
-		/*
-		 * There is a possiblity that the cmd cleanup may happen
-		 * in different contexts at the same time.
-		 * e.g: ifconfig down coming in ioctl context and command
-		 * complete event being handled in scheduler thread context.
-		 * In such scenario's check if either of the threads have
-		 * marked the command for delete and then proceed further
-		 * with cleanup. if it is already marked for cleanup, then
-		 * there is no need to proceed since the other thread is
-		 * cleaning it up.
-		 */
-		if (qdf_atomic_test_and_set_bit(CMD_MARKED_FOR_DELETE,
-						&cmd_list->cmd_in_use)) {
-			serialization_debug("SER_CMD already being deleted");
-			status = WLAN_SER_CMD_NOT_FOUND;
-			break;
-		}
-		serialization_debug("SER_CMD marked for removal");
-		/*
-		 * call pending cmd's callback to notify that
-		 * it is being removed
-		 */
-		if (cmd_list->cmd.cmd_cb) {
-			/* caller should now do necessary clean up */
-			cmd_list->cmd.cmd_cb(&cmd_list->cmd,
-					WLAN_SER_CB_CANCEL_CMD);
-			/* caller should release the memory */
-			cmd_list->cmd.cmd_cb(&cmd_list->cmd,
-					WLAN_SER_CB_RELEASE_MEM_CMD);
-		}
-
-		qdf_status = wlan_serialization_put_back_to_global_list(queue,
-				ser_pdev_obj, cmd_list);
-		if (QDF_STATUS_SUCCESS != qdf_status) {
-			serialization_err("can't remove cmd from queue");
-			status = WLAN_SER_CMD_NOT_FOUND;
-			break;
-		}
-		nnode = pnode;
-
-		if (!is_active_queue)
-			status = WLAN_SER_CMD_IN_PENDING_LIST;
-	}
-
-	return status;
-}
-
-/**
- * wlan_serialization_remove_cmd_from_given_queue() - to remove command from
- *							given queue
- * @queue: queue from which command needs to be removed
- * @cmd: command to match in the queue
- * @ser_pdev_obj: pointer to private pdev serialization object
- *
- * This API takes the queue, it matches the provided command from this queue
- * and removes it. Before removing the command, it will notify the caller
- * that if it needs to remove any memory allocated by caller.
- *
- * Return: none
- */
-static void wlan_serialization_remove_cmd_from_given_queue(qdf_list_t *queue,
-		struct wlan_serialization_command *cmd,
-		struct wlan_serialization_pdev_priv_obj *ser_pdev_obj)
-{
-	uint32_t qsize;
-	struct wlan_serialization_command_list *cmd_list;
-	qdf_list_node_t *nnode = NULL;
-	QDF_STATUS status;
-
-	if (!cmd)
-		return;
-
-	qsize = wlan_serialization_list_size(queue, ser_pdev_obj);
-	while (qsize--) {
-		status = wlan_serialization_get_cmd_from_queue(queue, &nnode,
-							       ser_pdev_obj);
-		if (status != QDF_STATUS_SUCCESS) {
-			serialization_err("can't peek cmd_id[%d] type[%d]",
-					  cmd->cmd_id, cmd->cmd_type);
-			break;
-		}
-		cmd_list = qdf_container_of(nnode,
-				struct wlan_serialization_command_list, node);
-		if (!wlan_serialization_match_cmd_id_type(nnode, cmd,
-							  ser_pdev_obj))
-			continue;
-		if (!wlan_serialization_match_cmd_vdev(nnode, cmd->vdev))
-			continue;
-		/*
-		 * Before removing the command from queue, check if it is
-		 * already in process of being removed in some other
-		 * context and if so, there is no need to continue with
-		 * the removal.
-		 */
-		if (qdf_atomic_test_and_set_bit(CMD_MARKED_FOR_DELETE,
-						&cmd_list->cmd_in_use)) {
-			serialization_debug("SER_CMD already being deleted");
-			break;
-		}
-		serialization_debug("SER_CMD marked for removal");
-		if (cmd_list->cmd.cmd_cb) {
-			/* caller should release the memory */
-			cmd_list->cmd.cmd_cb(&cmd_list->cmd,
-					WLAN_SER_CB_RELEASE_MEM_CMD);
-		}
-		status = wlan_serialization_put_back_to_global_list(queue,
-				ser_pdev_obj, cmd_list);
-
-		if (QDF_STATUS_SUCCESS != status)
-			serialization_err("Fail to add to free pool type[%d]",
-					  cmd->cmd_type);
-		/*
-		 * zero out the command, so caller would know that command has
-		 * been removed
-		 */
-		qdf_mem_zero(cmd, sizeof(struct wlan_serialization_command));
-		break;
-	}
-}
-
-/**
- * wlan_serialization_remove_cmd_from_active_queue() - helper function to remove
- *							cmd from active queue
- * @psoc: pointer to psoc
- * @obj: pointer to object getting passed by object manager
- * @arg: argument passed by caller to object manager which comes to this cb
- *
- * caller provide this API as callback to object manager, and in turn
- * object manager iterate through each pdev and call this API callback.
- *
- * Return: none
- */
-static void
-wlan_serialization_remove_cmd_from_active_queue(struct wlan_objmgr_psoc *psoc,
-		void *obj, void *arg)
-{
-	qdf_list_t *queue;
-	struct wlan_objmgr_pdev *pdev = obj;
-	struct wlan_serialization_pdev_priv_obj *ser_pdev_obj;
-	struct wlan_serialization_command *cmd = arg;
-
-	if (!pdev || !cmd) {
-		serialization_err("Invalid param");
-		return;
-	}
-
-	ser_pdev_obj = wlan_objmgr_pdev_get_comp_private_obj(pdev,
-			WLAN_UMAC_COMP_SERIALIZATION);
-	if (!ser_pdev_obj) {
-		serialization_err("Invalid ser_pdev_obj");
-		return;
-	}
-
-	if (cmd->cmd_type < WLAN_SER_CMD_NONSCAN)
-		queue = &ser_pdev_obj->active_scan_list;
-	else
-		queue = &ser_pdev_obj->active_list;
-
-	if (wlan_serialization_list_empty(queue, ser_pdev_obj)) {
-		serialization_err("Empty queue");
-		return;
-	}
-
-	wlan_serialization_remove_cmd_from_given_queue(queue, cmd,
-			ser_pdev_obj);
-
-	return;
-}
-
-/**
- * wlan_serialization_remove_cmd_from_active_queue() - helper function to remove
- *							cmd from pending queue
- * @psoc: pointer to psoc
- * @obj: pointer to object getting passed by object manager
- * @arg: argument passed by caller to object manager which comes to this cb
- *
- * caller provide this API as callback to object manager, and in turn
- * object manager iterate through each pdev and call this API callback.
- *
- * Return: none
- */
-static void
-wlan_serialization_remove_cmd_from_pending_queue(struct wlan_objmgr_psoc *psoc,
-		void *obj, void *arg)
-{
-	qdf_list_t *queue;
-	struct wlan_objmgr_pdev *pdev = obj;
-	struct wlan_serialization_pdev_priv_obj *ser_pdev_obj;
-	struct wlan_serialization_command *cmd = arg;
-
-	if (!pdev || !cmd) {
-		serialization_err("Invalid param");
-		return;
-	}
-
-	ser_pdev_obj = wlan_objmgr_pdev_get_comp_private_obj(pdev,
-			WLAN_UMAC_COMP_SERIALIZATION);
-	if (!ser_pdev_obj) {
-		serialization_err("Invalid ser_pdev_obj");
-		return;
-	}
-
-	if (cmd->cmd_type < WLAN_SER_CMD_NONSCAN)
-		queue = &ser_pdev_obj->pending_scan_list;
-	else
-		queue = &ser_pdev_obj->pending_list;
-
-	if (wlan_serialization_list_empty(queue, ser_pdev_obj)) {
-		serialization_err("Empty queue");
-		return;
-	}
-	wlan_serialization_remove_cmd_from_given_queue(queue,
-			cmd, ser_pdev_obj);
-
-	return;
-}
-
-/**
- * wlan_serialization_is_cmd_removed() - to check if requested command is
- *						removed
- * @psoc: pointer to soc
- * @cmd: given command to remove
- * @check_active_queue: flag to find out whether command needs to be removed
- *			from active queue or pending queue
- *
- * Return: true if removed else false
- */
-static bool
-wlan_serialization_is_cmd_removed(struct wlan_objmgr_psoc *psoc,
-		struct wlan_serialization_command *cmd,
-		bool check_active_queue)
-{
-	if (!psoc) {
-		serialization_err("Invalid psoc");
-		return false;
-	}
-
-	if (check_active_queue)
-		wlan_objmgr_iterate_obj_list(psoc, WLAN_PDEV_OP,
-			wlan_serialization_remove_cmd_from_active_queue,
-				cmd, 1, WLAN_SERIALIZATION_ID);
-	else
-		wlan_objmgr_iterate_obj_list(psoc, WLAN_PDEV_OP,
-			wlan_serialization_remove_cmd_from_pending_queue,
-			cmd, 1, WLAN_SERIALIZATION_ID);
-
-	if (cmd->vdev == NULL)
-		return true;
-
-	return false;
-}
-
-enum wlan_serialization_cmd_status
-wlan_serialization_dequeue_cmd(struct wlan_serialization_command *cmd,
-		uint8_t only_active_cmd)
-{
-	enum wlan_serialization_cmd_status status = WLAN_SER_CMD_NOT_FOUND;
-	struct wlan_objmgr_pdev *pdev;
-	struct wlan_objmgr_psoc *psoc;
-	struct wlan_serialization_pdev_priv_obj *ser_pdev_obj;
-	struct wlan_serialization_command cmd_backup;
-	enum wlan_serialization_cmd_type cmd_type;
-	bool is_cmd_removed;
-
-	if (!cmd) {
-		serialization_err("NULL command");
-		return status;
-	}
-	/* Dequeue process
-	 * 1) peek through command structure and see what is the command type
-	 * 2) two main types of commands to process
-	 *    a) SCAN
-	 *    b) NON-SCAN
-	 * 3) for each command there are separate command queues per pdev
-	 * 4) iterate through every pdev object and find the command and remove
-	 */
-
-	pdev = wlan_serialization_get_pdev_from_cmd(cmd);
-
-	if (pdev == NULL) {
-		serialization_err("invalid pdev");
-		return status;
-	}
-
-	psoc = wlan_pdev_get_psoc(pdev);
-	if (psoc == NULL) {
-		serialization_err("invalid psoc");
-		return status;
-	}
-
-	/* get priv object by wlan_objmgr_vdev_get_comp_private_obj */
-	ser_pdev_obj = wlan_objmgr_pdev_get_comp_private_obj(
-			pdev, WLAN_UMAC_COMP_SERIALIZATION);
-	if (!ser_pdev_obj) {
-		serialization_err("ser_pdev_obj is empty");
-		return status;
-	}
-	serialization_debug("command high_priority[%d] cmd_type[%d] cmd_id[%d]",
-			cmd->is_high_priority, cmd->cmd_type, cmd->cmd_id);
-	/*
-	 *  Pass the copy of command, instead of actual command because
-	 *  wlan_serialization_is_cmd_removed() api cleans the command
-	 *  buffer up on successful removal. We may need to use the command's
-	 *  content to stop the timer and etc.
-	 */
-	qdf_mem_copy(&cmd_backup, cmd,
-			sizeof(struct wlan_serialization_command));
-
-	cmd_type = cmd->cmd_type;
-	/* find and remove from active list */
-	if (only_active_cmd) {
-		wlan_serialization_find_and_stop_timer(psoc, cmd);
-		is_cmd_removed = wlan_serialization_is_cmd_removed(psoc,
-						&cmd_backup, true);
-		if (true == is_cmd_removed) {
-			/*
-			 * command is removed from active queue. now we have a
-			 * room in active queue, so we will move from relevant
-			 * pending queue to active queue
-			 */
-			wlan_serialization_move_pending_to_active(cmd_type,
-					ser_pdev_obj);
-			status = WLAN_SER_CMD_IN_ACTIVE_LIST;
-		} else {
-			serialization_err("cmd_type[%d], cmd_id[%d], vdev[%pK]",
-					cmd->cmd_type, cmd->cmd_id, cmd->vdev);
-			/*
-			 * if you come here means there is a possibility
-			 * that we couldn't find the command in active queue
-			 * which user has requested to remove or we couldn't
-			 * remove command from active queue and timer has been
-			 * stopped, so active queue may possibly stuck.
-			 */
-			QDF_ASSERT(0);
-			status = WLAN_SER_CMD_NOT_FOUND;
-		}
-		serialization_debug("Request to remove only from active queue");
-		return status;
-	}
-	qdf_mem_copy(&cmd_backup, cmd,
-			sizeof(struct wlan_serialization_command));
-	/* find and remove from pending list */
-	if (wlan_serialization_is_cmd_removed(psoc, &cmd_backup, false)) {
-		if (status != WLAN_SER_CMD_IN_ACTIVE_LIST)
-			status = WLAN_SER_CMD_IN_PENDING_LIST;
-		else
-			status = WLAN_SER_CMDS_IN_ALL_LISTS;
-	}
-
-	return status;
-}
-
-/**
- * wlan_serialization_cmd_cancel_handler() - helper func to cancel cmd
- * @ser_obj: private pdev ser obj
- * @cmd: pointer to command
- * @pdev: pointer to pdev
- * @vdev: pointer to vdev
- * @cmd_type: pointer to cmd_type
- *
- * This API will decide from which queue, command needs to be cancelled
- * and pass that queue and other parameter required to cancel the command
- * to helper function.
- *
- * Return: wlan_serialization_cmd_status
- */
-static enum wlan_serialization_cmd_status
-wlan_serialization_cmd_cancel_handler(
-		struct wlan_serialization_pdev_priv_obj *ser_obj,
-		struct wlan_serialization_command *cmd,
-		struct wlan_objmgr_pdev *pdev, struct wlan_objmgr_vdev *vdev,
-		enum wlan_serialization_cmd_type cmd_type)
-{
-	enum wlan_serialization_cmd_status status;
-	qdf_list_t *queue;
-
-	if (!ser_obj) {
-		serialization_err("invalid serial object");
-		return WLAN_SER_CMD_NOT_FOUND;
-	}
-	/* remove pending commands first */
-	if (cmd_type < WLAN_SER_CMD_NONSCAN)
-		queue = &ser_obj->pending_scan_list;
-	else
-		queue = &ser_obj->pending_list;
-	/* try and remove first from pending list */
-	status = wlan_serialization_remove_all_cmd_from_queue(queue,
-			ser_obj, pdev, vdev, cmd, false);
-	if (cmd_type < WLAN_SER_CMD_NONSCAN)
-		queue = &ser_obj->active_scan_list;
-	else
-		queue = &ser_obj->active_list;
-	/* try and remove next from active list */
-	if (WLAN_SER_CMD_IN_ACTIVE_LIST ==
-			wlan_serialization_remove_all_cmd_from_queue(queue,
-				ser_obj, pdev, vdev, cmd, true)) {
-		if (WLAN_SER_CMD_IN_PENDING_LIST == status)
-			status = WLAN_SER_CMDS_IN_ALL_LISTS;
-		else
-			status = WLAN_SER_CMD_IN_ACTIVE_LIST;
-	}
-
-	return status;
-}
-
-enum wlan_serialization_cmd_status
-wlan_serialization_find_and_cancel_cmd(
-		struct wlan_serialization_queued_cmd_info *cmd_info)
-{
-	struct wlan_serialization_command cmd;
-	enum wlan_serialization_cmd_status status = WLAN_SER_CMD_NOT_FOUND;
-	struct wlan_serialization_pdev_priv_obj *ser_obj = NULL;
-	struct wlan_objmgr_pdev *pdev;
-
-	if (!cmd_info) {
-		serialization_err("Invalid cmd_info");
-		return WLAN_SER_CMD_NOT_FOUND;
-	}
-	cmd.cmd_id = cmd_info->cmd_id;
-	cmd.cmd_type = cmd_info->cmd_type;
-	cmd.vdev = cmd_info->vdev;
-	pdev = wlan_serialization_get_pdev_from_cmd(&cmd);
-	if (!pdev) {
-		serialization_err("Invalid pdev");
-		return WLAN_SER_CMD_NOT_FOUND;
-	}
-	ser_obj = wlan_serialization_get_pdev_priv_obj(pdev);
-	if (!ser_obj) {
-		serialization_err("Invalid ser_obj");
-		return WLAN_SER_CMD_NOT_FOUND;
-	}
-
-	switch (cmd_info->req_type) {
-	case WLAN_SER_CANCEL_SINGLE_SCAN:
-		/* remove scan cmd which matches the given cmd struct */
-		status =  wlan_serialization_cmd_cancel_handler(ser_obj,
-				&cmd, NULL, NULL, cmd.cmd_type);
-		break;
-	case WLAN_SER_CANCEL_PDEV_SCANS:
-		/* remove all scan cmds which matches the pdev object */
-		status = wlan_serialization_cmd_cancel_handler(ser_obj,
-				NULL,
-				wlan_vdev_get_pdev(cmd.vdev),
-				NULL, cmd.cmd_type);
-		break;
-	case WLAN_SER_CANCEL_VDEV_SCANS:
-		/* remove all scan cmds which matches the vdev object */
-		status = wlan_serialization_cmd_cancel_handler(ser_obj,
-				NULL, NULL,
-				cmd.vdev, cmd.cmd_type);
-		break;
-	case WLAN_SER_CANCEL_NON_SCAN_CMD:
-		/* remove nonscan cmd which matches the given cmd */
-		status = wlan_serialization_cmd_cancel_handler(ser_obj,
-				&cmd, NULL, NULL, cmd.cmd_type);
-		break;
-	default:
-		serialization_err("Invalid request");
-	}
-
-	return status;
-}
-
-QDF_STATUS wlan_serialization_find_and_remove_cmd(
-		struct wlan_serialization_queued_cmd_info *cmd_info)
-{
-	struct wlan_serialization_command cmd;
-
-	if (!cmd_info) {
-		serialization_err("Invalid cmd_info");
-		return QDF_STATUS_E_FAILURE;
-	}
-
-	cmd.cmd_id = cmd_info->cmd_id;
-	cmd.cmd_type = cmd_info->cmd_type;
-	cmd.vdev = cmd_info->vdev;
-	if (WLAN_SER_CMD_IN_ACTIVE_LIST !=
-			wlan_serialization_dequeue_cmd(&cmd, true)) {
-		serialization_err("Can't dequeue requested cmd_id[%d] type[%d]",
-				cmd_info->cmd_id, cmd_info->cmd_type);
-		return QDF_STATUS_E_FAILURE;
-	}
-
-	return QDF_STATUS_SUCCESS;
-}
-#endif

+ 0 - 275
umac/cmn_services/serialization/src/wlan_serialization_enqueue.c

@@ -1,275 +0,0 @@
-/*
- * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
- *
- * Permission to use, copy, modify, and/or distribute this software for
- * any purpose with or without fee is hereby granted, provided that the
- * above copyright notice and this permission notice appear in all
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-/**
- * DOC: wlan_serialization_enqueue.c
- * This file defines the routines which are pertinent
- * to the queuing of commands.
- */
-#ifdef CONFIG_SERIALIZATION_V1
-#include <wlan_serialization_api.h>
-#include "wlan_serialization_main_i.h"
-#include "wlan_serialization_utils_i.h"
-#include <wlan_objmgr_vdev_obj.h>
-#include <wlan_objmgr_pdev_obj.h>
-#include <wlan_objmgr_psoc_obj.h>
-#include <qdf_list.h>
-
-static enum wlan_serialization_status
-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,
-			struct wlan_serialization_command_list **pcmd_list)
-{
-	struct wlan_serialization_command_list *cmd_list;
-	enum wlan_serialization_status status;
-	QDF_STATUS qdf_status;
-	qdf_list_node_t *nnode;
-
-	if (!cmd || !queue || !ser_pdev_obj || !psoc) {
-		serialization_err("Input arguments are not valid");
-		return WLAN_SER_CMD_DENIED_UNSPECIFIED;
-	}
-	serialization_debug("add cmd  cmd_id-%d type-%d",
-			    cmd->cmd_id, cmd->cmd_type);
-	if (wlan_serialization_list_empty(&ser_pdev_obj->global_cmd_pool_list,
-					  ser_pdev_obj)) {
-		serialization_err("list is full, can't add more");
-		return WLAN_SER_CMD_DENIED_LIST_FULL;
-	}
-	if (wlan_serialization_remove_front(&ser_pdev_obj->global_cmd_pool_list,
-					    &nnode, ser_pdev_obj) !=
-					    QDF_STATUS_SUCCESS) {
-		serialization_err("Failed to get cmd buffer from global pool");
-		return WLAN_SER_CMD_DENIED_UNSPECIFIED;
-	}
-	cmd_list = qdf_container_of(nnode,
-			struct wlan_serialization_command_list, node);
-	qdf_mem_copy(&cmd_list->cmd, cmd,
-			sizeof(struct wlan_serialization_command));
-	if (cmd->is_high_priority)
-		qdf_status = wlan_serialization_insert_front(queue,
-							     &cmd_list->node,
-							     ser_pdev_obj);
-	else
-		qdf_status = wlan_serialization_insert_back(queue,
-							    &cmd_list->node,
-							    ser_pdev_obj);
-	if (qdf_status != QDF_STATUS_SUCCESS) {
-		qdf_mem_zero(&cmd_list->cmd,
-				sizeof(struct wlan_serialization_command));
-		qdf_status = wlan_serialization_insert_back(
-					&ser_pdev_obj->global_cmd_pool_list,
-					&cmd_list->node,
-					ser_pdev_obj);
-		if (QDF_STATUS_SUCCESS != qdf_status) {
-			serialization_err("can't put cmd back to global pool");
-			QDF_ASSERT(0);
-		}
-		return WLAN_SER_CMD_DENIED_UNSPECIFIED;
-	}
-	qdf_atomic_set_bit(CMD_IS_ACTIVE, &cmd_list->cmd_in_use);
-	*pcmd_list = cmd_list;
-	if (is_cmd_for_active_queue)
-		status = WLAN_SER_CMD_ACTIVE;
-	else
-		status = WLAN_SER_CMD_PENDING;
-
-	return status;
-}
-
-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;
-	struct wlan_objmgr_psoc *psoc = NULL;
-
-	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;
-	if (wlan_serialization_list_empty(queue, ser_pdev_obj)) {
-		serialization_err("nothing in active queue");
-		QDF_ASSERT(0);
-		return;
-	}
-	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;
-	}
-
-	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);
-	/*
-	 * 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_IS_STATUS_SUCCESS(qdf_status))
-		return;
-	/*
-	 * Since the command activation has not succeeded,
-	 * remove the cmd from the active list and before
-	 * doing so, try to mark the cmd for delete so that
-	 * it is not accessed in other thread context for deletion
-	 * again.
-	 */
-	if (wlan_serialization_is_cmd_present_in_active_queue(
-		psoc, &cmd_list->cmd)) {
-		wlan_serialization_find_and_stop_timer(psoc,
-						&cmd_list->cmd);
-		if (qdf_atomic_test_and_set_bit(CMD_MARKED_FOR_DELETE,
-						&cmd_list->cmd_in_use)) {
-			serialization_debug("SER_CMD already being deleted");
-		} else {
-			serialization_debug("SER_CMD marked for removal");
-			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);
-		}
-	} else {
-		serialization_err("active cmd :%d,id:%d is removed already",
-				  cmd_list->cmd.cmd_type,
-				  cmd_list->cmd.cmd_id);
-	}
-	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,
-			struct wlan_serialization_command_list **pcmd_list)
-{
-	enum wlan_serialization_status status = WLAN_SER_CMD_DENIED_UNSPECIFIED;
-	struct wlan_objmgr_pdev *pdev;
-	struct wlan_objmgr_psoc *psoc;
-	struct wlan_serialization_pdev_priv_obj *ser_pdev_obj;
-	qdf_list_t *queue;
-
-	/* Enqueue process
-	 * 1) peek through command structure and see what is the command type
-	 * 2) two main types of commands to process
-	 *    a) SCAN
-	 *    b) NON-SCAN
-	 * 3) for each command there are separate command queues per pdev
-	 * 4) pull pdev from vdev structure and get the command queue associated
-	 *    with that pdev and try to enqueue on those queue
-	 * 5) Thumb rule:
-	 *    a) There could be only 1 active non-scan command at a
-	 *       time including all total non-scan commands of all pdevs.
-	 *
-	 *       example: pdev1 has 1 non-scan active command and
-	 *       pdev2 got 1 non-scan command then that command should go to
-	 *       pdev2's pending queue
-	 *
-	 *    b) There could be only N number of scan commands at a time
-	 *       including all total scan commands of all pdevs
-	 *
-	 *       example: Let's say N=8,
-	 *       pdev1's vdev1 has 5 scan command, pdev2's vdev1 has 3
-	 *       scan commands, if we get scan request on vdev2 then it will go
-	 *       to pending queue of vdev2 as we reached max allowed scan active
-	 *       command.
-	 */
-	if (!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");
-		return status;
-	}
-
-	psoc = wlan_pdev_get_psoc(pdev);
-	if (psoc == NULL) {
-		serialization_err("invalid psoc");
-		return status;
-	}
-
-	/* get priv object by wlan_objmgr_vdev_get_comp_private_obj */
-	ser_pdev_obj = wlan_objmgr_pdev_get_comp_private_obj(
-			pdev, WLAN_UMAC_COMP_SERIALIZATION);
-	if (!ser_pdev_obj) {
-		serialization_err("Can't find ser_pdev_obj");
-		return status;
-	}
-
-	serialization_debug("command high_priority[%d] cmd_type[%d] cmd_id[%d]",
-			cmd->is_high_priority, cmd->cmd_type, cmd->cmd_id);
-	if (cmd->cmd_type < WLAN_SER_CMD_NONSCAN) {
-		if (is_cmd_for_active_queue)
-			queue = &ser_pdev_obj->active_scan_list;
-		else
-			queue = &ser_pdev_obj->pending_scan_list;
-	} else {
-		if (is_cmd_for_active_queue)
-			queue = &ser_pdev_obj->active_list;
-		else
-			queue = &ser_pdev_obj->pending_list;
-	}
-
-	if (wlan_serialization_is_cmd_present_queue(cmd,
-				is_cmd_for_active_queue)) {
-		serialization_err("duplicate command, can't enqueue");
-		return status;
-	}
-
-	return wlan_serialization_add_cmd_to_given_queue(queue, cmd, psoc,
-			ser_pdev_obj, is_cmd_for_active_queue, pcmd_list);
-}
-#endif

+ 1 - 394
umac/cmn_services/serialization/src/wlan_serialization_main.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2019 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -22,399 +22,7 @@
  * serialization to initialize and de-initialize the
  * component.
  */
-#ifdef CONFIG_SERIALIZATION_V1
-#include "qdf_status.h"
-#include "qdf_list.h"
-#include "wlan_objmgr_cmn.h"
-#include "wlan_objmgr_global_obj.h"
-#include "wlan_objmgr_psoc_obj.h"
-#include "wlan_serialization_main_i.h"
-#include "wlan_serialization_rules_i.h"
-#include "wlan_serialization_utils_i.h"
-
-QDF_STATUS wlan_serialization_psoc_close(struct wlan_objmgr_psoc *psoc)
-{
-	QDF_STATUS status;
-	struct wlan_serialization_psoc_priv_obj *ser_soc_obj =
-		wlan_serialization_get_psoc_priv_obj(psoc);
-
-	if (!ser_soc_obj) {
-		serialization_err("invalid ser_soc_obj");
-		return QDF_STATUS_E_FAILURE;
-	}
-	/* clean up all timers before exiting */
-	status = wlan_serialization_cleanup_all_timers(ser_soc_obj);
-	if (status != QDF_STATUS_SUCCESS)
-		serialization_err("ser cleanning up all timer failed");
-
-	qdf_mem_free(ser_soc_obj->timers);
-	ser_soc_obj->timers = NULL;
-	ser_soc_obj->max_active_cmds = 0;
-
-	return status;
-}
-
-QDF_STATUS wlan_serialization_psoc_open(struct wlan_objmgr_psoc *psoc)
-{
-	uint8_t pdev_count;
-	struct wlan_serialization_psoc_priv_obj *ser_soc_obj =
-		wlan_serialization_get_psoc_priv_obj(psoc);
-
-	if (!ser_soc_obj) {
-		serialization_err("invalid ser_soc_obj");
-		return QDF_STATUS_E_FAILURE;
-	}
-	/* TODO:Get WLAN_SERIALIZATION_MAX_ACTIVE_SCAN_CMDS frm service ready */
-	pdev_count = wlan_psoc_get_pdev_count(psoc);
-	ser_soc_obj->max_active_cmds = WLAN_SERIALIZATION_MAX_ACTIVE_SCAN_CMDS +
-		pdev_count;
-	ser_soc_obj->timers =
-		qdf_mem_malloc(sizeof(struct wlan_serialization_timer) *
-				ser_soc_obj->max_active_cmds);
-	if (NULL == ser_soc_obj->timers) {
-		serialization_alert("Mem alloc failed for ser timers");
-		return QDF_STATUS_E_NOMEM;
-	}
-
-	return QDF_STATUS_SUCCESS;
-}
-
-/**
- * wlan_serialization_psoc_obj_create_notification() - PSOC obj create callback
- * @psoc: PSOC object
- * @arg_list: Variable argument list
- *
- * This callback is registered with object manager during initialization and
- * when obj manager gets its turn to create the object, it would notify each
- * component with the corresponding callback registered to inform the
- * completion of the creation of the respective object.
- *
- * Return: QDF Status
- */
-static QDF_STATUS wlan_serialization_psoc_obj_create_notification(
-		struct wlan_objmgr_psoc *psoc, void *arg_list)
-{
-	struct wlan_serialization_psoc_priv_obj *soc_ser_obj;
-
-	soc_ser_obj =
-		qdf_mem_malloc(sizeof(*soc_ser_obj));
-	if (NULL == soc_ser_obj) {
-		serialization_alert("Mem alloc failed for ser psoc priv obj");
-		return QDF_STATUS_E_NOMEM;
-	}
-	wlan_objmgr_psoc_component_obj_attach(psoc,
-			WLAN_UMAC_COMP_SERIALIZATION, soc_ser_obj,
-			QDF_STATUS_SUCCESS);
-	serialization_debug("ser psoc obj created");
-
-	return QDF_STATUS_SUCCESS;
-}
-
-/**
- * wlan_serialization_destroy_cmd_pool() - Destroy the global cmd pool
- * @ser_pdev_obj: Serialization private pdev object
- *
- * Return: None
- */
-static void wlan_serialization_destroy_cmd_pool(
-		  struct wlan_serialization_pdev_priv_obj *ser_pdev_obj)
-{
-
-	qdf_list_node_t *node = NULL;
-	struct wlan_serialization_command_list *cmd_list;
-
-	while (!qdf_list_empty(&ser_pdev_obj->global_cmd_pool_list)) {
-		qdf_list_remove_front(&ser_pdev_obj->global_cmd_pool_list,
-				&node);
-		cmd_list = (struct wlan_serialization_command_list *)node;
-		serialization_debug("Node being freed from global pool %pK",
-				cmd_list);
-		qdf_mem_free(cmd_list);
-
-	}
-	qdf_list_destroy(&ser_pdev_obj->global_cmd_pool_list);
-}
-
-/**
- * wlan_serialization_create_cmd_pool() - Create the global cmd pool
- * @pdev: PDEV Object
- * @ser_pdev_obj: Serialization private pdev object
- *
- * Global command pool of memory is created here.
- * It is safe to allocate memory individually for each command rather than
- * requesting for a huge chunk of memory at once.
- *
- * The individual command nodes allocated above will keep moving between
- * the active, pending and global pool lists dynamically, but all the
- * memory will be freed during driver unload only.
- *
- * Return: QDF Status
- */
-static QDF_STATUS
-wlan_serialization_create_cmd_pool(struct wlan_objmgr_pdev *pdev,
-		struct wlan_serialization_pdev_priv_obj *ser_pdev_obj)
-{
-	struct wlan_serialization_command_list *cmd_list_ptr;
-	uint8_t i;
-
-	for (i = 0; i < WLAN_SERIALIZATION_MAX_GLOBAL_POOL_CMDS; i++) {
-		cmd_list_ptr = qdf_mem_malloc(sizeof(*cmd_list_ptr));
-		if (NULL == cmd_list_ptr) {
-			serialization_alert("Mem alloc failed for cmd node");
-			wlan_serialization_destroy_cmd_pool(ser_pdev_obj);
-			return QDF_STATUS_E_NOMEM;
-		}
-		qdf_list_insert_back(
-				&ser_pdev_obj->global_cmd_pool_list,
-				&cmd_list_ptr->node);
-		cmd_list_ptr->cmd_in_use = 0;
-		serialization_debug("Created node at %pK and inserted to pool",
-				cmd_list_ptr);
-	}
-
-	return QDF_STATUS_SUCCESS;
-}
-
-
-/**
- * wlan_serialization_pdev_obj_create_notification() - PDEV obj create callback
- * @pdev: PDEV object
- * @arg_list: Variable argument list
- *
- * This callback is registered with object manager during initialization and
- * when obj manager gets its turn to create the object, it would notify each
- * component with the corresponding callback registered to inform the
- * completion of the creation of the respective object.
- *
- * Return: QDF Status
- */
-static QDF_STATUS wlan_serialization_pdev_obj_create_notification(
-		struct wlan_objmgr_pdev *pdev, void *arg_list)
-{
-	struct wlan_serialization_pdev_priv_obj *ser_pdev_obj;
-	QDF_STATUS status;
-
-	ser_pdev_obj =
-		qdf_mem_malloc(sizeof(*ser_pdev_obj));
-	if (NULL == ser_pdev_obj) {
-		serialization_alert("Mem alloc failed for ser pdev obj");
-		return QDF_STATUS_E_NOMEM;
-	}
-	status = wlan_serialization_create_lock(ser_pdev_obj);
-	if (status != QDF_STATUS_SUCCESS) {
-		serialization_err("Failed to create serialization lock");
-		return status;
-	}
-	qdf_list_create(&ser_pdev_obj->active_list,
-			WLAN_SERIALIZATION_MAX_ACTIVE_CMDS);
-	qdf_list_create(&ser_pdev_obj->pending_list,
-			WLAN_SERIALIZATION_MAX_GLOBAL_POOL_CMDS);
-	qdf_list_create(&ser_pdev_obj->active_scan_list,
-			WLAN_SERIALIZATION_MAX_ACTIVE_SCAN_CMDS);
-	qdf_list_create(&ser_pdev_obj->pending_scan_list,
-			WLAN_SERIALIZATION_MAX_GLOBAL_POOL_CMDS);
-	qdf_list_create(&ser_pdev_obj->global_cmd_pool_list,
-			WLAN_SERIALIZATION_MAX_GLOBAL_POOL_CMDS);
-	status = wlan_serialization_create_cmd_pool(pdev, ser_pdev_obj);
-	if (status != QDF_STATUS_SUCCESS) {
-		serialization_err("ser_pdev_obj failed status %d", status);
-		return status;
-	}
-	status = wlan_objmgr_pdev_component_obj_attach(pdev,
-		WLAN_UMAC_COMP_SERIALIZATION, ser_pdev_obj,
-		QDF_STATUS_SUCCESS);
-	if (status != QDF_STATUS_SUCCESS) {
-		serialization_err("serialization pdev obj attach failed");
-		return status;
-	}
-
-	return status;
-}
-
-/**
- * wlan_serialization_psoc_obj_destroy_notification() - PSOC obj delete callback
- * @psoc: PSOC object
- * @arg_list: Variable argument list
- *
- * This callback is registered with object manager during initialization and
- * when obj manager gets its turn to delete the object, it would notify each
- * component with the corresponding callback registered to inform the
- * completion of the deletion of the respective object.
- *
- * Return: QDF Status
- */
-static QDF_STATUS wlan_serialization_psoc_obj_destroy_notification(
-		struct wlan_objmgr_psoc *psoc, void *arg_list)
-{
-	QDF_STATUS status;
-	struct wlan_serialization_psoc_priv_obj *ser_soc_obj =
-		wlan_serialization_get_psoc_priv_obj(psoc);
-
-	if (NULL == ser_soc_obj) {
-		serialization_err("invalid ser_soc_obj");
-		return QDF_STATUS_E_FAULT;
-	}
-	status = wlan_objmgr_psoc_component_obj_detach(psoc,
-			WLAN_UMAC_COMP_SERIALIZATION,
-			ser_soc_obj);
-	if (status != QDF_STATUS_SUCCESS)
-		serialization_err("ser psoc private obj detach failed");
-	serialization_debug("ser psoc obj deleted with status %d", status);
-	qdf_mem_free(ser_soc_obj);
-
-	return status;
-}
-
-/**
- * wlan_serialization_pdev_obj_destroy_notification() - PDEV obj delete callback
- * @pdev: PDEV object
- * @arg_list: Variable argument list
- *
- * This callback is registered with object manager during initialization and
- * when obj manager gets its turn to delete the object, it would notify each
- * component with the corresponding callback registered to inform the
- * completion of the deletion of the respective object.
- *
- * Return: QDF Status
- */
-static QDF_STATUS wlan_serialization_pdev_obj_destroy_notification(
-		struct wlan_objmgr_pdev *pdev, void *arg_list)
-{
-	QDF_STATUS status;
-	struct wlan_serialization_pdev_priv_obj *ser_pdev_obj =
-		wlan_serialization_get_pdev_priv_obj(pdev);
-
-	status = wlan_objmgr_pdev_component_obj_detach(pdev,
-			WLAN_UMAC_COMP_SERIALIZATION, ser_pdev_obj);
-	wlan_serialization_destroy_list(ser_pdev_obj,
-					&ser_pdev_obj->active_list);
-	wlan_serialization_destroy_list(ser_pdev_obj,
-					&ser_pdev_obj->pending_list);
-	wlan_serialization_destroy_list(ser_pdev_obj,
-					&ser_pdev_obj->active_scan_list);
-	wlan_serialization_destroy_list(ser_pdev_obj,
-					&ser_pdev_obj->pending_scan_list);
-	wlan_serialization_destroy_cmd_pool(ser_pdev_obj);
-	serialization_debug("ser pdev obj detached with status %d", status);
-	status = wlan_serialization_destroy_lock(ser_pdev_obj);
-	if (status != QDF_STATUS_SUCCESS)
-		serialization_err("Failed to destroy serialization lock");
-	qdf_mem_free(ser_pdev_obj);
-
-	return status;
-}
-
-QDF_STATUS wlan_serialization_init(void)
-{
-	QDF_STATUS status = QDF_STATUS_SUCCESS;
-
-	status = wlan_objmgr_register_psoc_create_handler(
-			WLAN_UMAC_COMP_SERIALIZATION,
-			wlan_serialization_psoc_obj_create_notification, NULL);
-	if (status != QDF_STATUS_SUCCESS) {
-		serialization_err("Failed to reg soc ser obj create handler");
-		goto err_psoc_create;
-	}
-
-	status = wlan_objmgr_register_psoc_destroy_handler(
-			WLAN_UMAC_COMP_SERIALIZATION,
-			wlan_serialization_psoc_obj_destroy_notification, NULL);
-	if (status != QDF_STATUS_SUCCESS) {
-		serialization_err("Failed to reg soc ser obj delete handler");
-		goto err_psoc_delete;
-	}
 
-	status = wlan_objmgr_register_pdev_create_handler(
-			WLAN_UMAC_COMP_SERIALIZATION,
-			wlan_serialization_pdev_obj_create_notification, NULL);
-	if (status != QDF_STATUS_SUCCESS) {
-		serialization_err("Failed to reg pdev ser obj create handler");
-		goto err_pdev_create;
-	}
-
-	status = wlan_objmgr_register_pdev_destroy_handler(
-			WLAN_UMAC_COMP_SERIALIZATION,
-			wlan_serialization_pdev_obj_destroy_notification, NULL);
-	if (status != QDF_STATUS_SUCCESS) {
-		serialization_err("Failed to reg pdev ser obj delete handler");
-		goto err_pdev_delete;
-	}
-
-	serialization_debug("serialization handlers registered with obj mgr");
-
-	return QDF_STATUS_SUCCESS;
-
-err_vdev_delete:
-	wlan_objmgr_unregister_vdev_create_handler(WLAN_UMAC_COMP_SERIALIZATION,
-			wlan_serialization_vdev_obj_create_notification, NULL);
-err_vdev_create:
-	wlan_objmgr_unregister_pdev_destroy_handler(
-			WLAN_UMAC_COMP_SERIALIZATION,
-			wlan_serialization_pdev_obj_destroy_notification, NULL);
-err_pdev_delete:
-	wlan_objmgr_unregister_pdev_create_handler(WLAN_UMAC_COMP_SERIALIZATION,
-			wlan_serialization_pdev_obj_create_notification, NULL);
-err_pdev_create:
-	wlan_objmgr_unregister_psoc_destroy_handler(
-			WLAN_UMAC_COMP_SERIALIZATION,
-			wlan_serialization_psoc_obj_destroy_notification, NULL);
-err_psoc_delete:
-	wlan_objmgr_unregister_psoc_create_handler(WLAN_UMAC_COMP_SERIALIZATION,
-			 wlan_serialization_psoc_obj_create_notification, NULL);
-err_psoc_create:
-	return status;
-
-}
-
-QDF_STATUS wlan_serialization_deinit(void)
-{
-	QDF_STATUS status;
-	QDF_STATUS ret_status = QDF_STATUS_SUCCESS;
-
-	status = wlan_objmgr_unregister_psoc_create_handler(
-			WLAN_UMAC_COMP_SERIALIZATION,
-			wlan_serialization_psoc_obj_create_notification,
-			NULL);
-	if (status != QDF_STATUS_SUCCESS) {
-		serialization_err("unreg fail for psoc ser obj create notf:%d",
-				status);
-		ret_status = QDF_STATUS_E_FAILURE;
-	}
-	status = wlan_objmgr_unregister_psoc_destroy_handler(
-			WLAN_UMAC_COMP_SERIALIZATION,
-			wlan_serialization_psoc_obj_destroy_notification,
-			NULL);
-	if (status != QDF_STATUS_SUCCESS) {
-		serialization_err("unreg fail for psoc ser obj destroy notf:%d",
-				status);
-		ret_status = QDF_STATUS_E_FAILURE;
-	}
-
-	status = wlan_objmgr_unregister_pdev_create_handler(
-			WLAN_UMAC_COMP_SERIALIZATION,
-			wlan_serialization_pdev_obj_create_notification,
-			NULL);
-	if (status != QDF_STATUS_SUCCESS) {
-		serialization_err("unreg fail for pdev ser obj create notf:%d",
-				status);
-		ret_status = QDF_STATUS_E_FAILURE;
-	}
-
-	status = wlan_objmgr_unregister_pdev_destroy_handler(
-			WLAN_UMAC_COMP_SERIALIZATION,
-			wlan_serialization_pdev_obj_destroy_notification,
-			NULL);
-	if (status != QDF_STATUS_SUCCESS) {
-		serialization_err("unreg fail for pdev ser destroy notf:%d",
-				status);
-		ret_status = QDF_STATUS_E_FAILURE;
-	}
-
-	serialization_alert("deregistered callbacks with obj mgr successfully");
-
-	return ret_status;
-}
-#else /* New serialition code*/
 #include <qdf_status.h>
 #include <qdf_list.h>
 #include <wlan_objmgr_cmn.h>
@@ -1001,4 +609,3 @@ QDF_STATUS wlan_serialization_deinit(void)
 
 	return ret_status;
 }
-#endif

+ 0 - 54
umac/cmn_services/serialization/src/wlan_serialization_main_i.h

@@ -23,59 +23,6 @@
 #ifndef __WLAN_SERIALIZATION_MAIN_I_H
 #define __WLAN_SERIALIZATION_MAIN_I_H
 
-#ifdef CONFIG_SERIALIZATION_V1
-/* Include files */
-#include "wlan_objmgr_cmn.h"
-#include "wlan_objmgr_psoc_obj.h"
-#include "wlan_objmgr_pdev_obj.h"
-#include "qdf_mc_timer.h"
-
-#define WLAN_SERIALIZATION_MAX_GLOBAL_POOL_CMDS 24
-#define WLAN_SERIALIZATION_MAX_ACTIVE_CMDS 1
-#define WLAN_SERIALIZATION_MAX_ACTIVE_SCAN_CMDS 8
-
-#define serialization_alert(params...) \
-	QDF_TRACE_FATAL(QDF_MODULE_ID_SERIALIZATION, params)
-#define serialization_err(params...) \
-	QDF_TRACE_ERROR(QDF_MODULE_ID_SERIALIZATION, params)
-#define serialization_warn(params...) \
-	QDF_TRACE_WARN(QDF_MODULE_ID_SERIALIZATION, params)
-#define serialization_info(params...) \
-	QDF_TRACE_INFO(QDF_MODULE_ID_SERIALIZATION, params)
-#define serialization_debug(params...) \
-	QDF_TRACE_DEBUG(QDF_MODULE_ID_SERIALIZATION, params)
-
-#define serialization_nofl_alert(params...) \
-	QDF_TRACE_FATAL_NO_FL(QDF_MODULE_ID_SERIALIZATION, params)
-#define serialization_nofl_err(params...) \
-	QDF_TRACE_ERROR_NO_FL(QDF_MODULE_ID_SERIALIZATION, params)
-#define serialization_nofl_warn(params...) \
-	QDF_TRACE_WARN_NO_FL(QDF_MODULE_ID_SERIALIZATION, params)
-#define serialization_nofl_info(params...) \
-	QDF_TRACE_INFO_NO_FL(QDF_MODULE_ID_SERIALIZATION, params)
-#define serialization_nofl_debug(params...) \
-	QDF_TRACE_DEBUG_NO_FL(QDF_MODULE_ID_SERIALIZATION, params)
-
-#define serialization_enter() \
-	QDF_TRACE_ENTER(QDF_MODULE_ID_SERIALIZATION, "enter")
-#define serialization_exit() \
-	QDF_TRACE_EXIT(QDF_MODULE_ID_SERIALIZATION, "exit")
-
-/**
- * struct serialization_legacy_callback - to handle legacy serialization cb
- *
- * @serialization_purge_cmd_list: function ptr to be filled by serialization
- *				  module
- *
- * Some of the legacy modules wants to call API to purge the commands in
- * order to handle backward compatibility.
- */
-struct serialization_legacy_callback {
-	void (*serialization_purge_cmd_list) (struct wlan_objmgr_psoc *,
-		struct wlan_objmgr_vdev *, bool, bool, bool, bool, bool);
-};
-#else /*New serialization code*/
-/* Include files */
 #include <wlan_objmgr_cmn.h>
 #include <wlan_objmgr_psoc_obj.h>
 #include <wlan_objmgr_pdev_obj.h>
@@ -126,4 +73,3 @@ struct serialization_legacy_callback {
 					     bool, bool, bool, bool, bool);
 };
 #endif
-#endif

+ 2 - 977
umac/cmn_services/serialization/src/wlan_serialization_utils.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2019 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -15,986 +15,12 @@
  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  * PERFORMANCE OF THIS SOFTWARE.
  */
+
 /**
  * DOC: wlan_serialization_utils.c
  * This file defines the utility helper functions for serialization component.
  */
 
-#ifdef CONFIG_SERIALIZATION_V1
-#include "wlan_serialization_utils_i.h"
-#include "wlan_serialization_main_i.h"
-#include "wlan_serialization_api.h"
-#include "wlan_objmgr_vdev_obj.h"
-#include "wlan_objmgr_pdev_obj.h"
-#include "qdf_mc_timer.h"
-#include "wlan_utility.h"
-#include "qdf_platform.h"
-
-QDF_STATUS
-wlan_serialization_put_back_to_global_list(qdf_list_t *queue,
-		struct wlan_serialization_pdev_priv_obj *ser_pdev_obj,
-		struct wlan_serialization_command_list *cmd_list)
-{
-	QDF_STATUS status;
-	uint32_t cmd_id, cmd_type;
-
-	if (!queue || !ser_pdev_obj || !cmd_list) {
-		serialization_err("input parameters are invalid");
-		return QDF_STATUS_E_FAILURE;
-	}
-	/*
-	 * if the command is already removed in other context,
-	 * then it will be marked as inactive with the same
-	 * below code. So, test before proceeding.
-	 */
-	if (!qdf_atomic_test_and_clear_bit(CMD_IS_ACTIVE,
-					   &cmd_list->cmd_in_use)) {
-		serialization_debug("CMD is not active or being used");
-		return QDF_STATUS_SUCCESS;
-	}
-	status = wlan_serialization_remove_node(queue, &cmd_list->node,
-						ser_pdev_obj);
-	if (QDF_STATUS_SUCCESS != status) {
-		serialization_err("can't remove cmd from queue");
-		/* assert to catch any leaks */
-		QDF_ASSERT(0);
-		return status;
-	}
-	cmd_id = cmd_list->cmd.cmd_id;
-	cmd_type = cmd_list->cmd.cmd_type;
-	qdf_mem_zero(&cmd_list->cmd, sizeof(struct wlan_serialization_command));
-	status = wlan_serialization_insert_back(
-			&ser_pdev_obj->global_cmd_pool_list,
-			&cmd_list->node, ser_pdev_obj);
-	qdf_atomic_clear_bit(CMD_MARKED_FOR_DELETE, &cmd_list->cmd_in_use);
-	if (QDF_STATUS_SUCCESS != status) {
-		serialization_err("can't put command back to global pool");
-		QDF_ASSERT(0);
-	}
-	serialization_debug("cmd_id-%d, cmd_type-%d", cmd_id, cmd_type);
-
-	return status;
-}
-
-struct wlan_objmgr_pdev*
-wlan_serialization_get_pdev_from_cmd(struct wlan_serialization_command *cmd)
-{
-	struct wlan_objmgr_pdev *pdev = NULL;
-
-	if (!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;
-}
-
-QDF_STATUS wlan_serialization_get_cmd_from_queue(qdf_list_t *queue,
-			qdf_list_node_t **nnode,
-			struct wlan_serialization_pdev_priv_obj *ser_pdev_obj)
-{
-	QDF_STATUS status;
-	qdf_list_node_t *pnode;
-
-	if (!queue || !ser_pdev_obj) {
-		serialization_err("input parameters are invalid");
-		return QDF_STATUS_E_FAILURE;
-	}
-
-	pnode = *nnode;
-	if (!pnode)
-		status = wlan_serialization_peek_front(queue, nnode,
-						       ser_pdev_obj);
-	else
-		status = wlan_serialization_peek_next(queue, pnode, nnode,
-						      ser_pdev_obj);
-
-	if (status != QDF_STATUS_SUCCESS) {
-		serialization_err("can't get next node from queue");
-	}
-
-	return status;
-}
-
-/**
- * wlan_serialization_timer_destroy() - destroys the timer
- * @ser_timer: pointer to particular timer
- *
- * This API destroys the memory allocated by timer and assigns cmd member of
- * that timer structure to NULL
- *
- * Return: QDF_STATUS
- */
-static QDF_STATUS wlan_serialization_timer_destroy(
-		struct wlan_serialization_timer *ser_timer)
-{
-	QDF_STATUS status = QDF_STATUS_E_FAILURE;
-
-	if (!ser_timer || !ser_timer->cmd) {
-		serialization_debug("Invalid ser_timer");
-		return status;
-	}
-	status = qdf_mc_timer_destroy(&ser_timer->timer);
-	if (!QDF_IS_STATUS_SUCCESS(status)) {
-		serialization_err("Failed to destroy timer for cmd_id[%d]",
-				ser_timer->cmd->cmd_id);
-		QDF_ASSERT(0);
-		return status;
-	}
-	ser_timer->cmd = NULL;
-
-	return status;
-}
-
-static void wlan_serialization_non_scan_timeout_action(void)
-{
-	qdf_trigger_self_recovery();
-}
-
-/**
- * wlan_serialization_generic_timer_callback() - timer callback when timer fire
- * @arg: argument that timer passes to this callback
- *
- * All the timers in serialization module calls this callback when they fire,
- * and this API in turn calls command specific timeout callback and remove
- * timed-out command from active queue and move any pending command to active
- * queue of same cmd_type.
- *
- * Return: none
- */
-static void wlan_serialization_generic_timer_callback(void *arg)
-{
-	struct wlan_serialization_timer *timer = arg;
-	struct wlan_serialization_command *cmd = timer->cmd;
-	uint8_t vdev_id = WLAN_INVALID_VDEV_ID;
-
-	if (!cmd) {
-		serialization_err("command not found");
-		QDF_ASSERT(0);
-		return;
-	}
-
-	if (cmd->vdev)
-		vdev_id = wlan_vdev_get_id(cmd->vdev);
-
-	serialization_err("active cmd timeout for cmd_type[%d] vdev_id[%d]",
-			  cmd->cmd_type, vdev_id);
-
-	if (cmd->cmd_cb)
-		cmd->cmd_cb(cmd, WLAN_SER_CB_ACTIVE_CMD_TIMEOUT);
-
-	if (cmd->cmd_type >= WLAN_SER_CMD_NONSCAN)
-		wlan_serialization_non_scan_timeout_action();
-	/*
-	 * dequeue cmd API will cleanup and destroy the timer. If it fails to
-	 * dequeue command then we have to destroy the timer. It will also call
-	 * cmd callback with WLAN_SER_CB_RELEASE_MEM_CMD to free the memory.
-	 */
-	if (WLAN_SER_CMD_NOT_FOUND == wlan_serialization_dequeue_cmd(cmd, true))
-		wlan_serialization_timer_destroy(timer);
-	if (cmd->cmd_cb)
-		cmd->cmd_cb(cmd, WLAN_SER_CB_RELEASE_MEM_CMD);
-}
-
-/**
- * wlan_serialization_stop_timer() - to stop particular timer
- * @ser_timer: pointer to serialization timer
- *
- * This API stops the particular timer
- *
- * Return: QDF_STATUS
- */
-static QDF_STATUS
-wlan_serialization_stop_timer(struct wlan_serialization_timer *ser_timer)
-{
-	QDF_TIMER_STATE state;
-	QDF_STATUS status;
-
-	state = qdf_mc_timer_get_current_state(&ser_timer->timer);
-	if (QDF_TIMER_STATE_RUNNING != state &&
-			QDF_TIMER_STATE_STARTING != state) {
-		serialization_debug("nothing to stop");
-		wlan_serialization_timer_destroy(ser_timer);
-		return QDF_STATUS_SUCCESS;
-	}
-	status = qdf_mc_timer_stop(&ser_timer->timer);
-	if (!QDF_IS_STATUS_SUCCESS(status)) {
-		serialization_err("Failed to stop timer");
-		/* to catch the bug */
-		QDF_ASSERT(0);
-		return status;
-	}
-	wlan_serialization_timer_destroy(ser_timer);
-	status = QDF_STATUS_SUCCESS;
-
-	return status;
-}
-
-QDF_STATUS wlan_serialization_cleanup_all_timers(
-			struct wlan_serialization_psoc_priv_obj *psoc_ser_obj)
-{
-	struct wlan_serialization_timer *ser_timer;
-	QDF_STATUS status = QDF_STATUS_SUCCESS;
-	uint32_t i = 0;
-
-	if (!psoc_ser_obj) {
-		serialization_err("Invalid psoc_ser_obj");
-		return QDF_STATUS_E_FAILURE;
-	}
-
-	for (i = 0; psoc_ser_obj->max_active_cmds > i; i++) {
-		ser_timer = &psoc_ser_obj->timers[i];
-		if (!ser_timer->cmd)
-			continue;
-		status = wlan_serialization_stop_timer(ser_timer);
-		if (QDF_STATUS_SUCCESS != status) {
-			/* lets not break the loop but report error */
-			serialization_err("some error in stopping timer");
-		}
-	}
-
-	return status;
-}
-
-QDF_STATUS
-wlan_serialization_find_and_stop_timer(struct wlan_objmgr_psoc *psoc,
-				       struct wlan_serialization_command *cmd)
-{
-	struct wlan_serialization_psoc_priv_obj *psoc_ser_obj;
-	struct wlan_serialization_timer *ser_timer;
-	QDF_STATUS status = QDF_STATUS_E_FAILURE;
-	int i = 0;
-
-	if (!psoc || !cmd) {
-		serialization_err("invalid param");
-		return status;
-	}
-
-	if ((cmd->cmd_timeout_duration == 0) &&
-		(wlan_is_emulation_platform(wlan_psoc_get_nif_phy_version(psoc)
-	))) {
-		serialization_err("[SCAN-EMULATION]: Not performing timer functions\n");
-		return QDF_STATUS_SUCCESS;
-	}
-
-	psoc_ser_obj = wlan_serialization_get_psoc_priv_obj(psoc);
-	/*
-	 * Here cmd_id and cmd_type are used to locate the timer being
-	 * associated with command. For scan command, cmd_id is expected to
-	 * be unique and For non-scan command, there should be only one active
-	 * command per pdev
-	 */
-	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 = wlan_serialization_stop_timer(ser_timer);
-		if (QDF_STATUS_SUCCESS != status) {
-			serialization_err("Failed to stop timer for cmd_id[%d]",
-					cmd->cmd_id);
-		}
-		break;
-	}
-
-	if (QDF_STATUS_SUCCESS != status) {
-		serialization_err("can't find timer for cmd_type[%d]",
-				cmd->cmd_type);
-	}
-	return status;
-}
-
-QDF_STATUS
-wlan_serialization_find_and_start_timer(struct wlan_objmgr_psoc *psoc,
-					struct wlan_serialization_command *cmd)
-{
-	QDF_STATUS status = QDF_STATUS_E_FAILURE;
-	struct wlan_serialization_psoc_priv_obj *psoc_ser_obj;
-	struct wlan_serialization_timer *ser_timer;
-	int i = 0;
-
-	if (!psoc || !cmd) {
-		serialization_err("invalid param");
-		return status;
-	}
-
-	if ((cmd->cmd_timeout_duration == 0) &&
-		(wlan_is_emulation_platform(wlan_psoc_get_nif_phy_version(psoc)
-	))) {
-		serialization_err("[SCAN-EMULATION]: Not performing timer functions\n");
-		return QDF_STATUS_SUCCESS;
-	}
-
-
-	psoc_ser_obj = wlan_serialization_get_psoc_priv_obj(psoc);
-	for (i = 0; psoc_ser_obj->max_active_cmds > i; i++) {
-		/* Keep trying timer */
-		ser_timer = &psoc_ser_obj->timers[i];
-		if (ser_timer->cmd)
-			continue;
-		/* Remember timer is pointing to command */
-		ser_timer->cmd = cmd;
-		if (!QDF_IS_STATUS_SUCCESS(qdf_mc_timer_init(&ser_timer->timer,
-				QDF_TIMER_TYPE_SW,
-				wlan_serialization_generic_timer_callback,
-				ser_timer))) {
-			serialization_err("Failed to init timer cmdid [%d]",
-					cmd->cmd_id);
-			QDF_ASSERT(0);
-			continue;
-		}
-		if (!QDF_IS_STATUS_SUCCESS(qdf_mc_timer_start(&ser_timer->timer,
-						cmd->cmd_timeout_duration))) {
-			serialization_err("Failed to start timer cmdid [%d]",
-					cmd->cmd_id);
-			wlan_serialization_timer_destroy(ser_timer);
-			QDF_ASSERT(0);
-			continue;
-		}
-		status = QDF_STATUS_SUCCESS;
-		break;
-	}
-
-	return status;
-}
-
-/**
- * wlan_serialization_active_scan_cmd_count_handler() - count active scan cmds
- * @psoc: pointer to soc strucutre
- * @obj : pointer to pdev object
- * @arg: pointer to argument
- *
- * This API will be called while iterating each pdev object and it will count
- * number of scan commands present in that pdev object's active queue. count
- * will be updated in *arg
- *
- * Return: none
- */
-static void
-wlan_serialization_active_scan_cmd_count_handler(struct wlan_objmgr_psoc *psoc,
-						 void *obj, void *arg)
-{
-	struct wlan_objmgr_pdev *pdev = obj;
-	struct wlan_serialization_pdev_priv_obj *ser_pdev_obj;
-	uint32_t *count = arg;
-
-	if (!pdev) {
-		serialization_err("invalid pdev");
-		return;
-	}
-
-	ser_pdev_obj = wlan_objmgr_pdev_get_comp_private_obj(
-			pdev, WLAN_UMAC_COMP_SERIALIZATION);
-	*count += wlan_serialization_list_size(&ser_pdev_obj->active_scan_list,
-					       ser_pdev_obj);
-}
-
-/**
- * wlan_serialization_is_active_scan_cmd_allowed() - find if scan cmd allowed
- * @pdev: pointer to pdev object
- *
- * This API will be called to find out if active scan cmd is allowed. It has
- * to iterate through all pdev to find out total number of active scan cmds.
- * If total number of active scan cmds reach to allowed threshold then don't
- * allow more scan cmd.
- *
- * Return: true or false
- */
-static bool
-wlan_serialization_is_active_scan_cmd_allowed(struct wlan_objmgr_pdev *pdev)
-{
-	uint32_t count = 0;
-	struct wlan_objmgr_psoc *psoc;
-
-	if (!pdev) {
-		serialization_err("invalid pdev");
-		return false;
-	}
-
-	psoc = wlan_pdev_get_psoc(pdev);
-
-	if (!psoc) {
-		serialization_err("invalid psoc");
-		return false;
-	}
-
-	wlan_objmgr_iterate_obj_list(psoc, WLAN_PDEV_OP,
-			wlan_serialization_active_scan_cmd_count_handler,
-			&count, 1, WLAN_SERIALIZATION_ID);
-	if (count < ucfg_scan_get_max_active_scans(psoc)) {
-		serialization_debug("count is [%d]", count);
-		return true;
-	}
-
-	return false;
-}
-
-/**
- * wlan_serialization_is_active_nonscan_cmd_allowed() - find if cmd allowed
- * @pdev: pointer to pdev object
- *
- * This API will be called to find out if non scan cmd is allowed.
- *
- * Return: true or false
- */
-static bool
-wlan_serialization_is_active_nonscan_cmd_allowed(struct wlan_objmgr_pdev *pdev)
-{
-	struct wlan_serialization_pdev_priv_obj *ser_pdev_obj;
-
-	if (!pdev) {
-		serialization_err("invalid pdev");
-		return false;
-	}
-
-	ser_pdev_obj = wlan_objmgr_pdev_get_comp_private_obj(
-			pdev, WLAN_UMAC_COMP_SERIALIZATION);
-
-	if (!ser_pdev_obj) {
-		serialization_err("invalid ser_pdev_obj");
-		return false;
-	}
-
-	if (wlan_serialization_list_empty(&ser_pdev_obj->active_list,
-					  ser_pdev_obj))
-		return true;
-
-	return false;
-}
-
-bool
-wlan_serialization_is_active_cmd_allowed(struct wlan_serialization_command *cmd)
-{
-	struct wlan_objmgr_pdev *pdev;
-
-	pdev = wlan_serialization_get_pdev_from_cmd(cmd);
-	if (!pdev) {
-		serialization_err("NULL pdev");
-		return false;
-	}
-
-	if (cmd->cmd_type < WLAN_SER_CMD_NONSCAN)
-		return wlan_serialization_is_active_scan_cmd_allowed(pdev);
-	else
-		return wlan_serialization_is_active_nonscan_cmd_allowed(pdev);
-}
-
-QDF_STATUS wlan_serialization_validate_cmdtype(
-		 enum wlan_serialization_cmd_type cmd_type)
-{
-	serialization_debug("validate cmd_type:%d", cmd_type);
-
-	if (cmd_type < 0 || cmd_type >= WLAN_SER_CMD_MAX) {
-		serialization_err("Invalid cmd or comp passed");
-		return QDF_STATUS_E_INVAL;
-	}
-
-	return QDF_STATUS_SUCCESS;
-}
-
-QDF_STATUS wlan_serialization_validate_cmd(
-		 enum wlan_umac_comp_id comp_id,
-		 enum wlan_serialization_cmd_type cmd_type)
-{
-	serialization_debug("validate cmd_type:%d, comp_id:%d",
-			cmd_type, comp_id);
-	if (cmd_type < 0 || comp_id < 0 ||
-			cmd_type >= WLAN_SER_CMD_MAX ||
-			comp_id >= WLAN_UMAC_COMP_ID_MAX) {
-		serialization_err("Invalid cmd or comp passed");
-		return QDF_STATUS_E_INVAL;
-	}
-
-	return QDF_STATUS_SUCCESS;
-}
-
-static void wlan_serialization_release_list_cmds(
-		struct wlan_serialization_pdev_priv_obj *ser_pdev_obj,
-		qdf_list_t *list)
-{
-	qdf_list_node_t *node = NULL;
-
-	while (!wlan_serialization_list_empty(list, ser_pdev_obj)) {
-		wlan_serialization_remove_front(list, &node, ser_pdev_obj);
-		wlan_serialization_insert_back(
-				&ser_pdev_obj->global_cmd_pool_list,
-				node, ser_pdev_obj);
-	}
-
-	return;
-}
-
-void wlan_serialization_destroy_list(
-		struct wlan_serialization_pdev_priv_obj *ser_pdev_obj,
-		qdf_list_t *list)
-{
-	wlan_serialization_release_list_cmds(ser_pdev_obj, list);
-	qdf_list_destroy(list);
-}
-
-struct wlan_serialization_psoc_priv_obj *wlan_serialization_get_psoc_priv_obj(
-		struct wlan_objmgr_psoc *psoc)
-{
-	struct wlan_serialization_psoc_priv_obj *ser_soc_obj;
-	ser_soc_obj = wlan_objmgr_psoc_get_comp_private_obj(psoc,
-					WLAN_UMAC_COMP_SERIALIZATION);
-
-	return ser_soc_obj;
-}
-
-struct wlan_serialization_pdev_priv_obj *wlan_serialization_get_pdev_priv_obj(
-		struct wlan_objmgr_pdev *pdev)
-{
-	struct wlan_serialization_pdev_priv_obj *obj;
-	obj = wlan_objmgr_pdev_get_comp_private_obj(pdev,
-					WLAN_UMAC_COMP_SERIALIZATION);
-
-	return obj;
-}
-
-struct wlan_serialization_psoc_priv_obj *
-wlan_serialization_get_psoc_obj(struct wlan_serialization_command *cmd)
-{
-	struct wlan_serialization_psoc_priv_obj *ser_soc_obj = NULL;
-	struct wlan_objmgr_psoc *psoc;
-
-	if (!cmd->vdev)
-		return ser_soc_obj;
-
-	psoc = wlan_vdev_get_psoc(cmd->vdev);
-	ser_soc_obj = wlan_serialization_get_psoc_priv_obj(psoc);
-
-	return ser_soc_obj;
-}
-
-bool wlan_serialization_is_cmd_in_vdev_list(struct wlan_objmgr_vdev *vdev,
-					    qdf_list_t *queue)
-{
-	uint32_t queuelen;
-	qdf_list_node_t *nnode = NULL;
-	struct wlan_objmgr_pdev *pdev = wlan_vdev_get_pdev(vdev);
-	struct wlan_serialization_pdev_priv_obj *ser_pdev_obj =
-		wlan_serialization_get_pdev_priv_obj(pdev);
-	QDF_STATUS status;
-
-	queuelen = wlan_serialization_list_size(queue, ser_pdev_obj);
-	if (!queuelen) {
-		serialization_debug("queue empty");
-		return false;
-	}
-
-	while (queuelen--) {
-		status = wlan_serialization_get_cmd_from_queue(queue, &nnode,
-							       ser_pdev_obj);
-		if (status != QDF_STATUS_SUCCESS)
-			break;
-		if (wlan_serialization_match_cmd_vdev(nnode, vdev))
-			return true;
-	}
-
-	return false;
-}
-
-bool wlan_serialization_is_cmd_in_pdev_list(
-			struct wlan_objmgr_pdev *pdev,
-			qdf_list_t *queue)
-{
-	uint32_t queuelen;
-	qdf_list_node_t *nnode = NULL;
-	struct wlan_serialization_pdev_priv_obj *ser_pdev_obj =
-		wlan_serialization_get_pdev_priv_obj(pdev);
-	QDF_STATUS status;
-
-	queuelen = wlan_serialization_list_size(queue, ser_pdev_obj);
-	if (!queuelen) {
-		serialization_debug("queue empty");
-		return false;
-	}
-
-	while (queuelen--) {
-		status = wlan_serialization_get_cmd_from_queue(queue, &nnode,
-							       ser_pdev_obj);
-		if (status != QDF_STATUS_SUCCESS)
-			break;
-		if (wlan_serialization_match_cmd_pdev(nnode, pdev))
-			return true;
-	}
-
-	return false;
-}
-
-enum wlan_serialization_cmd_status
-wlan_serialization_is_cmd_in_active_pending(bool cmd_in_active,
-					    bool cmd_in_pending)
-{
-	if (cmd_in_active && cmd_in_pending)
-		return WLAN_SER_CMDS_IN_ALL_LISTS;
-	else if (cmd_in_active)
-		return WLAN_SER_CMD_IN_ACTIVE_LIST;
-	else if (cmd_in_pending)
-		return WLAN_SER_CMD_IN_PENDING_LIST;
-	else
-		return WLAN_SER_CMD_NOT_FOUND;
-}
-
-static bool wlan_serialization_is_cmd_present_in_given_queue(qdf_list_t *queue,
-			struct wlan_serialization_command *cmd,
-			struct wlan_serialization_pdev_priv_obj *ser_pdev_obj)
-{
-	uint32_t qsize;
-	QDF_STATUS status;
-	struct wlan_serialization_command_list *cmd_list = NULL;
-	qdf_list_node_t *nnode = NULL, *pnode = NULL;
-	bool found = false;
-
-	qsize = wlan_serialization_list_size(queue, ser_pdev_obj);
-	while (qsize--) {
-		if (!cmd_list)
-			status = wlan_serialization_peek_front(queue, &nnode,
-							       ser_pdev_obj);
-		else
-			status = wlan_serialization_peek_next(queue, pnode,
-							      &nnode,
-							      ser_pdev_obj);
-
-		if (status != QDF_STATUS_SUCCESS)
-			break;
-
-		pnode = nnode;
-		cmd_list = qdf_container_of(nnode,
-				struct wlan_serialization_command_list, node);
-		if (wlan_serialization_match_cmd_id_type(nnode, cmd,
-							 ser_pdev_obj) &&
-			wlan_serialization_match_cmd_vdev(nnode, cmd->vdev)) {
-			found = true;
-			break;
-		}
-		nnode = NULL;
-	}
-
-	return found;
-}
-
-bool wlan_serialization_is_cmd_present_queue(
-			struct wlan_serialization_command *cmd,
-			uint8_t is_active_queue)
-{
-	qdf_list_t *queue;
-	struct wlan_objmgr_pdev *pdev;
-	struct wlan_serialization_pdev_priv_obj *ser_pdev_obj;
-
-	if (!cmd) {
-		serialization_err("invalid params");
-		return false;
-	}
-	pdev = wlan_serialization_get_pdev_from_cmd(cmd);
-	if (!pdev) {
-		serialization_err("invalid pdev");
-		return false;
-	}
-	ser_pdev_obj = wlan_objmgr_pdev_get_comp_private_obj(pdev,
-					WLAN_UMAC_COMP_SERIALIZATION);
-	if (!ser_pdev_obj) {
-		serialization_err("invalid ser_pdev_obj");
-		return false;
-	}
-	if (!is_active_queue) {
-		if (cmd->cmd_type < WLAN_SER_CMD_NONSCAN)
-			queue = &ser_pdev_obj->pending_scan_list;
-		else
-			queue = &ser_pdev_obj->pending_list;
-	} else {
-		if (cmd->cmd_type < WLAN_SER_CMD_NONSCAN)
-			queue = &ser_pdev_obj->active_scan_list;
-		else
-			queue = &ser_pdev_obj->active_list;
-	}
-
-	return wlan_serialization_is_cmd_present_in_given_queue(queue, cmd,
-								ser_pdev_obj);
-}
-
-bool wlan_serialization_list_empty(
-			qdf_list_t *queue,
-			struct wlan_serialization_pdev_priv_obj *ser_pdev_obj)
-{
-	bool is_empty;
-
-	wlan_serialization_acquire_lock(ser_pdev_obj);
-	if (qdf_list_empty(queue))
-		is_empty = true;
-	else
-		is_empty = false;
-	wlan_serialization_release_lock(ser_pdev_obj);
-
-	return is_empty;
-}
-
-uint32_t wlan_serialization_list_size(
-			qdf_list_t *queue,
-			struct wlan_serialization_pdev_priv_obj *ser_pdev_obj)
-{
-	uint32_t size;
-
-	wlan_serialization_acquire_lock(ser_pdev_obj);
-	size = qdf_list_size(queue);
-	wlan_serialization_release_lock(ser_pdev_obj);
-
-	return size;
-}
-
-QDF_STATUS wlan_serialization_remove_front(
-			qdf_list_t *list,
-			qdf_list_node_t **node,
-			struct wlan_serialization_pdev_priv_obj *ser_pdev_obj)
-{
-	QDF_STATUS status;
-
-	wlan_serialization_acquire_lock(ser_pdev_obj);
-	status = qdf_list_remove_front(list, node);
-	wlan_serialization_release_lock(ser_pdev_obj);
-
-	return status;
-}
-
-QDF_STATUS wlan_serialization_remove_node(
-			qdf_list_t *list,
-			qdf_list_node_t *node,
-			struct wlan_serialization_pdev_priv_obj *ser_pdev_obj)
-{
-	QDF_STATUS status;
-
-	wlan_serialization_acquire_lock(ser_pdev_obj);
-	status = qdf_list_remove_node(list, node);
-	wlan_serialization_release_lock(ser_pdev_obj);
-
-	return status;
-}
-
-QDF_STATUS wlan_serialization_insert_front(
-			qdf_list_t *list,
-			qdf_list_node_t *node,
-			struct wlan_serialization_pdev_priv_obj *ser_pdev_obj)
-{
-	QDF_STATUS status;
-
-	wlan_serialization_acquire_lock(ser_pdev_obj);
-	status = qdf_list_insert_front(list, node);
-	wlan_serialization_release_lock(ser_pdev_obj);
-
-	return status;
-}
-
-QDF_STATUS wlan_serialization_insert_back(
-			qdf_list_t *list,
-			qdf_list_node_t *node,
-			struct wlan_serialization_pdev_priv_obj *ser_pdev_obj)
-{
-	QDF_STATUS status;
-
-	wlan_serialization_acquire_lock(ser_pdev_obj);
-	status = qdf_list_insert_back(list, node);
-	wlan_serialization_release_lock(ser_pdev_obj);
-
-	return status;
-}
-
-QDF_STATUS wlan_serialization_peek_front(
-			qdf_list_t *list,
-			qdf_list_node_t **node,
-			struct wlan_serialization_pdev_priv_obj *ser_pdev_obj)
-{
-	QDF_STATUS status;
-
-	wlan_serialization_acquire_lock(ser_pdev_obj);
-	status = qdf_list_peek_front(list, node);
-	wlan_serialization_release_lock(ser_pdev_obj);
-
-	return status;
-}
-
-QDF_STATUS wlan_serialization_peek_next(
-			qdf_list_t *list,
-			qdf_list_node_t *node1, qdf_list_node_t **node2,
-			struct wlan_serialization_pdev_priv_obj *ser_pdev_obj)
-{
-	QDF_STATUS status;
-
-	wlan_serialization_acquire_lock(ser_pdev_obj);
-	status = qdf_list_peek_next(list, node1, node2);
-	wlan_serialization_release_lock(ser_pdev_obj);
-
-	return status;
-}
-
-bool wlan_serialization_match_cmd_scan_id(
-			qdf_list_node_t *nnode,
-			struct wlan_serialization_command **cmd,
-			uint16_t scan_id, struct wlan_objmgr_vdev *vdev,
-			struct wlan_serialization_pdev_priv_obj *ser_pdev_obj)
-{
-	struct wlan_serialization_command_list *cmd_list = NULL;
-	bool match_found = false;
-
-	wlan_serialization_acquire_lock(ser_pdev_obj);
-	cmd_list = qdf_container_of(nnode,
-				    struct wlan_serialization_command_list,
-				    node);
-	if ((cmd_list->cmd.cmd_id == scan_id) &&
-	    (cmd_list->cmd.vdev == vdev)) {
-		*cmd = &cmd_list->cmd;
-		match_found = true;
-	};
-	wlan_serialization_release_lock(ser_pdev_obj);
-
-	return match_found;
-}
-
-bool wlan_serialization_match_cmd_id_type(
-			qdf_list_node_t *nnode,
-			struct wlan_serialization_command *cmd,
-			struct wlan_serialization_pdev_priv_obj *ser_pdev_obj)
-{
-	struct wlan_serialization_command_list *cmd_list = NULL;
-	bool match_found = true;
-
-	if (!cmd)
-		return false;
-	wlan_serialization_acquire_lock(ser_pdev_obj);
-	cmd_list = qdf_container_of(nnode,
-				    struct wlan_serialization_command_list,
-				    node);
-	if ((cmd_list->cmd.cmd_id != cmd->cmd_id) ||
-	    (cmd_list->cmd.cmd_type != cmd->cmd_type)) {
-		match_found = false;
-	};
-	wlan_serialization_release_lock(ser_pdev_obj);
-
-	return match_found;
-}
-
-bool wlan_serialization_match_cmd_vdev(qdf_list_node_t *nnode,
-				       struct wlan_objmgr_vdev *vdev)
-{
-	struct wlan_serialization_command_list *cmd_list = NULL;
-	bool match_found = false;
-	struct wlan_objmgr_pdev *pdev = wlan_vdev_get_pdev(vdev);
-	struct wlan_serialization_pdev_priv_obj *ser_pdev_obj =
-		wlan_serialization_get_pdev_priv_obj(pdev);
-
-	wlan_serialization_acquire_lock(ser_pdev_obj);
-	cmd_list = qdf_container_of(nnode,
-				    struct wlan_serialization_command_list,
-				    node);
-	if (cmd_list->cmd.vdev == vdev)
-		match_found = true;
-	wlan_serialization_release_lock(ser_pdev_obj);
-
-	return match_found;
-}
-
-bool wlan_serialization_match_cmd_pdev(qdf_list_node_t *nnode,
-				       struct wlan_objmgr_pdev *pdev)
-{
-	struct wlan_serialization_command_list *cmd_list = NULL;
-	bool match_found = false;
-	struct wlan_serialization_pdev_priv_obj *ser_pdev_obj =
-		wlan_serialization_get_pdev_priv_obj(pdev);
-	struct wlan_objmgr_pdev *node_pdev = NULL;
-
-	wlan_serialization_acquire_lock(ser_pdev_obj);
-	cmd_list = qdf_container_of(nnode,
-				    struct wlan_serialization_command_list,
-				    node);
-	node_pdev = wlan_vdev_get_pdev(cmd_list->cmd.vdev);
-	if (node_pdev == pdev)
-		match_found = true;
-	wlan_serialization_release_lock(ser_pdev_obj);
-
-	return match_found;
-}
-
-#ifdef WLAN_CMD_SERIALIZATION_LOCKING
-QDF_STATUS
-wlan_serialization_acquire_lock(struct wlan_serialization_pdev_priv_obj *obj)
-{
-	if (!obj) {
-		serialization_err("invalid object");
-		return QDF_STATUS_E_FAILURE;
-	}
-	qdf_spin_lock_bh(&obj->pdev_ser_list_lock);
-
-	return QDF_STATUS_SUCCESS;
-}
-
-QDF_STATUS
-wlan_serialization_release_lock(struct wlan_serialization_pdev_priv_obj *obj)
-{
-	if (!obj) {
-		serialization_err("invalid object");
-		return QDF_STATUS_E_FAILURE;
-	}
-	qdf_spin_unlock_bh(&obj->pdev_ser_list_lock);
-
-	return QDF_STATUS_SUCCESS;
-}
-
-QDF_STATUS
-wlan_serialization_create_lock(struct wlan_serialization_pdev_priv_obj *obj)
-{
-	if (!obj) {
-		serialization_err("invalid object");
-		return QDF_STATUS_E_FAILURE;
-	}
-	qdf_spinlock_create(&obj->pdev_ser_list_lock);
-
-	return QDF_STATUS_SUCCESS;
-}
-
-QDF_STATUS
-wlan_serialization_destroy_lock(struct wlan_serialization_pdev_priv_obj *obj)
-{
-	if (!obj) {
-		serialization_err("invalid object");
-		return QDF_STATUS_E_FAILURE;
-	}
-	qdf_spinlock_destroy(&obj->pdev_ser_list_lock);
-
-	return QDF_STATUS_SUCCESS;
-}
-#else
-QDF_STATUS
-wlan_serialization_acquire_lock(struct wlan_serialization_pdev_priv_obj *obj)
-{
-	return QDF_STATUS_SUCCESS;
-}
-
-QDF_STATUS
-wlan_serialization_release_lock(struct wlan_serialization_pdev_priv_obj *obj)
-{
-	return QDF_STATUS_SUCCESS;
-}
-
-QDF_STATUS
-wlan_serialization_create_lock(struct wlan_serialization_pdev_priv_obj *obj)
-{
-	return QDF_STATUS_SUCCESS;
-}
-
-QDF_STATUS
-wlan_serialization_destroy_lock(struct wlan_serialization_pdev_priv_obj *obj)
-{
-	return QDF_STATUS_SUCCESS;
-}
-#endif
-#else /*New serialization code*/
 #include <wlan_objmgr_vdev_obj.h>
 #include <wlan_objmgr_pdev_obj.h>
 #include <qdf_mc_timer.h>
@@ -1855,4 +881,3 @@ wlan_serialization_destroy_lock(qdf_spinlock_t *lock)
 
 	return QDF_STATUS_SUCCESS;
 }
-#endif

+ 1 - 596
umac/cmn_services/serialization/src/wlan_serialization_utils_i.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2019 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -23,600 +23,6 @@
 #ifndef __WLAN_SERIALIZATION_UTILS_I_H
 #define __WLAN_SERIALIZATION_UTILS_I_H
 
-#ifdef CONFIG_SERIALIZATION_V1
-/* Include files */
-#include "qdf_status.h"
-#include "qdf_list.h"
-#include "qdf_mc_timer.h"
-#include "wlan_objmgr_cmn.h"
-#include "wlan_objmgr_global_obj.h"
-#include "wlan_objmgr_psoc_obj.h"
-#include "wlan_serialization_rules_i.h"
-#include "wlan_scan_ucfg_api.h"
-
-/*
- * Below bit positions are used to identify if a
- * serialization command is in use or marked for
- * deletion.
- * CMD_MARKED_FOR_DELETE - The command is about to be deleted
- * CMD_IS_ACTIVE - The command is active and currently in use
- */
-#define CMD_MARKED_FOR_DELETE   1
-#define CMD_IS_ACTIVE           2
-/**
- * struct wlan_serialization_timer - Timer used for serialization
- * @cmd:      Cmd to which the timer is linked
- * @timer:    Timer associated with the command
- *
- * Timers are allocated statically during init, one each for the
- * maximum active commands permitted in the system. Once a cmd is
- * moved from pending list to active list, the timer is activated
- * and once the cmd is completed, the timer is cancelled. Timer is
- * also cancelled if the command is aborted
- *
- * The timers are maintained per psoc. A timer is associated to
- * unique combination of pdev, cmd_type and cmd_id.
- */
-struct wlan_serialization_timer {
-	struct wlan_serialization_command *cmd;
-	qdf_mc_timer_t timer;
-};
-
-/**
- * struct wlan_serialization_command_list - List of commands to be serialized
- * @node: Node identifier in the list
- * @cmd: Command to be serialized
- * @active: flag to check if the node/entry is logically active
- */
-struct wlan_serialization_command_list {
-	qdf_list_node_t node;
-	struct wlan_serialization_command cmd;
-	unsigned long cmd_in_use;
-};
-
-/**
- * struct wlan_serialization_pdev_priv_obj - pdev obj data for serialization
- * @active_list: list to hold the non-scan commands currently being executed
- * @pending_list list: to hold the non-scan commands currently pending
- * @active_scan_list: list to hold the scan commands currently active
- * @pending_scan_list: list to hold the scan commands currently pending
- * @global_cmd_pool_list: list to hold the global buffers
- * @pdev_ser_list_lock: A per pdev lock to protect the concurrent operations
- *                      on the queues.
- *
- * Serialization component maintains linked lists to store the commands
- * sent by other components to get serialized. All the lists are per
- * pdev. The maximum number of active scans is determined by the firmware.
- * There is only one non-scan active command per pdev at a time as per the
- * current software architecture. cmd_ptr holds the memory allocated for
- * each of the global cmd pool nodes and it is useful in freeing up these
- * nodes when needed.
- */
-struct wlan_serialization_pdev_priv_obj {
-	qdf_list_t active_list;
-	qdf_list_t pending_list;
-	qdf_list_t active_scan_list;
-	qdf_list_t pending_scan_list;
-	qdf_list_t global_cmd_pool_list;
-	qdf_spinlock_t pdev_ser_list_lock;
-};
-
-/**
- * struct wlan_serialization_psoc_priv_obj - psoc obj data for serialization
- * @wlan_serialization_module_state_cb - module level callback
- * @wlan_serialization_apply_rules_cb - pointer to apply rules on the cmd
- * @timers - Timers associated with the active commands
- * @max_axtive_cmds - Maximum active commands allowed
- *
- * Serialization component takes a command as input and checks whether to
- * allow/deny the command. It will use the module level callback registered
- * by each component to fetch the information needed to apply the rules.
- * Once the information is available, the rules callback registered for each
- * command internally by serialization will be applied to determine the
- * checkpoint for the command. If allowed, command will be put into active/
- * pending list and each active command is associated with a timer.
- */
-struct wlan_serialization_psoc_priv_obj {
-	wlan_serialization_comp_info_cb comp_info_cb[
-		WLAN_SER_CMD_MAX][WLAN_UMAC_COMP_ID_MAX];
-	wlan_serialization_apply_rules_cb apply_rules_cb[WLAN_SER_CMD_MAX];
-	struct wlan_serialization_timer *timers;
-	uint8_t max_active_cmds;
-};
-
-/**
- * wlan_serialization_put_back_to_global_list() - put back cmd in global pool
- * @queue: queue from which cmd needs to be taken out
- * @ser_pdev_obj: pdev private object
- * @cmd_list: cmd which needs to be matched
- *
- * command will be taken off from the queue and will be put back to global
- * pool of free command buffers.
- *
- * Return: QDF_STATUS
- */
-QDF_STATUS
-wlan_serialization_put_back_to_global_list(qdf_list_t *queue,
-		struct wlan_serialization_pdev_priv_obj *ser_pdev_obj,
-		struct wlan_serialization_command_list *cmd_list);
-/**
- * wlan_serialization_move_pending_to_active() - to move pending command to
- *						 active queue
- * @cmd_type: cmd type to device to which queue the command needs to go
- * @ser_pdev_obj: pointer to ser_pdev_obj
- *
- * Return: none
- */
-void wlan_serialization_move_pending_to_active(
-		enum wlan_serialization_cmd_type cmd_type,
-		struct wlan_serialization_pdev_priv_obj *ser_pdev_obj);
-/**
- * wlan_serialization_get_pdev_from_cmd() - get pdev from provided cmd
- * @cmd: pointer to actual command
- *
- * This API will get the pointer to pdev through checking type of cmd
- *
- * Return: pointer to pdev
- */
-struct wlan_objmgr_pdev*
-wlan_serialization_get_pdev_from_cmd(struct wlan_serialization_command *cmd);
-
-/**
- * wlan_serialization_get_cmd_from_queue() - to extract command from given queue
- * @queue: pointer to queue
- * @nnode: next node to extract
- * @ser_pdev_obj: Serialization PDEV object pointer
- *
- * This API will try to extract node from queue which is next to prev node. If
- * no previous node is given then take out the front node of the queue.
- *
- * Return: QDF_STATUS
- */
-QDF_STATUS wlan_serialization_get_cmd_from_queue(qdf_list_t *queue,
-			qdf_list_node_t **nnode,
-			struct wlan_serialization_pdev_priv_obj *ser_pdev_obj);
-
-/**
- * wlan_serialization_is_active_cmd_allowed() - check to see if command
- *						is allowed in active queue
- * @pdev: pointer to pdev structure
- * @cmd_type: type of command to check against
- *
- * Takes the command type and based on the type, it checks scan command queue
- * or nonscan command queue to see if active command is allowed or no
- *
- * Return: true if allowed else false
- */
-bool wlan_serialization_is_active_cmd_allowed(
-			struct wlan_serialization_command *cmd);
-
-/**
- * wlan_serialization_cleanup_all_timers() - to clean-up all timers
- *
- * @psoc_ser_ob: pointer to serialization psoc private object
- *
- * This API is to cleanup all the timers. it can be used when serialization
- * module is exiting. it will make sure that if timer is running then it will
- * stop and destroys the timer
- *
- * Return: QDF_STATUS
- */
-QDF_STATUS wlan_serialization_cleanup_all_timers(
-	struct wlan_serialization_psoc_priv_obj *psoc_ser_ob);
-
-/**
- * wlan_serialization_find_and_remove_cmd() - to find cmd from queue and remove
- * @cmd_info: pointer to command related information
- *
- * This api will find command from active queue and removes the command
- *
- * Return: QDF_STATUS
- */
-QDF_STATUS wlan_serialization_find_and_remove_cmd(
-		struct wlan_serialization_queued_cmd_info *cmd_info);
-
-/**
- * wlan_serialization_find_and_cancel_cmd() - to find cmd from queue and cancel
- * @cmd_info: pointer to command related information
- *
- * This api will find command from active queue and pending queue and
- * removes the command. If it is in active queue then it will notifies the
- * requester that it is in active queue and from there it expects requester
- * to send remove command
- *
- * Return: wlan_serialization_cmd_status
- */
-enum wlan_serialization_cmd_status
-wlan_serialization_find_and_cancel_cmd(
-		struct wlan_serialization_queued_cmd_info *cmd_info);
-/**
- * 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,
-		struct wlan_serialization_command_list **pcmd_list);
-
-/**
- * wlan_serialization_dequeue_cmd() - dequeue the cmd to pending/active Queue
- * @cmd: Command information
- * @is_cmd_for_active_queue: whether command is for active queue
- *
- * Return: Status of the serialization request
- */
-enum wlan_serialization_cmd_status
-wlan_serialization_dequeue_cmd(struct wlan_serialization_command *cmd,
-			       uint8_t is_cmd_for_active_queue);
-/**
- * wlan_serialization_find_and_stop_timer() - to find and stop the timer
- * @psoc: pointer to psoc
- * @cmd: pointer to actual command
- *
- * find the timer associated with command, stop it and destroy it
- *
- * Return: QDF_STATUS
- */
-QDF_STATUS
-wlan_serialization_find_and_stop_timer(struct wlan_objmgr_psoc *psoc,
-		struct wlan_serialization_command *cmd);
-/**
- * wlan_serialization_find_and_stop_timer() - to find and start the timer
- * @psoc: pointer to psoc
- * @cmd: pointer to actual command
- *
- * find the free timer, initialize it, and start it
- *
- * Return: QDF_STATUS
- */
-QDF_STATUS
-wlan_serialization_find_and_start_timer(struct wlan_objmgr_psoc *psoc,
-		struct wlan_serialization_command *cmd);
-
-/**
- * wlan_serialization_validate_cmd() - Validate the command
- * @comp_id: Component ID
- * @cmd_type: Command Type
- *
- * Return: QDF Status
- */
-QDF_STATUS wlan_serialization_validate_cmd(
-		 enum wlan_umac_comp_id comp_id,
-		 enum wlan_serialization_cmd_type cmd_type);
-
-/**
- * wlan_serialization_validate_cmdtype() - Validate the command type
- * @cmd_type: Command Type
- *
- * Return: QDF Status
- */
-QDF_STATUS wlan_serialization_validate_cmdtype(
-		 enum wlan_serialization_cmd_type cmd_type);
-
-
-/**
- * wlan_serialization_destroy_list() - Release the cmds and destroy list
- * @ser_pdev_obj: Serialization private pdev object
- * @list: List to be destroyed
- *
- * Return: None
- */
-void wlan_serialization_destroy_list(
-		struct wlan_serialization_pdev_priv_obj *ser_pdev_obj,
-		qdf_list_t *list);
-
-/**
- * wlan_serialization_get_psoc_priv_obj() - Return the component private obj
- * @psoc: Pointer to the PSOC object
- *
- * Return: Serialization component's PSOC level private data object
- */
-struct wlan_serialization_psoc_priv_obj *wlan_serialization_get_psoc_priv_obj(
-		struct wlan_objmgr_psoc *psoc);
-
-/**
- * wlan_serialization_get_pdev_priv_obj() - Return the component private obj
- * @psoc: Pointer to the PDEV object
- *
- * Return: Serialization component's PDEV level private data object
- */
-struct wlan_serialization_pdev_priv_obj *wlan_serialization_get_pdev_priv_obj(
-		struct wlan_objmgr_pdev *pdev);
-
-/**
- * wlan_serialization_get_psoc_obj() - Return the component private obj
- * @psoc: Pointer to the SERIALIZATION object
- *
- * Return: Serialization component's level private data object
- */
-struct wlan_serialization_psoc_priv_obj *
-wlan_serialization_get_psoc_obj(struct wlan_serialization_command *cmd);
-
-/**
- * wlan_serialization_is_cmd_in_vdev_list() - Check Node present in VDEV list
- * @vdev: Pointer to the VDEV object
- * @queue: Pointer to the qdf_list_t
- *
- * Return: Boolean true or false
- */
-bool
-wlan_serialization_is_cmd_in_vdev_list(
-		struct wlan_objmgr_vdev *vdev, qdf_list_t *queue);
-
-/**
- * wlan_serialization_is_cmd_in_pdev_list() - Check Node present in PDEV list
- * @pdev: Pointer to the PDEV object
- * @queue: Pointer to the qdf_list_t
- *
- * Return: Boolean true or false
- */
-bool
-wlan_serialization_is_cmd_in_pdev_list(
-		struct wlan_objmgr_pdev *pdev, qdf_list_t *queue);
-
-/**
- * wlan_serialization_is_cmd_in_active_pending() - return cmd status
- *						active/pending queue
- * @cmd_in_active: CMD in active list
- * @cmd_in_pending: CMD in pending list
- *
- * Return: enum wlan_serialization_cmd_status
- */
-enum wlan_serialization_cmd_status
-wlan_serialization_is_cmd_in_active_pending(bool cmd_in_active,
-		bool cmd_in_pending);
-
-/**
- * wlan_serialization_remove_all_cmd_from_queue() - Remove cmd which matches
- * @queue: queue from where command needs to be removed
- * @ser_pdev_obj: pointer to serialization object
- * @pdev: pointer to pdev
- * @vdev: pointer to vdev
- * @cmd: pointer to cmd
- * @is_active_queue: to check if command matching is for active queue
- *
- * This API will remove one or more commands which match the given parameters
- * interms of argument. For example, if user request all commands to removed
- * which matches "vdev" then iterate through all commands, find out and remove
- * command which matches vdev object.
- *
- * Return: enum wlan_serialization_cmd_status
- */
-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,
-		struct wlan_objmgr_pdev *pdev, struct wlan_objmgr_vdev *vdev,
-		struct wlan_serialization_command *cmd,
-		uint8_t is_active_queue);
-/**
- * wlan_serialization_is_cmd_present_queue() - Check if same command
- *				is already present active or pending queue
- * @cmd: pointer to command which we need to find
- * @is_active_queue: flag to find the command in active or pending queue
- *
- * This API will check the given command is already present in active or
- * pending queue based on flag
- * If present then return true otherwise false
- *
- * Return: true or false
- */
-bool wlan_serialization_is_cmd_present_queue(
-			struct wlan_serialization_command *cmd,
-			uint8_t is_active_queue);
-
-/**
- * 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(
-			struct wlan_serialization_command_list *cmd_list,
-			struct wlan_serialization_pdev_priv_obj *ser_pdev_obj);
-
-/**
- * wlan_serialization_list_empty() - check if the list is empty
- * @queue: Queue/List that needs to be checked for emptiness
- * @ser_pdev_obj: Serialization private pdev object
- *
- * Return: true if list is empty and false otherwise
- */
-bool wlan_serialization_list_empty(
-			qdf_list_t *queue,
-			struct wlan_serialization_pdev_priv_obj *ser_pdev_obj);
-
-/**
- * wlan_serialization_list_size() - Find the size of the provided queue
- * @queue: Queue/List for which the size/length is to be returned
- * @ser_pdev_obj: Serialization private pdev object
- *
- * Return: size/length of the queue/list
- */
-uint32_t wlan_serialization_list_size(
-			qdf_list_t *queue,
-			struct wlan_serialization_pdev_priv_obj *ser_pdev_obj);
-/**
- * wlan_serialization_acquire_lock() - to acquire lock for serialization module
- * @obj: pdev private object
- *
- * This API will acquire lock for serialization module. Mutex or spinlock will
- * be decided based on the context of the operation.
- *
- * Return: QDF_STATUS based on outcome of the operation
- */
-QDF_STATUS
-wlan_serialization_acquire_lock(struct wlan_serialization_pdev_priv_obj *obj);
-
-/**
- * wlan_serialization_release_lock() - to release lock for serialization module
- * @obj: pdev private object
- *
- * This API will release lock for serialization module. Mutex or spinlock will
- * be decided based on the context of the operation.
- *
- * Return: QDF_STATUS based on outcome of the operation
- */
-QDF_STATUS
-wlan_serialization_release_lock(struct wlan_serialization_pdev_priv_obj *obj);
-
-/**
- * wlan_serialization_create_lock() - to create lock for serialization module
- * @obj: pdev private object
- *
- * This API will create a lock for serialization module.
- *
- * Return: QDF_STATUS based on outcome of the operation
- */
-QDF_STATUS
-wlan_serialization_create_lock(struct wlan_serialization_pdev_priv_obj  *obj);
-
-/**
- * wlan_serialization_destroy_lock() - to destroy lock for serialization module
- *
- * This API will destroy a lock for serialization module.
- *
- * Return: QDF_STATUS based on outcome of the operation
- */
-QDF_STATUS
-wlan_serialization_destroy_lock(struct wlan_serialization_pdev_priv_obj *obj);
-/**
- * wlan_serialization_match_cmd_scan_id() - Check for a match on given nnode
- * @nnode: The node on which the matching has to be done
- * @cmd: Command that needs to be filled if there is a match
- * @scan_id: Scan ID to be matched
- * @vdev: VDEV object to be matched
- * @ser_pdev_obj: Serialization PDEV Object pointer.
- *
- * This API will check if the scan ID and VDEV of the given nnode are
- * matching with the one's that are being passed to this function.
- *
- * Return: True if matched,false otherwise.
- */
-bool wlan_serialization_match_cmd_scan_id(
-			qdf_list_node_t *nnode,
-			struct wlan_serialization_command **cmd,
-			uint16_t scan_id, struct wlan_objmgr_vdev *vdev,
-			struct wlan_serialization_pdev_priv_obj *ser_pdev_obj);
-/**
- * wlan_serialization_match_cmd_id_type() - Check for a match on given nnode
- * @nnode: The node on which the matching has to be done
- * @cmd: Command that needs to be matched
- * @ser_pdev_obj: Serialization PDEV Object pointer.
- *
- * This API will check if the cmd ID and cmd type of the given nnode are
- * matching with the one's that are being passed to this function.
- *
- * Return: True if matched,false otherwise.
- */
-bool wlan_serialization_match_cmd_id_type(
-			qdf_list_node_t *nnode,
-			struct wlan_serialization_command *cmd,
-			struct wlan_serialization_pdev_priv_obj *ser_pdev_obj);
-/**
- * wlan_serialization_match_cmd_vdev() - Check for a match on given nnode
- * @nnode: The node on which the matching has to be done
- * @vdev: VDEV object that needs to be matched
- *
- * This API will check if the VDEV object of the given nnode are
- * matching with the one's that are being passed to this function.
- *
- * Return: True if matched,false otherwise.
- */
-bool wlan_serialization_match_cmd_vdev(qdf_list_node_t *nnode,
-				       struct wlan_objmgr_vdev *vdev);
-/**
- * wlan_serialization_match_cmd_pdev() - Check for a match on given nnode
- * @nnode: The node on which the matching has to be done
- * @pdev: VDEV object that needs to be matched
- *
- * This API will check if the PDEV object of the given nnode are
- * matching with the one's that are being passed to this function.
- *
- * Return: True if matched,false otherwise.
- */
-bool wlan_serialization_match_cmd_pdev(qdf_list_node_t *nnode,
-				       struct wlan_objmgr_pdev *pdev);
-/**
- * wlan_serialization_remove_front() - Remove the front node of the list
- * @list: List from which the node is to be removed
- * @node: Pointer to store the node that is removed
- * @ser_pdev_obj: Serialization PDEV Object pointer
- *
- * Return: QDF_STATUS Success or Failure
- */
-QDF_STATUS wlan_serialization_remove_front(
-			qdf_list_t *list,
-			qdf_list_node_t **node,
-			struct wlan_serialization_pdev_priv_obj *ser_pdev_obj);
-/**
- * wlan_serialization_remove_node() - Remove the given node from the list
- * @list: List from which the node is to be removed
- * @node: Pointer to the node that is to be removed
- * @ser_pdev_obj: Serialization PDEV Object pointer
- *
- * Return: QDF_STATUS Success or Failure
- */
-QDF_STATUS wlan_serialization_remove_node(
-			qdf_list_t *list,
-			qdf_list_node_t *node,
-			struct wlan_serialization_pdev_priv_obj *ser_pdev_obj);
-/**
- * wlan_serialization_insert_front() - Insert a node into the front of the list
- * @list: List to which the node is to be inserted
- * @node: Pointer to the node that is to be inserted
- * @ser_pdev_obj: Serialization PDEV Object pointer
- *
- * Return: QDF_STATUS Success or Failure
- */
-QDF_STATUS wlan_serialization_insert_front(
-			qdf_list_t *list,
-			qdf_list_node_t *node,
-			struct wlan_serialization_pdev_priv_obj *ser_pdev_obj);
-/**
- * wlan_serialization_insert_back() - Insert a node into the back of the list
- * @list: List to which the node is to be inserted
- * @node: Pointer to the node that is to be inserted
- * @ser_pdev_obj: Serialization PDEV Object pointer
- *
- * Return: QDF_STATUS Success or Failure
- */
-QDF_STATUS wlan_serialization_insert_back(
-			qdf_list_t *list,
-			qdf_list_node_t *node,
-			struct wlan_serialization_pdev_priv_obj *ser_pdev_obj);
-/**
- * wlan_serialization_peek_front() - Peek the front node of the list
- * @list: List on which the node is to be peeked
- * @node: Pointer to the store the node that is being peeked
- * @ser_pdev_obj: Serialization PDEV Object pointer
- *
- * Return: QDF_STATUS Success or Failure
- */
-QDF_STATUS wlan_serialization_peek_front(
-			qdf_list_t *list,
-			qdf_list_node_t **node,
-			struct wlan_serialization_pdev_priv_obj *ser_pdev_obj);
-/**
- * wlan_serialization_peek_next() - Peek the next node of the list
- * @list: List on which the node is to be peeked
- * @node1: Input node which is previous to the node to be peeked
- * @node2: Pointer to the store the node that is being peeked
- * @ser_pdev_obj: Serialization PDEV Object pointer
- *
- * Return: QDF_STATUS Success or Failure
- */
-QDF_STATUS wlan_serialization_peek_next(
-			qdf_list_t *list,
-			qdf_list_node_t *node1,
-			qdf_list_node_t **node2,
-			struct wlan_serialization_pdev_priv_obj *ser_pdev_obj);
-#else /*New serialization code*/
-/* Include files */
 #include <qdf_status.h>
 #include <qdf_list.h>
 #include <qdf_mc_timer.h>
@@ -1281,4 +687,3 @@ void wlan_ser_update_cmd_history(
 		bool active_queue);
 
 #endif
-#endif