wlan_dsc.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. * Copyright (c) 2018-2019 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: Driver Synchronization Core (DSC) APIs for use by the driver
  21. * orchestration layer.
  22. *
  23. * This infrastructure accomplishes two high level goals:
  24. * 1) Replace ad-hoc locking/flags (hdd_init_deinit_lock,
  25. * iface_change_lock, con_mode_flag, etc., etc., etc.)
  26. * 2) Make cds_ssr_protect() and driver state checking atomic
  27. *
  28. * These two goals are commplished in DSC via two corollary concepts:
  29. * 1) Transitions (as in driver state machine transitions)
  30. * These are mutually exclusive, and replace ad-hoc locking
  31. * 2) Operations (as in operations the driver is currently servicing)
  32. * These execute concurrently with other operations, and replace
  33. * cds_ssr_protect(). Any active transition causes new operations to be
  34. * rejected, in the same way as cds_ssr_protect/hdd_validate_context would.
  35. *
  36. * Transitions and operations are split into 3 distinct levels: driver, psoc,
  37. * and vdev. These levels are arranged into a tree, with a single driver at
  38. * the root, zero or more psocs per driver, and zero or more vdevs per psoc.
  39. *
  40. * High level transitions block transitions and operations at the same level,
  41. * down-tree, and up-tree. So a driver transition effectively prevents any new
  42. * activity in the system, while a vdev transition prevents transitions and
  43. * operations on the same vdev, its parent psoc, and the driver. This also means
  44. * that sibling nodes can transition at the same time, e.g. one vdev going up at
  45. * the same time another is going down.
  46. */
  47. #ifndef __WLAN_DSC_H
  48. #define __WLAN_DSC_H
  49. #include "wlan_dsc_driver.h"
  50. #include "wlan_dsc_psoc.h"
  51. #include "wlan_dsc_vdev.h"
  52. #endif /* __WLAN_DSC_H */