wmi_version.h 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /*
  2. * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved.
  4. *
  5. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  6. *
  7. *
  8. * Permission to use, copy, modify, and/or distribute this software for
  9. * any purpose with or without fee is hereby granted, provided that the
  10. * above copyright notice and this permission notice appear in all
  11. * copies.
  12. *
  13. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  14. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  15. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  16. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  17. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  18. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  19. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  20. * PERFORMANCE OF THIS SOFTWARE.
  21. */
  22. /*
  23. * This file was originally distributed by Qualcomm Atheros, Inc.
  24. * under proprietary terms before Copyright ownership was assigned
  25. * to the Linux Foundation.
  26. */
  27. /*
  28. * IMPORTANT NOTE: For all change to WMI Interface, the ABI version number _must_ be updated.
  29. */
  30. /** Major version number is incremented when there are significant changes to WMI Interface that break compatibility. */
  31. #define __WMI_VER_MAJOR_ 1
  32. /** Minor version number is incremented when there are changes
  33. * (however minor) to WMI Interface that break
  34. * compatibility. */
  35. #define __WMI_VER_MINOR_ 0
  36. /** WMI revision number has to be incremented when there is a
  37. * change that may or may not break compatibility. */
  38. #define __WMI_REVISION_ 1514
  39. /** The Version Namespace should not be normally changed. Only
  40. * host and firmware of the same WMI namespace will work
  41. * together.
  42. * For example, "QCA_ML" converts to 0x4C, 0x4D5F414351.
  43. * where 'Q'=0x51, 'C'=0x43, 'A'=0x41, '_'=0x5F. 'M'=4D, 'L'=4C
  44. */
  45. #define __NAMESPACE_0_ 0x5F414351
  46. #define __NAMESPACE_1_ 0x00004C4D
  47. #define __NAMESPACE_2_ 0x00000000
  48. #define __NAMESPACE_3_ 0x00000000
  49. /* Format of the version number. */
  50. #define WMI_VER_MAJOR_BIT_OFFSET 24
  51. #define WMI_VER_MINOR_BIT_OFFSET 0
  52. #define WMI_VER_MAJOR_BIT_MASK 0xFF000000
  53. #define WMI_VER_MINOR_BIT_MASK 0x00FFFFFF
  54. /* Macros to extract the sw_version components.
  55. */
  56. #define WMI_VER_GET_MAJOR(x) (((x) & WMI_VER_MAJOR_BIT_MASK)>>WMI_VER_MAJOR_BIT_OFFSET)
  57. #define WMI_VER_GET_MINOR(x) (((x) & WMI_VER_MINOR_BIT_MASK)>>WMI_VER_MINOR_BIT_OFFSET)
  58. #define WMI_VER_GET_VERSION_0(major, minor) ( (( major << WMI_VER_MAJOR_BIT_OFFSET ) & WMI_VER_MAJOR_BIT_MASK) + (( minor << WMI_VER_MINOR_BIT_OFFSET ) & WMI_VER_MINOR_BIT_MASK) )
  59. /*
  60. * The version has the following format:
  61. * Bits 24-31: Major version
  62. * Bits 0-23: Minor version
  63. * Bits 0-31: Build number
  64. * E.g. Build 1.1.7 would be represented as 0x01000001 for Major/Minor & 0x00000007 for buildnum.
  65. *
  66. * DO NOT split the following macro into multiple lines as this may confuse the build scripts.
  67. */
  68. /* ABI Version. Reflects the version of binary interface exposed by Target firmware. */
  69. #define WMI_ABI_VERSION_0 WMI_VER_GET_VERSION_0(__WMI_VER_MAJOR_, __WMI_VER_MINOR_)
  70. #define WMI_ABI_VERSION_1 __WMI_REVISION_
  71. #define WMI_ABI_VERSION_NS_0 __NAMESPACE_0_
  72. #define WMI_ABI_VERSION_NS_1 __NAMESPACE_1_
  73. #define WMI_ABI_VERSION_NS_2 __NAMESPACE_2_
  74. #define WMI_ABI_VERSION_NS_3 __NAMESPACE_3_