From nobody Thu Oct 17 17:38:43 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XTw6q3Ly5z5ZGJ2; Thu, 17 Oct 2024 17:38:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XTw6q2qz1z4FC2; Thu, 17 Oct 2024 17:38:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729186723; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=l4DWjONk8OAMwnj/SUz5FV1kJ40gkqSkUx2i81tM+/E=; b=ul77mfumk3wRiQoYlc3LN7a5Xm0Ljqma4KHMdY9wvBv00Kn5x8/+ABqS179hVqWsUfW0Z1 JOdj8/Z6jKfqn3cBOI17lKD8dfs5688UJRGIat5+GmHSWEZ/I+vT7Z1MStIYBegMROAVty szs4YCfr8YyoRoUDvgjNJfrZ4UCaCdE7S6iXjw8D0q8HvAFCa/etYNP4kwTz1y+mDgliA2 d588u0GVDY+U7/G9/oV8dWsBriFslJm7v41qDekpyhcrKLwkzoxovWpt7Imf/FWHOVqj5c FDd2ojviP+ge7AZpU0duZ6zOjzAMhyUfV/EmjBQuWQ54bzF5p8l0sH8dGiguBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729186723; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=l4DWjONk8OAMwnj/SUz5FV1kJ40gkqSkUx2i81tM+/E=; b=IRHdyf5Ex0UCRFNqH28Fcx3R+fGIs93Lrr0hGef82fcpfJ924rjCTgkqjIDHxrY8C2Qf6S 5mBJFpdJSwCHPaAWwgcrailEltgHbdLXO6rHT6DTK+24XUgfzpOdHwANpV+h2FsqJJ3aMS QJOTlnHcaDELOAPDnkdNw9PXHMgk3spetyCL60BZich8zRTSCPHGdUkLv/eW3VXHNXK/YC im9XM1iSn/uctvKd1MDY8Qf11Yl0o4rtqv71UfOinGkACsbjzy46IWP/A9cHZIARDZpQo9 ynOj4P+n2EaXU7OTdYuSS4LfsbhnAStaBIVcQGplHvsFR+La2gFnnLLnB+1yIw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1729186723; a=rsa-sha256; cv=none; b=sSlXGXj9QQAXtW8DvXfg+LgM7jYTpMIpjiDyVBHNH7zEHyIqKTNp3MwG2Sq/bP+7/zu7H9 XsMnoWqr4Nx8xX4pmcS6NrWmmUiBFB37B7g7K/qshF6DgEo3znQF2mtK7QQHV+OUEp0t+E PcZbPBMURS7rKqpDT/D+kjQOWod50BEZT5ZORCPXD3tV5gRfx2Hzrp9Sc90Uc72Bufv69Z /m2nHzqID7TG6mj3vpAMMzGUT0SeXejLWrcgHp+mBtds38BoJXbqPUvFVpEkOweyi1bKAV welG+ZTT4+R/tIWLXheUGZS6R9l99TprrjeoSCUgUW+RDnlcg4n9Gr/FAyfPyA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XTw6q2QrbzycW; Thu, 17 Oct 2024 17:38:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49HHchQ2035353; Thu, 17 Oct 2024 17:38:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49HHchuS035350; Thu, 17 Oct 2024 17:38:43 GMT (envelope-from git) Date: Thu, 17 Oct 2024 17:38:43 GMT Message-Id: <202410171738.49HHchuS035350@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: b4c8f251d65f - main - iwlwifi: FreeBSD specific sysctl export update List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b4c8f251d65fa99601da000e586933a6df662839 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=b4c8f251d65fa99601da000e586933a6df662839 commit b4c8f251d65fa99601da000e586933a6df662839 Author: Bjoern A. Zeeb AuthorDate: 2024-05-16 21:48:41 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-10-17 17:26:24 +0000 iwlwifi: FreeBSD specific sysctl export update Update the sysctl export (also adding a mapping function) to also print (1) for all lines the "flavor" (device_family) name and (2) also print lines where we only have the trans cfg and not iwl cfg as with the flavor we can match PCI IDs to firmware package and so we can have an increased number of matches. A side effect is that we can also have fwget(8) PCI ID matches for firmware (flavors) not yet (publicly) existing. That will allow us to add them at a later point while a previous release already supports the chipsets and knows how to get the firmware for them. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/contrib/dev/iwlwifi/iwl-config.h | 36 ++++++++++++++++++++++++++++++++++++ sys/contrib/dev/iwlwifi/pcie/drv.c | 22 ++++++++++++++++------ 2 files changed, 52 insertions(+), 6 deletions(-) diff --git a/sys/contrib/dev/iwlwifi/iwl-config.h b/sys/contrib/dev/iwlwifi/iwl-config.h index 241a9e3f2a1a..4ea322595925 100644 --- a/sys/contrib/dev/iwlwifi/iwl-config.h +++ b/sys/contrib/dev/iwlwifi/iwl-config.h @@ -38,6 +38,42 @@ enum iwl_device_family { IWL_DEVICE_FAMILY_SC, }; +#if defined(__FreeBSD__) +static const char *iwl_device_family_str[] = { + [IWL_DEVICE_FAMILY_UNDEFINED] = "undefined", + [IWL_DEVICE_FAMILY_1000] = "1000", + [IWL_DEVICE_FAMILY_100] = "100", + [IWL_DEVICE_FAMILY_2000] = "2000", + [IWL_DEVICE_FAMILY_2030] = "2030", + [IWL_DEVICE_FAMILY_105] = "105", + [IWL_DEVICE_FAMILY_135] = "135", + [IWL_DEVICE_FAMILY_5000] = "5000", + [IWL_DEVICE_FAMILY_5150] = "5150", + [IWL_DEVICE_FAMILY_6000] = "6000", + [IWL_DEVICE_FAMILY_6000i] = "6000i", + [IWL_DEVICE_FAMILY_6005] = "6005", + [IWL_DEVICE_FAMILY_6030] = "6030", + [IWL_DEVICE_FAMILY_6050] = "6050", + [IWL_DEVICE_FAMILY_6150] = "6150", + [IWL_DEVICE_FAMILY_7000] = "7000", + [IWL_DEVICE_FAMILY_8000] = "8000", + [IWL_DEVICE_FAMILY_9000] = "9000", + [IWL_DEVICE_FAMILY_22000] = "22000", + [IWL_DEVICE_FAMILY_AX210] = "AX210", + [IWL_DEVICE_FAMILY_BZ] = "BZ", + [IWL_DEVICE_FAMILY_SC] = "SC", +}; + +static inline const char * +iwl_device_family_name(enum iwl_device_family devive_family) +{ + if (devive_family < 0 || + devive_family >= ARRAY_SIZE(iwl_device_family_str)) + return "unknown"; + return (iwl_device_family_str[devive_family]); +} +#endif + /* * LED mode * IWL_LED_DEFAULT: use device default diff --git a/sys/contrib/dev/iwlwifi/pcie/drv.c b/sys/contrib/dev/iwlwifi/pcie/drv.c index 0aab7a1fdc8e..8780d77b704b 100644 --- a/sys/contrib/dev/iwlwifi/pcie/drv.c +++ b/sys/contrib/dev/iwlwifi/pcie/drv.c @@ -1628,18 +1628,27 @@ sysctl_iwlwifi_pci_ids_name(SYSCTL_HANDLER_ARGS) if ((id->driver_data & TRANS_CFG_MARKER) != 0) { /* Skip and print them below. */ + struct iwl_cfg_trans_params *trans; + + trans = (void *)(id->driver_data & ~TRANS_CFG_MARKER); + sbuf_printf(sb, "%#06x/%#06x/%#06x/%#06x\t%s\t%s\t%d\t%s\n", + id->vendor, id->device, id->subvendor, id->subdevice, + "", "", trans->device_family, + iwl_device_family_name(trans->device_family)); } else if (id->driver_data != 0) { const struct iwl_cfg *cfg; cfg = (void *)(id->driver_data & ~TRANS_CFG_MARKER); - sbuf_printf(sb, "%#06x/%#06x/%#06x/%#06x\t%s\t%s\n", + sbuf_printf(sb, "%#06x/%#06x/%#06x/%#06x\t%s\t%s\t%d\t%s\n", id->vendor, id->device, id->subvendor, id->subdevice, - cfg->name, cfg->fw_name_pre); + cfg->name, cfg->fw_name_pre, cfg->trans.device_family, + iwl_device_family_name(cfg->trans.device_family)); } else { - sbuf_printf(sb, "%#06x/%#06x/%#06x/%#06x\t%s\t%s\n", + sbuf_printf(sb, "%#06x/%#06x/%#06x/%#06x\t%s\t%s\t%d\t%s\n", id->vendor, id->device, id->subvendor, id->subdevice, - "",""); + "","", IWL_DEVICE_FAMILY_UNDEFINED, + iwl_device_family_name(IWL_DEVICE_FAMILY_UNDEFINED)); } id++; } @@ -1655,9 +1664,10 @@ sysctl_iwlwifi_pci_ids_name(SYSCTL_HANDLER_ARGS) else name = ""; - sbuf_printf(sb, "%#06x/%#06x/%#06x/%#06x\t%s\t%s\n", + sbuf_printf(sb, "%#06x/%#06x/%#06x/%#06x\t%s\t%s\t%d\t%s\n", PCI_VENDOR_ID_INTEL, dev_info->device, PCI_ANY_ID, dev_info->subdevice, - name, dev_info->cfg->fw_name_pre); + name, dev_info->cfg->fw_name_pre, dev_info->cfg->trans.device_family, + iwl_device_family_name(dev_info->cfg->trans.device_family)); } error = sbuf_finish(sb);