From f060166e743b9093907e07f6b79f3239a53009f2 Mon Sep 17 00:00:00 2001 From: stsp Date: Mon, 6 Mar 2023 10:16:16 +0000 Subject: [PATCH] recognize more iwx ucode TLV sections which are present in newer fw images --- sys/dev/pci/if_iwx.c | 14 +++++++++++++- sys/dev/pci/if_iwxreg.h | 7 ++++++- sys/dev/pci/if_iwxvar.h | 4 ++-- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/sys/dev/pci/if_iwx.c b/sys/dev/pci/if_iwx.c index a91a0d85b38..858367f1613 100644 --- a/sys/dev/pci/if_iwx.c +++ b/sys/dev/pci/if_iwx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_iwx.c,v 1.153 2023/02/19 12:23:27 stsp Exp $ */ +/* $OpenBSD: if_iwx.c,v 1.154 2023/03/06 10:16:16 stsp Exp $ */ /* * Copyright (c) 2014, 2016 genua gmbh @@ -1537,6 +1537,7 @@ iwx_read_firmware(struct iwx_softc *sc) case IWX_UCODE_TLV_FW_FSEQ_VERSION: case IWX_UCODE_TLV_PHY_INTEGRATION_VERSION: case IWX_UCODE_TLV_FW_NUM_STATIONS: + case IWX_UCODE_TLV_FW_NUM_BEACONS: break; /* undocumented TLVs found in iwx-cc-a0-46 image */ @@ -1556,12 +1557,23 @@ iwx_read_firmware(struct iwx_softc *sc) case IWX_UCODE_TLV_TYPE_REGIONS: case IWX_UCODE_TLV_TYPE_TRIGGERS: case IWX_UCODE_TLV_TYPE_CONF_SET: + case IWX_UCODE_TLV_SEC_TABLE_ADDR: + case IWX_UCODE_TLV_D3_KEK_KCK_ADDR: + case IWX_UCODE_TLV_CURRENT_PC: break; /* undocumented TLV found in iwx-cc-a0-67 image */ case 0x100000b: break; + /* undocumented TLV found in iwx-ty-a0-gf-a0-73 image */ + case 0x101: + break; + + /* undocumented TLV found in iwx-ty-a0-gf-a0-77 image */ + case 0x100000c: + break; + default: err = EINVAL; goto parse_out; diff --git a/sys/dev/pci/if_iwxreg.h b/sys/dev/pci/if_iwxreg.h index 3b9cbde8fc5..681d2945bd1 100644 --- a/sys/dev/pci/if_iwxreg.h +++ b/sys/dev/pci/if_iwxreg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_iwxreg.h,v 1.41 2023/02/14 12:14:07 stsp Exp $ */ +/* $OpenBSD: if_iwxreg.h,v 1.42 2023/03/06 10:16:16 stsp Exp $ */ /*- * Based on BSD-licensed source modules in the Linux iwlwifi driver, @@ -1574,8 +1574,13 @@ struct iwx_ucode_header { #define IWX_UCODE_TLV_PNVM_VERSION 62 #define IWX_UCODE_TLV_PNVM_SKU 64 +#define IWX_UCODE_TLV_SEC_TABLE_ADDR 66 +#define IWX_UCODE_TLV_D3_KEK_KCK_ADDR 67 +#define IWX_UCODE_TLV_CURRENT_PC 68 + #define IWX_UCODE_TLV_CONST_BASE 0x100 #define IWX_UCODE_TLV_FW_NUM_STATIONS (IWX_UCODE_TLV_CONST_BASE + 0) +#define IWX_UCODE_TLV_FW_NUM_BEACONS (IWX_UCODE_TLV_CONST_BASE + 2) #define IWX_UCODE_TLV_DEBUG_BASE 0x1000005 #define IWX_UCODE_TLV_TYPE_DEBUG_INFO (IWX_UCODE_TLV_DEBUG_BASE + 0) diff --git a/sys/dev/pci/if_iwxvar.h b/sys/dev/pci/if_iwxvar.h index 6468bfec46e..13dc72e83b0 100644 --- a/sys/dev/pci/if_iwxvar.h +++ b/sys/dev/pci/if_iwxvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_iwxvar.h,v 1.37 2022/05/14 05:48:44 stsp Exp $ */ +/* $OpenBSD: if_iwxvar.h,v 1.38 2023/03/06 10:16:17 stsp Exp $ */ /* * Copyright (c) 2014 genua mbh @@ -123,7 +123,7 @@ struct iwx_tx_radiotap_header { (1 << IEEE80211_RADIOTAP_RATE) | \ (1 << IEEE80211_RADIOTAP_CHANNEL)) -#define IWX_UCODE_SECT_MAX 54 +#define IWX_UCODE_SECT_MAX 57 /* * fw_status is used to determine if we've already parsed the firmware file -- 2.20.1