* [PATCH do not merge 0/4] wifi: mwifiex: add iw61x support
@ 2025-03-26 12:18 Sascha Hauer
2025-03-26 12:18 ` [PATCH do not merge 1/4] wifi: mwifiex: release firmware at remove time Sascha Hauer
` (4 more replies)
0 siblings, 5 replies; 15+ messages in thread
From: Sascha Hauer @ 2025-03-26 12:18 UTC (permalink / raw)
To: Brian Norris, Francesco Dolcini, Ulf Hansson
Cc: linux-wireless, linux-kernel, linux-mmc, Sascha Hauer
This series adds iw61x support to the mwifiex driver. It works for me,
but is not yet ready to be merged. Some people showed interest in it, so
I am sending it here.
All testing and review feedback appreciated.
During startup I get these messages:
[ 12.078010] mwifiex_sdio mmc1:0001:1: Unknown GET_HW_SPEC TLV type: 0xff
[ 12.078018] mwifiex_sdio mmc1:0001:1: Unknown GET_HW_SPEC TLV type: 0xff
[ 12.078024] mwifiex_sdio mmc1:0001:1: Unknown GET_HW_SPEC TLV type: 0x23e
[ 12.078029] mwifiex_sdio mmc1:0001:1: Unknown GET_HW_SPEC TLV type: 0x25c
Not sure what these are about, I can't see these handled in the
downstream mwifiex driver as well. Could also be there is some parsing
error. Nevertheless the driver seems to work.
The series applies to v6.14, but should apply to my mwifiex cleanup
series as well.
Sascha
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
Sascha Hauer (4):
wifi: mwifiex: release firmware at remove time
wifi: mwifiex: handle VDLL
wifi: mwifiex: wait longer for SDIO card status
wifi: mwifiex: add iw61x support
drivers/net/wireless/marvell/mwifiex/cmdevt.c | 86 ++++++++++++++++++++++++
drivers/net/wireless/marvell/mwifiex/fw.h | 16 +++++
drivers/net/wireless/marvell/mwifiex/main.c | 9 +--
drivers/net/wireless/marvell/mwifiex/main.h | 4 ++
drivers/net/wireless/marvell/mwifiex/sdio.c | 81 +++++++++++++++++++++-
drivers/net/wireless/marvell/mwifiex/sdio.h | 3 +
drivers/net/wireless/marvell/mwifiex/sta_event.c | 4 ++
drivers/net/wireless/marvell/mwifiex/uap_event.c | 4 ++
include/linux/mmc/sdio_ids.h | 3 +
9 files changed, 205 insertions(+), 5 deletions(-)
---
base-commit: 1e26c5e28ca5821a824e90dd359556f5e9e7b89f
change-id: 20250326-mwifiex-iw61x-b9570bf30735
Best regards,
--
Sascha Hauer <s.hauer@pengutronix.de>
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH do not merge 1/4] wifi: mwifiex: release firmware at remove time
2025-03-26 12:18 [PATCH do not merge 0/4] wifi: mwifiex: add iw61x support Sascha Hauer
@ 2025-03-26 12:18 ` Sascha Hauer
2025-03-26 12:18 ` [PATCH do not merge 2/4] wifi: mwifiex: handle VDLL Sascha Hauer
` (3 subsequent siblings)
4 siblings, 0 replies; 15+ messages in thread
From: Sascha Hauer @ 2025-03-26 12:18 UTC (permalink / raw)
To: Brian Norris, Francesco Dolcini, Ulf Hansson
Cc: linux-wireless, linux-kernel, linux-mmc, Sascha Hauer
With VDLL support the device will request parts of the firmware during
runtime, so instead of releasing the firmware immediately after initial
firmware upload, release it during device deregistration.
FIXME: I am not sure if we run into trouble with the firmware framework
when we don't release the firmware. We might have to copy it over to
some private buffer instead of just keeping it around.
FIXME: we might want to limit the release firmware at remove time to the
devices that actually need it.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
drivers/net/wireless/marvell/mwifiex/main.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/marvell/mwifiex/main.c b/drivers/net/wireless/marvell/mwifiex/main.c
index 855019fe54858..0b394ea261316 100644
--- a/drivers/net/wireless/marvell/mwifiex/main.c
+++ b/drivers/net/wireless/marvell/mwifiex/main.c
@@ -695,10 +695,6 @@ static int _mwifiex_fw_dpc(const struct firmware *firmware, void *context)
release_firmware(adapter->cal_data);
adapter->cal_data = NULL;
}
- if (adapter->firmware) {
- release_firmware(adapter->firmware);
- adapter->firmware = NULL;
- }
if (init_failed) {
if (adapter->irq_wakeup >= 0)
device_init_wakeup(adapter->dev, false);
@@ -1836,6 +1832,11 @@ int mwifiex_remove_card(struct mwifiex_adapter *adapter)
"info: unregister device\n");
if (adapter->if_ops.unregister_dev)
adapter->if_ops.unregister_dev(adapter);
+ if (adapter->firmware) {
+ release_firmware(adapter->firmware);
+ adapter->firmware = NULL;
+ }
+
/* Free adapter structure */
mwifiex_dbg(adapter, INFO,
"info: free adapter\n");
--
2.39.5
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH do not merge 2/4] wifi: mwifiex: handle VDLL
2025-03-26 12:18 [PATCH do not merge 0/4] wifi: mwifiex: add iw61x support Sascha Hauer
2025-03-26 12:18 ` [PATCH do not merge 1/4] wifi: mwifiex: release firmware at remove time Sascha Hauer
@ 2025-03-26 12:18 ` Sascha Hauer
2025-04-18 8:12 ` [EXT] " Jeff Chen
2025-03-26 12:18 ` [PATCH do not merge 3/4] wifi: mwifiex: wait longer for SDIO card status Sascha Hauer
` (2 subsequent siblings)
4 siblings, 1 reply; 15+ messages in thread
From: Sascha Hauer @ 2025-03-26 12:18 UTC (permalink / raw)
To: Brian Norris, Francesco Dolcini, Ulf Hansson
Cc: linux-wireless, linux-kernel, linux-mmc, Sascha Hauer
Some adapters send events to the Kernel requesting VDLL images. When we
receive such an event we have to upload parts of the firmware image to
the device.
When the firmware requests a VDLL image then we have to bypass the
pending command queue and have to send it immediately. Failing to do
so will cause every other command sent from the queue to timeout.
There is this check currently in mwifiex_download_vdll_block():
if (adapter->cmd_sent) {
mwifiex_dbg(adapter, MSG, "%s: adapter is busy\n", __func__);
return -EBUSY;
}
The downstream driver has this check as well. However, the downstream
driver tries to defer sending the VDLL command when this happens. It
sets a variable in the private driver struct where the main process
picks it up later. I am not sure if this can work, because when
adapter->cmd_sent is true then it's already too late, we already missed
to send the VDLL image before the next command. In my tests I never saw
the above trigger, but this surely a place to have a closer look at.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
drivers/net/wireless/marvell/mwifiex/cmdevt.c | 86 ++++++++++++++++++++++++
drivers/net/wireless/marvell/mwifiex/fw.h | 16 +++++
drivers/net/wireless/marvell/mwifiex/main.h | 4 ++
drivers/net/wireless/marvell/mwifiex/sta_event.c | 4 ++
drivers/net/wireless/marvell/mwifiex/uap_event.c | 4 ++
5 files changed, 114 insertions(+)
diff --git a/drivers/net/wireless/marvell/mwifiex/cmdevt.c b/drivers/net/wireless/marvell/mwifiex/cmdevt.c
index b30ed321c6251..916d0b804bec3 100644
--- a/drivers/net/wireless/marvell/mwifiex/cmdevt.c
+++ b/drivers/net/wireless/marvell/mwifiex/cmdevt.c
@@ -1716,3 +1716,89 @@ int mwifiex_ret_wakeup_reason(struct mwifiex_private *priv,
return 0;
}
+
+static int mwifiex_download_vdll_block(struct mwifiex_adapter *adapter, u32 offset,
+ u16 block_len)
+{
+ int ret;
+ struct host_cmd_ds_gen *cmd_hdr = NULL;
+ u16 msg_len = block_len + sizeof(*cmd_hdr);
+ struct sk_buff *skb;
+ u32 fw_offset;
+
+ block_len = min(block_len, adapter->vdll_len - offset);
+
+ if (offset > adapter->vdll_len)
+ return -EINVAL;
+
+ if (adapter->cmd_sent) {
+ mwifiex_dbg(adapter, MSG, "%s: adapter is busy\n", __func__);
+ return -EBUSY;
+ }
+
+ skb = dev_alloc_skb(msg_len + MWIFIEX_TYPE_LEN);
+ if (!skb) {
+ mwifiex_dbg(adapter, ERROR,
+ "SLEEP_CFM: dev_alloc_skb failed\n");
+ return -ENOMEM;
+ }
+
+ skb_put(skb, msg_len);
+
+ cmd_hdr = (void *)skb->data;
+ cmd_hdr->command = cpu_to_le16(HostCmd_CMD_VDLL);
+ cmd_hdr->seq_num = cpu_to_le16(0xFF00);
+ cmd_hdr->size = cpu_to_le16(msg_len);
+
+ fw_offset = adapter->firmware->size - adapter->vdll_len + offset;
+ memcpy(skb->data + sizeof(*cmd_hdr), adapter->firmware->data + fw_offset, block_len);
+
+ skb_push(skb, adapter->intf_hdr_len);
+
+ ret = adapter->if_ops.host_to_card(adapter, MWIFIEX_TYPE_VDLL, skb, NULL);
+ if (ret < 0)
+ mwifiex_dbg(adapter, MSG, "DNLD_VDLL: Host to Card Failed\n");
+
+ dev_kfree_skb_any(skb);
+
+ return ret;
+
+}
+
+int mwifiex_process_vdll_event(struct mwifiex_private *priv, struct sk_buff *event_skb)
+{
+ int status = 0;
+ struct mwifiex_vdll_ind *ind;
+ struct mwifiex_adapter *adapter = priv->adapter;
+
+ ind = (struct mwifiex_vdll_ind *)(event_skb->data + sizeof(u32));
+
+ switch (le16_to_cpu(ind->type)) {
+ case VDLL_IND_TYPE_REQ:
+ mwifiex_download_vdll_block(adapter, le32_to_cpu(ind->offset),
+ le16_to_cpu(ind->block_len));
+ break;
+ case VDLL_IND_TYPE_OFFSET:
+ adapter->vdll_len = le32_to_cpu(ind->offset);
+ mwifiex_dbg(adapter, MSG, "VDLL_IND (OFFSET): offset=0x%x\n",
+ adapter->vdll_len);
+ break;
+ case VDLL_IND_TYPE_ERR_SIG:
+ mwifiex_dbg(adapter, MSG, "VDLL_IND (SIG ERR).\n");
+ break;
+ case VDLL_IND_TYPE_ERR_ID:
+ mwifiex_dbg(adapter, MSG, "VDLL_IND (ID ERR).\n");
+ break;
+ case VDLL_IND_TYPE_SEC_ERR_ID:
+ mwifiex_dbg(adapter, MSG, "VDLL_IND (SECURE ERR).\n");
+ break;
+ case VDLL_IND_TYPE_INTF_RESET:
+ mwifiex_dbg(adapter, MSG, "VDLL_IND (INTF_RESET)\n");
+ break;
+ default:
+ mwifiex_dbg(adapter, MSG, "unknown vdll ind type=%d\n", ind->type);
+ break;
+ }
+
+ return status;
+}
diff --git a/drivers/net/wireless/marvell/mwifiex/fw.h b/drivers/net/wireless/marvell/mwifiex/fw.h
index 4a96281792cc1..92541bc6d0122 100644
--- a/drivers/net/wireless/marvell/mwifiex/fw.h
+++ b/drivers/net/wireless/marvell/mwifiex/fw.h
@@ -406,6 +406,7 @@ enum MWIFIEX_802_11_PRIVACY_FILTER {
#define HostCmd_CMD_FW_DUMP_EVENT 0x0125
#define HostCmd_CMD_SDIO_SP_RX_AGGR_CFG 0x0223
#define HostCmd_CMD_STA_CONFIGURE 0x023f
+#define HostCmd_CMD_VDLL 0x0240
#define HostCmd_CMD_CHAN_REGION_CFG 0x0242
#define HostCmd_CMD_PACKET_AGGR_CTRL 0x0251
#define HostCmd_CMD_ADD_NEW_STATION 0x025f
@@ -584,6 +585,7 @@ enum mwifiex_channel_flags {
#define EVENT_FW_DUMP_INFO 0x00000073
#define EVENT_TX_STATUS_REPORT 0x00000074
#define EVENT_BT_COEX_WLAN_PARA_CHANGE 0X00000076
+#define EVENT_VDLL_IND 0x00000081
#define EVENT_ID_MASK 0xffff
#define BSS_NUM_MASK 0xf
@@ -2449,4 +2451,18 @@ struct hw_spec_max_conn {
u8 max_sta_conn;
} __packed;
+#define VDLL_IND_TYPE_REQ 0 /* req host side download vdll block */
+#define VDLL_IND_TYPE_OFFSET 1 /* notify vdll start offset in firmware image */
+#define VDLL_IND_TYPE_ERR_SIG 2 /* notify vdll download error: signature error */
+#define VDLL_IND_TYPE_ERR_ID 3 /* notify vdll download error: ID error */
+#define VDLL_IND_TYPE_SEC_ERR_ID 4 /* notify vdll download error: Secure error */
+#define VDLL_IND_TYPE_INTF_RESET 5 /* req host side interface reset */
+
+struct mwifiex_vdll_ind {
+ __le16 type;
+ __le16 vdllId;
+ __le32 offset;
+ __le16 block_len;
+} __packed;
+
#endif /* !_MWIFIEX_FW_H_ */
diff --git a/drivers/net/wireless/marvell/mwifiex/main.h b/drivers/net/wireless/marvell/mwifiex/main.h
index 0674dcf7a5374..5adbf66957e14 100644
--- a/drivers/net/wireless/marvell/mwifiex/main.h
+++ b/drivers/net/wireless/marvell/mwifiex/main.h
@@ -131,6 +131,7 @@ enum {
#define MWIFIEX_TYPE_DATA 0
#define MWIFIEX_TYPE_AGGR_DATA 10
#define MWIFIEX_TYPE_EVENT 3
+#define MWIFIEX_TYPE_VDLL 4
#define MAX_BITMAP_RATES_SIZE 18
@@ -1041,6 +1042,8 @@ struct mwifiex_adapter {
struct delayed_work devdump_work;
bool ignore_btcoex_events;
+
+ u32 vdll_len;
};
void mwifiex_process_tx_queue(struct mwifiex_adapter *adapter);
@@ -1252,6 +1255,7 @@ int mwifiex_cmd_802_11_bg_scan_config(struct mwifiex_private *priv,
struct host_cmd_ds_command *cmd,
void *data_buf);
int mwifiex_stop_bg_scan(struct mwifiex_private *priv);
+int mwifiex_process_vdll_event(struct mwifiex_private *priv, struct sk_buff *event_skb);
/*
* This function checks if the queuing is RA based or not.
diff --git a/drivers/net/wireless/marvell/mwifiex/sta_event.c b/drivers/net/wireless/marvell/mwifiex/sta_event.c
index 400348abeee54..e516f44f1804d 100644
--- a/drivers/net/wireless/marvell/mwifiex/sta_event.c
+++ b/drivers/net/wireless/marvell/mwifiex/sta_event.c
@@ -1084,6 +1084,10 @@ int mwifiex_process_sta_event(struct mwifiex_private *priv)
mwifiex_dbg(adapter, EVENT, "event: firmware debug info\n");
mwifiex_fw_dump_info_event(priv, adapter->event_skb);
break;
+ case EVENT_VDLL_IND:
+ mwifiex_dbg(adapter, EVENT, "event: VDLL event\n");
+ mwifiex_process_vdll_event(priv, adapter->event_skb);
+ break;
/* Debugging event; not used, but let's not print an ERROR for it. */
case EVENT_UNKNOWN_DEBUG:
mwifiex_dbg(adapter, EVENT, "event: debug\n");
diff --git a/drivers/net/wireless/marvell/mwifiex/uap_event.c b/drivers/net/wireless/marvell/mwifiex/uap_event.c
index 58ef5020a46a7..80a9c433db64a 100644
--- a/drivers/net/wireless/marvell/mwifiex/uap_event.c
+++ b/drivers/net/wireless/marvell/mwifiex/uap_event.c
@@ -317,6 +317,10 @@ int mwifiex_process_uap_event(struct mwifiex_private *priv)
memset(&priv->roc_cfg, 0x00, sizeof(struct mwifiex_roc_cfg));
break;
+ case EVENT_VDLL_IND:
+ mwifiex_dbg(adapter, EVENT, "event: handle VDLL event...\n");
+ mwifiex_process_vdll_event(priv, adapter->event_skb);
+ break;
default:
mwifiex_dbg(adapter, EVENT,
"event: unknown event id: %#x\n", eventcause);
--
2.39.5
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH do not merge 3/4] wifi: mwifiex: wait longer for SDIO card status
2025-03-26 12:18 [PATCH do not merge 0/4] wifi: mwifiex: add iw61x support Sascha Hauer
2025-03-26 12:18 ` [PATCH do not merge 1/4] wifi: mwifiex: release firmware at remove time Sascha Hauer
2025-03-26 12:18 ` [PATCH do not merge 2/4] wifi: mwifiex: handle VDLL Sascha Hauer
@ 2025-03-26 12:18 ` Sascha Hauer
2025-03-26 12:18 ` [PATCH do not merge 4/4] wifi: mwifiex: add iw61x support Sascha Hauer
2025-03-31 6:50 ` [PATCH do not merge 0/4] " Francesco Dolcini
4 siblings, 0 replies; 15+ messages in thread
From: Sascha Hauer @ 2025-03-26 12:18 UTC (permalink / raw)
To: Brian Norris, Francesco Dolcini, Ulf Hansson
Cc: linux-wireless, linux-kernel, linux-mmc, Sascha Hauer
The IW61x needs longer than the currently used MAX_POLL_TRIES for some
operations. Increase the value to 10000 * 10us = 100000us as done in the
downstream driver as well.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
drivers/net/wireless/marvell/mwifiex/sdio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/marvell/mwifiex/sdio.c b/drivers/net/wireless/marvell/mwifiex/sdio.c
index 490ffd981164d..cbcb5674b8036 100644
--- a/drivers/net/wireless/marvell/mwifiex/sdio.c
+++ b/drivers/net/wireless/marvell/mwifiex/sdio.c
@@ -1265,7 +1265,7 @@ mwifiex_sdio_poll_card_status(struct mwifiex_adapter *adapter, u8 bits)
u32 tries;
u8 cs;
- for (tries = 0; tries < MAX_POLL_TRIES; tries++) {
+ for (tries = 0; tries < 10000; tries++) {
if (mwifiex_read_reg(adapter, card->reg->poll_reg, &cs))
break;
else if ((cs & bits) == bits)
--
2.39.5
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH do not merge 4/4] wifi: mwifiex: add iw61x support
2025-03-26 12:18 [PATCH do not merge 0/4] wifi: mwifiex: add iw61x support Sascha Hauer
` (2 preceding siblings ...)
2025-03-26 12:18 ` [PATCH do not merge 3/4] wifi: mwifiex: wait longer for SDIO card status Sascha Hauer
@ 2025-03-26 12:18 ` Sascha Hauer
2025-03-26 12:23 ` Francesco Dolcini
2025-03-28 15:05 ` Ernest Van Hoecke
2025-03-31 6:50 ` [PATCH do not merge 0/4] " Francesco Dolcini
4 siblings, 2 replies; 15+ messages in thread
From: Sascha Hauer @ 2025-03-26 12:18 UTC (permalink / raw)
To: Brian Norris, Francesco Dolcini, Ulf Hansson
Cc: linux-wireless, linux-kernel, linux-mmc, Sascha Hauer
This adds iw61x aka SD9177 support to the mwifiex driver. It is named
SD9177 in the downstream driver, I deliberately chose the NXP name in
the driver.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
drivers/net/wireless/marvell/mwifiex/sdio.c | 79 +++++++++++++++++++++++++++++
drivers/net/wireless/marvell/mwifiex/sdio.h | 3 ++
include/linux/mmc/sdio_ids.h | 3 ++
3 files changed, 85 insertions(+)
diff --git a/drivers/net/wireless/marvell/mwifiex/sdio.c b/drivers/net/wireless/marvell/mwifiex/sdio.c
index cbcb5674b8036..7b4045a40df57 100644
--- a/drivers/net/wireless/marvell/mwifiex/sdio.c
+++ b/drivers/net/wireless/marvell/mwifiex/sdio.c
@@ -318,6 +318,62 @@ static const struct mwifiex_sdio_card_reg mwifiex_reg_sd89xx = {
0x68, 0x69, 0x6a},
};
+static const struct mwifiex_sdio_card_reg mwifiex_reg_iw612 = {
+ .start_rd_port = 0,
+ .start_wr_port = 0,
+ .base_0_reg = 0xF8,
+ .base_1_reg = 0xF9,
+ .poll_reg = 0x5C,
+ .host_int_enable = UP_LD_HOST_INT_MASK | DN_LD_HOST_INT_MASK |
+ CMD_PORT_UPLD_INT_MASK | CMD_PORT_DNLD_INT_MASK,
+ .host_int_rsr_reg = 0x4,
+ .host_int_status_reg = 0x0C,
+ .host_int_mask_reg = 0x08,
+ .host_strap_reg = 0xF4,
+ .host_strap_mask = 0x01,
+ .host_strap_value = 0x01,
+ .status_reg_0 = 0xE8,
+ .status_reg_1 = 0xE9,
+ .sdio_int_mask = 0xff,
+ .data_port_mask = 0xffffffff,
+ .io_port_0_reg = 0xE4,
+ .io_port_1_reg = 0xE5,
+ .io_port_2_reg = 0xE6,
+ .max_mp_regs = 196,
+ .rd_bitmap_l = 0x10,
+ .rd_bitmap_u = 0x11,
+ .rd_bitmap_1l = 0x12,
+ .rd_bitmap_1u = 0x13,
+ .wr_bitmap_l = 0x14,
+ .wr_bitmap_u = 0x15,
+ .wr_bitmap_1l = 0x16,
+ .wr_bitmap_1u = 0x17,
+ .rd_len_p0_l = 0x18,
+ .rd_len_p0_u = 0x19,
+ .card_misc_cfg_reg = 0xd8,
+ .card_cfg_2_1_reg = 0xd9,
+ .cmd_rd_len_0 = 0xc0,
+ .cmd_rd_len_1 = 0xc1,
+ .cmd_rd_len_2 = 0xc2,
+ .cmd_rd_len_3 = 0xc3,
+ .cmd_cfg_0 = 0xc4,
+ .cmd_cfg_1 = 0xc5,
+ .cmd_cfg_2 = 0xc6,
+ .cmd_cfg_3 = 0xc7,
+ .fw_dump_host_ready = 0xcc,
+ .fw_dump_ctrl = 0xf0,
+ .fw_dump_start = 0xf1,
+ .fw_dump_end = 0xf8,
+ .func1_dump_reg_start = 0x10,
+ .func1_dump_reg_end = 0x17,
+ .func1_scratch_reg = 0xe8,
+ .func1_spec_reg_num = 13,
+ .func1_spec_reg_table = {0x08, 0x58, 0x5C, 0x5D,
+ 0x60, 0x61, 0x62, 0x64,
+ 0x65, 0x66, 0x68, 0x69,
+ 0x6a},
+};
+
static const struct mwifiex_sdio_device mwifiex_sdio_sd8786 = {
.firmware = SD8786_DEFAULT_FW_NAME,
.reg = &mwifiex_reg_sd87xx,
@@ -441,6 +497,25 @@ static const struct mwifiex_sdio_device mwifiex_sdio_sd8997 = {
.host_mlme = false,
};
+static const struct mwifiex_sdio_device mwifiex_sdio_iw612 = {
+ .firmware = IW612_DEFAULT_FW_NAME,
+ .firmware_sdiouart = IW612_SDIOUART_FW_NAME,
+ .reg = &mwifiex_reg_iw612,
+ .max_ports = 32,
+ .mp_agg_pkt_limit = 16,
+ .tx_buf_size = MWIFIEX_TX_DATA_BUF_SIZE_4K,
+ .mp_tx_agg_buf_size = MWIFIEX_MP_AGGR_BUF_SIZE_MAX,
+ .mp_rx_agg_buf_size = MWIFIEX_MP_AGGR_BUF_SIZE_MAX,
+ .supports_sdio_new_mode = true,
+ .has_control_mask = false,
+ .can_dump_fw = true,
+ .fw_dump_enh = true,
+ .can_auto_tdls = false,
+ .can_ext_scan = true,
+ .fw_ready_extra_delay = false,
+ .host_mlme = true,
+};
+
static const struct mwifiex_sdio_device mwifiex_sdio_sd8887 = {
.firmware = SD8887_DEFAULT_FW_NAME,
.reg = &mwifiex_reg_sd8887,
@@ -974,6 +1049,8 @@ static const struct sdio_device_id mwifiex_ids[] = {
.driver_data = (unsigned long)&mwifiex_sdio_sd8987},
{SDIO_DEVICE(SDIO_VENDOR_ID_MARVELL, SDIO_DEVICE_ID_MARVELL_8997_WLAN),
.driver_data = (unsigned long)&mwifiex_sdio_sd8997},
+ {SDIO_DEVICE(SDIO_VENDOR_ID_NXP, SDIO_DEVICE_ID_NXP_IW612_WLAN),
+ .driver_data = (unsigned long)&mwifiex_sdio_iw612},
{},
};
@@ -3212,3 +3289,5 @@ MODULE_FIRMWARE(SD8978_SDIOUART_FW_NAME);
MODULE_FIRMWARE(SD8987_DEFAULT_FW_NAME);
MODULE_FIRMWARE(SD8997_DEFAULT_FW_NAME);
MODULE_FIRMWARE(SD8997_SDIOUART_FW_NAME);
+MODULE_FIRMWARE(IW612_DEFAULT_FW_NAME);
+MODULE_FIRMWARE(IW612_SDIOUART_FW_NAME);
diff --git a/drivers/net/wireless/marvell/mwifiex/sdio.h b/drivers/net/wireless/marvell/mwifiex/sdio.h
index 65d142286c46e..97759456314b0 100644
--- a/drivers/net/wireless/marvell/mwifiex/sdio.h
+++ b/drivers/net/wireless/marvell/mwifiex/sdio.h
@@ -29,6 +29,9 @@
#define SD8987_DEFAULT_FW_NAME "mrvl/sd8987_uapsta.bin"
#define SD8997_DEFAULT_FW_NAME "mrvl/sdsd8997_combo_v4.bin"
#define SD8997_SDIOUART_FW_NAME "mrvl/sdiouart8997_combo_v4.bin"
+#define IW612_DEFAULT_FW_NAME "nxp/sdsd_nw61x.bin"
+#define IW612_SDIOUART_FW_NAME "nxp/sd_w61x.bin"
+
#define BLOCK_MODE 1
#define BYTE_MODE 0
diff --git a/include/linux/mmc/sdio_ids.h b/include/linux/mmc/sdio_ids.h
index 7cddfdac2f576..a421c58abd331 100644
--- a/include/linux/mmc/sdio_ids.h
+++ b/include/linux/mmc/sdio_ids.h
@@ -115,6 +115,9 @@
#define SDIO_VENDOR_ID_MICROCHIP_WILC 0x0296
#define SDIO_DEVICE_ID_MICROCHIP_WILC1000 0x5347
+#define SDIO_VENDOR_ID_NXP 0x0471
+#define SDIO_DEVICE_ID_NXP_IW612_WLAN 0x0205
+
#define SDIO_VENDOR_ID_REALTEK 0x024c
#define SDIO_DEVICE_ID_REALTEK_RTW8723BS 0xb723
#define SDIO_DEVICE_ID_REALTEK_RTW8821BS 0xb821
--
2.39.5
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH do not merge 4/4] wifi: mwifiex: add iw61x support
2025-03-26 12:18 ` [PATCH do not merge 4/4] wifi: mwifiex: add iw61x support Sascha Hauer
@ 2025-03-26 12:23 ` Francesco Dolcini
2025-03-26 13:54 ` Sascha Hauer
2025-03-28 15:05 ` Ernest Van Hoecke
1 sibling, 1 reply; 15+ messages in thread
From: Francesco Dolcini @ 2025-03-26 12:23 UTC (permalink / raw)
To: Sascha Hauer
Cc: Brian Norris, Francesco Dolcini, Ulf Hansson, linux-wireless,
linux-kernel, linux-mmc
On Wed, Mar 26, 2025 at 01:18:34PM +0100, Sascha Hauer wrote:
> This adds iw61x aka SD9177 support to the mwifiex driver. It is named
> SD9177 in the downstream driver, I deliberately chose the NXP name in
> the driver.
>
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> ---
> drivers/net/wireless/marvell/mwifiex/sdio.c | 79 +++++++++++++++++++++++++++++
> drivers/net/wireless/marvell/mwifiex/sdio.h | 3 ++
> include/linux/mmc/sdio_ids.h | 3 ++
> 3 files changed, 85 insertions(+)
>
> diff --git a/drivers/net/wireless/marvell/mwifiex/sdio.c b/drivers/net/wireless/marvell/mwifiex/sdio.c
> index cbcb5674b8036..7b4045a40df57 100644
> --- a/drivers/net/wireless/marvell/mwifiex/sdio.c
> +++ b/drivers/net/wireless/marvell/mwifiex/sdio.c
...
> @@ -3212,3 +3289,5 @@ MODULE_FIRMWARE(SD8978_SDIOUART_FW_NAME);
> MODULE_FIRMWARE(SD8987_DEFAULT_FW_NAME);
> MODULE_FIRMWARE(SD8997_DEFAULT_FW_NAME);
> MODULE_FIRMWARE(SD8997_SDIOUART_FW_NAME);
> +MODULE_FIRMWARE(IW612_DEFAULT_FW_NAME);
> +MODULE_FIRMWARE(IW612_SDIOUART_FW_NAME);
> diff --git a/drivers/net/wireless/marvell/mwifiex/sdio.h b/drivers/net/wireless/marvell/mwifiex/sdio.h
> index 65d142286c46e..97759456314b0 100644
> --- a/drivers/net/wireless/marvell/mwifiex/sdio.h
> +++ b/drivers/net/wireless/marvell/mwifiex/sdio.h
> @@ -29,6 +29,9 @@
> #define SD8987_DEFAULT_FW_NAME "mrvl/sd8987_uapsta.bin"
> #define SD8997_DEFAULT_FW_NAME "mrvl/sdsd8997_combo_v4.bin"
> #define SD8997_SDIOUART_FW_NAME "mrvl/sdiouart8997_combo_v4.bin"
> +#define IW612_DEFAULT_FW_NAME "nxp/sdsd_nw61x.bin"
> +#define IW612_SDIOUART_FW_NAME "nxp/sd_w61x.bin"
Is there a way to have BT over SDIO with iw61x? I was sure only sd-uart was
possible.
Francesco
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH do not merge 4/4] wifi: mwifiex: add iw61x support
2025-03-26 12:23 ` Francesco Dolcini
@ 2025-03-26 13:54 ` Sascha Hauer
2025-03-27 9:33 ` Francesco Dolcini
0 siblings, 1 reply; 15+ messages in thread
From: Sascha Hauer @ 2025-03-26 13:54 UTC (permalink / raw)
To: Francesco Dolcini
Cc: Brian Norris, Ulf Hansson, linux-wireless, linux-kernel,
linux-mmc
Hi Francesco,
On Wed, Mar 26, 2025 at 01:23:35PM +0100, Francesco Dolcini wrote:
> On Wed, Mar 26, 2025 at 01:18:34PM +0100, Sascha Hauer wrote:
> > This adds iw61x aka SD9177 support to the mwifiex driver. It is named
> > SD9177 in the downstream driver, I deliberately chose the NXP name in
> > the driver.
> >
> > Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> > ---
> > drivers/net/wireless/marvell/mwifiex/sdio.c | 79 +++++++++++++++++++++++++++++
> > drivers/net/wireless/marvell/mwifiex/sdio.h | 3 ++
> > include/linux/mmc/sdio_ids.h | 3 ++
> > 3 files changed, 85 insertions(+)
> >
> > diff --git a/drivers/net/wireless/marvell/mwifiex/sdio.c b/drivers/net/wireless/marvell/mwifiex/sdio.c
> > index cbcb5674b8036..7b4045a40df57 100644
> > --- a/drivers/net/wireless/marvell/mwifiex/sdio.c
> > +++ b/drivers/net/wireless/marvell/mwifiex/sdio.c
>
> ...
>
> > @@ -3212,3 +3289,5 @@ MODULE_FIRMWARE(SD8978_SDIOUART_FW_NAME);
> > MODULE_FIRMWARE(SD8987_DEFAULT_FW_NAME);
> > MODULE_FIRMWARE(SD8997_DEFAULT_FW_NAME);
> > MODULE_FIRMWARE(SD8997_SDIOUART_FW_NAME);
> > +MODULE_FIRMWARE(IW612_DEFAULT_FW_NAME);
> > +MODULE_FIRMWARE(IW612_SDIOUART_FW_NAME);
> > diff --git a/drivers/net/wireless/marvell/mwifiex/sdio.h b/drivers/net/wireless/marvell/mwifiex/sdio.h
> > index 65d142286c46e..97759456314b0 100644
> > --- a/drivers/net/wireless/marvell/mwifiex/sdio.h
> > +++ b/drivers/net/wireless/marvell/mwifiex/sdio.h
> > @@ -29,6 +29,9 @@
> > #define SD8987_DEFAULT_FW_NAME "mrvl/sd8987_uapsta.bin"
> > #define SD8997_DEFAULT_FW_NAME "mrvl/sdsd8997_combo_v4.bin"
> > #define SD8997_SDIOUART_FW_NAME "mrvl/sdiouart8997_combo_v4.bin"
> > +#define IW612_DEFAULT_FW_NAME "nxp/sdsd_nw61x.bin"
> > +#define IW612_SDIOUART_FW_NAME "nxp/sd_w61x.bin"
>
> Is there a way to have BT over SDIO with iw61x? I was sure only sd-uart was
> possible.
The communication to the Bluetooth module indeed is UART only.
I think nxp/sdsd_nw61x.bin contains firmwares for both the WiFi and
Bluetooth chip. When using this you can use the Bluetooth UART directly
without uploading a separate Bluetooth firmware.
nxp/sd_w61x.bin only contains the WiFi firmware, so you have to
upload a separate Bluetooth firmware over the UART interface.
Sascha
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH do not merge 4/4] wifi: mwifiex: add iw61x support
2025-03-26 13:54 ` Sascha Hauer
@ 2025-03-27 9:33 ` Francesco Dolcini
2025-03-28 15:10 ` Sascha Hauer
0 siblings, 1 reply; 15+ messages in thread
From: Francesco Dolcini @ 2025-03-27 9:33 UTC (permalink / raw)
To: Sascha Hauer
Cc: Francesco Dolcini, Brian Norris, Ulf Hansson, linux-wireless,
linux-kernel, linux-mmc
On Wed, Mar 26, 2025 at 02:54:35PM +0100, Sascha Hauer wrote:
> On Wed, Mar 26, 2025 at 01:23:35PM +0100, Francesco Dolcini wrote:
> > On Wed, Mar 26, 2025 at 01:18:34PM +0100, Sascha Hauer wrote:
> > > This adds iw61x aka SD9177 support to the mwifiex driver. It is named
> > > SD9177 in the downstream driver, I deliberately chose the NXP name in
> > > the driver.
> > >
> > > Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> > > ---
> > > drivers/net/wireless/marvell/mwifiex/sdio.c | 79 +++++++++++++++++++++++++++++
> > > drivers/net/wireless/marvell/mwifiex/sdio.h | 3 ++
> > > include/linux/mmc/sdio_ids.h | 3 ++
> > > 3 files changed, 85 insertions(+)
> > >
> > > diff --git a/drivers/net/wireless/marvell/mwifiex/sdio.c b/drivers/net/wireless/marvell/mwifiex/sdio.c
> > > index cbcb5674b8036..7b4045a40df57 100644
> > > --- a/drivers/net/wireless/marvell/mwifiex/sdio.c
> > > +++ b/drivers/net/wireless/marvell/mwifiex/sdio.c
> >
> > ...
> >
> > > @@ -3212,3 +3289,5 @@ MODULE_FIRMWARE(SD8978_SDIOUART_FW_NAME);
> > > MODULE_FIRMWARE(SD8987_DEFAULT_FW_NAME);
> > > MODULE_FIRMWARE(SD8997_DEFAULT_FW_NAME);
> > > MODULE_FIRMWARE(SD8997_SDIOUART_FW_NAME);
> > > +MODULE_FIRMWARE(IW612_DEFAULT_FW_NAME);
> > > +MODULE_FIRMWARE(IW612_SDIOUART_FW_NAME);
> > > diff --git a/drivers/net/wireless/marvell/mwifiex/sdio.h b/drivers/net/wireless/marvell/mwifiex/sdio.h
> > > index 65d142286c46e..97759456314b0 100644
> > > --- a/drivers/net/wireless/marvell/mwifiex/sdio.h
> > > +++ b/drivers/net/wireless/marvell/mwifiex/sdio.h
> > > @@ -29,6 +29,9 @@
> > > #define SD8987_DEFAULT_FW_NAME "mrvl/sd8987_uapsta.bin"
> > > #define SD8997_DEFAULT_FW_NAME "mrvl/sdsd8997_combo_v4.bin"
> > > #define SD8997_SDIOUART_FW_NAME "mrvl/sdiouart8997_combo_v4.bin"
> > > +#define IW612_DEFAULT_FW_NAME "nxp/sdsd_nw61x.bin"
> > > +#define IW612_SDIOUART_FW_NAME "nxp/sd_w61x.bin"
> >
> > Is there a way to have BT over SDIO with iw61x? I was sure only sd-uart was
> > possible.
>
> The communication to the Bluetooth module indeed is UART only.
>
> I think nxp/sdsd_nw61x.bin contains firmwares for both the WiFi and
> Bluetooth chip. When using this you can use the Bluetooth UART directly
> without uploading a separate Bluetooth firmware.
>
> nxp/sd_w61x.bin only contains the WiFi firmware, so you have to
> upload a separate Bluetooth firmware over the UART interface.
If that the case what you did here is not correct.
The 2 firmware files here are used file depending on the BT host interface used
on the Wi-Fi/BT chip, and this is read from some strapping register. See commit
255ca28a659d ("mwifiex: Select firmware based on strapping").
BTW, this name sdsd_nw61x.bin is confusing, I would have expected this to be
something like sduart_nw61x.bin.
Francesco
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH do not merge 4/4] wifi: mwifiex: add iw61x support
2025-03-26 12:18 ` [PATCH do not merge 4/4] wifi: mwifiex: add iw61x support Sascha Hauer
2025-03-26 12:23 ` Francesco Dolcini
@ 2025-03-28 15:05 ` Ernest Van Hoecke
1 sibling, 0 replies; 15+ messages in thread
From: Ernest Van Hoecke @ 2025-03-28 15:05 UTC (permalink / raw)
To: Sascha Hauer
Cc: Brian Norris, Francesco Dolcini, Ulf Hansson, linux-wireless,
linux-kernel, linux-mmc
On Wed, Mar 26, 2025 at 01:18:34PM +0100, Sascha Hauer wrote:
> This adds iw61x aka SD9177 support to the mwifiex driver. It is named
> SD9177 in the downstream driver, I deliberately chose the NXP name in
> the driver.
Hi Sascha,
Thanks for sharing these patches. To test, I applied them to our
downstream branch based on the NXP BSP 6.6.52-2.2.0 and can confirm that
the driver works well on our iMX95-based board which uses a ublox
MAYA-W260 (IW611) for WiFi (SDIO) and BT (UART). Both STA and AP mode
looked good to me.
Kind regards,
Ernest
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH do not merge 4/4] wifi: mwifiex: add iw61x support
2025-03-27 9:33 ` Francesco Dolcini
@ 2025-03-28 15:10 ` Sascha Hauer
2025-04-29 8:25 ` Ivan T. Ivanov
0 siblings, 1 reply; 15+ messages in thread
From: Sascha Hauer @ 2025-03-28 15:10 UTC (permalink / raw)
To: Francesco Dolcini
Cc: Brian Norris, Ulf Hansson, linux-wireless, linux-kernel,
linux-mmc
On Thu, Mar 27, 2025 at 10:33:17AM +0100, Francesco Dolcini wrote:
> On Wed, Mar 26, 2025 at 02:54:35PM +0100, Sascha Hauer wrote:
> > On Wed, Mar 26, 2025 at 01:23:35PM +0100, Francesco Dolcini wrote:
> > > On Wed, Mar 26, 2025 at 01:18:34PM +0100, Sascha Hauer wrote:
> > > > This adds iw61x aka SD9177 support to the mwifiex driver. It is named
> > > > SD9177 in the downstream driver, I deliberately chose the NXP name in
> > > > the driver.
> > > >
> > > > Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> > > > ---
> > > > drivers/net/wireless/marvell/mwifiex/sdio.c | 79 +++++++++++++++++++++++++++++
> > > > drivers/net/wireless/marvell/mwifiex/sdio.h | 3 ++
> > > > include/linux/mmc/sdio_ids.h | 3 ++
> > > > 3 files changed, 85 insertions(+)
> > > >
> > > > diff --git a/drivers/net/wireless/marvell/mwifiex/sdio.c b/drivers/net/wireless/marvell/mwifiex/sdio.c
> > > > index cbcb5674b8036..7b4045a40df57 100644
> > > > --- a/drivers/net/wireless/marvell/mwifiex/sdio.c
> > > > +++ b/drivers/net/wireless/marvell/mwifiex/sdio.c
> > >
> > > ...
> > >
> > > > @@ -3212,3 +3289,5 @@ MODULE_FIRMWARE(SD8978_SDIOUART_FW_NAME);
> > > > MODULE_FIRMWARE(SD8987_DEFAULT_FW_NAME);
> > > > MODULE_FIRMWARE(SD8997_DEFAULT_FW_NAME);
> > > > MODULE_FIRMWARE(SD8997_SDIOUART_FW_NAME);
> > > > +MODULE_FIRMWARE(IW612_DEFAULT_FW_NAME);
> > > > +MODULE_FIRMWARE(IW612_SDIOUART_FW_NAME);
> > > > diff --git a/drivers/net/wireless/marvell/mwifiex/sdio.h b/drivers/net/wireless/marvell/mwifiex/sdio.h
> > > > index 65d142286c46e..97759456314b0 100644
> > > > --- a/drivers/net/wireless/marvell/mwifiex/sdio.h
> > > > +++ b/drivers/net/wireless/marvell/mwifiex/sdio.h
> > > > @@ -29,6 +29,9 @@
> > > > #define SD8987_DEFAULT_FW_NAME "mrvl/sd8987_uapsta.bin"
> > > > #define SD8997_DEFAULT_FW_NAME "mrvl/sdsd8997_combo_v4.bin"
> > > > #define SD8997_SDIOUART_FW_NAME "mrvl/sdiouart8997_combo_v4.bin"
> > > > +#define IW612_DEFAULT_FW_NAME "nxp/sdsd_nw61x.bin"
> > > > +#define IW612_SDIOUART_FW_NAME "nxp/sd_w61x.bin"
> > >
> > > Is there a way to have BT over SDIO with iw61x? I was sure only sd-uart was
> > > possible.
> >
> > The communication to the Bluetooth module indeed is UART only.
> >
> > I think nxp/sdsd_nw61x.bin contains firmwares for both the WiFi and
> > Bluetooth chip. When using this you can use the Bluetooth UART directly
> > without uploading a separate Bluetooth firmware.
> >
> > nxp/sd_w61x.bin only contains the WiFi firmware, so you have to
> > upload a separate Bluetooth firmware over the UART interface.
>
> If that the case what you did here is not correct.
>
> The 2 firmware files here are used file depending on the BT host interface used
> on the Wi-Fi/BT chip, and this is read from some strapping register. See commit
> 255ca28a659d ("mwifiex: Select firmware based on strapping").
>
> BTW, this name sdsd_nw61x.bin is confusing, I would have expected this to be
> something like sduart_nw61x.bin.
You are right, there seem to be some things mixed up. I'll have a look
into it for the next round.
Sascha
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH do not merge 0/4] wifi: mwifiex: add iw61x support
2025-03-26 12:18 [PATCH do not merge 0/4] wifi: mwifiex: add iw61x support Sascha Hauer
` (3 preceding siblings ...)
2025-03-26 12:18 ` [PATCH do not merge 4/4] wifi: mwifiex: add iw61x support Sascha Hauer
@ 2025-03-31 6:50 ` Francesco Dolcini
2025-04-29 12:59 ` Ivan T. Ivanov
4 siblings, 1 reply; 15+ messages in thread
From: Francesco Dolcini @ 2025-03-31 6:50 UTC (permalink / raw)
To: Sascha Hauer, Jeff Chen, Pete Hsieh
Cc: Brian Norris, Francesco Dolcini, Ulf Hansson, linux-wireless,
linux-kernel, linux-mmc
+Pete/Jesse @NXP
On Wed, Mar 26, 2025 at 01:18:30PM +0100, Sascha Hauer wrote:
> This series adds iw61x support to the mwifiex driver. It works for me,
> but is not yet ready to be merged. Some people showed interest in it, so
> I am sending it here.
>
> All testing and review feedback appreciated.
>
> During startup I get these messages:
>
> [ 12.078010] mwifiex_sdio mmc1:0001:1: Unknown GET_HW_SPEC TLV type: 0xff
> [ 12.078018] mwifiex_sdio mmc1:0001:1: Unknown GET_HW_SPEC TLV type: 0xff
> [ 12.078024] mwifiex_sdio mmc1:0001:1: Unknown GET_HW_SPEC TLV type: 0x23e
> [ 12.078029] mwifiex_sdio mmc1:0001:1: Unknown GET_HW_SPEC TLV type: 0x25c
>
> Not sure what these are about, I can't see these handled in the
> downstream mwifiex driver as well. Could also be there is some parsing
> error. Nevertheless the driver seems to work.
>
> The series applies to v6.14, but should apply to my mwifiex cleanup
> series as well.
>
> Sascha
>
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sharing this, so maybe you can help on having a way forward for iw61x
chip supported with mainline Linux.
Francesco
^ permalink raw reply [flat|nested] 15+ messages in thread
* RE: [EXT] [PATCH do not merge 2/4] wifi: mwifiex: handle VDLL
2025-03-26 12:18 ` [PATCH do not merge 2/4] wifi: mwifiex: handle VDLL Sascha Hauer
@ 2025-04-18 8:12 ` Jeff Chen
0 siblings, 0 replies; 15+ messages in thread
From: Jeff Chen @ 2025-04-18 8:12 UTC (permalink / raw)
To: Sascha Hauer, Brian Norris, Francesco Dolcini, Ulf Hansson
Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-mmc@vger.kernel.org
> -----Original Message-----
> From: Sascha Hauer <s.hauer@pengutronix.de>
> Sent: Wednesday, March 26, 2025 8:19 PM
> To: Brian Norris <briannorris@chromium.org>; Francesco Dolcini
> <francesco@dolcini.it>; Ulf Hansson <ulf.hansson@linaro.org>
> Cc: linux-wireless@vger.kernel.org; linux-kernel@vger.kernel.org;
> linux-mmc@vger.kernel.org; Sascha Hauer <s.hauer@pengutronix.de>
> Subject: [EXT] [PATCH do not merge 2/4] wifi: mwifiex: handle VDLL
>
> Caution: This is an external email. Please take care when clicking links or
> opening attachments. When in doubt, report the message using the 'Report
> this email' button
>
>
> Some adapters send events to the Kernel requesting VDLL images. When we
> receive such an event we have to upload parts of the firmware image to the
> device.
>
> When the firmware requests a VDLL image then we have to bypass the
> pending command queue and have to send it immediately. Failing to do so will
> cause every other command sent from the queue to timeout.
>
> There is this check currently in mwifiex_download_vdll_block():
>
> if (adapter->cmd_sent) {
> mwifiex_dbg(adapter, MSG, "%s: adapter is busy\n",
> __func__);
> return -EBUSY;
> }
>
> The downstream driver has this check as well. However, the downstream
> driver tries to defer sending the VDLL command when this happens. It sets a
> variable in the private driver struct where the main process picks it up later. I
> am not sure if this can work, because when
> adapter->cmd_sent is true then it's already too late, we already missed
> to send the VDLL image before the next command. In my tests I never saw the
> above trigger, but this surely a place to have a closer look at.
>
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> ---
> drivers/net/wireless/marvell/mwifiex/cmdevt.c | 86
> ++++++++++++++++++++++++
> drivers/net/wireless/marvell/mwifiex/fw.h | 16 +++++
> drivers/net/wireless/marvell/mwifiex/main.h | 4 ++
> drivers/net/wireless/marvell/mwifiex/sta_event.c | 4 ++
> drivers/net/wireless/marvell/mwifiex/uap_event.c | 4 ++
> 5 files changed, 114 insertions(+)
>
> diff --git a/drivers/net/wireless/marvell/mwifiex/cmdevt.c
> b/drivers/net/wireless/marvell/mwifiex/cmdevt.c
> index b30ed321c6251..916d0b804bec3 100644
> --- a/drivers/net/wireless/marvell/mwifiex/cmdevt.c
> +++ b/drivers/net/wireless/marvell/mwifiex/cmdevt.c
> @@ -1716,3 +1716,89 @@ int mwifiex_ret_wakeup_reason(struct
> mwifiex_private *priv,
>
> return 0;
> }
> +
> +static int mwifiex_download_vdll_block(struct mwifiex_adapter *adapter,
> u32 offset,
> + u16 block_len) {
> + int ret;
> + struct host_cmd_ds_gen *cmd_hdr = NULL;
> + u16 msg_len = block_len + sizeof(*cmd_hdr);
> + struct sk_buff *skb;
> + u32 fw_offset;
> +
> + block_len = min(block_len, adapter->vdll_len - offset);
> +
> + if (offset > adapter->vdll_len)
> + return -EINVAL;
> +
> + if (adapter->cmd_sent) {
> + mwifiex_dbg(adapter, MSG, "%s: adapter is busy\n",
> __func__);
> + return -EBUSY;
> + }
Shared the handling of VDLL events in the nxpwifi driver:
- When “cmd_sent” is true: The VDLL block download is deferred, with its offset and length stored for later processing.
- When no command is active (“cmd_sent” is false): The VDLL block is downloaded immediately in the nxpwifi_main_process.
int nxpwifi_process_vdll_event(struct nxpwifi_private *priv,
struct sk_buff *skb)
{
:
if (!adapter->cmd_sent) {
ret = nxpwifi_download_vdll_block(adapter,
ctrl->vdll_mem
+ offset,
block_len);
if (ret)
nxpwifi_dbg(adapter, ERROR,
"Download VDLL failed\n");
} else {
nxpwifi_dbg(adapter, EVENT,
"Delay download VDLL block\n");
ctrl->pending_block_len = block_len;
ctrl->pending_block = ctrl->vdll_mem + offset;
}
:
}
int nxpwifi_main_process(struct nxpwifi_adapter *adapter)
{
:
if (!adapter->cmd_sent &&
adapter->vdll_ctrl.pending_block) {
struct vdll_dnld_ctrl *ctrl = &adapter->vdll_ctrl;
nxpwifi_download_vdll_block(adapter, ctrl->pending_block,
ctrl->pending_block_len);
ctrl->pending_block = NULL;
}
:
}
> +
> + skb = dev_alloc_skb(msg_len + MWIFIEX_TYPE_LEN);
> + if (!skb) {
> + mwifiex_dbg(adapter, ERROR,
> + "SLEEP_CFM: dev_alloc_skb failed\n");
> + return -ENOMEM;
> + }
> +
> + skb_put(skb, msg_len);
> +
> + cmd_hdr = (void *)skb->data;
> + cmd_hdr->command = cpu_to_le16(HostCmd_CMD_VDLL);
> + cmd_hdr->seq_num = cpu_to_le16(0xFF00);
> + cmd_hdr->size = cpu_to_le16(msg_len);
> +
> + fw_offset = adapter->firmware->size - adapter->vdll_len + offset;
> + memcpy(skb->data + sizeof(*cmd_hdr), adapter->firmware->data +
> + fw_offset, block_len);
> +
> + skb_push(skb, adapter->intf_hdr_len);
> +
> + ret = adapter->if_ops.host_to_card(adapter, MWIFIEX_TYPE_VDLL,
> skb, NULL);
> + if (ret < 0)
> + mwifiex_dbg(adapter, MSG, "DNLD_VDLL: Host to Card
> + Failed\n");
> +
> + dev_kfree_skb_any(skb);
> +
> + return ret;
> +
> +}
> +
> +int mwifiex_process_vdll_event(struct mwifiex_private *priv, struct
> +sk_buff *event_skb) {
> + int status = 0;
> + struct mwifiex_vdll_ind *ind;
> + struct mwifiex_adapter *adapter = priv->adapter;
> +
> + ind = (struct mwifiex_vdll_ind *)(event_skb->data +
> + sizeof(u32));
> +
> + switch (le16_to_cpu(ind->type)) {
> + case VDLL_IND_TYPE_REQ:
> + mwifiex_download_vdll_block(adapter,
> le32_to_cpu(ind->offset),
> +
> le16_to_cpu(ind->block_len));
> + break;
> + case VDLL_IND_TYPE_OFFSET:
> + adapter->vdll_len = le32_to_cpu(ind->offset);
> + mwifiex_dbg(adapter, MSG, "VDLL_IND (OFFSET):
> offset=0x%x\n",
> + adapter->vdll_len);
> + break;
> + case VDLL_IND_TYPE_ERR_SIG:
> + mwifiex_dbg(adapter, MSG, "VDLL_IND (SIG ERR).\n");
> + break;
> + case VDLL_IND_TYPE_ERR_ID:
> + mwifiex_dbg(adapter, MSG, "VDLL_IND (ID ERR).\n");
> + break;
> + case VDLL_IND_TYPE_SEC_ERR_ID:
> + mwifiex_dbg(adapter, MSG, "VDLL_IND (SECURE ERR).\n");
> + break;
> + case VDLL_IND_TYPE_INTF_RESET:
> + mwifiex_dbg(adapter, MSG, "VDLL_IND (INTF_RESET)\n");
> + break;
> + default:
> + mwifiex_dbg(adapter, MSG, "unknown vdll ind
> type=%d\n", ind->type);
> + break;
> + }
> +
> + return status;
> +}
> diff --git a/drivers/net/wireless/marvell/mwifiex/fw.h
> b/drivers/net/wireless/marvell/mwifiex/fw.h
> index 4a96281792cc1..92541bc6d0122 100644
> --- a/drivers/net/wireless/marvell/mwifiex/fw.h
> +++ b/drivers/net/wireless/marvell/mwifiex/fw.h
> @@ -406,6 +406,7 @@ enum MWIFIEX_802_11_PRIVACY_FILTER {
> #define HostCmd_CMD_FW_DUMP_EVENT 0x0125
> #define HostCmd_CMD_SDIO_SP_RX_AGGR_CFG 0x0223
> #define HostCmd_CMD_STA_CONFIGURE 0x023f
> +#define HostCmd_CMD_VDLL 0x0240
> #define HostCmd_CMD_CHAN_REGION_CFG 0x0242
> #define HostCmd_CMD_PACKET_AGGR_CTRL 0x0251
> #define HostCmd_CMD_ADD_NEW_STATION 0x025f
> @@ -584,6 +585,7 @@ enum mwifiex_channel_flags {
> #define EVENT_FW_DUMP_INFO 0x00000073
> #define EVENT_TX_STATUS_REPORT 0x00000074
> #define EVENT_BT_COEX_WLAN_PARA_CHANGE 0X00000076
> +#define EVENT_VDLL_IND 0x00000081
>
> #define EVENT_ID_MASK 0xffff
> #define BSS_NUM_MASK 0xf
> @@ -2449,4 +2451,18 @@ struct hw_spec_max_conn {
> u8 max_sta_conn;
> } __packed;
>
> +#define VDLL_IND_TYPE_REQ 0 /* req host side download
> vdll block */
> +#define VDLL_IND_TYPE_OFFSET 1 /* notify vdll start offset in
> firmware image */
> +#define VDLL_IND_TYPE_ERR_SIG 2 /* notify vdll download error:
> signature error */
> +#define VDLL_IND_TYPE_ERR_ID 3 /* notify vdll download error:
> ID error */
> +#define VDLL_IND_TYPE_SEC_ERR_ID 4 /* notify vdll download error:
> Secure error */
> +#define VDLL_IND_TYPE_INTF_RESET 5 /* req host side interface
> reset */
> +
> +struct mwifiex_vdll_ind {
> + __le16 type;
> + __le16 vdllId;
> + __le32 offset;
> + __le16 block_len;
> +} __packed;
> +
> #endif /* !_MWIFIEX_FW_H_ */
> diff --git a/drivers/net/wireless/marvell/mwifiex/main.h
> b/drivers/net/wireless/marvell/mwifiex/main.h
> index 0674dcf7a5374..5adbf66957e14 100644
> --- a/drivers/net/wireless/marvell/mwifiex/main.h
> +++ b/drivers/net/wireless/marvell/mwifiex/main.h
> @@ -131,6 +131,7 @@ enum {
> #define MWIFIEX_TYPE_DATA 0
> #define MWIFIEX_TYPE_AGGR_DATA 10
> #define MWIFIEX_TYPE_EVENT 3
> +#define MWIFIEX_TYPE_VDLL 4
>
> #define MAX_BITMAP_RATES_SIZE 18
>
> @@ -1041,6 +1042,8 @@ struct mwifiex_adapter {
> struct delayed_work devdump_work;
>
> bool ignore_btcoex_events;
> +
> + u32 vdll_len;
> };
>
> void mwifiex_process_tx_queue(struct mwifiex_adapter *adapter); @@
> -1252,6 +1255,7 @@ int mwifiex_cmd_802_11_bg_scan_config(struct
> mwifiex_private *priv,
> struct host_cmd_ds_command
> *cmd,
> void *data_buf); int
> mwifiex_stop_bg_scan(struct mwifiex_private *priv);
> +int mwifiex_process_vdll_event(struct mwifiex_private *priv, struct
> +sk_buff *event_skb);
>
> /*
> * This function checks if the queuing is RA based or not.
> diff --git a/drivers/net/wireless/marvell/mwifiex/sta_event.c
> b/drivers/net/wireless/marvell/mwifiex/sta_event.c
> index 400348abeee54..e516f44f1804d 100644
> --- a/drivers/net/wireless/marvell/mwifiex/sta_event.c
> +++ b/drivers/net/wireless/marvell/mwifiex/sta_event.c
> @@ -1084,6 +1084,10 @@ int mwifiex_process_sta_event(struct
> mwifiex_private *priv)
> mwifiex_dbg(adapter, EVENT, "event: firmware debug
> info\n");
> mwifiex_fw_dump_info_event(priv, adapter->event_skb);
> break;
> + case EVENT_VDLL_IND:
> + mwifiex_dbg(adapter, EVENT, "event: VDLL event\n");
> + mwifiex_process_vdll_event(priv, adapter->event_skb);
> + break;
> /* Debugging event; not used, but let's not print an ERROR for it. */
> case EVENT_UNKNOWN_DEBUG:
> mwifiex_dbg(adapter, EVENT, "event: debug\n"); diff --git
> a/drivers/net/wireless/marvell/mwifiex/uap_event.c
> b/drivers/net/wireless/marvell/mwifiex/uap_event.c
> index 58ef5020a46a7..80a9c433db64a 100644
> --- a/drivers/net/wireless/marvell/mwifiex/uap_event.c
> +++ b/drivers/net/wireless/marvell/mwifiex/uap_event.c
> @@ -317,6 +317,10 @@ int mwifiex_process_uap_event(struct
> mwifiex_private *priv)
> memset(&priv->roc_cfg, 0x00, sizeof(struct
> mwifiex_roc_cfg));
> break;
>
> + case EVENT_VDLL_IND:
> + mwifiex_dbg(adapter, EVENT, "event: handle VDLL
> event...\n");
> + mwifiex_process_vdll_event(priv, adapter->event_skb);
> + break;
> default:
> mwifiex_dbg(adapter, EVENT,
> "event: unknown event id: %#x\n",
> eventcause);
>
> --
> 2.39.5
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH do not merge 4/4] wifi: mwifiex: add iw61x support
2025-03-28 15:10 ` Sascha Hauer
@ 2025-04-29 8:25 ` Ivan T. Ivanov
0 siblings, 0 replies; 15+ messages in thread
From: Ivan T. Ivanov @ 2025-04-29 8:25 UTC (permalink / raw)
To: Sascha Hauer
Cc: Francesco Dolcini, Brian Norris, Ulf Hansson, linux-wireless,
linux-kernel, linux-mmc
Hi,
Thank you for your work on this!
On 03-28 16:10, Sascha Hauer wrote:
> On Thu, Mar 27, 2025 at 10:33:17AM +0100, Francesco Dolcini wrote:
> > On Wed, Mar 26, 2025 at 02:54:35PM +0100, Sascha Hauer wrote:
> > > On Wed, Mar 26, 2025 at 01:23:35PM +0100, Francesco Dolcini wrote:
> > > > On Wed, Mar 26, 2025 at 01:18:34PM +0100, Sascha Hauer wrote:
> > > > > This adds iw61x aka SD9177 support to the mwifiex driver. It is named
> > > > > SD9177 in the downstream driver, I deliberately chose the NXP name in
> > > > > the driver.
> > > > >
> > > > > Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> > > > > ---
> > > > > drivers/net/wireless/marvell/mwifiex/sdio.c | 79 +++++++++++++++++++++++++++++
> > > > > drivers/net/wireless/marvell/mwifiex/sdio.h | 3 ++
> > > > > include/linux/mmc/sdio_ids.h | 3 ++
> > > > > 3 files changed, 85 insertions(+)
> > > > >
> > > > > diff --git a/drivers/net/wireless/marvell/mwifiex/sdio.c b/drivers/net/wireless/marvell/mwifiex/sdio.c
> > > > > index cbcb5674b8036..7b4045a40df57 100644
> > > > > --- a/drivers/net/wireless/marvell/mwifiex/sdio.c
> > > > > +++ b/drivers/net/wireless/marvell/mwifiex/sdio.c
> > > >
> > > > ...
> > > >
> > > > > @@ -3212,3 +3289,5 @@ MODULE_FIRMWARE(SD8978_SDIOUART_FW_NAME);
> > > > > MODULE_FIRMWARE(SD8987_DEFAULT_FW_NAME);
> > > > > MODULE_FIRMWARE(SD8997_DEFAULT_FW_NAME);
> > > > > MODULE_FIRMWARE(SD8997_SDIOUART_FW_NAME);
> > > > > +MODULE_FIRMWARE(IW612_DEFAULT_FW_NAME);
> > > > > +MODULE_FIRMWARE(IW612_SDIOUART_FW_NAME);
> > > > > diff --git a/drivers/net/wireless/marvell/mwifiex/sdio.h b/drivers/net/wireless/marvell/mwifiex/sdio.h
> > > > > index 65d142286c46e..97759456314b0 100644
> > > > > --- a/drivers/net/wireless/marvell/mwifiex/sdio.h
> > > > > +++ b/drivers/net/wireless/marvell/mwifiex/sdio.h
> > > > > @@ -29,6 +29,9 @@
> > > > > #define SD8987_DEFAULT_FW_NAME "mrvl/sd8987_uapsta.bin"
> > > > > #define SD8997_DEFAULT_FW_NAME "mrvl/sdsd8997_combo_v4.bin"
> > > > > #define SD8997_SDIOUART_FW_NAME "mrvl/sdiouart8997_combo_v4.bin"
> > > > > +#define IW612_DEFAULT_FW_NAME "nxp/sdsd_nw61x.bin"
> > > > > +#define IW612_SDIOUART_FW_NAME "nxp/sd_w61x.bin"
> > > >
> > > > Is there a way to have BT over SDIO with iw61x? I was sure only sd-uart was
> > > > possible.
> > >
> > > The communication to the Bluetooth module indeed is UART only.
> > >
> > > I think nxp/sdsd_nw61x.bin contains firmwares for both the WiFi and
> > > Bluetooth chip. When using this you can use the Bluetooth UART directly
> > > without uploading a separate Bluetooth firmware.
> > >
> > > nxp/sd_w61x.bin only contains the WiFi firmware, so you have to
> > > upload a separate Bluetooth firmware over the UART interface.
> >
> > If that the case what you did here is not correct.
> >
> > The 2 firmware files here are used file depending on the BT host interface used
> > on the Wi-Fi/BT chip, and this is read from some strapping register. See commit
> > 255ca28a659d ("mwifiex: Select firmware based on strapping").
> >
> > BTW, this name sdsd_nw61x.bin is confusing, I would have expected this to be
> > something like sduart_nw61x.bin.
>
> You are right, there seem to be some things mixed up. I'll have a look
> into it for the next round.
>
Looking at downstream driver looks like based on chip revision firmware
files will be different. My best finding on the firmware files naming about
this chip was this thread [1] on the NXP forums.
Regards,
Ivan
[1] https://community.nxp.com/t5/Other-NXP-Products/NXP-IW612-Kernel-Integration-amp-Firmware-Flashing-Issues/m-p/2056699#M27741
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH do not merge 0/4] wifi: mwifiex: add iw61x support
2025-03-31 6:50 ` [PATCH do not merge 0/4] " Francesco Dolcini
@ 2025-04-29 12:59 ` Ivan T. Ivanov
2025-05-05 7:32 ` Francesco Dolcini
0 siblings, 1 reply; 15+ messages in thread
From: Ivan T. Ivanov @ 2025-04-29 12:59 UTC (permalink / raw)
To: Francesco Dolcini
Cc: Sascha Hauer, Jeff Chen, Pete Hsieh, Brian Norris, Ulf Hansson,
linux-wireless, linux-kernel, linux-mmc
Hi,
On 03-31 08:50, Francesco Dolcini wrote:
> Message-ID: <20250331065026.GA12444@francesco-nb>
>
> +Pete/Jesse @NXP
>
> On Wed, Mar 26, 2025 at 01:18:30PM +0100, Sascha Hauer wrote:
> > This series adds iw61x support to the mwifiex driver. It works for me,
> > but is not yet ready to be merged. Some people showed interest in it, so
> > I am sending it here.
> >
> > All testing and review feedback appreciated.
> >
> > During startup I get these messages:
> >
> > [ 12.078010] mwifiex_sdio mmc1:0001:1: Unknown GET_HW_SPEC TLV type: 0xff
> > [ 12.078018] mwifiex_sdio mmc1:0001:1: Unknown GET_HW_SPEC TLV type: 0xff
> > [ 12.078024] mwifiex_sdio mmc1:0001:1: Unknown GET_HW_SPEC TLV type: 0x23e
In the downstream driver, branch lf-6.12.3_1.0.0, t his seems to be
MrvlIEtypes_fw_cap_info_t for things like:
FW_CAPINFO_EXT_802_11AX, FW_CAPINFO_EXT_6G ....
> > [ 12.078029] mwifiex_sdio mmc1:0001:1: Unknown GET_HW_SPEC TLV type: 0x25c
> >
This looks like MrvlIEtypes_Secure_Boot_Uuid_t. Doesn't seems too
important.
> > Not sure what these are about, I can't see these handled in the
> > downstream mwifiex driver as well. Could also be there is some parsing
> > error. Nevertheless the driver seems to work.
Yep, it is working. Thank you! I am testing this on FRDM-iMX93, which has
IW612 revision 1.0.
I have to use nxp/sd_w61x_v1.bin.se on this board and NULL firmware_sdiouart
because it seems that firmware return 1 as "strap" value, even if WiFi
is definitely connected over SDIO.
Regards,
Ivan
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH do not merge 0/4] wifi: mwifiex: add iw61x support
2025-04-29 12:59 ` Ivan T. Ivanov
@ 2025-05-05 7:32 ` Francesco Dolcini
0 siblings, 0 replies; 15+ messages in thread
From: Francesco Dolcini @ 2025-05-05 7:32 UTC (permalink / raw)
To: Ivan T. Ivanov
Cc: Francesco Dolcini, Sascha Hauer, Jeff Chen, Pete Hsieh,
Brian Norris, Ulf Hansson, linux-wireless, linux-kernel,
linux-mmc
On Tue, Apr 29, 2025 at 03:59:28PM +0300, Ivan T. Ivanov wrote:
> On 03-31 08:50, Francesco Dolcini wrote:
> > Message-ID: <20250331065026.GA12444@francesco-nb>
> > On Wed, Mar 26, 2025 at 01:18:30PM +0100, Sascha Hauer wrote:
> > > This series adds iw61x support to the mwifiex driver. It works for me,
> > > but is not yet ready to be merged. Some people showed interest in it, so
> > > I am sending it here.
...
> > > Not sure what these are about, I can't see these handled in the
> > > downstream mwifiex driver as well. Could also be there is some parsing
> > > error. Nevertheless the driver seems to work.
>
> Yep, it is working. Thank you! I am testing this on FRDM-iMX93, which has
> IW612 revision 1.0.
>
> I have to use nxp/sd_w61x_v1.bin.se on this board and NULL firmware_sdiouart
> because it seems that firmware return 1 as "strap" value, even if WiFi
> is definitely connected over SDIO.
Wi-Fi is always connected over SDIO (for IW61x), the strapping is
related to the interface used for BT. In the past it was common to have
options for having BT over SDIO or UART or USB, but for IW61x it seems
that UART is the only available option.
Francesco
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2025-05-05 7:33 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-26 12:18 [PATCH do not merge 0/4] wifi: mwifiex: add iw61x support Sascha Hauer
2025-03-26 12:18 ` [PATCH do not merge 1/4] wifi: mwifiex: release firmware at remove time Sascha Hauer
2025-03-26 12:18 ` [PATCH do not merge 2/4] wifi: mwifiex: handle VDLL Sascha Hauer
2025-04-18 8:12 ` [EXT] " Jeff Chen
2025-03-26 12:18 ` [PATCH do not merge 3/4] wifi: mwifiex: wait longer for SDIO card status Sascha Hauer
2025-03-26 12:18 ` [PATCH do not merge 4/4] wifi: mwifiex: add iw61x support Sascha Hauer
2025-03-26 12:23 ` Francesco Dolcini
2025-03-26 13:54 ` Sascha Hauer
2025-03-27 9:33 ` Francesco Dolcini
2025-03-28 15:10 ` Sascha Hauer
2025-04-29 8:25 ` Ivan T. Ivanov
2025-03-28 15:05 ` Ernest Van Hoecke
2025-03-31 6:50 ` [PATCH do not merge 0/4] " Francesco Dolcini
2025-04-29 12:59 ` Ivan T. Ivanov
2025-05-05 7:32 ` Francesco Dolcini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox