wmi_version.h 3.3 KB

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