From: Lachlan Hodges <lachlan.hodges@morsemicro.com>
To: johannes@sipsolutions.net,
Lachlan Hodges <lachlan.hodges@morsemicro.com>,
Dan Callaghan <dan.callaghan@morsemicro.com>,
Arien Judge <arien.judge@morsemicro.com>
Cc: ayman.grais@morsemicro.com, linux-wireless@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH wireless-next v3 10/33] wifi: mm81x: add fw.h
Date: Fri, 26 Jun 2026 16:29:06 +1000 [thread overview]
Message-ID: <20260626063014.1275235-11-lachlan.hodges@morsemicro.com> (raw)
In-Reply-To: <20260626063014.1275235-1-lachlan.hodges@morsemicro.com>
(Patches split per file for review, will be a single commit alongside
SDIO ids once review is complete. See cover letter for more
information)
Signed-off-by: Lachlan Hodges <lachlan.hodges@morsemicro.com>
---
drivers/net/wireless/morsemicro/mm81x/fw.h | 141 +++++++++++++++++++++
1 file changed, 141 insertions(+)
create mode 100644 drivers/net/wireless/morsemicro/mm81x/fw.h
diff --git a/drivers/net/wireless/morsemicro/mm81x/fw.h b/drivers/net/wireless/morsemicro/mm81x/fw.h
new file mode 100644
index 000000000000..d590ad3121c1
--- /dev/null
+++ b/drivers/net/wireless/morsemicro/mm81x/fw.h
@@ -0,0 +1,141 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Copyright (c) 2017-2026 Morse Micro
+ */
+
+#ifndef _MM81X_FW_H_
+#define _MM81X_FW_H_
+
+#include <linux/firmware.h>
+#include <linux/completion.h>
+#include <linux/elf.h>
+#include "yaps_hw.h"
+
+#define BCF_DATABASE_SIZE (1024)
+#define MM81X_FW_DIR "morsemicro"
+#define MM81X_FW_EXT ".bin"
+
+#define MAX_BCF_NAME_LEN 64
+
+/* FW_CAPABILITIES_FLAGS_WIDTH = ceil(MM81X_CAPS_MAX_HW_LEN / 32) */
+#define FW_CAPABILITIES_FLAGS_WIDTH (4)
+
+struct mm81x_elf32_ehdr {
+ unsigned char e_ident[EI_NIDENT];
+ __le16 e_type;
+ __le16 e_machine;
+ __le32 e_version;
+ __le32 e_entry;
+ __le32 e_phoff;
+ __le32 e_shoff;
+ __le32 e_flags;
+ __le16 e_ehsize;
+ __le16 e_phentsize;
+ __le16 e_phnum;
+ __le16 e_shentsize;
+ __le16 e_shnum;
+ __le16 e_shstrndx;
+} __packed;
+
+struct mm81x_elf32_shdr {
+ __le32 sh_name;
+ __le32 sh_type;
+ __le32 sh_flags;
+ __le32 sh_addr;
+ __le32 sh_offset;
+ __le32 sh_size;
+ __le32 sh_link;
+ __le32 sh_info;
+ __le32 sh_addralign;
+ __le32 sh_entsize;
+} __packed;
+
+struct mm81x_elf32_phdr {
+ __le32 p_type;
+ __le32 p_offset;
+ __le32 p_vaddr;
+ __le32 p_paddr;
+ __le32 p_filesz;
+ __le32 p_memsz;
+ __le32 p_flags;
+ __le32 p_align;
+} __packed;
+
+enum mm81x_fw_info_tlv_type {
+ MM81X_FW_INFO_TLV_BCF_ADDR = 1,
+};
+
+struct mm81x_fw_info_tlv {
+ __le16 type;
+ __le16 length;
+ u8 val[];
+} __packed;
+
+enum mm81x_fw_ext_host_tbl_tag {
+ /* The S1G capability tag */
+ MM81X_FW_HOST_TABLE_TAG_S1G_CAPABILITIES = 0,
+ MM81X_FW_HOST_TABLE_TAG_PAGER_BYPASS_TX_STATUS = 1,
+ MM81X_FW_HOST_TABLE_TAG_INSERT_SKB_CHECKSUM = 2,
+ MM81X_FW_HOST_TABLE_TAG_YAPS_TABLE = 3,
+ MM81X_FW_HOST_TABLE_TAG_PAGER_PKT_MEMORY = 4,
+ MM81X_FW_HOST_TABLE_TAG_PAGER_BYPASS_CMD_RESP = 5,
+};
+
+struct ext_host_tbl_tlv_hdr {
+ /* The tag used to identify which capability this represents */
+ __le16 tag;
+ /* The length of the capability structure including this header */
+ __le16 length;
+} __packed;
+
+struct ext_host_tbl_s1g_caps {
+ struct ext_host_tbl_tlv_hdr header;
+ __le32 flags[FW_CAPABILITIES_FLAGS_WIDTH];
+ /*
+ * The minimum A-MPDU start spacing required by firmware.
+ * Value | Description
+ * ------|------------
+ * 0 | No restriction
+ * 1 | 1/4 us
+ * 2 | 1/2 us
+ * 3 | 1 us
+ * 4 | 2 us
+ * 5 | 4 us
+ * 6 | 8 us
+ * 7 | 16 us
+ */
+ u8 ampdu_mss;
+ u8 beamformee_sts_capability;
+ u8 number_sounding_dimensions;
+ /*
+ * The maximum A-MPDU length. This is the exponent value such that
+ * (2^(13 + exponent) - 1) is the length
+ */
+ u8 maximum_ampdu_length;
+ /*
+ * Offset to apply to the specification's MMSS table to signal further
+ * minimum MPDU start spacing.
+ */
+ u8 mm81x_mmss_offset;
+} __packed;
+
+struct ext_host_tbl_insert_skb_checksum {
+ struct ext_host_tbl_tlv_hdr header;
+ u8 insert_and_validate_checksum;
+};
+
+struct ext_host_tbl_yaps_table {
+ struct ext_host_tbl_tlv_hdr header;
+ struct mm81x_yaps_hw_table yaps_table;
+} __packed;
+
+struct ext_host_tbl {
+ __le32 ext_host_tbl_length;
+ u8 dev_mac_addr[6];
+ u8 ext_host_table_data_tlvs[];
+} __packed;
+
+int mm81x_fw_init(struct mm81x *mors, bool reset);
+int mm81x_fw_parse_ext_host_tbl(struct mm81x *mors);
+
+#endif /* !_MM81X_FW_H_ */
--
2.43.0
next prev parent reply other threads:[~2026-06-26 6:31 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-26 6:28 [PATCH wireless-next v3 00/33] wifi: mm81x: add mm81x driver Lachlan Hodges
2026-06-26 6:28 ` [PATCH wireless-next v3 01/33] wifi: cfg80211: introduce helper to get S1G primary width Lachlan Hodges
2026-06-26 6:28 ` [PATCH wireless-next v3 02/33] wifi: ieee80211: introduce generic KHZ_TO_HZ helper Lachlan Hodges
2026-06-26 6:28 ` [PATCH wireless-next v3 03/33] wifi: mm81x: add bus.h Lachlan Hodges
2026-06-26 6:29 ` [PATCH wireless-next v3 04/33] wifi: mm81x: add command.c Lachlan Hodges
2026-06-26 6:29 ` [PATCH wireless-next v3 05/33] wifi: mm81x: add command_defs.h Lachlan Hodges
2026-06-26 6:29 ` [PATCH wireless-next v3 06/33] wifi: mm81x: add command.h Lachlan Hodges
2026-06-26 6:29 ` [PATCH wireless-next v3 07/33] wifi: mm81x: add core.c Lachlan Hodges
2026-06-26 6:29 ` [PATCH wireless-next v3 08/33] wifi: mm81x: add core.h Lachlan Hodges
2026-06-26 6:29 ` [PATCH wireless-next v3 09/33] wifi: mm81x: add fw.c Lachlan Hodges
2026-06-26 6:29 ` Lachlan Hodges [this message]
2026-06-26 6:29 ` [PATCH wireless-next v3 11/33] wifi: mm81x: add hif.h Lachlan Hodges
2026-06-26 6:29 ` [PATCH wireless-next v3 12/33] wifi: mm81x: add hw.c Lachlan Hodges
2026-06-26 6:29 ` [PATCH wireless-next v3 13/33] wifi: mm81x: add hw.h Lachlan Hodges
2026-06-26 6:29 ` [PATCH wireless-next v3 14/33] wifi: mm81x: add mac.c Lachlan Hodges
2026-06-26 6:29 ` [PATCH wireless-next v3 15/33] wifi: mm81x: add mac.h Lachlan Hodges
2026-06-26 6:29 ` [PATCH wireless-next v3 16/33] wifi: mm81x: add mmrc.c Lachlan Hodges
2026-06-26 6:29 ` [PATCH wireless-next v3 17/33] wifi: mm81x: add mmrc.h Lachlan Hodges
2026-06-26 6:29 ` [PATCH wireless-next v3 18/33] wifi: mm81x: add ps.c Lachlan Hodges
2026-06-26 6:29 ` [PATCH wireless-next v3 19/33] wifi: mm81x: add ps.h Lachlan Hodges
2026-06-26 6:29 ` [PATCH wireless-next v3 20/33] wifi: mm81x: add rate_code.h Lachlan Hodges
2026-06-26 6:29 ` [PATCH wireless-next v3 21/33] wifi: mm81x: add rc.c Lachlan Hodges
2026-06-26 6:29 ` [PATCH wireless-next v3 22/33] wifi: mm81x: add rc.h Lachlan Hodges
2026-06-26 6:29 ` [PATCH wireless-next v3 23/33] mmc: sdio: add Morse Micro vendor ids Lachlan Hodges
2026-06-26 6:29 ` [PATCH wireless-next v3 24/33] wifi: mm81x: add sdio.c Lachlan Hodges
2026-06-26 6:29 ` [PATCH wireless-next v3 25/33] wifi: mm81x: add skbq.c Lachlan Hodges
2026-06-26 6:29 ` [PATCH wireless-next v3 26/33] wifi: mm81x: add skbq.h Lachlan Hodges
2026-06-26 6:29 ` [PATCH wireless-next v3 27/33] wifi: mm81x: add usb.c Lachlan Hodges
2026-06-26 6:29 ` [PATCH wireless-next v3 28/33] wifi: mm81x: add yaps.c Lachlan Hodges
2026-06-26 6:29 ` [PATCH wireless-next v3 29/33] wifi: mm81x: add yaps.h Lachlan Hodges
2026-06-26 6:29 ` [PATCH wireless-next v3 30/33] wifi: mm81x: add yaps_hw.c Lachlan Hodges
2026-06-26 6:29 ` [PATCH wireless-next v3 31/33] wifi: mm81x: add yaps_hw.h Lachlan Hodges
2026-06-26 6:29 ` [PATCH wireless-next v3 32/33] wifi: mm81x: add Kconfig and Makefile Lachlan Hodges
2026-06-26 6:29 ` [PATCH wireless-next v3 33/33] wifi: mm81x: add MAINTAINERS entry Lachlan Hodges
2026-06-29 0:13 ` [PATCH wireless-next v3 00/33] wifi: mm81x: add mm81x driver Lachlan Hodges
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260626063014.1275235-11-lachlan.hodges@morsemicro.com \
--to=lachlan.hodges@morsemicro.com \
--cc=arien.judge@morsemicro.com \
--cc=ayman.grais@morsemicro.com \
--cc=dan.callaghan@morsemicro.com \
--cc=johannes@sipsolutions.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox