mac80211: Update mesh constants to approved IEEE ANA values
[carl9170fw.git] / carlfw / src / fw.c
1 /*
2  * carl9170 firmware - used by the ar9170 wireless device
3  *
4  * Firmware descriptor
5  *
6  * Copyright 2009, 2010 Christian Lamparter <chunkeey@googlemail.com>
7  *
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.
12  *
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.
17  *
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.
21  */
22 #include "carl9170.h"
23 #include "fwdsc.h"
24
25 #define FILL(small, big, more...)                                       \
26         .small = {                                                      \
27                 CARL9170FW_FILL_DESC(big##_MAGIC,                       \
28                         sizeof(struct carl9170fw_## small##_desc),      \
29                         CARL9170FW_## big##_DESC_MIN_VER,               \
30                         CARL9170FW_## big##_DESC_CUR_VER),              \
31                 more                                                    \
32         }
33
34 const struct carl9170_firmware_descriptor __section(fwdsc) carl9170fw_desc = {
35         FILL(otus, OTUS,
36              .feature_set = cpu_to_le32(BIT(CARL9170FW_DUMMY_FEATURE) |
37                                         BIT(CARL9170FW_USB_RESP_EP2) |
38 #ifdef CONFIG_CARL9170FW_USB_INIT_FIRMWARE
39                                         BIT(CARL9170FW_USB_INIT_FIRMWARE) |
40 # ifdef CONFIG_CARL9170FW_USB_UP_STREAM
41                                         BIT(CARL9170FW_USB_UP_STREAM) |
42 # endif /* CONFIG_CARL9170FW_USB_UP_STREAM */
43 # ifdef CONFIG_CARL9170FW_USB_DOWN_STREAM
44                                         BIT(CARL9170FW_USB_DOWN_STREAM) |
45 # endif /* CONFIG_CARL9170FW_USB_DOWN_STREAM */
46 #endif /* CONFIG_CARL9170FW_USB_INIT_FIRMWARE */
47 #ifdef CONFIG_CARL9170FW_RADIO_FUNCTIONS
48                                         BIT(CARL9170FW_COMMAND_PHY) |
49 #endif /* CONFIG_CARL9170FW_RADIO_FUNCTIONS */
50 #ifdef CONFIG_CARL9170FW_SECURITY_ENGINE
51                                         BIT(CARL9170FW_COMMAND_CAM) |
52 #endif /* CONFIG_CARL9170FW_SECURITY_ENGINE */
53 #ifdef CONFIG_CARL9170FW_CAB_QUEUE
54                                         BIT(CARL9170FW_WLANTX_CAB) |
55 #endif /* CONFIG_CARL9170FW_CAB_QUEUE */
56 #ifdef CONFIG_CARL9170FW_HANDLE_BACK_REQ
57                                         BIT(CARL9170FW_HANDLE_BACK_REQ) |
58 #endif /* CONFIG_CARL9170FW_HANDLE_BACK_REQ */
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_PSM
66                                         BIT(CARL9170FW_PSM) |
67 #endif /* CONFIG_CARL9170FW_PSM */
68                                         BIT(CARL9170FW_RX_FILTER) |
69                                            (0)),
70
71              .miniboot_size = cpu_to_le16(0),
72              .tx_descs = AR9170_TX_BLOCK_NUMBER,
73              .cmd_bufs = CARL9170_INT_RQ_CACHES,
74              .rx_max_frame_len = cpu_to_le16(CONFIG_CARL9170FW_RX_FRAME_LEN),
75              .tx_frag_len = cpu_to_le16(AR9170_BLOCK_SIZE),
76              .fw_address = cpu_to_le32(AR9170_PRAM_OFFSET),
77              .bcn_addr = (__le32) cpu_to_le32(&dma_mem.reserved.bcn),
78              .bcn_len = (__le16) cpu_to_le16(sizeof(dma_mem.reserved.bcn)),
79              .vif_num = CARL9170_INTF_NUM,
80              .api_ver = CONFIG_CARL9170FW_RELEASE_VERSION,
81         ),
82
83         FILL(motd, MOTD,
84              .fw_year_month_day = cpu_to_le32(
85                         CARL9170FW_SET_DAY(CARL9170FW_VERSION_DAY) +
86                         CARL9170FW_SET_MONTH(CARL9170FW_VERSION_MONTH) +
87                         CARL9170FW_SET_YEAR(CARL9170FW_VERSION_YEAR)),
88              .desc = "Community AR9170 Linux",
89              .release = CARL9170FW_VERSION_GIT),
90
91         FILL(dbg, DBG,
92              .bogoclock_addr = cpu_to_le32(0),
93              .counter_addr = cpu_to_le32(&fw.counter),
94              .rx_total_addr = cpu_to_le32(&fw.wlan.rx_total),
95              .rx_overrun_addr = cpu_to_le32(&fw.wlan.rx_overruns),
96              .rx_filter = cpu_to_le32(&fw.wlan.rx_filter),
97         ),
98
99         FILL(last, LAST),
100 };
101
102 #undef FILL
103
104 struct firmware_context_struct fw;