1 /* 2 * Copyright (c) 2016-2018 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 /** 20 * @file cdp_txrx_peer.h 21 * @brief Define the host data path peer API functions 22 * called by the host control SW and the OS interface module 23 */ 24 #ifndef _CDP_TXRX_PEER_H_ 25 #define _CDP_TXRX_PEER_H_ 26 #include <cdp_txrx_ops.h> 27 #include "cdp_txrx_handle.h" 28 29 /** 30 * cdp_peer_register() - Register peer into physical device 31 * @soc - data path soc handle 32 * @pdev - data path device instance 33 * @sta_desc - peer description 34 * 35 * Register peer into physical device 36 * 37 * Return: QDF_STATUS_SUCCESS registration success 38 * QDF_STATUS_E_NOSUPPORT not support this feature 39 */ 40 static inline QDF_STATUS 41 cdp_peer_register(ol_txrx_soc_handle soc, struct cdp_pdev *pdev, 42 struct ol_txrx_desc_type *sta_desc) 43 { 44 if (!soc || !soc->ops || !soc->ops->peer_ops) { 45 QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL, 46 "%s invalid instance", __func__); 47 return QDF_STATUS_E_INVAL; 48 } 49 50 if (soc->ops->peer_ops->register_peer) 51 return soc->ops->peer_ops->register_peer(pdev, sta_desc); 52 53 return QDF_STATUS_E_NOSUPPORT; 54 } 55 56 /** 57 * cdp_clear_peer() - remove peer from physical device 58 * @soc - data path soc handle 59 * @pdev - data path device instance 60 * @sta_id - local peer id 61 * 62 * remove peer from physical device 63 * 64 * Return: QDF_STATUS_SUCCESS registration success 65 * QDF_STATUS_E_NOSUPPORT not support this feature 66 */ 67 static inline QDF_STATUS 68 cdp_clear_peer(ol_txrx_soc_handle soc, struct cdp_pdev *pdev, uint8_t sta_id) 69 { 70 if (!soc || !soc->ops || !soc->ops->peer_ops) { 71 QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL, 72 "%s invalid instance", __func__); 73 return QDF_STATUS_E_INVAL; 74 } 75 76 if (soc->ops->peer_ops->clear_peer) 77 return soc->ops->peer_ops->clear_peer(pdev, sta_id); 78 79 return QDF_STATUS_E_NOSUPPORT; 80 } 81 82 /** 83 * cdp_peer_register_ocb_peer() - register ocb peer from physical device 84 * @soc - data path soc handle 85 * @cds_ctx - cds void context 86 * @mac_addr - mac address for ocb self peer 87 * @peer_id - local peer id 88 * 89 * register ocb peer from physical device 90 * 91 * Return: QDF_STATUS_SUCCESS registration success 92 * QDF_STATUS_E_NOSUPPORT not support this feature 93 */ 94 static inline QDF_STATUS 95 cdp_peer_register_ocb_peer(ol_txrx_soc_handle soc, 96 uint8_t *mac_addr, uint8_t *peer_id) 97 { 98 if (!soc || !soc->ops || !soc->ops->peer_ops) { 99 QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL, 100 "%s invalid instance", __func__); 101 return QDF_STATUS_E_INVAL; 102 } 103 104 if (soc->ops->peer_ops->register_ocb_peer) 105 return soc->ops->peer_ops->register_ocb_peer(mac_addr, peer_id); 106 107 return QDF_STATUS_E_NOSUPPORT; 108 } 109 110 /** 111 * cdp_peer_remove_for_vdev() - remove peer instance from virtual interface 112 * @soc - data path soc handle 113 * @vdev - virtual interface instance 114 * @callback - remove done notification callback function pointer 115 * @callback_context - callback caller context 116 * @remove_last_peer - removed peer is last peer or not 117 * 118 * remove peer instance from virtual interface 119 * 120 * Return: NONE 121 */ 122 static inline void 123 cdp_peer_remove_for_vdev(ol_txrx_soc_handle soc, 124 struct cdp_vdev *vdev, ol_txrx_vdev_peer_remove_cb callback, 125 void *callback_context, bool remove_last_peer) 126 { 127 if (!soc || !soc->ops || !soc->ops->peer_ops) { 128 QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL, 129 "%s invalid instance", __func__); 130 return; 131 } 132 133 if (soc->ops->peer_ops->remove_peers_for_vdev) 134 return soc->ops->peer_ops->remove_peers_for_vdev( 135 vdev, callback, callback_context, remove_last_peer); 136 137 return; 138 } 139 140 /** 141 * cdp_peer_remove_for_vdev_no_lock() - remove peer instance from vdev 142 * @soc - data path soc handle 143 * @vdev - virtual interface instance 144 * @callback - remove done notification callback function pointer 145 * @callback_context - callback caller context 146 * 147 * remove peer instance from virtual interface without lock 148 * 149 * Return: NONE 150 */ 151 static inline void 152 cdp_peer_remove_for_vdev_no_lock(ol_txrx_soc_handle soc, 153 struct cdp_vdev *vdev, 154 ol_txrx_vdev_peer_remove_cb callback, 155 void *callback_context) 156 { 157 if (!soc || !soc->ops || !soc->ops->peer_ops) { 158 QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL, 159 "%s invalid instance", __func__); 160 return; 161 } 162 163 if (soc->ops->peer_ops->remove_peers_for_vdev_no_lock) 164 return soc->ops->peer_ops->remove_peers_for_vdev_no_lock( 165 vdev, callback, callback_context); 166 } 167 168 /** 169 * cdp_peer_get_ref_by_addr() - Find peer by peer mac address and inc peer ref 170 * @soc - data path soc handle 171 * @pdev - data path device instance 172 * @peer_addr - peer mac address 173 * @peer_id - local peer id with target mac address 174 * @debug_id - debug_id to track caller 175 * 176 * To release the peer ref, cdp_peer_release_ref needs to be called. 177 * 178 * Return: peer instance void pointer 179 * NULL cannot find target peer 180 */ 181 static inline void 182 *cdp_peer_get_ref_by_addr(ol_txrx_soc_handle soc, struct cdp_pdev *pdev, 183 u8 *peer_addr, u8 *peer_id, 184 enum peer_debug_id_type debug_id) 185 { 186 if (!soc || !soc->ops || !soc->ops->peer_ops) { 187 QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL, 188 "%s invalid instance", __func__); 189 return NULL; 190 } 191 192 if (soc->ops->peer_ops->peer_get_ref_by_addr) 193 return soc->ops->peer_ops->peer_get_ref_by_addr( 194 pdev, peer_addr, peer_id, debug_id); 195 196 return NULL; 197 } 198 199 /** 200 * cdp_peer_release_ref() - Release peer reference 201 * @soc - data path soc handle 202 * @peer - peer pointer 203 * @debug_id - debug_id to track caller 204 * 205 * Return:void 206 */ 207 static inline void 208 cdp_peer_release_ref(ol_txrx_soc_handle soc, void *peer, 209 enum peer_debug_id_type debug_id) 210 { 211 if (!soc || !soc->ops || !soc->ops->peer_ops) { 212 QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL, 213 "%s invalid instance", __func__); 214 return; 215 } 216 217 if (soc->ops->peer_ops->peer_release_ref) 218 soc->ops->peer_ops->peer_release_ref(peer, debug_id); 219 } 220 221 /** 222 * cdp_peer_find_by_addr() - Find peer by peer mac address 223 * @soc - data path soc handle 224 * @pdev - data path device instance 225 * @peer_addr - peer mac address 226 * @peer_id - local peer id with target mac address 227 * 228 * Find peer and local peer id by peer mac address 229 * 230 * Return: peer instance void pointer 231 * NULL cannot find target peer 232 */ 233 static inline void 234 *cdp_peer_find_by_addr(ol_txrx_soc_handle soc, struct cdp_pdev *pdev, 235 uint8_t *peer_addr, uint8_t *peer_id) 236 { 237 if (!soc || !soc->ops || !soc->ops->peer_ops) { 238 QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL, 239 "%s invalid instance", __func__); 240 return NULL; 241 } 242 243 if (soc->ops->peer_ops->find_peer_by_addr) 244 return soc->ops->peer_ops->find_peer_by_addr( 245 pdev, peer_addr, peer_id); 246 247 return NULL; 248 } 249 250 /** 251 * cdp_peer_find_by_addr_and_vdev() - Find peer by peer mac address within vdev 252 * @soc - data path soc handle 253 * @pdev - data path device instance 254 * @vdev - virtual interface instance 255 * @peer_addr - peer mac address 256 * @peer_id - local peer id with target mac address 257 * 258 * Find peer by peer mac address within vdev 259 * 260 * Return: peer instance void pointer 261 * NULL cannot find target peer 262 */ 263 static inline void 264 *cdp_peer_find_by_addr_and_vdev(ol_txrx_soc_handle soc, struct cdp_pdev *pdev, 265 struct cdp_vdev *vdev, uint8_t *peer_addr, uint8_t *peer_id) 266 { 267 if (!soc || !soc->ops || !soc->ops->peer_ops) { 268 QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL, 269 "%s invalid instance", __func__); 270 return NULL; 271 } 272 273 if (soc->ops->peer_ops->find_peer_by_addr_and_vdev) 274 return soc->ops->peer_ops->find_peer_by_addr_and_vdev( 275 pdev, vdev, peer_addr, peer_id); 276 277 return NULL; 278 } 279 280 /** 281 * cdp_peer_find_by_local_id() - Find peer by local peer id 282 * @soc - data path soc handle 283 * @pdev - data path device instance 284 * @local_peer_id - local peer id want to find 285 * 286 * Find peer by local peer id within physical device 287 * 288 * Return: peer instance void pointer 289 * NULL cannot find target peer 290 */ 291 static inline void 292 *cdp_peer_find_by_local_id(ol_txrx_soc_handle soc, struct cdp_pdev *pdev, 293 uint8_t local_peer_id) 294 { 295 if (!soc || !soc->ops || !soc->ops->peer_ops) { 296 QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL, 297 "%s invalid instance", __func__); 298 return NULL; 299 } 300 301 if (soc->ops->peer_ops->peer_find_by_local_id) 302 return soc->ops->peer_ops->peer_find_by_local_id( 303 pdev, local_peer_id); 304 305 return NULL; 306 } 307 308 /** 309 * cdp_peer_state_update() - update peer local state 310 * @soc - data path soc handle 311 * @pdev - data path device instance 312 * @peer_addr - peer mac address 313 * @state - new peer local state 314 * 315 * update peer local state 316 * 317 * Return: QDF_STATUS_SUCCESS registration success 318 * QDF_STATUS_E_NOSUPPORT not support this feature 319 */ 320 static inline QDF_STATUS 321 cdp_peer_state_update(ol_txrx_soc_handle soc, struct cdp_pdev *pdev, 322 uint8_t *peer_addr, enum ol_txrx_peer_state state) 323 { 324 if (!soc || !soc->ops || !soc->ops->peer_ops) { 325 QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL, 326 "%s invalid instance", __func__); 327 return QDF_STATUS_E_INVAL; 328 } 329 330 if (soc->ops->peer_ops->peer_state_update) 331 return soc->ops->peer_ops->peer_state_update( 332 pdev, peer_addr, state); 333 334 return QDF_STATUS_E_NOSUPPORT; 335 } 336 337 /** 338 * cdp_peer_state_get() - Get local peer state 339 * @soc - data path soc handle 340 * @peer - peer instance 341 * 342 * Get local peer state 343 * 344 * Return: peer status 345 */ 346 static inline int 347 cdp_peer_state_get(ol_txrx_soc_handle soc, void *peer) 348 { 349 if (!soc || !soc->ops || !soc->ops->peer_ops) { 350 QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL, 351 "%s invalid instance", __func__); 352 return 0; 353 } 354 355 if (soc->ops->peer_ops->get_peer_state) 356 return soc->ops->peer_ops->get_peer_state(peer); 357 358 return 0; 359 } 360 361 /** 362 * cdp_peer_get_local_peer_id() - Find local peer id within peer instance 363 * @soc - data path soc handle 364 * @peer - peer instance 365 * 366 * Find local peer id within peer instance 367 * 368 * Return: local peer id 369 * HTT_INVALID_PEER Invalid peer 370 */ 371 static inline uint16_t 372 cdp_peer_get_local_peer_id(ol_txrx_soc_handle soc, void *peer) 373 { 374 if (!soc || !soc->ops || !soc->ops->peer_ops) { 375 QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL, 376 "%s invalid instance", __func__); 377 return HTT_INVALID_PEER; 378 } 379 380 if (soc->ops->peer_ops->local_peer_id) 381 return soc->ops->peer_ops->local_peer_id(peer); 382 383 return HTT_INVALID_PEER; 384 } 385 386 /** 387 * cdp_peer_get_vdevid() - Get virtual interface id which peer registered 388 * @soc - data path soc handle 389 * @peer - peer instance 390 * @vdev_id - virtual interface id which peer registered 391 * 392 * Get virtual interface id which peer registered 393 * 394 * Return: QDF_STATUS_SUCCESS registration success 395 * QDF_STATUS_E_NOSUPPORT not support this feature 396 */ 397 static inline QDF_STATUS 398 cdp_peer_get_vdevid(ol_txrx_soc_handle soc, void *peer, uint8_t *vdev_id) 399 { 400 if (!soc || !soc->ops || !soc->ops->peer_ops) { 401 QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL, 402 "%s invalid instance", __func__); 403 return QDF_STATUS_E_INVAL; 404 } 405 406 if (soc->ops->peer_ops->get_vdevid) 407 return soc->ops->peer_ops->get_vdevid(peer, vdev_id); 408 409 return QDF_STATUS_E_NOSUPPORT; 410 } 411 412 /** 413 * cdp_peer_get_vdev_by_sta_id() - Get vdev instance by local peer id 414 * @soc - data path soc handle 415 * @pdev - data path device instance 416 * @sta_id - local peer id 417 * 418 * Get virtual interface id by local peer id 419 * 420 * Return: Virtual interface instance 421 * NULL in case cannot find 422 */ 423 static inline struct cdp_vdev 424 *cdp_peer_get_vdev_by_sta_id(ol_txrx_soc_handle soc, struct cdp_pdev *pdev, 425 uint8_t sta_id) 426 { 427 if (!soc || !soc->ops || !soc->ops->peer_ops) { 428 QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL, 429 "%s invalid instance", __func__); 430 return NULL; 431 } 432 433 if (soc->ops->peer_ops->get_vdev_by_sta_id) 434 return soc->ops->peer_ops->get_vdev_by_sta_id(pdev, sta_id); 435 436 return NULL; 437 } 438 439 /** 440 * cdp_peer_get_peer_mac_addr() - Get peer mac address 441 * @soc - data path soc handle 442 * @peer - peer instance 443 * 444 * Get peer mac address 445 * 446 * Return: peer mac address pointer 447 * NULL in case cannot find 448 */ 449 static inline uint8_t 450 *cdp_peer_get_peer_mac_addr(ol_txrx_soc_handle soc, void *peer) 451 { 452 if (!soc || !soc->ops || !soc->ops->peer_ops) { 453 QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL, 454 "%s invalid instance", __func__); 455 return NULL; 456 } 457 458 if (soc->ops->peer_ops->peer_get_peer_mac_addr) 459 return soc->ops->peer_ops->peer_get_peer_mac_addr(peer); 460 461 return NULL; 462 } 463 464 /** 465 * cdp_peer_get_vdev() - Get virtual interface instance which peer belongs 466 * @soc - data path soc handle 467 * @peer - peer instance 468 * 469 * Get virtual interface instance which peer belongs 470 * 471 * Return: virtual interface instance pointer 472 * NULL in case cannot find 473 */ 474 static inline struct cdp_vdev 475 *cdp_peer_get_vdev(ol_txrx_soc_handle soc, void *peer) 476 { 477 if (!soc || !soc->ops || !soc->ops->peer_ops) { 478 QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL, 479 "%s invalid instance", __func__); 480 return NULL; 481 } 482 483 if (soc->ops->peer_ops->get_vdev_for_peer) 484 return soc->ops->peer_ops->get_vdev_for_peer(peer); 485 486 return NULL; 487 } 488 489 /** 490 * cdp_peer_update_ibss_add_peer_num_of_vdev() - update number of peer 491 * @soc - data path soc handle 492 * @vdev - virtual interface instance 493 * @peer_num_delta - number of peer should be updated 494 * 495 * update number of peer 496 * 497 * Return: updated number of peer 498 * 0 fail 499 */ 500 static inline int16_t 501 cdp_peer_update_ibss_add_peer_num_of_vdev(ol_txrx_soc_handle soc, 502 struct cdp_vdev *vdev, int16_t peer_num_delta) 503 { 504 if (!soc || !soc->ops || !soc->ops->peer_ops) { 505 QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL, 506 "%s invalid instance", __func__); 507 return 0; 508 } 509 510 if (soc->ops->peer_ops->update_ibss_add_peer_num_of_vdev) 511 return soc->ops->peer_ops->update_ibss_add_peer_num_of_vdev( 512 vdev, peer_num_delta); 513 514 return 0; 515 } 516 517 /** 518 * cdp_peer_copy_mac_addr_raw() - copy peer mac address 519 * @soc - data path soc handle 520 * @vdev - virtual interface instance 521 * @bss_addr - mac address should be copied 522 * 523 * copy peer mac address 524 * 525 * Return: none 526 */ 527 static inline void 528 cdp_peer_copy_mac_addr_raw(ol_txrx_soc_handle soc, 529 struct cdp_vdev *vdev, uint8_t *bss_addr) 530 { 531 if (!soc || !soc->ops || !soc->ops->peer_ops) { 532 QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL, 533 "%s invalid instance", __func__); 534 return; 535 } 536 537 if (soc->ops->peer_ops->copy_mac_addr_raw) 538 return soc->ops->peer_ops->copy_mac_addr_raw(vdev, bss_addr); 539 540 return; 541 } 542 543 /** 544 * cdp_peer_add_last_real_peer() - Add peer with last peer marking 545 * @soc - data path soc handle 546 * @pdev - data path device instance 547 * @vdev - virtual interface instance 548 * @peer_id - local peer id 549 * 550 * copy peer mac address 551 * 552 * Return: none 553 */ 554 static inline void 555 cdp_peer_add_last_real_peer(ol_txrx_soc_handle soc, 556 struct cdp_pdev *pdev, struct cdp_vdev *vdev, uint8_t *peer_id) 557 { 558 if (!soc || !soc->ops || !soc->ops->peer_ops) { 559 QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL, 560 "%s invalid instance", __func__); 561 return; 562 } 563 564 if (soc->ops->peer_ops->add_last_real_peer) 565 return soc->ops->peer_ops->add_last_real_peer( 566 pdev, vdev, peer_id); 567 return; 568 } 569 570 /** 571 * cdp_peer_last_assoc_received() - last assoc received peer 572 * @soc - data path soc handle 573 * @peer - peer instance pointer 574 * 575 * !!! This should be implemented on legacy also 576 * last assoc received peer 577 * 578 * Return: pointer 579 */ 580 static inline qdf_time_t * 581 cdp_peer_last_assoc_received(ol_txrx_soc_handle soc, void *peer) 582 { 583 if (!soc || !soc->ops || !soc->ops->peer_ops) { 584 QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL, 585 "%s invalid instance", __func__); 586 return NULL; 587 } 588 589 if (soc->ops->peer_ops->last_assoc_received) 590 return soc->ops->peer_ops->last_assoc_received(peer); 591 592 return NULL; 593 } 594 595 /** 596 * cdp_peer_last_disassoc_received() - last disassoc received peer 597 * @soc - data path soc handle 598 * @peer - peer instance pointer 599 * 600 * !!! This should be implemented on legacy also 601 * last disassoc received peer 602 * 603 * Return: pointer 604 */ 605 static inline qdf_time_t * 606 cdp_peer_last_disassoc_received(ol_txrx_soc_handle soc, void *peer) 607 { 608 if (!soc || !soc->ops || !soc->ops->peer_ops) { 609 QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL, 610 "%s invalid instance", __func__); 611 return NULL; 612 } 613 614 if (soc->ops->peer_ops->last_disassoc_received) 615 return soc->ops->peer_ops->last_disassoc_received(peer); 616 617 return NULL; 618 } 619 620 /** 621 * cdp_peer_last_deauth_received() - last deauth received peer 622 * @soc - data path soc handle 623 * @peer - peer instance pointer 624 * 625 * !!! This should be implemented on legacy also 626 * last deauth received peer 627 * 628 * Return: pointer 629 */ 630 static inline qdf_time_t * 631 cdp_peer_last_deauth_received(ol_txrx_soc_handle soc, void *peer) 632 { 633 if (!soc || !soc->ops || !soc->ops->peer_ops) { 634 QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL, 635 "%s invalid instance", __func__); 636 return NULL; 637 } 638 639 if (soc->ops->peer_ops->last_deauth_received) 640 return soc->ops->peer_ops->last_deauth_received(peer); 641 642 return NULL; 643 } 644 645 /** 646 * cdp_peer_is_vdev_restore_last_peer() - restore last peer 647 * @soc - data path soc handle 648 * @peer - peer instance pointer 649 * 650 * restore last peer 651 * 652 * Return: true, restore success 653 * fasle, restore fail 654 */ 655 static inline bool 656 cdp_peer_is_vdev_restore_last_peer(ol_txrx_soc_handle soc, void *peer) 657 { 658 if (!soc || !soc->ops || !soc->ops->peer_ops) { 659 QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL, 660 "%s invalid instance", __func__); 661 return false; 662 } 663 664 if (soc->ops->peer_ops->is_vdev_restore_last_peer) 665 return soc->ops->peer_ops->is_vdev_restore_last_peer(peer); 666 667 return false; 668 } 669 670 /** 671 * cdp_peer_update_last_real_peer() - update last real peer 672 * @soc - data path soc handle 673 * @pdev - data path device instance 674 * @peer - peer instance pointer 675 * @peer_id - local peer id 676 * @restore_last_peer - restore last peer or not 677 * 678 * update last real peer 679 * 680 * Return: none 681 */ 682 static inline void 683 cdp_peer_update_last_real_peer(ol_txrx_soc_handle soc, struct cdp_pdev *pdev, 684 void *peer, uint8_t *peer_id, bool restore_last_peer) 685 { 686 if (!soc || !soc->ops || !soc->ops->peer_ops) { 687 QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL, 688 "%s invalid instance", __func__); 689 return; 690 } 691 692 if (soc->ops->peer_ops->update_last_real_peer) 693 return soc->ops->peer_ops->update_last_real_peer(pdev, peer, 694 peer_id, restore_last_peer); 695 696 return; 697 } 698 699 /** 700 * ol_txrx_peer_detach_force_delete() - Detach and delete a peer's data object 701 * @peer - the object to detach 702 * 703 * Detach a peer and force the peer object to be removed. It is called during 704 * roaming scenario when the firmware has already deleted a peer. 705 * Peer object is freed immediately to avoid duplicate peers during roam sync 706 * indication processing. 707 * 708 * Return: None 709 */ 710 static inline void cdp_peer_detach_force_delete(ol_txrx_soc_handle soc, 711 void *peer) 712 { 713 if (!soc || !soc->ops || !soc->ops->peer_ops) { 714 QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL, 715 "%s invalid instance", __func__); 716 return; 717 } 718 719 if (soc->ops->peer_ops->peer_detach_force_delete) 720 return soc->ops->peer_ops->peer_detach_force_delete(peer); 721 722 return; 723 } 724 #endif /* _CDP_TXRX_PEER_H_ */ 725