Madan Mohan Koyyalamudi | e32d219 | 2013-09-28 23:54:37 -0700 | [diff] [blame] | 1 | /* |
Manjeet Singh | 7eb1c49 | 2017-01-02 14:15:51 +0530 | [diff] [blame] | 2 | * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. |
Madan Mohan Koyyalamudi | e32d219 | 2013-09-28 23:54:37 -0700 | [diff] [blame] | 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 | /* |
| 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 | */ |
Prakash Dhavali | 7410fac | 2014-02-05 21:27:47 -0800 | [diff] [blame] | 27 | |
Madan Mohan Koyyalamudi | e32d219 | 2013-09-28 23:54:37 -0700 | [diff] [blame] | 28 | /* |
| 29 | * IMPORTANT NOTE: For all change to WMI Interface, the ABI version number _must_ be updated. |
| 30 | */ |
| 31 | /** Major version number is incremented when there are significant changes to WMI Interface that break compatibility. */ |
| 32 | #define __WMI_VER_MAJOR_ 1 |
| 33 | /** Minor version number is incremented when there are changes |
| 34 | * (however minor) to WMI Interface that break |
| 35 | * compatibility. */ |
| 36 | #define __WMI_VER_MINOR_ 0 |
| 37 | /** WMI revision number has to be incremented when there is a |
| 38 | * change that may or may not break compatibility. */ |
tinlin | e9e726b | 2017-12-13 14:09:06 +0800 | [diff] [blame] | 39 | #define __WMI_REVISION_ 476 |
Madan Mohan Koyyalamudi | e32d219 | 2013-09-28 23:54:37 -0700 | [diff] [blame] | 40 | |
| 41 | /** The Version Namespace should not be normally changed. Only |
| 42 | * host and firmware of the same WMI namespace will work |
| 43 | * together. |
| 44 | * For example, "QCA_ML" converts to 0x4C, 0x4D5F414351. |
| 45 | * where 'Q'=0x51, 'C'=0x43, 'A'=0x41, '_'=0x5F. 'M'=4D, 'L'=4C |
| 46 | */ |
| 47 | #define __NAMESPACE_0_ 0x5F414351 |
| 48 | #define __NAMESPACE_1_ 0x00004C4D |
| 49 | #define __NAMESPACE_2_ 0x00000000 |
| 50 | #define __NAMESPACE_3_ 0x00000000 |
| 51 | |
| 52 | /* Format of the version number. */ |
| 53 | #define WMI_VER_MAJOR_BIT_OFFSET 24 |
| 54 | #define WMI_VER_MINOR_BIT_OFFSET 0 |
| 55 | |
| 56 | #define WMI_VER_MAJOR_BIT_MASK 0xFF000000 |
| 57 | #define WMI_VER_MINOR_BIT_MASK 0x00FFFFFF |
| 58 | |
| 59 | /* Macros to extract the sw_version components. |
| 60 | */ |
| 61 | #define WMI_VER_GET_MAJOR(x) (((x) & WMI_VER_MAJOR_BIT_MASK)>>WMI_VER_MAJOR_BIT_OFFSET) |
| 62 | #define WMI_VER_GET_MINOR(x) (((x) & WMI_VER_MINOR_BIT_MASK)>>WMI_VER_MINOR_BIT_OFFSET) |
| 63 | |
| 64 | #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) ) |
| 65 | /* |
| 66 | * The version has the following format: |
| 67 | * Bits 24-31: Major version |
| 68 | * Bits 0-23: Minor version |
| 69 | * Bits 0-31: Build number |
| 70 | * E.g. Build 1.1.7 would be represented as 0x01000001 for Major/Minor & 0x00000007 for buildnum. |
| 71 | * |
| 72 | * DO NOT split the following macro into multiple lines as this may confuse the build scripts. |
| 73 | */ |
| 74 | /* ABI Version. Reflects the version of binary interface exposed by Target firmware. */ |
| 75 | #define WMI_ABI_VERSION_0 WMI_VER_GET_VERSION_0(__WMI_VER_MAJOR_, __WMI_VER_MINOR_) |
| 76 | #define WMI_ABI_VERSION_1 __WMI_REVISION_ |
| 77 | #define WMI_ABI_VERSION_NS_0 __NAMESPACE_0_ |
| 78 | #define WMI_ABI_VERSION_NS_1 __NAMESPACE_1_ |
| 79 | #define WMI_ABI_VERSION_NS_2 __NAMESPACE_2_ |
| 80 | #define WMI_ABI_VERSION_NS_3 __NAMESPACE_3_ |