2 * Intel Wireless Multicomm 3200 WiFi driver
4 * Copyright (C) 2009 Intel Corporation. All rights reserved.
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
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
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.
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.
33 * Intel Corporation <ilw@linux.intel.com>
34 * Samuel Ortiz <samuel.ortiz@intel.com>
35 * Zhu Yi <yi.zhu@intel.com>
43 * struct iwm_fw_hdr_rec - An iwm firmware image is a
44 * concatenation of various records. Each of them is
45 * defined by an ID (aka op code), a length, and the
47 * @op_code: The record ID, see IWM_HDR_REC_OP_*
49 * @len: The record payload length
51 * @buf: The record payload
53 struct iwm_fw_hdr_rec {
59 /* Header's definitions */
60 #define IWM_HDR_LEN (512)
61 #define IWM_HDR_BARKER_LEN (16)
63 /* Header's opcodes */
64 #define IWM_HDR_REC_OP_INVALID (0x00)
65 #define IWM_HDR_REC_OP_BUILD_DATE (0x01)
66 #define IWM_HDR_REC_OP_BUILD_TAG (0x02)
67 #define IWM_HDR_REC_OP_SW_VER (0x03)
68 #define IWM_HDR_REC_OP_HW_SKU (0x04)
69 #define IWM_HDR_REC_OP_BUILD_OPT (0x05)
70 #define IWM_HDR_REC_OP_MEM_DESC (0x06)
71 #define IWM_HDR_REC_USERDEFS (0x07)
73 /* Header's records length (in bytes) */
74 #define IWM_HDR_REC_LEN_BUILD_DATE (4)
75 #define IWM_HDR_REC_LEN_BUILD_TAG (64)
76 #define IWM_HDR_REC_LEN_SW_VER (4)
77 #define IWM_HDR_REC_LEN_HW_SKU (4)
78 #define IWM_HDR_REC_LEN_BUILD_OPT (4)
79 #define IWM_HDR_REC_LEN_MEM_DESC (12)
80 #define IWM_HDR_REC_LEN_USERDEF (64)
82 #define IWM_BUILD_YEAR(date) ((date >> 16) & 0xffff)
83 #define IWM_BUILD_MONTH(date) ((date >> 8) & 0xff)
84 #define IWM_BUILD_DAY(date) (date & 0xff)
86 struct iwm_fw_img_desc {
92 struct iwm_fw_img_ver {
98 int iwm_load_fw(struct iwm_priv *iwm);