| Cindy H. Kao | 4613e72 | 2011-05-06 10:40:15 -0700 | [diff] [blame] | 1 | /****************************************************************************** | 
|  | 2 | * | 
|  | 3 | * This file is provided under a dual BSD/GPLv2 license.  When using or | 
|  | 4 | * redistributing this file, you may do so under either license. | 
|  | 5 | * | 
|  | 6 | * GPL LICENSE SUMMARY | 
|  | 7 | * | 
| Wey-Yi Guy | fb4961d | 2012-01-06 13:16:33 -0800 | [diff] [blame] | 8 | * Copyright(c) 2010 - 2012 Intel Corporation. All rights reserved. | 
| Cindy H. Kao | 4613e72 | 2011-05-06 10:40:15 -0700 | [diff] [blame] | 9 | * | 
|  | 10 | * This program is free software; you can redistribute it and/or modify | 
|  | 11 | * it under the terms of version 2 of the GNU General Public License as | 
|  | 12 | * published by the Free Software Foundation. | 
|  | 13 | * | 
|  | 14 | * This program is distributed in the hope that it will be useful, but | 
|  | 15 | * WITHOUT ANY WARRANTY; without even the implied warranty of | 
|  | 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU | 
|  | 17 | * General Public License for more details. | 
|  | 18 | * | 
|  | 19 | * You should have received a copy of the GNU General Public License | 
|  | 20 | * along with this program; if not, write to the Free Software | 
|  | 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, | 
|  | 22 | * USA | 
|  | 23 | * | 
|  | 24 | * The full GNU General Public License is included in this distribution | 
|  | 25 | * in the file called LICENSE.GPL. | 
|  | 26 | * | 
|  | 27 | * Contact Information: | 
|  | 28 | *  Intel Linux Wireless <ilw@linux.intel.com> | 
|  | 29 | * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 | 
|  | 30 | * | 
|  | 31 | * BSD LICENSE | 
|  | 32 | * | 
| Wey-Yi Guy | fb4961d | 2012-01-06 13:16:33 -0800 | [diff] [blame] | 33 | * Copyright(c) 2010 - 2012 Intel Corporation. All rights reserved. | 
| Cindy H. Kao | 4613e72 | 2011-05-06 10:40:15 -0700 | [diff] [blame] | 34 | * All rights reserved. | 
|  | 35 | * | 
|  | 36 | * Redistribution and use in source and binary forms, with or without | 
|  | 37 | * modification, are permitted provided that the following conditions | 
|  | 38 | * are met: | 
|  | 39 | * | 
|  | 40 | *  * Redistributions of source code must retain the above copyright | 
|  | 41 | *    notice, this list of conditions and the following disclaimer. | 
|  | 42 | *  * Redistributions in binary form must reproduce the above copyright | 
|  | 43 | *    notice, this list of conditions and the following disclaimer in | 
|  | 44 | *    the documentation and/or other materials provided with the | 
|  | 45 | *    distribution. | 
|  | 46 | *  * Neither the name Intel Corporation nor the names of its | 
|  | 47 | *    contributors may be used to endorse or promote products derived | 
|  | 48 | *    from this software without specific prior written permission. | 
|  | 49 | * | 
|  | 50 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | 
|  | 51 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | 
|  | 52 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | 
|  | 53 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | 
|  | 54 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | 
|  | 55 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 
|  | 56 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 
|  | 57 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 
|  | 58 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 
|  | 59 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 
|  | 60 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 
|  | 61 | * | 
|  | 62 | *****************************************************************************/ | 
|  | 63 | #ifndef __IWL_TESTMODE_H__ | 
|  | 64 | #define __IWL_TESTMODE_H__ | 
|  | 65 |  | 
|  | 66 | #include <linux/types.h> | 
|  | 67 |  | 
|  | 68 |  | 
| Wey-Yi Guy | 4466320 | 2011-06-24 09:02:44 -0700 | [diff] [blame] | 69 | /* | 
|  | 70 | * Commands from user space to kernel space(IWL_TM_CMD_ID_APP2DEV_XX) and | 
| Cindy H. Kao | 4613e72 | 2011-05-06 10:40:15 -0700 | [diff] [blame] | 71 | * from and kernel space to user space(IWL_TM_CMD_ID_DEV2APP_XX). | 
| Wey-Yi Guy | 4466320 | 2011-06-24 09:02:44 -0700 | [diff] [blame] | 72 | * The command ID is carried with IWL_TM_ATTR_COMMAND. | 
|  | 73 | * | 
|  | 74 | * @IWL_TM_CMD_APP2DEV_UCODE: | 
|  | 75 | *	commands from user application to the uCode, | 
|  | 76 | *	the actual uCode host command ID is carried with | 
|  | 77 | *	IWL_TM_ATTR_UCODE_CMD_ID | 
|  | 78 | * | 
| Hsu, Kenny | 72bcacc | 2011-11-15 19:24:32 -0800 | [diff] [blame] | 79 | * @IWL_TM_CMD_APP2DEV_DIRECT_REG_READ32: | 
|  | 80 | * @IWL_TM_CMD_APP2DEV_DIRECT_REG_WRITE32: | 
|  | 81 | * @IWL_TM_CMD_APP2DEV_DIRECT_REG_WRITE8: | 
| Wey-Yi Guy | 4466320 | 2011-06-24 09:02:44 -0700 | [diff] [blame] | 82 | *	commands from user applicaiton to access register | 
|  | 83 | * | 
|  | 84 | * @IWL_TM_CMD_APP2DEV_GET_DEVICENAME: retrieve device name | 
|  | 85 | * @IWL_TM_CMD_APP2DEV_LOAD_INIT_FW: load initial uCode image | 
|  | 86 | * @IWL_TM_CMD_APP2DEV_CFG_INIT_CALIB: perform calibration | 
|  | 87 | * @IWL_TM_CMD_APP2DEV_LOAD_RUNTIME_FW: load runtime uCode image | 
|  | 88 | * @IWL_TM_CMD_APP2DEV_GET_EEPROM: request EEPROM data | 
|  | 89 | * @IWL_TM_CMD_APP2DEV_FIXRATE_REQ: set fix MCS | 
|  | 90 | *	commands fom user space for pure driver level operations | 
|  | 91 | * | 
|  | 92 | * @IWL_TM_CMD_APP2DEV_BEGIN_TRACE: | 
|  | 93 | * @IWL_TM_CMD_APP2DEV_END_TRACE: | 
|  | 94 | * @IWL_TM_CMD_APP2DEV_READ_TRACE: | 
|  | 95 | *	commands fom user space for uCode trace operations | 
|  | 96 | * | 
|  | 97 | * @IWL_TM_CMD_DEV2APP_SYNC_RSP: | 
|  | 98 | *	commands from kernel space to carry the synchronous response | 
|  | 99 | *	to user application | 
|  | 100 | * @IWL_TM_CMD_DEV2APP_UCODE_RX_PKT: | 
|  | 101 | *	commands from kernel space to multicast the spontaneous messages | 
| Amit Beka | cdfef6c | 2012-01-31 15:30:39 +0200 | [diff] [blame] | 102 | *	to user application, or reply of host commands | 
| Wey-Yi Guy | 4466320 | 2011-06-24 09:02:44 -0700 | [diff] [blame] | 103 | * @IWL_TM_CMD_DEV2APP_EEPROM_RSP: | 
|  | 104 | *	commands from kernel space to carry the eeprom response | 
|  | 105 | *	to user application | 
| Hsu, Kenny | 306713f | 2011-11-22 23:03:39 -0800 | [diff] [blame] | 106 | * | 
| Wey-Yi Guy | e98a193 | 2011-07-08 08:46:26 -0700 | [diff] [blame] | 107 | * @IWL_TM_CMD_APP2DEV_OWNERSHIP: | 
|  | 108 | *	commands from user application to own change the ownership of the uCode | 
|  | 109 | *	if application has the ownership, the only host command from | 
|  | 110 | *	testmode will deliver to uCode. Default owner is driver | 
| Hsu, Kenny | 306713f | 2011-11-22 23:03:39 -0800 | [diff] [blame] | 111 | * | 
| Wey-Yi Guy | 0a79bb5 | 2012-01-28 08:30:49 -0800 | [diff] [blame] | 112 | * @IWL_TM_CMD_APP2DEV_LOAD_WOWLAN_FW: load Wake On Wireless LAN uCode image | 
| Hsu, Kenny | e1a38fe | 2011-11-28 00:55:38 -0800 | [diff] [blame] | 113 | * @IWL_TM_CMD_APP2DEV_GET_FW_VERSION: retrieve uCode version | 
| Hsu, Kenny | 0bec12b | 2011-12-01 01:12:50 -0800 | [diff] [blame] | 114 | * @IWL_TM_CMD_APP2DEV_GET_DEVICE_ID: retrieve ID information in device | 
| Kenny Hsu | 668bd6a | 2012-01-06 13:16:32 -0800 | [diff] [blame] | 115 | * @IWL_TM_CMD_APP2DEV_GET_FW_INFO: | 
| Wey-Yi Guy | 0a79bb5 | 2012-01-28 08:30:49 -0800 | [diff] [blame] | 116 | *	retrieve information of existing loaded uCode image | 
| Hsu, Kenny | d4af19f | 2011-11-24 22:26:53 -0800 | [diff] [blame] | 117 | * | 
| Amit Beka | 6c55f5e | 2012-01-25 13:30:27 +0200 | [diff] [blame] | 118 | * @IWL_TM_CMD_APP2DEV_INDIRECT_BUFFER_READ: | 
|  | 119 | * @IWL_TM_CMD_APP2DEV_INDIRECT_BUFFER_DUMP: | 
|  | 120 | * @IWL_TM_CMD_APP2DEV_INDIRECT_BUFFER_WRITE: | 
|  | 121 | *	Commands to read/write data from periphery or SRAM memory ranges. | 
|  | 122 | *	Fore reading, a READ command is sent from the userspace and the data | 
|  | 123 | *	is returned when the user calls a DUMP command. | 
|  | 124 | *	For writing, only a WRITE command is used. | 
| Amit Beka | 0aef8dd | 2012-03-07 09:52:29 -0800 | [diff] [blame] | 125 | * @IWL_TM_CMD_APP2DEV_NOTIFICATIONS: | 
|  | 126 | *	Command to enable/disable notifications (currently RX packets) from the | 
|  | 127 | *	driver to userspace. | 
| Cindy H. Kao | 4613e72 | 2011-05-06 10:40:15 -0700 | [diff] [blame] | 128 | */ | 
|  | 129 | enum iwl_tm_cmd_t { | 
| Wey-Yi Guy | 4466320 | 2011-06-24 09:02:44 -0700 | [diff] [blame] | 130 | IWL_TM_CMD_APP2DEV_UCODE		= 1, | 
| Hsu, Kenny | 72bcacc | 2011-11-15 19:24:32 -0800 | [diff] [blame] | 131 | IWL_TM_CMD_APP2DEV_DIRECT_REG_READ32	= 2, | 
|  | 132 | IWL_TM_CMD_APP2DEV_DIRECT_REG_WRITE32	= 3, | 
|  | 133 | IWL_TM_CMD_APP2DEV_DIRECT_REG_WRITE8	= 4, | 
| Wey-Yi Guy | 4466320 | 2011-06-24 09:02:44 -0700 | [diff] [blame] | 134 | IWL_TM_CMD_APP2DEV_GET_DEVICENAME	= 5, | 
|  | 135 | IWL_TM_CMD_APP2DEV_LOAD_INIT_FW		= 6, | 
|  | 136 | IWL_TM_CMD_APP2DEV_CFG_INIT_CALIB	= 7, | 
|  | 137 | IWL_TM_CMD_APP2DEV_LOAD_RUNTIME_FW	= 8, | 
|  | 138 | IWL_TM_CMD_APP2DEV_GET_EEPROM		= 9, | 
|  | 139 | IWL_TM_CMD_APP2DEV_FIXRATE_REQ		= 10, | 
|  | 140 | IWL_TM_CMD_APP2DEV_BEGIN_TRACE		= 11, | 
|  | 141 | IWL_TM_CMD_APP2DEV_END_TRACE		= 12, | 
|  | 142 | IWL_TM_CMD_APP2DEV_READ_TRACE		= 13, | 
|  | 143 | IWL_TM_CMD_DEV2APP_SYNC_RSP		= 14, | 
|  | 144 | IWL_TM_CMD_DEV2APP_UCODE_RX_PKT		= 15, | 
|  | 145 | IWL_TM_CMD_DEV2APP_EEPROM_RSP		= 16, | 
| Wey-Yi Guy | e98a193 | 2011-07-08 08:46:26 -0700 | [diff] [blame] | 146 | IWL_TM_CMD_APP2DEV_OWNERSHIP		= 17, | 
| Amit Beka | 6c55f5e | 2012-01-25 13:30:27 +0200 | [diff] [blame] | 147 | RESERVED_18				= 18, | 
|  | 148 | RESERVED_19				= 19, | 
|  | 149 | RESERVED_20				= 20, | 
|  | 150 | RESERVED_21				= 21, | 
| Hsu, Kenny | d4af19f | 2011-11-24 22:26:53 -0800 | [diff] [blame] | 151 | IWL_TM_CMD_APP2DEV_LOAD_WOWLAN_FW	= 22, | 
| Hsu, Kenny | e1a38fe | 2011-11-28 00:55:38 -0800 | [diff] [blame] | 152 | IWL_TM_CMD_APP2DEV_GET_FW_VERSION	= 23, | 
| Hsu, Kenny | 0bec12b | 2011-12-01 01:12:50 -0800 | [diff] [blame] | 153 | IWL_TM_CMD_APP2DEV_GET_DEVICE_ID	= 24, | 
| Kenny Hsu | 668bd6a | 2012-01-06 13:16:32 -0800 | [diff] [blame] | 154 | IWL_TM_CMD_APP2DEV_GET_FW_INFO		= 25, | 
| Amit Beka | 6c55f5e | 2012-01-25 13:30:27 +0200 | [diff] [blame] | 155 | IWL_TM_CMD_APP2DEV_INDIRECT_BUFFER_READ = 26, | 
|  | 156 | IWL_TM_CMD_APP2DEV_INDIRECT_BUFFER_DUMP = 27, | 
|  | 157 | IWL_TM_CMD_APP2DEV_INDIRECT_BUFFER_WRITE = 28, | 
| Amit Beka | 0aef8dd | 2012-03-07 09:52:29 -0800 | [diff] [blame] | 158 | IWL_TM_CMD_APP2DEV_NOTIFICATIONS	= 29, | 
|  | 159 | IWL_TM_CMD_MAX				= 30, | 
| Cindy H. Kao | 4613e72 | 2011-05-06 10:40:15 -0700 | [diff] [blame] | 160 | }; | 
|  | 161 |  | 
| Wey-Yi Guy | 4466320 | 2011-06-24 09:02:44 -0700 | [diff] [blame] | 162 | /* | 
|  | 163 | * Atrribute filed in testmode command | 
|  | 164 | * See enum iwl_tm_cmd_t. | 
|  | 165 | * | 
|  | 166 | * @IWL_TM_ATTR_NOT_APPLICABLE: | 
|  | 167 | *	The attribute is not applicable or invalid | 
|  | 168 | * @IWL_TM_ATTR_COMMAND: | 
|  | 169 | *	From user space to kernel space: | 
|  | 170 | *	the command either destines to ucode, driver, or register; | 
|  | 171 | *	From kernel space to user space: | 
|  | 172 | *	the command either carries synchronous response, | 
|  | 173 | *	or the spontaneous message multicast from the device; | 
|  | 174 | * | 
|  | 175 | * @IWL_TM_ATTR_UCODE_CMD_ID: | 
|  | 176 | * @IWL_TM_ATTR_UCODE_CMD_DATA: | 
|  | 177 | *	When IWL_TM_ATTR_COMMAND is IWL_TM_CMD_APP2DEV_UCODE, | 
|  | 178 | *	The mandatory fields are : | 
|  | 179 | *	IWL_TM_ATTR_UCODE_CMD_ID for recognizable command ID; | 
| Wey-Yi Guy | 4466320 | 2011-06-24 09:02:44 -0700 | [diff] [blame] | 180 | *	IWL_TM_ATTR_UCODE_CMD_DATA for the actual command payload | 
|  | 181 | *	to the ucode | 
|  | 182 | * | 
|  | 183 | * @IWL_TM_ATTR_REG_OFFSET: | 
|  | 184 | * @IWL_TM_ATTR_REG_VALUE8: | 
|  | 185 | * @IWL_TM_ATTR_REG_VALUE32: | 
|  | 186 | *	When IWL_TM_ATTR_COMMAND is IWL_TM_CMD_APP2DEV_REG_XXX, | 
|  | 187 | *	The mandatory fields are: | 
|  | 188 | *	IWL_TM_ATTR_REG_OFFSET for the offset of the target register; | 
|  | 189 | *	IWL_TM_ATTR_REG_VALUE8 or IWL_TM_ATTR_REG_VALUE32 for value | 
|  | 190 | * | 
|  | 191 | * @IWL_TM_ATTR_SYNC_RSP: | 
|  | 192 | *	When IWL_TM_ATTR_COMMAND is IWL_TM_CMD_DEV2APP_SYNC_RSP, | 
|  | 193 | *	The mandatory fields are: | 
|  | 194 | *	IWL_TM_ATTR_SYNC_RSP for the data content responding to the user | 
|  | 195 | *	application command | 
|  | 196 | * | 
|  | 197 | * @IWL_TM_ATTR_UCODE_RX_PKT: | 
|  | 198 | *	When IWL_TM_ATTR_COMMAND is IWL_TM_CMD_DEV2APP_UCODE_RX_PKT, | 
|  | 199 | *	The mandatory fields are: | 
|  | 200 | *	IWL_TM_ATTR_UCODE_RX_PKT for the data content multicast to the user | 
|  | 201 | *	application | 
|  | 202 | * | 
|  | 203 | * @IWL_TM_ATTR_EEPROM: | 
|  | 204 | *	When IWL_TM_ATTR_COMMAND is IWL_TM_CMD_DEV2APP_EEPROM, | 
|  | 205 | *	The mandatory fields are: | 
|  | 206 | *	IWL_TM_ATTR_EEPROM for the data content responging to the user | 
|  | 207 | *	application | 
|  | 208 | * | 
|  | 209 | * @IWL_TM_ATTR_TRACE_ADDR: | 
|  | 210 | * @IWL_TM_ATTR_TRACE_SIZE: | 
|  | 211 | * @IWL_TM_ATTR_TRACE_DUMP: | 
|  | 212 | *	When IWL_TM_ATTR_COMMAND is IWL_TM_CMD_APP2DEV_XXX_TRACE, | 
|  | 213 | *	The mandatory fields are: | 
|  | 214 | *	IWL_TM_ATTR_MEM_TRACE_ADDR for the trace address | 
|  | 215 | *	IWL_TM_ATTR_MEM_TRACE_SIZE for the trace buffer size | 
|  | 216 | *	IWL_TM_ATTR_MEM_TRACE_DUMP for the trace dump | 
|  | 217 | * | 
|  | 218 | * @IWL_TM_ATTR_FIXRATE: | 
|  | 219 | *	When IWL_TM_ATTR_COMMAND is IWL_TM_CMD_APP2DEV_FIXRATE_REQ, | 
|  | 220 | *	The mandatory fields are: | 
|  | 221 | *	IWL_TM_ATTR_FIXRATE for the fixed rate | 
|  | 222 | * | 
| Wey-Yi Guy | e98a193 | 2011-07-08 08:46:26 -0700 | [diff] [blame] | 223 | * @IWL_TM_ATTR_UCODE_OWNER: | 
|  | 224 | *	When IWL_TM_ATTR_COMMAND is IWL_TM_CMD_APP2DEV_OWNERSHIP, | 
|  | 225 | *	The mandatory fields are: | 
|  | 226 | *	IWL_TM_ATTR_UCODE_OWNER for the new owner | 
| Hsu, Kenny | 306713f | 2011-11-22 23:03:39 -0800 | [diff] [blame] | 227 | * | 
| Amit Beka | 6c55f5e | 2012-01-25 13:30:27 +0200 | [diff] [blame] | 228 | * @IWL_TM_ATTR_MEM_ADDR: | 
|  | 229 | * @IWL_TM_ATTR_BUFFER_SIZE: | 
|  | 230 | *	When IWL_TM_ATTR_COMMAND is IWL_TM_CMD_APP2DEV_INDIRECT_BUFFER_READ | 
|  | 231 | *	or IWL_TM_CMD_APP2DEV_INDIRECT_BUFFER_WRITE. | 
| Hsu, Kenny | 306713f | 2011-11-22 23:03:39 -0800 | [diff] [blame] | 232 | *	The mandatory fields are: | 
| Amit Beka | 6c55f5e | 2012-01-25 13:30:27 +0200 | [diff] [blame] | 233 | *	IWL_TM_ATTR_MEM_ADDR for the address in SRAM/periphery to read/write | 
|  | 234 | *	IWL_TM_ATTR_BUFFER_SIZE for the buffer size of data to read/write. | 
| Hsu, Kenny | 306713f | 2011-11-22 23:03:39 -0800 | [diff] [blame] | 235 | * | 
| Amit Beka | 6c55f5e | 2012-01-25 13:30:27 +0200 | [diff] [blame] | 236 | * @IWL_TM_ATTR_BUFFER_DUMP: | 
|  | 237 | *	When IWL_TM_ATTR_COMMAND is IWL_TM_CMD_APP2DEV_INDIRECT_BUFFER_DUMP, | 
|  | 238 | *	IWL_TM_ATTR_BUFFER_DUMP is used for the data that was read. | 
|  | 239 | *	When IWL_TM_ATTR_COMMAND is IWL_TM_CMD_APP2DEV_INDIRECT_BUFFER_WRITE, | 
|  | 240 | *	this attribute contains the data to write. | 
| Hsu, Kenny | 306713f | 2011-11-22 23:03:39 -0800 | [diff] [blame] | 241 | * | 
| Hsu, Kenny | e1a38fe | 2011-11-28 00:55:38 -0800 | [diff] [blame] | 242 | * @IWL_TM_ATTR_FW_VERSION: | 
|  | 243 | *	When IWL_TM_ATTR_COMMAND is IWL_TM_CMD_APP2DEV_GET_FW_VERSION, | 
|  | 244 | *	IWL_TM_ATTR_FW_VERSION for the uCode version | 
|  | 245 | * | 
| Hsu, Kenny | 0bec12b | 2011-12-01 01:12:50 -0800 | [diff] [blame] | 246 | * @IWL_TM_ATTR_DEVICE_ID: | 
|  | 247 | *	When IWL_TM_ATTR_COMMAND is IWL_TM_CMD_APP2DEV_GET_DEVICE_ID, | 
|  | 248 | *	IWL_TM_ATTR_DEVICE_ID for the device ID information | 
|  | 249 | * | 
| Kenny Hsu | 668bd6a | 2012-01-06 13:16:32 -0800 | [diff] [blame] | 250 | * @IWL_TM_ATTR_FW_TYPE: | 
|  | 251 | * @IWL_TM_ATTR_FW_INST_SIZE: | 
|  | 252 | * @IWL_TM_ATTR_FW_DATA_SIZE: | 
|  | 253 | *	When IWL_TM_ATTR_COMMAND is IWL_TM_CMD_APP2DEV_GET_FW_INFO, | 
|  | 254 | *	The mandatory fields are: | 
|  | 255 | *	IWL_TM_ATTR_FW_TYPE for the uCode type (INIT/RUNTIME/...) | 
|  | 256 | *	IWL_TM_ATTR_FW_INST_SIZE for the size of instruction section | 
|  | 257 | *	IWL_TM_ATTR_FW_DATA_SIZE for the size of data section | 
|  | 258 | * | 
| Amit Beka | cdfef6c | 2012-01-31 15:30:39 +0200 | [diff] [blame] | 259 | * @IWL_TM_ATTR_UCODE_CMD_SKB: | 
|  | 260 | *	When IWL_TM_ATTR_COMMAND is IWL_TM_CMD_APP2DEV_UCODE this flag | 
|  | 261 | *	indicates that the user wants to receive the response of the command | 
|  | 262 | *	in a reply SKB. If it's not present, the response is not returned. | 
| Amit Beka | 0aef8dd | 2012-03-07 09:52:29 -0800 | [diff] [blame] | 263 | * @IWL_TM_ATTR_ENABLE_NOTIFICATIONS: | 
|  | 264 | *	When IWL_TM_ATTR_COMMAND is IWL_TM_CMD_APP2DEV_NOTIFICATIONS, this | 
|  | 265 | *	flag enables (if present) or disables (if not) the forwarding | 
|  | 266 | *	to userspace. | 
| Wey-Yi Guy | 4466320 | 2011-06-24 09:02:44 -0700 | [diff] [blame] | 267 | */ | 
| Cindy H. Kao | 4613e72 | 2011-05-06 10:40:15 -0700 | [diff] [blame] | 268 | enum iwl_tm_attr_t { | 
| Wey-Yi Guy | 4466320 | 2011-06-24 09:02:44 -0700 | [diff] [blame] | 269 | IWL_TM_ATTR_NOT_APPLICABLE		= 0, | 
|  | 270 | IWL_TM_ATTR_COMMAND			= 1, | 
|  | 271 | IWL_TM_ATTR_UCODE_CMD_ID		= 2, | 
|  | 272 | IWL_TM_ATTR_UCODE_CMD_DATA		= 3, | 
|  | 273 | IWL_TM_ATTR_REG_OFFSET			= 4, | 
|  | 274 | IWL_TM_ATTR_REG_VALUE8			= 5, | 
|  | 275 | IWL_TM_ATTR_REG_VALUE32			= 6, | 
|  | 276 | IWL_TM_ATTR_SYNC_RSP			= 7, | 
|  | 277 | IWL_TM_ATTR_UCODE_RX_PKT		= 8, | 
|  | 278 | IWL_TM_ATTR_EEPROM			= 9, | 
|  | 279 | IWL_TM_ATTR_TRACE_ADDR			= 10, | 
|  | 280 | IWL_TM_ATTR_TRACE_SIZE			= 11, | 
|  | 281 | IWL_TM_ATTR_TRACE_DUMP			= 12, | 
|  | 282 | IWL_TM_ATTR_FIXRATE			= 13, | 
| Wey-Yi Guy | e98a193 | 2011-07-08 08:46:26 -0700 | [diff] [blame] | 283 | IWL_TM_ATTR_UCODE_OWNER			= 14, | 
| Amit Beka | 6c55f5e | 2012-01-25 13:30:27 +0200 | [diff] [blame] | 284 | IWL_TM_ATTR_MEM_ADDR			= 15, | 
|  | 285 | IWL_TM_ATTR_BUFFER_SIZE			= 16, | 
|  | 286 | IWL_TM_ATTR_BUFFER_DUMP			= 17, | 
| Hsu, Kenny | e1a38fe | 2011-11-28 00:55:38 -0800 | [diff] [blame] | 287 | IWL_TM_ATTR_FW_VERSION			= 18, | 
| Hsu, Kenny | 0bec12b | 2011-12-01 01:12:50 -0800 | [diff] [blame] | 288 | IWL_TM_ATTR_DEVICE_ID			= 19, | 
| Kenny Hsu | 668bd6a | 2012-01-06 13:16:32 -0800 | [diff] [blame] | 289 | IWL_TM_ATTR_FW_TYPE			= 20, | 
|  | 290 | IWL_TM_ATTR_FW_INST_SIZE		= 21, | 
|  | 291 | IWL_TM_ATTR_FW_DATA_SIZE		= 22, | 
| Amit Beka | cdfef6c | 2012-01-31 15:30:39 +0200 | [diff] [blame] | 292 | IWL_TM_ATTR_UCODE_CMD_SKB		= 23, | 
| Amit Beka | 0aef8dd | 2012-03-07 09:52:29 -0800 | [diff] [blame] | 293 | IWL_TM_ATTR_ENABLE_NOTIFICATION		= 24, | 
|  | 294 | IWL_TM_ATTR_MAX				= 25, | 
| Cindy H. Kao | 4613e72 | 2011-05-06 10:40:15 -0700 | [diff] [blame] | 295 | }; | 
|  | 296 |  | 
| Wey-Yi Guy | 7a4e528 | 2011-05-06 10:21:28 -0700 | [diff] [blame] | 297 | /* uCode trace buffer */ | 
| Wey-Yi Guy | 49b7210 | 2011-05-30 10:29:37 -0700 | [diff] [blame] | 298 | #define TRACE_BUFF_SIZE_MAX	0x200000 | 
|  | 299 | #define TRACE_BUFF_SIZE_MIN	0x20000 | 
|  | 300 | #define TRACE_BUFF_SIZE_DEF	TRACE_BUFF_SIZE_MIN | 
| Wey-Yi Guy | 7a4e528 | 2011-05-06 10:21:28 -0700 | [diff] [blame] | 301 | #define TRACE_BUFF_PADD		0x2000 | 
| Hsu, Kenny | e056a65 | 2011-11-22 23:05:02 -0800 | [diff] [blame] | 302 |  | 
|  | 303 | /* Maximum data size of each dump it packet */ | 
|  | 304 | #define DUMP_CHUNK_SIZE		(PAGE_SIZE - 1024) | 
| Cindy H. Kao | 4613e72 | 2011-05-06 10:40:15 -0700 | [diff] [blame] | 305 |  | 
| Kenny Hsu | b07f08a | 2012-01-06 13:16:30 -0800 | [diff] [blame] | 306 | /* Address offset of data segment in SRAM */ | 
|  | 307 | #define SRAM_DATA_SEG_OFFSET   0x800000 | 
|  | 308 |  | 
| Cindy H. Kao | 4613e72 | 2011-05-06 10:40:15 -0700 | [diff] [blame] | 309 | #endif |