Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1 | /* |
Govind Singh | d24f5e4 | 2016-02-22 15:16:46 +0530 | [diff] [blame] | 2 | * Copyright (c) 2004-2010, 2013-2014, 2016 The Linux Foundation. All rights reserved. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [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 | */ |
| 27 | |
| 28 | /* |
| 29 | * This file contains the definitions of the WMI protocol specified in the |
| 30 | * Wireless Module Interface (WMI). It includes definitions of all the |
| 31 | * commands and events. Commands are messages from the host to the WM. |
| 32 | * Events and Replies are messages from the WM to the host. |
| 33 | * |
| 34 | * Ownership of correctness in regards to commands |
| 35 | * belongs to the host driver and the WMI is not required to validate |
| 36 | * parameters for value, proper range, or any other checking. |
| 37 | * |
| 38 | */ |
| 39 | |
| 40 | #ifndef _WMI_H_ |
| 41 | #define _WMI_H_ |
| 42 | |
| 43 | #include "wlan_defs.h" |
| 44 | #include "wmix.h" |
| 45 | #include "wmi_unified.h" |
| 46 | #include "wmi_tlv_helper.h" |
| 47 | #include "wmi_tlv_defs.h" |
| 48 | |
| 49 | #ifdef __cplusplus |
| 50 | extern "C" { |
| 51 | #endif |
| 52 | |
| 53 | #define HTC_PROTOCOL_VERSION 0x0002 |
| 54 | |
| 55 | #define WMI_PROTOCOL_VERSION 0x0002 |
| 56 | |
| 57 | #define WMI_MODE_MAX 8 |
| 58 | #define WMI_MAX_RATE_MASK 6 |
| 59 | |
| 60 | PREPACK struct host_app_area_s { |
| 61 | A_UINT32 wmi_protocol_ver; |
| 62 | } POSTPACK; |
| 63 | |
| 64 | #undef MS |
| 65 | #define MS(_v, _f) (((_v) & _f ## _MASK) >> _f ## _LSB) |
| 66 | #undef SM |
| 67 | #define SM(_v, _f) (((_v) << _f ## _LSB) & _f ## _MASK) |
| 68 | #undef WO |
| 69 | #define WO(_f) ((_f ## _OFFSET) >> 2) |
| 70 | |
| 71 | #undef GET_FIELD |
| 72 | #define GET_FIELD(_addr, _f) MS(*((A_UINT32 *)(_addr) + WO(_f)), _f) |
| 73 | #undef SET_FIELD |
| 74 | #define SET_FIELD(_addr, _f, _val) \ |
| 75 | (*((A_UINT32 *)(_addr) + WO(_f)) = \ |
| 76 | (*((A_UINT32 *)(_addr) + WO(_f)) & ~_f ## _MASK) | SM(_val, _f)) |
| 77 | |
| 78 | #define WMI_GET_FIELD(_msg_buf, _msg_type, _f) \ |
| 79 | GET_FIELD(_msg_buf, _msg_type ## _ ## _f) |
| 80 | |
| 81 | #define WMI_SET_FIELD(_msg_buf, _msg_type, _f, _val) \ |
| 82 | SET_FIELD(_msg_buf, _msg_type ## _ ## _f, _val) |
| 83 | |
| 84 | #define WMI_EP_APASS 0x0 |
| 85 | #define WMI_EP_LPASS 0x1 |
| 86 | #define WMI_EP_SENSOR 0x2 |
| 87 | |
| 88 | /* |
| 89 | * Control Path |
| 90 | */ |
| 91 | typedef PREPACK struct { |
| 92 | A_UINT32 commandId : 24, reserved : 2, /* used for WMI endpoint ID */ |
| 93 | plt_priv : 6; /* platform private */ |
| 94 | } POSTPACK WMI_CMD_HDR; /* used for commands and events */ |
| 95 | |
| 96 | #define WMI_CMD_HDR_COMMANDID_LSB 0 |
| 97 | #define WMI_CMD_HDR_COMMANDID_MASK 0x00ffffff |
| 98 | #define WMI_CMD_HDR_COMMANDID_OFFSET 0x00000000 |
| 99 | #define WMI_CMD_HDR_WMI_ENDPOINTID_MASK 0x03000000 |
| 100 | #define WMI_CMD_HDR_WMI_ENDPOINTID_OFFSET 24 |
| 101 | #define WMI_CMD_HDR_PLT_PRIV_LSB 24 |
| 102 | #define WMI_CMD_HDR_PLT_PRIV_MASK 0xff000000 |
| 103 | #define WMI_CMD_HDR_PLT_PRIV_OFFSET 0x00000000 |
| 104 | |
| 105 | /* |
| 106 | * List of Commnands |
| 107 | */ |
| 108 | typedef enum { |
| 109 | WMI_EXTENSION_CMDID, /* used in wmi_svc.c / * Non-wireless extensions * / */ |
| 110 | WMI_IGNORE_CMDID, /* used in wlan_wmi.c */ |
| 111 | } WMI_COMMAND_ID; |
| 112 | |
| 113 | typedef enum { |
| 114 | NONE_CRYPT = 0x01, |
| 115 | WEP_CRYPT = 0x02, |
| 116 | TKIP_CRYPT = 0x04, |
| 117 | AES_CRYPT = 0x08, |
| 118 | #ifdef WAPI_ENABLE |
| 119 | WAPI_CRYPT = 0x10, |
| 120 | #endif /*WAPI_ENABLE */ |
| 121 | } CRYPTO_TYPE; |
| 122 | |
| 123 | #define WMI_MAX_SSID_LEN 32 |
| 124 | |
| 125 | /* |
| 126 | * WMI_SET_PMK_CMDID |
| 127 | */ |
| 128 | #define WMI_PMK_LEN 32 |
| 129 | |
| 130 | /* |
| 131 | * WMI_ADD_CIPHER_KEY_CMDID |
| 132 | */ |
| 133 | typedef enum { |
| 134 | PAIRWISE_USAGE = 0x00, |
| 135 | GROUP_USAGE = 0x01, |
| 136 | TX_USAGE = 0x02, /* default Tx Key - Static WEP only */ |
| 137 | } KEY_USAGE; |
| 138 | |
| 139 | /* |
| 140 | * List of Events (target to host) |
| 141 | */ |
| 142 | typedef enum { |
| 143 | WMI_EXTENSION_EVENTID, /* wmi_profhook.c and umac_wmi_events.c */ |
| 144 | } WMI_EVENT_ID; |
| 145 | |
| 146 | typedef enum { |
| 147 | WMI_11A_CAPABILITY = 1, |
| 148 | WMI_11G_CAPABILITY = 2, |
| 149 | WMI_11AG_CAPABILITY = 3, |
| 150 | WMI_11NA_CAPABILITY = 4, |
| 151 | WMI_11NG_CAPABILITY = 5, |
| 152 | WMI_11NAG_CAPABILITY = 6, |
| 153 | WMI_11AC_CAPABILITY = 7, |
Govind Singh | d24f5e4 | 2016-02-22 15:16:46 +0530 | [diff] [blame] | 154 | WMI_11AX_CAPABILITY = 8, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 155 | /* END CAPABILITY */ |
| 156 | WMI_11N_CAPABILITY_OFFSET = |
| 157 | (WMI_11NA_CAPABILITY - WMI_11A_CAPABILITY), |
| 158 | } WMI_PHY_CAPABILITY; |
| 159 | |
| 160 | /* Deprectated, need clean up */ |
| 161 | #define WMI_MAX_RX_META_SZ (12) |
| 162 | |
| 163 | typedef PREPACK struct { |
| 164 | A_INT8 rssi; |
| 165 | A_UINT8 info; /* usage of 'info' field(8-bit): |
| 166 | * b1:b0 - WMI_MSG_TYPE |
| 167 | * b4:b3:b2 - UP(tid) |
| 168 | * b5 - Used in AP mode. More-data in tx dir, PS in rx. |
| 169 | * b7:b6 - Dot3 header(0), |
| 170 | * Dot11 Header(1), |
| 171 | * ACL data(2) |
| 172 | */ |
| 173 | |
| 174 | A_UINT16 info2; /* usage of 'info2' field(16-bit): |
| 175 | * b11:b0 - seq_no |
| 176 | * b12 - A-MSDU? |
| 177 | * b15:b13 - META_DATA_VERSION 0 - 7 |
| 178 | */ |
| 179 | A_UINT16 info3; /* b3:b2:b1:b0 - device id |
| 180 | * b4 - Used in AP mode. uAPSD trigger in rx, EOSP in tx |
| 181 | * b7:b5 - unused? |
| 182 | * b15:b8 - pad before data start(irrespective of meta version) |
| 183 | */ |
| 184 | } POSTPACK WMI_DATA_HDR; |
| 185 | |
| 186 | #ifdef __cplusplus |
| 187 | } |
| 188 | #endif |
| 189 | #endif /* _WMI_H_ */ |