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