iwl-fw-file.h 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  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. *
  8. * Copyright(c) 2008 - 2014 Intel Corporation. All rights reserved.
  9. * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH
  10. *
  11. * This program is free software; you can redistribute it and/or modify
  12. * it under the terms of version 2 of the GNU General Public License as
  13. * published by the Free Software Foundation.
  14. *
  15. * This program is distributed in the hope that it will be useful, but
  16. * WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  18. * General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU General Public License
  21. * along with this program; if not, write to the Free Software
  22. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110,
  23. * USA
  24. *
  25. * The full GNU General Public License is included in this distribution
  26. * in the file called COPYING.
  27. *
  28. * Contact Information:
  29. * Intel Linux Wireless <ilw@linux.intel.com>
  30. * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
  31. *
  32. * BSD LICENSE
  33. *
  34. * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved.
  35. * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH
  36. * All rights reserved.
  37. *
  38. * Redistribution and use in source and binary forms, with or without
  39. * modification, are permitted provided that the following conditions
  40. * are met:
  41. *
  42. * * Redistributions of source code must retain the above copyright
  43. * notice, this list of conditions and the following disclaimer.
  44. * * Redistributions in binary form must reproduce the above copyright
  45. * notice, this list of conditions and the following disclaimer in
  46. * the documentation and/or other materials provided with the
  47. * distribution.
  48. * * Neither the name Intel Corporation nor the names of its
  49. * contributors may be used to endorse or promote products derived
  50. * from this software without specific prior written permission.
  51. *
  52. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  53. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  54. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  55. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  56. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  57. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  58. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  59. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  60. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  61. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  62. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  63. *****************************************************************************/
  64. #ifndef __iwl_fw_file_h__
  65. #define __iwl_fw_file_h__
  66. #include <linux/netdevice.h>
  67. /* v1/v2 uCode file layout */
  68. struct iwl_ucode_header {
  69. __le32 ver; /* major/minor/API/serial */
  70. union {
  71. struct {
  72. __le32 inst_size; /* bytes of runtime code */
  73. __le32 data_size; /* bytes of runtime data */
  74. __le32 init_size; /* bytes of init code */
  75. __le32 init_data_size; /* bytes of init data */
  76. __le32 boot_size; /* bytes of bootstrap code */
  77. u8 data[0]; /* in same order as sizes */
  78. } v1;
  79. struct {
  80. __le32 build; /* build number */
  81. __le32 inst_size; /* bytes of runtime code */
  82. __le32 data_size; /* bytes of runtime data */
  83. __le32 init_size; /* bytes of init code */
  84. __le32 init_data_size; /* bytes of init data */
  85. __le32 boot_size; /* bytes of bootstrap code */
  86. u8 data[0]; /* in same order as sizes */
  87. } v2;
  88. } u;
  89. };
  90. /*
  91. * new TLV uCode file layout
  92. *
  93. * The new TLV file format contains TLVs, that each specify
  94. * some piece of data.
  95. */
  96. enum iwl_ucode_tlv_type {
  97. IWL_UCODE_TLV_INVALID = 0, /* unused */
  98. IWL_UCODE_TLV_INST = 1,
  99. IWL_UCODE_TLV_DATA = 2,
  100. IWL_UCODE_TLV_INIT = 3,
  101. IWL_UCODE_TLV_INIT_DATA = 4,
  102. IWL_UCODE_TLV_BOOT = 5,
  103. IWL_UCODE_TLV_PROBE_MAX_LEN = 6, /* a u32 value */
  104. IWL_UCODE_TLV_PAN = 7,
  105. IWL_UCODE_TLV_RUNT_EVTLOG_PTR = 8,
  106. IWL_UCODE_TLV_RUNT_EVTLOG_SIZE = 9,
  107. IWL_UCODE_TLV_RUNT_ERRLOG_PTR = 10,
  108. IWL_UCODE_TLV_INIT_EVTLOG_PTR = 11,
  109. IWL_UCODE_TLV_INIT_EVTLOG_SIZE = 12,
  110. IWL_UCODE_TLV_INIT_ERRLOG_PTR = 13,
  111. IWL_UCODE_TLV_ENHANCE_SENS_TBL = 14,
  112. IWL_UCODE_TLV_PHY_CALIBRATION_SIZE = 15,
  113. IWL_UCODE_TLV_WOWLAN_INST = 16,
  114. IWL_UCODE_TLV_WOWLAN_DATA = 17,
  115. IWL_UCODE_TLV_FLAGS = 18,
  116. IWL_UCODE_TLV_SEC_RT = 19,
  117. IWL_UCODE_TLV_SEC_INIT = 20,
  118. IWL_UCODE_TLV_SEC_WOWLAN = 21,
  119. IWL_UCODE_TLV_DEF_CALIB = 22,
  120. IWL_UCODE_TLV_PHY_SKU = 23,
  121. IWL_UCODE_TLV_SECURE_SEC_RT = 24,
  122. IWL_UCODE_TLV_SECURE_SEC_INIT = 25,
  123. IWL_UCODE_TLV_SECURE_SEC_WOWLAN = 26,
  124. IWL_UCODE_TLV_NUM_OF_CPU = 27,
  125. IWL_UCODE_TLV_CSCHEME = 28,
  126. IWL_UCODE_TLV_API_CHANGES_SET = 29,
  127. IWL_UCODE_TLV_ENABLED_CAPABILITIES = 30,
  128. IWL_UCODE_TLV_N_SCAN_CHANNELS = 31,
  129. };
  130. struct iwl_ucode_tlv {
  131. __le32 type; /* see above */
  132. __le32 length; /* not including type/length fields */
  133. u8 data[0];
  134. };
  135. #define IWL_TLV_UCODE_MAGIC 0x0a4c5749
  136. #define FW_VER_HUMAN_READABLE_SZ 64
  137. struct iwl_tlv_ucode_header {
  138. /*
  139. * The TLV style ucode header is distinguished from
  140. * the v1/v2 style header by first four bytes being
  141. * zero, as such is an invalid combination of
  142. * major/minor/API/serial versions.
  143. */
  144. __le32 zero;
  145. __le32 magic;
  146. u8 human_readable[FW_VER_HUMAN_READABLE_SZ];
  147. __le32 ver; /* major/minor/API/serial */
  148. __le32 build;
  149. __le64 ignore;
  150. /*
  151. * The data contained herein has a TLV layout,
  152. * see above for the TLV header and types.
  153. * Note that each TLV is padded to a length
  154. * that is a multiple of 4 for alignment.
  155. */
  156. u8 data[0];
  157. };
  158. /*
  159. * ucode TLVs
  160. *
  161. * ability to get extension for: flags & capabilities from ucode binaries files
  162. */
  163. struct iwl_ucode_api {
  164. __le32 api_index;
  165. __le32 api_flags;
  166. } __packed;
  167. struct iwl_ucode_capa {
  168. __le32 api_index;
  169. __le32 api_capa;
  170. } __packed;
  171. #endif /* __iwl_fw_file_h__ */