wlan_dsc.h 2.4 KB

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