1 /* 2 * Copyright (c) 2017-2020 The Linux Foundation. All rights reserved. 3 * Copyright (c) 2022-2023 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 * @history: serialization history 104 * 105 * NB: not using kernel-doc format since the kernel-doc script doesn't 106 * handle the qdf_bitmap() macro 107 */ 108 struct wlan_serialization_pdev_queue { 109 qdf_list_t active_list; 110 qdf_list_t pending_list; 111 qdf_list_t cmd_pool_list; 112 qdf_bitmap(vdev_active_cmd_bitmap, WLAN_UMAC_PSOC_MAX_VDEVS); 113 bool blocking_cmd_active; 114 uint16_t blocking_cmd_waiting; 115 qdf_spinlock_t pdev_queue_lock; 116 #ifdef WLAN_SER_DEBUG 117 struct ser_history history; 118 #endif 119 }; 120 121 /** 122 * struct wlan_serialization_vdev_queue - queue data related to vdev 123 * @active_list: list to hold the commands currently being executed 124 * @pending_list: list: to hold the commands currently pending 125 * @queue_disable: is the queue disabled 126 */ 127 struct wlan_serialization_vdev_queue { 128 qdf_list_t active_list; 129 qdf_list_t pending_list; 130 bool queue_disable; 131 }; 132 133 /** 134 * enum serialization_pdev_queue_type - Types of available pdev queues 135 * @SER_PDEV_QUEUE_COMP_SCAN: Scan queue 136 * @SER_PDEV_QUEUE_COMP_NON_SCAN: Non Scan queue 137 * @SER_PDEV_QUEUE_COMP_MAX: Max enumeration 138 */ 139 enum serialization_pdev_queue_type { 140 SER_PDEV_QUEUE_COMP_SCAN, 141 SER_PDEV_QUEUE_COMP_NON_SCAN, 142 SER_PDEV_QUEUE_COMP_MAX, 143 }; 144 145 /** 146 * enum serialization_vdev_queue_type - Types of available vdev queues 147 * @SER_VDEV_QUEUE_COMP_NON_SCAN: Non Scan queue 148 * @SER_VDEV_QUEUE_COMP_MAX: Max enumeration 149 */ 150 enum serialization_vdev_queue_type { 151 SER_VDEV_QUEUE_COMP_NON_SCAN, 152 SER_VDEV_QUEUE_COMP_MAX, 153 }; 154 155 /** 156 * enum wlan_serialization_match_type - Comparison options for a command 157 * @WLAN_SER_MATCH_VDEV: Compare vdev 158 * @WLAN_SER_MATCH_PDEV: Compare pdev 159 * @WLAN_SER_MATCH_CMD_TYPE_VDEV: Compare command type and vdev 160 * @WLAN_SER_MATCH_CMD_ID_VDEV: Compare command id and vdev 161 * @WLAN_SER_MATCH_MAX: Max enumeration 162 */ 163 enum wlan_serialization_match_type { 164 WLAN_SER_MATCH_VDEV, 165 WLAN_SER_MATCH_PDEV, 166 WLAN_SER_MATCH_CMD_TYPE_VDEV, 167 WLAN_SER_MATCH_CMD_ID_VDEV, 168 WLAN_SER_MATCH_MAX, 169 }; 170 171 /** 172 * struct wlan_ser_pdev_obj - pdev obj data for serialization 173 * @pdev_q: Array of pdev queues 174 */ 175 struct wlan_ser_pdev_obj { 176 struct wlan_serialization_pdev_queue pdev_q[SER_PDEV_QUEUE_COMP_MAX]; 177 }; 178 179 /** 180 * struct wlan_ser_vdev_obj - Serialization private object of vdev 181 * @vdev_q: Array of vdev queues 182 */ 183 struct wlan_ser_vdev_obj { 184 struct wlan_serialization_vdev_queue vdev_q[SER_VDEV_QUEUE_COMP_MAX]; 185 }; 186 187 /** 188 * struct wlan_ser_psoc_obj - psoc obj data for serialization 189 * @comp_info_cb: module level callback 190 * @apply_rules_cb: pointer to apply rules on the cmd 191 * @timers: Timers associated with the active commands 192 * @max_active_cmds: Maximum active commands allowed 193 * @timer_lock: lock for @timers 194 * 195 * Serialization component takes a command as input and checks whether to 196 * allow/deny the command. It will use the module level callback registered 197 * by each component to fetch the information needed to apply the rules. 198 * Once the information is available, the rules callback registered for each 199 * command internally by serialization will be applied to determine the 200 * checkpoint for the command. If allowed, command will be put into active/ 201 * pending list and each active command is associated with a timer. 202 */ 203 struct wlan_ser_psoc_obj { 204 wlan_serialization_comp_info_cb comp_info_cb[WLAN_SER_CMD_MAX][WLAN_UMAC_COMP_ID_MAX]; 205 wlan_serialization_apply_rules_cb apply_rules_cb[WLAN_SER_CMD_MAX]; 206 struct wlan_serialization_timer *timers; 207 uint8_t max_active_cmds; 208 qdf_spinlock_t timer_lock; 209 }; 210 211 /** 212 * wlan_serialization_remove_cmd_from_queue() - to remove command from 213 * given queue 214 * @queue: queue from which command needs to be removed 215 * @cmd: command to match in the queue 216 * @pcmd_list: Pointer to command list containing the command 217 * @ser_pdev_obj: pointer to private pdev serialization object 218 * @node_type: Pdev node or vdev node 219 * 220 * This API takes the queue, it matches the provided command from this queue 221 * and removes it. Before removing the command, it will notify the caller 222 * that if it needs to remove any memory allocated by caller. 223 * 224 * Return: QDF_STATUS_SUCCESS on success, error code on failure 225 */ 226 QDF_STATUS 227 wlan_serialization_remove_cmd_from_queue( 228 qdf_list_t *queue, 229 struct wlan_serialization_command *cmd, 230 struct wlan_serialization_command_list **pcmd_list, 231 struct wlan_ser_pdev_obj *ser_pdev_obj, 232 enum wlan_serialization_node node_type); 233 234 /** 235 * wlan_serialization_add_cmd_to_queue() - Add a cmd to given queue 236 * @queue: queue to which command needs to be added 237 * @cmd_list: Pointer to command list containing the command 238 * @ser_pdev_obj: pointer to private pdev serialization object 239 * @is_cmd_for_active_queue: Add cmd to active or pending queue 240 * @node_type: Pdev node or vdev node 241 * 242 * Return: Status of the serialization request 243 */ 244 enum wlan_serialization_status 245 wlan_serialization_add_cmd_to_queue( 246 qdf_list_t *queue, 247 struct wlan_serialization_command_list *cmd_list, 248 struct wlan_ser_pdev_obj *ser_pdev_obj, 249 uint8_t is_cmd_for_active_queue, 250 enum wlan_serialization_node node_type); 251 252 /** 253 * wlan_serialization_get_psoc_from_cmd() - get psoc from provided cmd 254 * @cmd: pointer to actual command 255 * 256 * This API will get the pointer to psoc through checking type of cmd 257 * 258 * Return: pointer to psoc 259 */ 260 struct wlan_objmgr_psoc* 261 wlan_serialization_get_psoc_from_cmd(struct wlan_serialization_command *cmd); 262 263 /** 264 * wlan_serialization_get_pdev_from_cmd() - get pdev from provided cmd 265 * @cmd: pointer to actual command 266 * 267 * This API will get the pointer to pdev through checking type of cmd 268 * 269 * Return: pointer to pdev 270 */ 271 struct wlan_objmgr_pdev* 272 wlan_serialization_get_pdev_from_cmd(struct wlan_serialization_command *cmd); 273 274 /** 275 * wlan_serialization_get_vdev_from_cmd() - get vdev from provided cmd 276 * @cmd: pointer to actual command 277 * 278 * This API will get the pointer to vdev through checking type of cmd 279 * 280 * Return: pointer to vdev 281 */ 282 struct wlan_objmgr_vdev* 283 wlan_serialization_get_vdev_from_cmd(struct wlan_serialization_command *cmd); 284 285 /** 286 * wlan_serialization_get_cmd_from_queue() - to extract command from given queue 287 * @queue: pointer to queue 288 * @nnode: next node to extract 289 * 290 * This API will try to extract node from queue which is next to prev node. If 291 * no previous node is given then take out the front node of the queue. 292 * 293 * Return: QDF_STATUS 294 */ 295 QDF_STATUS wlan_serialization_get_cmd_from_queue( 296 qdf_list_t *queue, qdf_list_node_t **nnode); 297 298 /** 299 * wlan_serialization_stop_timer() - to stop particular timer 300 * @ser_timer: pointer to serialization timer 301 * 302 * This API stops the particular timer 303 * 304 * Return: QDF_STATUS 305 */ 306 QDF_STATUS 307 wlan_serialization_stop_timer(struct wlan_serialization_timer *ser_timer); 308 309 /** 310 * wlan_serialization_cleanup_vdev_timers() - clean-up all timers for a vdev 311 * 312 * @vdev: pointer to vdev object 313 * 314 * This API is to cleanup all the timers for a vdev. 315 * It can be used when serialization vdev destroy is called. 316 * It will make sure that if timer is running then it will 317 * stop and destroys the timer 318 * 319 * Return: QDF_STATUS 320 */ 321 322 QDF_STATUS wlan_serialization_cleanup_vdev_timers( 323 struct wlan_objmgr_vdev *vdev); 324 325 /** 326 * wlan_serialization_cleanup_all_timers() - to clean-up all timers 327 * 328 * @psoc_ser_ob: pointer to serialization psoc private object 329 * 330 * This API is to cleanup all the timers. it can be used when serialization 331 * module is exiting. it will make sure that if timer is running then it will 332 * stop and destroys the timer 333 * 334 * Return: QDF_STATUS 335 */ 336 QDF_STATUS wlan_serialization_cleanup_all_timers( 337 struct wlan_ser_psoc_obj *psoc_ser_ob); 338 339 /** 340 * wlan_serialization_validate_cmd() - Validate the command 341 * @comp_id: Component ID 342 * @cmd_type: Command Type 343 * 344 * Return: QDF_STATUS 345 */ 346 QDF_STATUS wlan_serialization_validate_cmd( 347 enum wlan_umac_comp_id comp_id, 348 enum wlan_serialization_cmd_type cmd_type); 349 350 /** 351 * wlan_serialization_validate_cmd_list() - Validate the command list 352 * @cmd_list: Serialization command list 353 * 354 * Return: QDF_STATUS 355 */ 356 QDF_STATUS wlan_serialization_validate_cmd_list( 357 struct wlan_serialization_command_list *cmd_list); 358 359 /** 360 * wlan_serialization_validate_cmdtype() - Validate the command type 361 * @cmd_type: Command Type 362 * 363 * Return: QDF_STATUS 364 */ 365 QDF_STATUS wlan_serialization_validate_cmdtype( 366 enum wlan_serialization_cmd_type cmd_type); 367 368 /** 369 * wlan_serialization_destroy_pdev_list() - Release the pdev cmds and 370 * destroy list 371 * @pdev_queue: Pointer to the pdev queue 372 * 373 * Return: None 374 */ 375 void wlan_serialization_destroy_pdev_list( 376 struct wlan_serialization_pdev_queue *pdev_queue); 377 378 /** 379 * wlan_serialization_destroy_vdev_list() - Release the vdev cmds and 380 * destroy list 381 * @list: List to be destroyed 382 * 383 * Return: None 384 */ 385 void wlan_serialization_destroy_vdev_list(qdf_list_t *list); 386 387 /** 388 * wlan_serialization_get_psoc_obj() - Return the component private obj 389 * @psoc: Pointer to the PSOC object 390 * 391 * Return: Serialization component's PSOC level private data object 392 */ 393 struct wlan_ser_psoc_obj *wlan_serialization_get_psoc_obj( 394 struct wlan_objmgr_psoc *psoc); 395 396 /** 397 * wlan_serialization_get_pdev_obj() - Return the component private obj 398 * @pdev: Pointer to the PDEV object 399 * 400 * Return: Serialization component's PDEV level private data object 401 */ 402 struct wlan_ser_pdev_obj *wlan_serialization_get_pdev_obj( 403 struct wlan_objmgr_pdev *pdev); 404 405 /** 406 * wlan_serialization_get_vdev_obj() - Return the component private obj 407 * @vdev: Pointer to the VDEV object 408 * 409 * Return: Serialization component's VDEV level private data object 410 */ 411 struct wlan_ser_vdev_obj *wlan_serialization_get_vdev_obj( 412 struct wlan_objmgr_vdev *vdev); 413 414 /** 415 * wlan_serialization_is_cmd_in_vdev_list() - Check Node present in VDEV list 416 * @vdev: Pointer to the VDEV object 417 * @queue: Pointer to the qdf_list_t 418 * @node_type: Pdev node or vdev node 419 * 420 * Return: Boolean true or false 421 */ 422 bool 423 wlan_serialization_is_cmd_in_vdev_list( 424 struct wlan_objmgr_vdev *vdev, qdf_list_t *queue, 425 enum wlan_serialization_node node_type); 426 427 /** 428 * wlan_serialization_is_cmd_in_pdev_list() - Check Node present in PDEV list 429 * @pdev: Pointer to the PDEV object 430 * @queue: Pointer to the qdf_list_t 431 * 432 * Return: Boolean true or false 433 */ 434 bool 435 wlan_serialization_is_cmd_in_pdev_list( 436 struct wlan_objmgr_pdev *pdev, qdf_list_t *queue); 437 438 /** 439 * wlan_serialization_is_cmd_in_active_pending() - return cmd status 440 * active/pending queue 441 * @cmd_in_active: CMD in active list 442 * @cmd_in_pending: CMD in pending list 443 * 444 * Return: enum wlan_serialization_cmd_status 445 */ 446 enum wlan_serialization_cmd_status 447 wlan_serialization_is_cmd_in_active_pending( 448 bool cmd_in_active, bool cmd_in_pending); 449 450 /** 451 * wlan_serialization_is_cmd_present_in_given_queue() - Check if the cmd is 452 * present in the given queue 453 * @queue: List of commands which has to be searched 454 * @cmd: Serialization command information 455 * @node_type: Pdev node or vdev node 456 * 457 * Return: Boolean true or false 458 */ 459 bool wlan_serialization_is_cmd_present_in_given_queue( 460 qdf_list_t *queue, 461 struct wlan_serialization_command *cmd, 462 enum wlan_serialization_node node_type); 463 464 /** 465 * wlan_serialization_timer_destroy() - destroys the timer 466 * @ser_timer: pointer to particular timer 467 * 468 * This API destroys the memory allocated by timer and assigns cmd member of 469 * that timer structure to NULL 470 * 471 * Return: QDF_STATUS 472 */ 473 QDF_STATUS wlan_serialization_timer_destroy( 474 struct wlan_serialization_timer *ser_timer); 475 476 /** 477 * wlan_serialization_list_empty() - check if the list is empty 478 * @queue: Queue/List that needs to be checked for emptiness 479 * 480 * Return: true if list is empty and false otherwise 481 */ 482 bool wlan_serialization_list_empty(qdf_list_t *queue); 483 484 /** 485 * wlan_serialization_list_size() - Find the size of the provided queue 486 * @queue: Queue/List for which the size/length is to be returned 487 * 488 * Return: size/length of the queue/list 489 */ 490 uint32_t wlan_serialization_list_size(qdf_list_t *queue); 491 492 /** 493 * wlan_serialization_match_cmd_type() - Check for a match on given nnode 494 * @nnode: The node on which the matching has to be done 495 * @cmd_type: Command type that needs to be matched 496 * @node_type: Pdev node or vdev node 497 * 498 * This API will check if the cmd ID and cmd type of the given nnode are 499 * matching with the one's that are being passed to this function. 500 * 501 * Return: True if matched,false otherwise. 502 */ 503 bool wlan_serialization_match_cmd_type( 504 qdf_list_node_t *nnode, 505 enum wlan_serialization_cmd_type cmd_type, 506 enum wlan_serialization_node node_type); 507 508 /** 509 * wlan_serialization_match_cmd_id_type() - Check for a match on given nnode 510 * @nnode: The node on which the matching has to be done 511 * @cmd: Command that needs to be matched 512 * @node_type: Pdev node or vdev node 513 * 514 * This API will check if the cmd ID and cmd type of the given nnode are 515 * matching with the one's that are being passed to this function. 516 * 517 * Return: True if matched,false otherwise. 518 */ 519 bool wlan_serialization_match_cmd_id_type( 520 qdf_list_node_t *nnode, 521 struct wlan_serialization_command *cmd, 522 enum wlan_serialization_node node_type); 523 524 /** 525 * wlan_serialization_match_cmd_vdev() - Check for a match on given nnode 526 * @nnode: The node on which the matching has to be done 527 * @vdev: VDEV object that needs to be matched 528 * @node_type: Pdev node or vdev node 529 * 530 * This API will check if the VDEV object of the given nnode are 531 * matching with the one's that are being passed to this function. 532 * 533 * Return: True if matched,false otherwise. 534 */ 535 bool wlan_serialization_match_cmd_vdev(qdf_list_node_t *nnode, 536 struct wlan_objmgr_vdev *vdev, 537 enum wlan_serialization_node node_type); 538 539 /** 540 * wlan_serialization_match_cmd_pdev() - Check for a match on given nnode 541 * @nnode: The node on which the matching has to be done 542 * @pdev: pdev object that needs to be matched 543 * @node_type: Node type. Pdev node or vdev node 544 * 545 * This API will check if the PDEV object of the given nnode are 546 * matching with the one's that are being passed to this function. 547 * 548 * Return: True if matched,false otherwise. 549 */ 550 bool wlan_serialization_match_cmd_pdev(qdf_list_node_t *nnode, 551 struct wlan_objmgr_pdev *pdev, 552 enum wlan_serialization_node node_type); 553 554 /** 555 * wlan_serialization_match_cmd_blocking() - Check for a blocking cmd 556 * @nnode: The node on which the matching has to be done 557 * @node_type: Pdev node or vdev node 558 * 559 * This API will check if the give command of nnode is a blocking command. 560 * 561 * Return: True if blocking command, false otherwise. 562 */ 563 bool wlan_serialization_match_cmd_blocking( 564 qdf_list_node_t *nnode, 565 enum wlan_serialization_node node_type); 566 567 /** 568 * wlan_serialization_find_cmd() - Find the cmd matching the given criteria 569 * @queue: Queue to search 570 * @match_type: Match criteria 571 * @cmd: Serialization command information 572 * @cmd_type: Command type to be matched 573 * @pdev: pdev object that needs to be matched 574 * @vdev: vdev object that needs to be matched 575 * @node_type: Node type. Pdev node or vdev node 576 * 577 * Return: Pointer to the node member in the list 578 */ 579 qdf_list_node_t * 580 wlan_serialization_find_cmd(qdf_list_t *queue, uint32_t match_type, 581 struct wlan_serialization_command *cmd, 582 enum wlan_serialization_cmd_type cmd_type, 583 struct wlan_objmgr_pdev *pdev, 584 struct wlan_objmgr_vdev *vdev, 585 enum wlan_serialization_node node_type); 586 587 /** 588 * wlan_serialization_remove_front() - Remove the front node of the list 589 * @list: List from which the node is to be removed 590 * @node: Pointer to store the node that is removed 591 * 592 * Return: QDF_STATUS Success or Failure 593 */ 594 QDF_STATUS wlan_serialization_remove_front( 595 qdf_list_t *list, 596 qdf_list_node_t **node); 597 598 /** 599 * wlan_serialization_remove_node() - Remove the given node from the list 600 * @list: List from which the node is to be removed 601 * @node: Pointer to the node that is to be removed 602 * 603 * Return: QDF_STATUS Success or Failure 604 */ 605 QDF_STATUS wlan_serialization_remove_node( 606 qdf_list_t *list, 607 qdf_list_node_t *node); 608 609 /** 610 * wlan_serialization_insert_front() - Insert a node into the front of the list 611 * @list: List to which the node is to be inserted 612 * @node: Pointer to the node that is to be inserted 613 * 614 * Return: QDF_STATUS Success or Failure 615 */ 616 QDF_STATUS wlan_serialization_insert_front( 617 qdf_list_t *list, 618 qdf_list_node_t *node); 619 620 /** 621 * wlan_serialization_insert_back() - Insert a node into the back of the list 622 * @list: List to which the node is to be inserted 623 * @node: Pointer to the node that is to be inserted 624 * 625 * Return: QDF_STATUS Success or Failure 626 */ 627 QDF_STATUS wlan_serialization_insert_back( 628 qdf_list_t *list, 629 qdf_list_node_t *node); 630 631 /** 632 * wlan_serialization_peek_front() - Peek the front node of the list 633 * @list: List on which the node is to be peeked 634 * @node: Pointer to the store the node that is being peeked 635 * 636 * Return: QDF_STATUS Success or Failure 637 */ 638 QDF_STATUS wlan_serialization_peek_front( 639 qdf_list_t *list, 640 qdf_list_node_t **node); 641 642 /** 643 * wlan_serialization_peek_next() - Peek the next node of the list 644 * @list: List on which the node is to be peeked 645 * @node1: Pointer to the node1 from where the next node has to be peeked 646 * @node2: Pointer to the store the node that is being peeked 647 * 648 * Return: QDF_STATUS Success or Failure 649 */ 650 QDF_STATUS wlan_serialization_peek_next( 651 qdf_list_t *list, 652 qdf_list_node_t *node1, 653 qdf_list_node_t **node2); 654 655 /** 656 * wlan_serialization_acquire_lock() - Acquire 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_acquire_lock(qdf_spinlock_t *lock); 663 664 /** 665 * wlan_serialization_release_lock() - Release 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_release_lock(qdf_spinlock_t *lock); 672 673 /** 674 * wlan_serialization_create_lock() - Init 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_create_lock(qdf_spinlock_t *lock); 681 682 /** 683 * wlan_serialization_destroy_lock() - Deinit the lock to the given queue 684 * @lock: Pointer to the lock 685 * 686 * Return: QDF_STATUS success or failure 687 */ 688 QDF_STATUS 689 wlan_serialization_destroy_lock(qdf_spinlock_t *lock); 690 691 /** 692 * wlan_serialization_any_vdev_cmd_active() - Check any vdev cmd active for pdev 693 * @pdev_queue: serialization pdev queue object 694 * 695 * Return: true or false 696 */ 697 bool wlan_serialization_any_vdev_cmd_active( 698 struct wlan_serialization_pdev_queue *pdev_queue); 699 700 /** 701 * wlan_ser_update_cmd_history() - Update serialization queue history 702 * @pdev_queue:serialization pdev queue 703 * @cmd: cmd to be added/remeoved 704 * @ser_reason: serialization action that resulted in addition/removal 705 * @add_remove: added or removed from queue 706 * @active_queue:for active queue 707 * 708 * Return: QDF_STATUS success or failure 709 */ 710 711 void wlan_ser_update_cmd_history( 712 struct wlan_serialization_pdev_queue *pdev_queue, 713 struct wlan_serialization_command *cmd, 714 enum ser_queue_reason ser_reason, 715 bool add_remove, 716 bool active_queue); 717 718 #endif 719