Zhu Yi | bb9f869 | 2009-05-21 21:20:45 +0800 | [diff] [blame] | 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 | |
| 39 | #ifndef __IWM_FW_H__ |
| 40 | #define __IWM_FW_H__ |
| 41 | |
| 42 | /** |
| 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 |
| 46 | * actual data. |
| 47 | * @op_code: The record ID, see IWM_HDR_REC_OP_* |
| 48 | * |
| 49 | * @len: The record payload length |
| 50 | * |
| 51 | * @buf: The record payload |
| 52 | */ |
| 53 | struct iwm_fw_hdr_rec { |
| 54 | u16 op_code; |
| 55 | u16 len; |
| 56 | u8 buf[0]; |
| 57 | }; |
| 58 | |
| 59 | /* Header's definitions */ |
| 60 | #define IWM_HDR_LEN (512) |
| 61 | #define IWM_HDR_BARKER_LEN (16) |
| 62 | |
| 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) |
| 72 | |
| 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) |
| 81 | |
| 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) |
| 85 | |
| 86 | struct iwm_fw_img_desc { |
| 87 | u32 offset; |
| 88 | u32 address; |
| 89 | u32 length; |
| 90 | }; |
| 91 | |
| 92 | struct iwm_fw_img_ver { |
| 93 | u8 minor; |
| 94 | u8 major; |
| 95 | u16 reserved; |
| 96 | }; |
| 97 | |
| 98 | int iwm_load_fw(struct iwm_priv *iwm); |
| 99 | |
| 100 | #endif |