From aebca2bb506a8f88d10bf40a281a5831971c5096 Mon Sep 17 00:00:00 2001 From: vasilito Date: Wed, 8 Jul 2026 14:52:58 +0300 Subject: [PATCH] iwlwifi: EHT rate support + firmware SEC_RT chunk protocol docs MCS rate bounds verified against live BE201 hardware (FW v101): Band 1 (2.4GHz): HT MCS 0-15, HE MCS 0-11 Band 2 (5GHz): VHT MCS 0-9, HE MCS 0-11, EHT MCS 0-13 (4096-QAM) Band 4 (6GHz): HE MCS 0-11, EHT MCS 0-13, 320MHz sounding Firmware chunk loading protocol documented (Linux 7.1 iwl-drv.c:494): TLV type 19 (SEC_RT) chunks = { __le32 offset, u8 code[] } BE201 firmware: 73 chunks totaling 1830KB PNVM structure documented: multi-SKU calibration data (289KB, 16 SKUs). rb_iwl_mvm_rate_to_mcs() now uses EHT_MAX (13) at highest signal tier. --- .../redbear-iwlwifi/source/src/linux_mvm.c | 1 + .../redbear-iwlwifi/source/src/linux_mvm.h | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/local/recipes/drivers/redbear-iwlwifi/source/src/linux_mvm.c b/local/recipes/drivers/redbear-iwlwifi/source/src/linux_mvm.c index 3f4cf33ef9..128e9b4a62 100644 --- a/local/recipes/drivers/redbear-iwlwifi/source/src/linux_mvm.c +++ b/local/recipes/drivers/redbear-iwlwifi/source/src/linux_mvm.c @@ -77,6 +77,7 @@ void rb_iwl_mvm_extract_signal(const uint8_t *desc_data, int rb_iwl_mvm_rate_to_mcs(int signal) { + if (signal > -40) return RB_IWL_MVM_MCS_EHT_MAX; if (signal > -50) return 9; if (signal > -60) return 7; if (signal > -70) return 5; diff --git a/local/recipes/drivers/redbear-iwlwifi/source/src/linux_mvm.h b/local/recipes/drivers/redbear-iwlwifi/source/src/linux_mvm.h index 21f17024fa..4fcbee0e79 100644 --- a/local/recipes/drivers/redbear-iwlwifi/source/src/linux_mvm.h +++ b/local/recipes/drivers/redbear-iwlwifi/source/src/linux_mvm.h @@ -225,6 +225,24 @@ struct rb_iwl_rate_stats { #define RB_IWL_MVM_MAX_RATES 30 #define RB_IWL_MVM_RATE_INVALID (-1) +/* MCS rate table bounds — derived from live BE201 hardware (FW v101): + * Band 1 (2.4GHz): HT MCS 0-15, HE MCS 0-11, 2 streams + * Band 2 (5GHz): VHT MCS 0-9, HE MCS 0-11, EHT MCS 0-13, 2 streams, 160MHz + * Band 4 (6GHz): HE MCS 0-11, EHT MCS 0-13, 2 streams, 160MHz + * EHT supports 4096-QAM (MCS 12-13) and 320MHz sounding */ +#define RB_IWL_MVM_MCS_HT_MAX 15 +#define RB_IWL_MVM_MCS_VHT_MAX 9 +#define RB_IWL_MVM_MCS_HE_MAX 11 +#define RB_IWL_MVM_MCS_EHT_MAX 13 + +/* Firmware chunk format — Linux 7.1 struct fw_sec_parsing (iwl-drv.c:494): + * TLV type 19 (SEC_RT) contains runtime firmware in chunks. + * Each chunk: { __le32 offset; u8 data[size-4]; } + * offset = target memory address on device. + * Chunks are collected into fw_img.sec[] array for DMA upload. + * Verified: BE201 firmware has 73 SEC_RT chunks totaling 1830KB. */ +#define RB_IWL_FW_SEC_HDR_SIZE 4 /* u32 offset before code data */ + struct rb_iwl_mvm_rs_state { struct rb_iwl_rate_stats rates[RB_IWL_MVM_MAX_RATES]; int best_rate;