fw.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /*
  2. * Intel Wireless Multicomm 3200 WiFi driver
  3. *
  4. * Copyright (C) 2009 Intel Corporation. All rights reserved.
  5. *
  6. * Redistribution and use in source and binary forms, with or without
  7. * modification, are permitted provided that the following conditions
  8. * are met:
  9. *
  10. * * Redistributions of source code must retain the above copyright
  11. * notice, this list of conditions and the following disclaimer.
  12. * * Redistributions in binary form must reproduce the above copyright
  13. * notice, this list of conditions and the following disclaimer in
  14. * the documentation and/or other materials provided with the
  15. * distribution.
  16. * * Neither the name of Intel Corporation nor the names of its
  17. * contributors may be used to endorse or promote products derived
  18. * from this software without specific prior written permission.
  19. *
  20. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  21. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  22. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  23. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  24. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  25. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  26. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  27. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  28. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  29. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  30. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  31. *
  32. *
  33. * Intel Corporation <ilw@linux.intel.com>
  34. * Samuel Ortiz <samuel.ortiz@intel.com>
  35. * Zhu Yi <yi.zhu@intel.com>
  36. *
  37. */
  38. #ifndef __IWM_FW_H__
  39. #define __IWM_FW_H__
  40. /**
  41. * struct iwm_fw_hdr_rec - An iwm firmware image is a
  42. * concatenation of various records. Each of them is
  43. * defined by an ID (aka op code), a length, and the
  44. * actual data.
  45. * @op_code: The record ID, see IWM_HDR_REC_OP_*
  46. *
  47. * @len: The record payload length
  48. *
  49. * @buf: The record payload
  50. */
  51. struct iwm_fw_hdr_rec {
  52. u16 op_code;
  53. u16 len;
  54. u8 buf[0];
  55. };
  56. /* Header's definitions */
  57. #define IWM_HDR_LEN (512)
  58. #define IWM_HDR_BARKER_LEN (16)
  59. /* Header's opcodes */
  60. #define IWM_HDR_REC_OP_INVALID (0x00)
  61. #define IWM_HDR_REC_OP_BUILD_DATE (0x01)
  62. #define IWM_HDR_REC_OP_BUILD_TAG (0x02)
  63. #define IWM_HDR_REC_OP_SW_VER (0x03)
  64. #define IWM_HDR_REC_OP_HW_SKU (0x04)
  65. #define IWM_HDR_REC_OP_BUILD_OPT (0x05)
  66. #define IWM_HDR_REC_OP_MEM_DESC (0x06)
  67. #define IWM_HDR_REC_USERDEFS (0x07)
  68. /* Header's records length (in bytes) */
  69. #define IWM_HDR_REC_LEN_BUILD_DATE (4)
  70. #define IWM_HDR_REC_LEN_BUILD_TAG (64)
  71. #define IWM_HDR_REC_LEN_SW_VER (4)
  72. #define IWM_HDR_REC_LEN_HW_SKU (4)
  73. #define IWM_HDR_REC_LEN_BUILD_OPT (4)
  74. #define IWM_HDR_REC_LEN_MEM_DESC (12)
  75. #define IWM_HDR_REC_LEN_USERDEF (64)
  76. #define IWM_BUILD_YEAR(date) ((date >> 16) & 0xffff)
  77. #define IWM_BUILD_MONTH(date) ((date >> 8) & 0xff)
  78. #define IWM_BUILD_DAY(date) (date & 0xff)
  79. struct iwm_fw_img_desc {
  80. u32 offset;
  81. u32 address;
  82. u32 length;
  83. };
  84. struct iwm_fw_img_ver {
  85. u8 minor;
  86. u8 major;
  87. u16 reserved;
  88. };
  89. int iwm_load_fw(struct iwm_priv *iwm);
  90. #endif