| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
#include "carl9170.h" |
| 22 |
#include "fwdsc.h" |
| 23 |
|
| 24 |
#define FILL(small, big, more...) \ |
| 25 |
.small = { \ |
| 26 |
CARL9170FW_FILL_DESC(big##_MAGIC, \ |
| 27 |
sizeof(struct carl9170fw_## small##_desc), \ |
| 28 |
CARL9170FW_## big##_DESC_MIN_VER, \ |
| 29 |
CARL9170FW_## big##_DESC_CUR_VER), \ |
| 30 |
more \ |
| 31 |
} |
| 32 |
|
| 33 |
const struct carl9170_firmware_descriptor __in_section(fwdsc) __visible carl9170fw_desc = { |
| 34 |
FILL(otus, OTUS, |
| 35 |
.feature_set = cpu_to_le32(BIT(CARL9170FW_DUMMY_FEATURE) | |
| 36 |
BIT(CARL9170FW_USB_RESP_EP2) | |
| 37 |
BIT(CARL9170FW_HANDLE_BACK_REQ) | |
| 38 |
BIT(CARL9170FW_RX_FILTER) | |
| 39 |
BIT(CARL9170FW_HW_COUNTERS) | |
| 40 |
BIT(CARL9170FW_RX_BA_FILTER) | |
| 41 |
BIT(CARL9170FW_USB_INIT_FIRMWARE) | |
| 42 |
BIT(CARL9170FW_HAS_WREGB_CMD) | |
| 43 |
#ifdef CONFIG_CARL9170FW_USB_UP_STREAM |
| 44 |
BIT(CARL9170FW_USB_UP_STREAM) | |
| 45 |
#endif |
| 46 |
#ifdef CONFIG_CARL9170FW_USB_DOWN_STREAM |
| 47 |
BIT(CARL9170FW_USB_DOWN_STREAM) | |
| 48 |
#endif |
| 49 |
#ifdef CONFIG_CARL9170FW_RADIO_FUNCTIONS |
| 50 |
BIT(CARL9170FW_COMMAND_PHY) | |
| 51 |
BIT(CARL9170FW_PSM) | |
| 52 |
BIT(CARL9170FW_FIXED_5GHZ_PSM) | |
| 53 |
#endif |
| 54 |
#ifdef CONFIG_CARL9170FW_SECURITY_ENGINE |
| 55 |
BIT(CARL9170FW_COMMAND_CAM) | |
| 56 |
#endif |
| 57 |
BIT(CARL9170FW_WLANTX_CAB) | |
| 58 |
#ifdef CONFIG_CARL9170FW_UNUSABLE |
| 59 |
BIT(CARL9170FW_UNUSABLE) | |
| 60 |
#endif |
| 61 |
#ifdef CONFIG_CARL9170FW_GPIO_INTERRUPT |
| 62 |
BIT(CARL9170FW_GPIO_INTERRUPT) | |
| 63 |
#endif |
| 64 |
#ifdef CONFIG_CARL9170FW_WOL |
| 65 |
BIT(CARL9170FW_WOL) | |
| 66 |
#endif |
| 67 |
(0)), |
| 68 |
|
| 69 |
.miniboot_size = cpu_to_le16(0), |
| 70 |
.tx_descs = AR9170_TX_BLOCK_NUMBER, |
| 71 |
.cmd_bufs = CARL9170_INT_RQ_CACHES, |
| 72 |
.rx_max_frame_len = cpu_to_le16(CONFIG_CARL9170FW_RX_FRAME_LEN), |
| 73 |
.tx_frag_len = cpu_to_le16(AR9170_BLOCK_SIZE), |
| 74 |
.fw_address = cpu_to_le32(AR9170_PRAM_OFFSET), |
| 75 |
.bcn_addr = (__le32) cpu_to_le32(&dma_mem.reserved.bcn), |
| 76 |
.bcn_len = (__le16) cpu_to_le16(sizeof(dma_mem.reserved.bcn)), |
| 77 |
.vif_num = CARL9170_INTF_NUM, |
| 78 |
.api_ver = CONFIG_CARL9170FW_RELEASE_VERSION, |
| 79 |
), |
| 80 |
|
| 81 |
FILL(txsq, TXSQ, |
| 82 |
.seq_table_addr = cpu_to_le32(&fw.wlan.sequence), |
| 83 |
), |
| 84 |
|
| 85 |
#ifdef CONFIG_CARL9170FW_WOL |
| 86 |
FILL(wol, WOL, |
| 87 |
.supported_triggers = BIT(CARL9170_WOL_DISCONNECT) | |
| 88 |
BIT(CARL9170_WOL_MAGIC_PKT), |
| 89 |
), |
| 90 |
#endif |
| 91 |
|
| 92 |
|
| 93 |
FILL(motd, MOTD, |
| 94 |
.fw_year_month_day = cpu_to_le32( |
| 95 |
CARL9170FW_SET_DAY(CARL9170FW_VERSION_DAY) + |
| 96 |
CARL9170FW_SET_MONTH(CARL9170FW_VERSION_MONTH) + |
| 97 |
CARL9170FW_SET_YEAR(CARL9170FW_VERSION_YEAR)), |
| 98 |
.desc = "Community AR9170 Linux", |
| 99 |
.release = CARL9170FW_VERSION_GIT), |
| 100 |
|
| 101 |
FILL(dbg, DBG, |
| 102 |
.bogoclock_addr = cpu_to_le32(0), |
| 103 |
.counter_addr = cpu_to_le32(&fw.counter), |
| 104 |
.rx_total_addr = cpu_to_le32(0), |
| 105 |
.rx_overrun_addr = cpu_to_le32(0), |
| 106 |
.rx_filter = cpu_to_le32(&fw.wlan.rx_filter), |
| 107 |
), |
| 108 |
|
| 109 |
FILL(last, LAST), |
| 110 |
}; |
| 111 |
|
| 112 |
#undef FILL |
| 113 |
|
| 114 |
struct firmware_context_struct fw; |