1 /* 2 * Copyright (c) 2017-2020 The Linux Foundation. All rights reserved. 3 * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. 4 * 5 * Permission to use, copy, modify, and/or distribute this software for 6 * any purpose with or without fee is hereby granted, provided that the 7 * above copyright notice and this permission notice appear in all 8 * copies. 9 * 10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL 11 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED 12 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE 13 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL 14 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR 15 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 16 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 17 * PERFORMANCE OF THIS SOFTWARE. 18 */ 19 /** 20 * DOC: wlan_serialization_utils_i.h 21 * This file defines the prototypes for the utility helper functions 22 * for the serialization component. 23 */ 24 #ifndef __WLAN_SERIALIZATION_UTILS_I_H 25 #define __WLAN_SERIALIZATION_UTILS_I_H 26 27 #include <qdf_status.h> 28 #include <qdf_list.h> 29 #include <qdf_mc_timer.h> 30 #include <wlan_objmgr_cmn.h> 31 #include <wlan_objmgr_global_obj.h> 32 #include <wlan_objmgr_psoc_obj.h> 33 #include <wlan_scan_ucfg_api.h> 34 #include "wlan_serialization_rules_i.h" 35 #ifdef WLAN_SER_DEBUG 36 #include "wlan_serialization_debug_i.h" 37 #endif 38 39 /* 40 * Below bit positions are used to identify if a 41 * serialization command is in use or marked for 42 * deletion. 43 * CMD_MARKED_FOR_ACTIVATION - The command is about to be activated 44 * CMD_IS_ACTIVE - The command is active and currently in use 45 */ 46 #define CMD_MARKED_FOR_ACTIVATION 1 47 #define CMD_IS_ACTIVE 2 48 #define CMD_ACTIVE_MARKED_FOR_CANCEL 3 49 #define CMD_ACTIVE_MARKED_FOR_REMOVAL 4 50 #define CMD_MARKED_FOR_MOVEMENT 5 51 /** 52 * struct wlan_serialization_timer - Timer used for serialization 53 * @cmd: Cmd to which the timer is linked 54 * @timer: Timer associated with the command 55 * 56 * Timers are allocated statically during init, one each for the 57 * maximum active commands permitted in the system. Once a cmd is 58 * moved from pending list to active list, the timer is activated 59 * and once the cmd is completed, the timer is cancelled. Timer is 60 * also cancelled if the command is aborted 61 * 62 * The timers are maintained per psoc. A timer is associated to 63 * unique combination of pdev, cmd_type and cmd_id. 64 */ 65 struct wlan_serialization_timer { 66 struct wlan_serialization_command *cmd; 67 qdf_timer_t timer; 68 }; 69 70 /** 71 * enum wlan_serialization_node - Types of available nodes in serialization list 72 * @WLAN_SER_PDEV_NODE: pdev node from the pdev queue 73 * @WLAN_SER_VDEV_NODE: vdev node from the vdev queue 74 */ 75 enum wlan_serialization_node { 76 WLAN_SER_PDEV_NODE, 77 WLAN_SER_VDEV_NODE, 78 }; 79 80 /** 81 * struct wlan_serialization_command_list - List of commands to be serialized 82 * @pdev_node: PDEV node identifier in the list 83 * @vdev_node: VDEV node identifier in the list 84 * @cmd: Command to be serialized 85 * @cmd_in_use: flag to check if the node/entry is logically active 86 */ 87 struct wlan_serialization_command_list { 88 qdf_list_node_t pdev_node; 89 qdf_list_node_t vdev_node; 90 struct wlan_serialization_command cmd; 91 unsigned long cmd_in_use; 92 }; 93 94 /** 95 * struct wlan_serialization_pdev_queue - queue data related to pdev 96 * @active_list: list to hold the commands currently being executed 97 * @pending_list: list to hold the commands currently pending 98 * @cmd_pool_list: list to hold the global command pool 99 * @vdev_active_cmd_bitmap: Active cmd bitmap of vdev for the given pdev 100 * @blocking_cmd_active: Indicate if a blocking cmd is in active execution 101 * @blocking_cmd_waiting: Indicate if a blocking cmd is in pending queue 102 * @pdev_queue_lock: pdev lock to protect concurrent operations on the queues 103 */ 104 struct wlan_serialization_pdev_queue { 105 qdf_list_t active_list; 106 qdf_list_t pending_list; 107 qdf_list_t cmd_pool_list; 108 qdf_bitmap(vdev_active_cmd_bitmap, WLAN_UMAC_PSOC_MAX_VDEVS); 109 bool blocking_cmd_active; 110 uint16_t blocking_cmd_waiting; 111 qdf_spinlock_t pdev_queue_lock; 112 #ifdef WLAN_SER_DEBUG 113 struct ser_history history; 114 #endif 115 }; 116 117 /** 118 * struct wlan_serialization_vdev_queue - queue data related to vdev 119 * @active_list: list to hold the commands currently being executed 120 * @pending_list list: to hold the commands currently pending 121 * @queue_disable: is the queue disabled 122 */ 123 struct wlan_serialization_vdev_queue { 124 qdf_list_t active_list; 125 qdf_list_t pending_list; 126 bool queue_disable; 127 }; 128 129 /** 130 * enum wlan_serialization_pdev_queue_type - Types of available pdev queues 131 * @QUEUE_COMP_SCAN: Scan queue 132 * @QUEUE_COMP_NON_SCAN: Non Scan queue 133 */ 134 enum serialization_pdev_queue_type { 135 SER_PDEV_QUEUE_COMP_SCAN, 136 SER_PDEV_QUEUE_COMP_NON_SCAN, 137 SER_PDEV_QUEUE_COMP_MAX, 138 }; 139 140 /** 141 * enum wlan_serialization_vdev_queue_type - Types of available vdev queues 142 * @QUEUE_COMP_NON_SCAN: Non Scan queue 143 */ 144 enum serialization_vdev_queue_type { 145 SER_VDEV_QUEUE_COMP_NON_SCAN, 146 SER_VDEV_QUEUE_COMP_MAX, 147 }; 148 149 /** 150 * enum wlan_serialization_match_type - Comparison options for a command 151 * @WLAN_SER_MATCH_VDEV: Compare vdev 152 * @WLAN_SER_MATCH_PDEV: Compare pdev 153 * @WLAN_SER_MATCH_CMD_TYPE_VDEV: Compare command type and vdev 154 * @WLAN_SER_MATCH_CMD_ID_VDEV: Compare command id and vdev 155 */ 156 enum wlan_serialization_match_type { 157 WLAN_SER_MATCH_VDEV, 158 WLAN_SER_MATCH_PDEV, 159 WLAN_SER_MATCH_CMD_TYPE_VDEV, 160 WLAN_SER_MATCH_CMD_ID_VDEV, 161 WLAN_SER_MATCH_MAX, 162 }; 163 164 /** 165 * struct wlan_ser_pdev_obj - pdev obj data for serialization 166 * @pdev_q: Array of pdev queues 167 */ 168 struct wlan_ser_pdev_obj { 169 struct wlan_serialization_pdev_queue pdev_q[SER_PDEV_QUEUE_COMP_MAX]; 170 }; 171 172 /** 173 * struct wlan_ser_vdev_priv_obj - Serialization private object of vdev 174 * @vdev_q: Array of vdev queues 175 */ 176 struct wlan_ser_vdev_obj { 177 struct wlan_serialization_vdev_queue vdev_q[SER_VDEV_QUEUE_COMP_MAX]; 178 }; 179 180 /** 181 * struct wlan_ser_psoc_obj - psoc obj data for serialization 182 * @comp_info_cb - module level callback 183 * @apply_rules_cb - pointer to apply rules on the cmd 184 * @timers - Timers associated with the active commands 185 * @max_axtive_cmds - Maximum active commands allowed 186 * 187 * Serialization component takes a command as input and checks whether to 188 * allow/deny the command. It will use the module level callback registered 189 * by each component to fetch the information needed to apply the rules. 190 * Once the information is available, the rules callback registered for each 191 * command internally by serialization will be applied to determine the 192 * checkpoint for the command. If allowed, command will be put into active/ 193 * pending list and each active command is associated with a timer. 194 */ 195 struct wlan_ser_psoc_obj { 196 wlan_serialization_comp_info_cb comp_info_cb[ 197 WLAN_SER_CMD_MAX][WLAN_UMAC_COMP_ID_MAX]; 198 wlan_serialization_apply_rules_cb apply_rules_cb[WLAN_SER_CMD_MAX]; 199 struct wlan_serialization_timer *timers; 200 uint8_t max_active_cmds; 201 qdf_spinlock_t timer_lock; 202 }; 203 204 /** 205 * wlan_serialization_remove_cmd_from_queue() - to remove command from 206 * given queue 207 * @queue: queue from which command needs to be removed 208 * @cmd: command to match in the queue 209 * @pcmd_list: Pointer to command list containing the command 210 * @ser_pdev_obj: pointer to private pdev serialization object 211 * @node_type: Pdev node or vdev node 212 * 213 * This API takes the queue, it matches the provided command from this queue 214 * and removes it. Before removing the command, it will notify the caller 215 * that if it needs to remove any memory allocated by caller. 216 * 217 * Return: QDF_STATUS_SUCCESS on success, error code on failure 218 */ 219 QDF_STATUS 220 wlan_serialization_remove_cmd_from_queue( 221 qdf_list_t *queue, 222 struct wlan_serialization_command *cmd, 223 struct wlan_serialization_command_list **pcmd_list, 224 struct wlan_ser_pdev_obj *ser_pdev_obj, 225 enum wlan_serialization_node node_type); 226 227 /** 228 * wlan_serialization_add_cmd_from_queue() - Add a cmd to 229 * given queue 230 * @queue: queue from which command needs to be removed 231 * @cmd_list: Pointer to command list containing the command 232 * @ser_pdev_obj: pointer to private pdev serialization object 233 * @is_cmd_for_active_queue: Add cmd to active or pending queue 234 * @node_type: Pdev node or vdev node 235 * 236 * Return: Status of the serialization request 237 */ 238 enum wlan_serialization_status 239 wlan_serialization_add_cmd_to_queue( 240 qdf_list_t *queue, 241 struct wlan_serialization_command_list *cmd_list, 242 struct wlan_ser_pdev_obj *ser_pdev_obj, 243 uint8_t is_cmd_for_active_queue, 244 enum wlan_serialization_node node_type); 245 246 /** 247 * wlan_serialization_get_psoc_from_cmd() - get psoc from provided cmd 248 * @cmd: pointer to actual command 249 * 250 * This API will get the pointer to psoc through checking type of cmd 251 * 252 * Return: pointer to psoc 253 */ 254 struct wlan_objmgr_psoc* 255 wlan_serialization_get_psoc_from_cmd(struct wlan_serialization_command *cmd); 256 257 /** 258 * wlan_serialization_get_pdev_from_cmd() - get pdev from provided cmd 259 * @cmd: pointer to actual command 260 * 261 * This API will get the pointer to pdev through checking type of cmd 262 * 263 * Return: pointer to pdev 264 */ 265 struct wlan_objmgr_pdev* 266 wlan_serialization_get_pdev_from_cmd(struct wlan_serialization_command *cmd); 267 268 /** 269 * wlan_serialization_get_vdev_from_cmd() - get vdev from provided cmd 270 * @cmd: pointer to actual command 271 * 272 * This API will get the pointer to vdev through checking type of cmd 273 * 274 * Return: pointer to vdev 275 */ 276 struct wlan_objmgr_vdev* 277 wlan_serialization_get_vdev_from_cmd(struct wlan_serialization_command *cmd); 278 279 /** 280 * wlan_serialization_get_cmd_from_queue() - to extract command from given queue 281 * @queue: pointer to queue 282 * @nnode: next node to extract 283 * 284 * This API will try to extract node from queue which is next to prev node. If 285 * no previous node is given then take out the front node of the queue. 286 * 287 * Return: QDF_STATUS 288 */ 289 QDF_STATUS wlan_serialization_get_cmd_from_queue( 290 qdf_list_t *queue, qdf_list_node_t **nnode); 291 292 /** 293 * wlan_serialization_stop_timer() - to stop particular timer 294 * @ser_timer: pointer to serialization timer 295 * 296 * This API stops the particular timer 297 * 298 * Return: QDF_STATUS 299 */ 300 QDF_STATUS 301 wlan_serialization_stop_timer(struct wlan_serialization_timer *ser_timer); 302 /** 303 * wlan_serialization_cleanup_vdev_timers() - clean-up all timers for a vdev 304 * 305 * @vdev: pointer to vdev object 306 * 307 * This API is to cleanup all the timers for a vdev. 308 * It can be used when serialization vdev destroy is called. 309 * It will make sure that if timer is running then it will 310 * stop and destroys the timer 311 * 312 * Return: QDF_STATUS 313 */ 314 315 QDF_STATUS wlan_serialization_cleanup_vdev_timers( 316 struct wlan_objmgr_vdev *vdev); 317 318 /** 319 * wlan_serialization_cleanup_all_timers() - to clean-up all timers 320 * 321 * @psoc_ser_ob: pointer to serialization psoc private object 322 * 323 * This API is to cleanup all the timers. it can be used when serialization 324 * module is exiting. it will make sure that if timer is running then it will 325 * stop and destroys the timer 326 * 327 * Return: QDF_STATUS 328 */ 329 QDF_STATUS wlan_serialization_cleanup_all_timers( 330 struct wlan_ser_psoc_obj *psoc_ser_ob); 331 332 /** 333 * wlan_serialization_validate_cmd() - Validate the command 334 * @comp_id: Component ID 335 * @cmd_type: Command Type 336 * 337 * Return: QDF_STATUS 338 */ 339 QDF_STATUS wlan_serialization_validate_cmd( 340 enum wlan_umac_comp_id comp_id, 341 enum wlan_serialization_cmd_type cmd_type); 342 343 /** 344 * wlan_serialization_validate_cmd_list() - Validate the command list 345 * @cmd_list: Serialization command list 346 * 347 * Return: QDF_STATUS 348 */ 349 QDF_STATUS wlan_serialization_validate_cmd_list( 350 struct wlan_serialization_command_list *cmd_list); 351 352 /** 353 * wlan_serialization_validate_cmdtype() - Validate the command type 354 * @cmd_type: Command Type 355 * 356 * Return: QDF_STATUS 357 */ 358 QDF_STATUS wlan_serialization_validate_cmdtype( 359 enum wlan_serialization_cmd_type cmd_type); 360 361 /** 362 * wlan_serialization_destroy_pdev_list() - Release the pdev cmds and 363 * destroy list 364 * @pdev_queue: Pointer to the pdev queue 365 * 366 * Return: None 367 */ 368 void wlan_serialization_destroy_pdev_list( 369 struct wlan_serialization_pdev_queue *pdev_queue); 370 371 /** 372 * wlan_serialization_destroy_vdev_list() - Release the vdev cmds and 373 * destroy list 374 * @list: List to be destroyed 375 * 376 * Return: None 377 */ 378 void wlan_serialization_destroy_vdev_list(qdf_list_t *list); 379 380 /** 381 * wlan_serialization_get_psoc_obj() - Return the component private obj 382 * @psoc: Pointer to the PSOC object 383 * 384 * Return: Serialization component's PSOC level private data object 385 */ 386 struct wlan_ser_psoc_obj *wlan_serialization_get_psoc_obj( 387 struct wlan_objmgr_psoc *psoc); 388 389 /** 390 * wlan_serialization_get_pdev_obj() - Return the component private obj 391 * @psoc: Pointer to the PDEV object 392 * 393 * Return: Serialization component's PDEV level private data object 394 */ 395 struct wlan_ser_pdev_obj *wlan_serialization_get_pdev_obj( 396 struct wlan_objmgr_pdev *pdev); 397 398 /** 399 * wlan_serialization_get_vdev_obj() - Return the component private obj 400 * @vdev: Pointer to the VDEV object 401 * 402 * Return: Serialization component's VDEV level private data object 403 */ 404 struct wlan_ser_vdev_obj *wlan_serialization_get_vdev_obj( 405 struct wlan_objmgr_vdev *vdev); 406 407 /** 408 * wlan_serialization_is_cmd_in_vdev_list() - Check Node present in VDEV list 409 * @vdev: Pointer to the VDEV object 410 * @queue: Pointer to the qdf_list_t 411 * @node_type: Pdev node or vdev node 412 * 413 * Return: Boolean true or false 414 */ 415 bool 416 wlan_serialization_is_cmd_in_vdev_list( 417 struct wlan_objmgr_vdev *vdev, qdf_list_t *queue, 418 enum wlan_serialization_node node_type); 419 420 /** 421 * wlan_serialization_is_cmd_in_pdev_list() - Check Node present in PDEV list 422 * @pdev: Pointer to the PDEV object 423 * @queue: Pointer to the qdf_list_t 424 * 425 * Return: Boolean true or false 426 */ 427 bool 428 wlan_serialization_is_cmd_in_pdev_list( 429 struct wlan_objmgr_pdev *pdev, qdf_list_t *queue); 430 431 /** 432 * wlan_serialization_is_cmd_in_active_pending() - return cmd status 433 * active/pending queue 434 * @cmd_in_active: CMD in active list 435 * @cmd_in_pending: CMD in pending list 436 * 437 * Return: enum wlan_serialization_cmd_status 438 */ 439 enum wlan_serialization_cmd_status 440 wlan_serialization_is_cmd_in_active_pending( 441 bool cmd_in_active, bool cmd_in_pending); 442 443 /** 444 * wlan_serialization_is_cmd_present_in_given_queue() - Check if the cmd is 445 * present in the given queue 446 * @queue: List of commands which has to be searched 447 * @cmd: Serialization command information 448 * @node_type: Pdev node or vdev node 449 * 450 * Return: Boolean true or false 451 */ 452 bool wlan_serialization_is_cmd_present_in_given_queue( 453 qdf_list_t *queue, 454 struct wlan_serialization_command *cmd, 455 enum wlan_serialization_node node_type); 456 457 /** 458 * wlan_serialization_timer_destroy() - destroys the timer 459 * @ser_timer: pointer to particular timer 460 * 461 * This API destroys the memory allocated by timer and assigns cmd member of 462 * that timer structure to NULL 463 * 464 * Return: QDF_STATUS 465 */ 466 QDF_STATUS wlan_serialization_timer_destroy( 467 struct wlan_serialization_timer *ser_timer); 468 469 /** 470 * wlan_serialization_list_empty() - check if the list is empty 471 * @queue: Queue/List that needs to be checked for emptiness 472 * 473 * Return: true if list is empty and false otherwise 474 */ 475 bool wlan_serialization_list_empty(qdf_list_t *queue); 476 477 /** 478 * wlan_serialization_list_size() - Find the size of the provided queue 479 * @queue: Queue/List for which the size/length is to be returned 480 * 481 * Return: size/length of the queue/list 482 */ 483 uint32_t wlan_serialization_list_size(qdf_list_t *queue); 484 485 /** 486 * wlan_serialization_match_cmd_type() - Check for a match on given nnode 487 * @nnode: The node on which the matching has to be done 488 * @cmd_type: Command type that needs to be matched 489 * @node_type: Pdev node or vdev node 490 * 491 * This API will check if the cmd ID and cmd type of the given nnode are 492 * matching with the one's that are being passed to this function. 493 * 494 * Return: True if matched,false otherwise. 495 */ 496 bool wlan_serialization_match_cmd_type( 497 qdf_list_node_t *nnode, 498 enum wlan_serialization_cmd_type, 499 enum wlan_serialization_node node_type); 500 501 /** 502 * wlan_serialization_match_cmd_id_type() - Check for a match on given nnode 503 * @nnode: The node on which the matching has to be done 504 * @cmd: Command that needs to be matched 505 * @node_type: Pdev node or vdev node 506 * 507 * This API will check if the cmd ID and cmd type of the given nnode are 508 * matching with the one's that are being passed to this function. 509 * 510 * Return: True if matched,false otherwise. 511 */ 512 bool wlan_serialization_match_cmd_id_type( 513 qdf_list_node_t *nnode, 514 struct wlan_serialization_command *cmd, 515 enum wlan_serialization_node node_type); 516 517 /** 518 * wlan_serialization_match_cmd_vdev() - Check for a match on given nnode 519 * @nnode: The node on which the matching has to be done 520 * @vdev: VDEV object that needs to be matched 521 * @node_type: Pdev node or vdev node 522 * 523 * This API will check if the VDEV object of the given nnode are 524 * matching with the one's that are being passed to this function. 525 * 526 * Return: True if matched,false otherwise. 527 */ 528 bool wlan_serialization_match_cmd_vdev(qdf_list_node_t *nnode, 529 struct wlan_objmgr_vdev *vdev, 530 enum wlan_serialization_node node_type); 531 532 /** 533 * wlan_serialization_match_cmd_pdev() - Check for a match on given nnode 534 * @nnode: The node on which the matching has to be done 535 * @pdev: pdev object that needs to be matched 536 * @node_type: Node type. Pdev node or vdev node 537 * 538 * This API will check if the PDEV object of the given nnode are 539 * matching with the one's that are being passed to this function. 540 * 541 * Return: True if matched,false otherwise. 542 */ 543 bool wlan_serialization_match_cmd_pdev(qdf_list_node_t *nnode, 544 struct wlan_objmgr_pdev *pdev, 545 enum wlan_serialization_node node_type); 546 547 /** 548 * wlan_serialization_match_cmd_blocking() - Check for a blocking cmd 549 * @nnode: The node on which the matching has to be done 550 * @node_type: Pdev node or vdev node 551 * 552 * This API will check if the give command of nnode is a blocking command. 553 * 554 * Return: True if blocking command, false otherwise. 555 */ 556 bool wlan_serialization_match_cmd_blocking( 557 qdf_list_node_t *nnode, 558 enum wlan_serialization_node node_type); 559 560 /** 561 * wlan_serialization_find_cmd() - Find the cmd matching the given criteria 562 * @cmd: Serialization command information 563 * @cmd_type: Command type to be matched 564 * @pdev: pdev object that needs to be matched 565 * @vdev: vdev object that needs to be matched 566 * @node_type: Node type. Pdev node or vdev node 567 * 568 * Return: Pointer to the node member in the list 569 */ 570 qdf_list_node_t * 571 wlan_serialization_find_cmd(qdf_list_t *queue, uint32_t match_type, 572 struct wlan_serialization_command *cmd, 573 enum wlan_serialization_cmd_type cmd_type, 574 struct wlan_objmgr_pdev *pdev, 575 struct wlan_objmgr_vdev *vdev, 576 enum wlan_serialization_node node_type); 577 578 /** 579 * wlan_serialization_remove_front() - Remove the front node of the list 580 * @list: List from which the node is to be removed 581 * @node: Pointer to store the node that is removed 582 * 583 * Return: QDF_STATUS Success or Failure 584 */ 585 QDF_STATUS wlan_serialization_remove_front( 586 qdf_list_t *list, 587 qdf_list_node_t **node); 588 589 /** 590 * wlan_serialization_remove_node() - Remove the given node from the list 591 * @list: List from which the node is to be removed 592 * @node: Pointer to the node that is to be removed 593 * 594 * Return: QDF_STATUS Success or Failure 595 */ 596 QDF_STATUS wlan_serialization_remove_node( 597 qdf_list_t *list, 598 qdf_list_node_t *node); 599 600 /** 601 * wlan_serialization_insert_front() - Insert a node into the front of the list 602 * @list: List to which the node is to be inserted 603 * @node: Pointer to the node that is to be inserted 604 * 605 * Return: QDF_STATUS Success or Failure 606 */ 607 QDF_STATUS wlan_serialization_insert_front( 608 qdf_list_t *list, 609 qdf_list_node_t *node); 610 611 /** 612 * wlan_serialization_insert_back() - Insert a node into the back of the list 613 * @list: List to which the node is to be inserted 614 * @node: Pointer to the node that is to be inserted 615 * 616 * Return: QDF_STATUS Success or Failure 617 */ 618 QDF_STATUS wlan_serialization_insert_back( 619 qdf_list_t *list, 620 qdf_list_node_t *node); 621 622 /** 623 * wlan_serialization_peek_front() - Peek the front node of the list 624 * @list: List on which the node is to be peeked 625 * @node: Pointer to the store the node that is being peeked 626 * 627 * Return: QDF_STATUS Success or Failure 628 */ 629 QDF_STATUS wlan_serialization_peek_front( 630 qdf_list_t *list, 631 qdf_list_node_t **node); 632 633 /** 634 * wlan_serialization_peek_next() - Peek the next node of the list 635 * @list: List on which the node is to be peeked 636 * @node1: Pointer to the node1 from where the next node has to be peeked 637 * @node2: Pointer to the store the node that is being peeked 638 * 639 * Return: QDF_STATUS Success or Failure 640 */ 641 QDF_STATUS wlan_serialization_peek_next( 642 qdf_list_t *list, 643 qdf_list_node_t *node1, 644 qdf_list_node_t **node2); 645 646 /** 647 * wlan_serialization_acquire_lock() - Acquire lock to the given queue 648 * @lock: Pointer to the lock 649 * 650 * Return: QDF_STATUS success or failure 651 */ 652 QDF_STATUS 653 wlan_serialization_acquire_lock(qdf_spinlock_t *lock); 654 655 /** 656 * wlan_serialization_release_lock() - Release lock to the given queue 657 * @lock: Pointer to the lock 658 * 659 * Return: QDF_STATUS success or failure 660 */ 661 QDF_STATUS 662 wlan_serialization_release_lock(qdf_spinlock_t *lock); 663 664 /** 665 * wlan_serialization_create_lock() - Init the lock to the given queue 666 * @lock: Pointer to the lock 667 * 668 * Return: QDF_STATUS success or failure 669 */ 670 QDF_STATUS 671 wlan_serialization_create_lock(qdf_spinlock_t *lock); 672 673 /** 674 * wlan_serialization_destroy_lock() - Deinit the lock to the given queue 675 * @lock: Pointer to the lock 676 * 677 * Return: QDF_STATUS success or failure 678 */ 679 QDF_STATUS 680 wlan_serialization_destroy_lock(qdf_spinlock_t *lock); 681 682 /** 683 * wlan_serialization_any_vdev_cmd_active() - Check any vdev cmd active for pdev 684 * @pdev_queue: serialization pdev queue object 685 * 686 * Return: true or false 687 */ 688 bool wlan_serialization_any_vdev_cmd_active( 689 struct wlan_serialization_pdev_queue *pdev_queue); 690 691 /** 692 * wlan_ser_update_cmd_history() - Update serialization queue history 693 * @pdev_queue:serialization pdev queue 694 * @cmd: cmd to be added/remeoved 695 * @ser_reason: serialization action that resulted in addition/removal 696 * @add_remove: added or removed from queue 697 * @active_queue:for active queue 698 * 699 * Return: QDF_STATUS success or failure 700 */ 701 702 void wlan_ser_update_cmd_history( 703 struct wlan_serialization_pdev_queue *pdev_queue, 704 struct wlan_serialization_command *cmd, 705 enum ser_queue_reason ser_reason, 706 bool add_remove, 707 bool active_queue); 708 709 #endif 710