xref: /wlan-driver/fw-api/fw/wmi_version.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
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 /*
24  * This file was originally distributed by Qualcomm Atheros, Inc.
25  * under proprietary terms before Copyright ownership was assigned
26  * to the Linux Foundation.
27  */
28 
29 /*
30  * IMPORTANT NOTE: For all change to WMI Interface, the ABI version number _must_ be updated.
31  */
32 /** Major version number is incremented when there are significant changes to WMI Interface that break compatibility. */
33 #define __WMI_VER_MAJOR_    1
34 /** Minor version number is incremented when there are changes
35  *  (however minor) to WMI Interface that break
36  *  compatibility. */
37 #define __WMI_VER_MINOR_    0
38 /** WMI revision number has to be incremented when there is a
39  *  change that may or may not break compatibility. */
40 #define __WMI_REVISION_ 1503
41 
42 /** The Version Namespace should not be normally changed. Only
43  *  host and firmware of the same WMI namespace will work
44  *  together.
45  *  For example, "QCA_ML" converts to 0x4C, 0x4D5F414351.
46  *  where 'Q'=0x51, 'C'=0x43, 'A'=0x41, '_'=0x5F. 'M'=4D, 'L'=4C
47  */
48 #define __NAMESPACE_0_    0x5F414351
49 #define __NAMESPACE_1_    0x00004C4D
50 #define __NAMESPACE_2_    0x00000000
51 #define __NAMESPACE_3_    0x00000000
52 
53 /* Format of the version number. */
54 #define WMI_VER_MAJOR_BIT_OFFSET        24
55 #define WMI_VER_MINOR_BIT_OFFSET        0
56 
57 #define WMI_VER_MAJOR_BIT_MASK          0xFF000000
58 #define WMI_VER_MINOR_BIT_MASK          0x00FFFFFF
59 
60 /* Macros to extract the sw_version components.
61  */
62 #define WMI_VER_GET_MAJOR(x) (((x) & WMI_VER_MAJOR_BIT_MASK)>>WMI_VER_MAJOR_BIT_OFFSET)
63 #define WMI_VER_GET_MINOR(x) (((x) & WMI_VER_MINOR_BIT_MASK)>>WMI_VER_MINOR_BIT_OFFSET)
64 
65 #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) )
66 /*
67  * The version has the following format:
68  * Bits 24-31: Major version
69  * Bits 0-23: Minor version
70  * Bits 0-31:  Build number
71  * E.g. Build 1.1.7 would be represented as 0x01000001 for Major/Minor & 0x00000007 for buildnum.
72  *
73  * DO NOT split the following macro into multiple lines as this may confuse the build scripts.
74  */
75 /* ABI Version. Reflects the version of binary interface exposed by Target firmware. */
76 #define WMI_ABI_VERSION_0  WMI_VER_GET_VERSION_0(__WMI_VER_MAJOR_, __WMI_VER_MINOR_)
77 #define WMI_ABI_VERSION_1  __WMI_REVISION_
78 #define WMI_ABI_VERSION_NS_0 __NAMESPACE_0_
79 #define WMI_ABI_VERSION_NS_1 __NAMESPACE_1_
80 #define WMI_ABI_VERSION_NS_2 __NAMESPACE_2_
81 #define WMI_ABI_VERSION_NS_3 __NAMESPACE_3_
82 
83