2 * carl9170 firmware - used by the ar9170 wireless device
6 * Copyright 2009, 2010 Christian Lamparter <chunkeey@googlemail.com>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25 #define FILL(small, big, more...) \
27 CARL9170FW_FILL_DESC(big##_MAGIC, \
28 sizeof(struct carl9170fw_## small##_desc), \
29 CARL9170FW_## big##_DESC_MIN_VER, \
30 CARL9170FW_## big##_DESC_CUR_VER), \
34 const struct carl9170_firmware_descriptor __section(fwdsc) carl9170fw_desc = {
36 .fw_feature_set = cpu_to_le32(BIT(CARL9170FW_DUMMY_FEATURE) |
37 #ifdef CONFIG_CARL9170FW_RADIO_FUNCTIONS
38 BIT(CARL9170FW_COMMAND_PHY) |
39 #endif /* CONFIG_CARL9170FW_RADIO_FUNCTIONS */
40 #ifdef CONFIG_CARL9170FW_SECURITY_ENGINE
41 BIT(CARL9170FW_COMMAND_CAM) |
42 #endif /* CONFIG_CARL9170FW_SECURITY_ENGINE */
43 #ifdef CONFIG_CARL9170FW_CAB_QUEUE
44 BIT(CARL9170FW_WLANTX_CAB) |
45 #endif /* CONFIG_CARL9170FW_CAB_QUEUE */
46 #ifdef CONFIG_CARL9170FW_HANDLE_BACK_REQ
47 BIT(CARL9170FW_HANDLE_BACK_REQ) |
48 #endif /* CONFIG_CARL9170FW_HANDLE_BACK_REQ */
49 #ifdef CONFIG_CARL9170FW_UNUSABLE
50 BIT(CARL9170FW_UNUSABLE) |
51 #endif /* CONFIG_CARL9170FW_UNUSABLE */
52 #ifdef CONFIG_CARL9170FW_GPIO_INTERRUPT
53 BIT(CARL9170FW_GPIO_INTERRUPT) |
54 #endif /* CONFIG_CARL9170FW_GPIO_INTERRUPT */
55 #ifdef CONFIG_CARL9170FW_PSM
59 .bcn_addr = (__le32) cpu_to_le32(&dma_mem.reserved.bcn),
60 .bcn_len = (__le16) cpu_to_le16(sizeof(dma_mem.reserved.bcn)),
61 .vif_num = CARL9170_INTF_NUM,
62 .api_ver = CONFIG_CARL9170FW_RELEASE_VERSION,
66 .usb_feature_set = cpu_to_le32(BIT(CARL9170FW_USB_DUMMY_FEATURE) |
67 BIT(CARL9170FW_USB_RESP_EP2) |
68 #ifdef CONFIG_CARL9170FW_USB_INIT_FIRMWARE
69 BIT(CARL9170FW_USB_INIT_FIRMWARE) |
70 # ifdef CONFIG_CARL9170FW_USB_UP_STREAM
71 BIT(CARL9170FW_USB_UP_STREAM) |
72 # endif /* CONFIG_CARL9170FW_USB_UP_STREAM */
73 # ifdef CONFIG_CARL9170FW_USB_DOWN_STREAM
74 BIT(CARL9170FW_USB_DOWN_STREAM) |
75 # endif /* CONFIG_CARL9170FW_USB_DOWN_STREAM */
76 #endif /* CONFIG_CARL9170FW_USB_INIT_FIRMWARE */
77 #ifdef CONFIG_CARL9170FW_USB_WATCHDOG
78 BIT(CARL9170FW_USB_WATCHDOG) |
79 #endif /* CONFIG_CARL9170FW_USB_WATCHDOG */
82 .miniboot_size = cpu_to_le16(0),
83 .tx_descs = AR9170_TX_BLOCK_NUMBER,
84 .cmd_bufs = CARL9170_INT_RQ_CACHES,
85 .rx_max_frame_len = cpu_to_le16(CONFIG_CARL9170FW_RX_FRAME_LEN),
86 .tx_frag_len = cpu_to_le16(AR9170_BLOCK_SIZE),
87 .fw_address = cpu_to_le32(AR9170_PRAM_OFFSET),
91 .fw_year_month_day = cpu_to_le32(
92 CARL9170FW_SET_DAY(CARL9170FW_VERSION_DAY) +
93 CARL9170FW_SET_MONTH(CARL9170FW_VERSION_MONTH) +
94 CARL9170FW_SET_YEAR(CARL9170FW_VERSION_YEAR)),
95 .desc = "Community AR9170 Linux",
96 .release = CARL9170FW_VERSION_GIT),
99 .bogoclock_addr = cpu_to_le32(&fw.bogoclock),
100 .counter_addr = cpu_to_le32(&fw.counter),
101 .rx_total_addr = cpu_to_le32(&fw.wlan.rx_total),
102 .rx_overrun_addr = cpu_to_le32(&fw.wlan.rx_overruns),
110 struct firmware_context_struct fw;