2 * carl9170 firmware - used by the ar9170 wireless device
6 * Copyright 2009-2011 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.
24 #include "pattern_generator.h"
26 #define FILL(small, big, more...) \
28 CARL9170FW_FILL_DESC(big##_MAGIC, \
29 sizeof(struct carl9170fw_## small##_desc), \
30 CARL9170FW_## big##_DESC_MIN_VER, \
31 CARL9170FW_## big##_DESC_CUR_VER), \
35 const struct carl9170_firmware_descriptor __section(fwdsc) __visible carl9170fw_desc = {
37 .feature_set = cpu_to_le32(BIT(CARL9170FW_DUMMY_FEATURE) |
38 BIT(CARL9170FW_USB_RESP_EP2) |
39 BIT(CARL9170FW_HANDLE_BACK_REQ) |
40 BIT(CARL9170FW_RX_FILTER) |
41 BIT(CARL9170FW_HW_COUNTERS) |
42 BIT(CARL9170FW_RX_BA_FILTER) |
43 BIT(CARL9170FW_USB_INIT_FIRMWARE) |
44 #ifdef CONFIG_CARL9170FW_USB_UP_STREAM
45 BIT(CARL9170FW_USB_UP_STREAM) |
46 #endif /* CONFIG_CARL9170FW_USB_UP_STREAM */
47 #ifdef CONFIG_CARL9170FW_USB_DOWN_STREAM
48 BIT(CARL9170FW_USB_DOWN_STREAM) |
49 #endif /* CONFIG_CARL9170FW_USB_DOWN_STREAM */
50 #ifdef CONFIG_CARL9170FW_RADIO_FUNCTIONS
51 BIT(CARL9170FW_COMMAND_PHY) |
53 BIT(CARL9170FW_FIXED_5GHZ_PSM) |
54 #endif /* CONFIG_CARL9170FW_RADIO_FUNCTIONS */
55 #ifdef CONFIG_CARL9170FW_SECURITY_ENGINE
56 BIT(CARL9170FW_COMMAND_CAM) |
57 #endif /* CONFIG_CARL9170FW_SECURITY_ENGINE */
58 BIT(CARL9170FW_WLANTX_CAB) |
59 #ifdef CONFIG_CARL9170FW_UNUSABLE
60 BIT(CARL9170FW_UNUSABLE) |
61 #endif /* CONFIG_CARL9170FW_UNUSABLE */
62 #ifdef CONFIG_CARL9170FW_GPIO_INTERRUPT
63 BIT(CARL9170FW_GPIO_INTERRUPT) |
64 #endif /* CONFIG_CARL9170FW_GPIO_INTERRUPT */
65 #ifdef CONFIG_CARL9170FW_WOL
67 #endif /* CONFIG_CARL9170FW_WOL */
68 #ifdef CONFIG_CARL9170FW_RADAR
69 BIT(CARL9170FW_RADAR_PATTERN_GENERATOR) |
70 #endif /* CONFIG_CARL9170FW_RADAR */
73 .miniboot_size = cpu_to_le16(0),
74 .tx_descs = AR9170_TX_BLOCK_NUMBER,
75 .cmd_bufs = CARL9170_INT_RQ_CACHES,
76 .rx_max_frame_len = cpu_to_le16(CONFIG_CARL9170FW_RX_FRAME_LEN),
77 .tx_frag_len = cpu_to_le16(AR9170_BLOCK_SIZE),
78 .fw_address = cpu_to_le32(AR9170_PRAM_OFFSET),
79 .bcn_addr = (__le32) cpu_to_le32(&dma_mem.reserved.bcn),
80 .bcn_len = (__le16) cpu_to_le16(sizeof(dma_mem.reserved.bcn)),
81 .vif_num = CARL9170_INTF_NUM,
82 .api_ver = CONFIG_CARL9170FW_RELEASE_VERSION,
86 .seq_table_addr = cpu_to_le32(&fw.wlan.sequence),
89 #ifdef CONFIG_CARL9170FW_WOL
91 .supported_triggers = BIT(CARL9170_WOL_DISCONNECT) |
92 BIT(CARL9170_WOL_MAGIC_PKT),
94 #endif /* CONFIG_CARL9170FW_WOL */
97 .fw_year_month_day = cpu_to_le32(
98 CARL9170FW_SET_DAY(CARL9170FW_VERSION_DAY) +
99 CARL9170FW_SET_MONTH(CARL9170FW_VERSION_MONTH) +
100 CARL9170FW_SET_YEAR(CARL9170FW_VERSION_YEAR)),
101 .desc = "Community AR9170 Linux",
102 .release = CARL9170FW_VERSION_GIT),
105 #if defined(CARL9170FW_PATTERN_GENERATOR)
107 .soft_radar = cpu_to_le32(&fw.wlan.soft_radar),
108 .num_radars = __CARL9170FW_NUM_RADARS,
109 .radars = { /* filled by the fwprepare tool */ },
111 #endif /* CONFIG_CARL9170FW_RADAR */
114 .bogoclock_addr = cpu_to_le32(0),
115 .counter_addr = cpu_to_le32(&fw.counter),
116 .rx_total_addr = cpu_to_le32(0),
117 .rx_overrun_addr = cpu_to_le32(0),
118 .rx_filter = cpu_to_le32(&fw.wlan.rx_filter),
126 struct firmware_context_struct fw;