From nobody Fri Jul 4 03:22:38 2025 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 4bYJq23kKsz60VJT; Fri, 04 Jul 2025 03:22:38 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bYJq21c3wz3VTh; Fri, 04 Jul 2025 03:22:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751599358; 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=DSJCBwwwYLejCOtP4qbW0BxrZqpqVMwQqfdigg+j1l0=; b=udGp52pe1U5zrV2loAgix7g9AhfVLlNTBXDYcFrYfYQ5i4Lcnihh5Emoo38/MqUeiMhVYu Q1y72qGBSHl40je0Now4xF1wI0yedrn8RU04Fbhgx9kk/6hJyhfoPjV3mlLMXfTpfAcGt/ 3IfZf50sgSgzxD74msooXWX+faFX8b2vV+nDTMl5qZGEhY2rvcln3B6JhzQMZwr8Sxm3O2 59csQxJ6yqq4cZfhbmtk/X1C4esRQ7i7EtWPwOTnOZgjMM8UuZT7i2sXyS7Yh86JRqnsdh U2ldjHvfP7l25lf+qBO+xC4CJvPlwmBB+mTqEJ50+czWDI5ngtIpeT14/JVbCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751599358; 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=DSJCBwwwYLejCOtP4qbW0BxrZqpqVMwQqfdigg+j1l0=; b=fYoCH+M3zl4+INmSgX8pImK1bAWB4NxPAjfHuil6XHHPIGYyhhOeZ/6ZIlAtQ+rodu278l vRtRlHHvBWi/U2pXny4rUGlyZp6Akyx6J4bBELKB9xNLLgSJES0p5MlUYT8xQVgW6MG2mx Cy5M4H6rFGhGlEKNUxSj6fsHWJjoQo12Fjg1HiTFtd1QWpbWN25BpsbFI7OsBP+2dHZQu5 m8L4RVPP4u3vPLW8cuVmeyfI2XwtRhlo9FDGL/Va4ZH15e2zyPM5xqjcsTTMNBpOJ+x+bl +N9LOS6UKY63XRnBerdvj639dvDPQ2Fx9cy8I1RaXQKN+LSPeFMwWUcYIf2dlQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751599358; a=rsa-sha256; cv=none; b=b4P0OPgp61Is3bg1jS5Nv/AK/JS7akQScopHYjK2IwO/voqfiKWuNU1Wo8fCRkW6ShzjKU djfjvptnUZ8J0W3IX5WnSsL/ZyxDVURk6GxfOxz1BAGpEO3AOFE4QIDkxVog9czlbJrCQw dX1Nz4mp5CSjbfjkHfLfQi+ol6KCeenEEWWWIy1Kp0a2+yfQmfRP6JkyoczX8Vtf/0Rofa YpD/XxhYq6lzA6PZVYd0xdfRWtGIsG/c0wEdRucHsOwJercN1WQ6AhYEZLwfojyrjAvg5w ReHn87S0NNU5AQXSzS0HESXqIRKE2jZCAVozk4Jan3V3u37i/BTosUf3WcH/xA== 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 4bYJq21224zYst; Fri, 04 Jul 2025 03:22:38 +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 5643McaO079585; Fri, 4 Jul 2025 03:22:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5643Mccq079582; Fri, 4 Jul 2025 03:22:38 GMT (envelope-from git) Date: Fri, 4 Jul 2025 03:22:38 GMT Message-Id: <202507040322.5643Mccq079582@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: 2f5666c1727c - main - LinuxKPI: MODULE_DEVICE_TABLE() factor out the bus specific MODULE_PNP_INFO() 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: 2f5666c1727c949491f73e6c3277b7b542131714 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=2f5666c1727c949491f73e6c3277b7b542131714 commit 2f5666c1727c949491f73e6c3277b7b542131714 Author: Bjoern A. Zeeb AuthorDate: 2025-06-22 22:50:33 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-07-04 03:22:22 +0000 LinuxKPI: MODULE_DEVICE_TABLE() factor out the bus specific MODULE_PNP_INFO() In order to be able to use MODULE_DEVICE_TABLE() with multiple bus attachments, factor out the bus-specfic MODULE_PNP_INFO() and place it next to the structure defining the table. As it turns out bnxt(4) has been using the MODULE_DEVICE_TABLE() with PCI attachments for the "auxillary" bus so far. That makes little sense. Define the MODULE_PNP_INFO() to nothing for that. We may consider pulling these LinucKPI bits in semi-native drivers into LinuxKPI one day as that route is not really sustainabke. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: imp, dumbbell Differential Revision: https://reviews.freebsd.org/D51049 --- sys/compat/linuxkpi/common/include/linux/pci.h | 7 +++++-- sys/dev/bnxt/bnxt_en/bnxt_auxbus_compat.h | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/pci.h b/sys/compat/linuxkpi/common/include/linux/pci.h index f8a0b2d84d41..af19829f1cbb 100644 --- a/sys/compat/linuxkpi/common/include/linux/pci.h +++ b/sys/compat/linuxkpi/common/include/linux/pci.h @@ -72,6 +72,10 @@ struct pci_device_id { uintptr_t driver_data; }; +#define MODULE_DEVICE_TABLE_BUS_pci(_bus, _table) \ +MODULE_PNP_INFO("U32:vendor;U32:device;V32:subvendor;V32:subdevice", \ + _bus, lkpi_ ## _table, _table, nitems(_table) - 1) + /* Linux has an empty element at the end of the ID table -> nitems() - 1. */ #define MODULE_DEVICE_TABLE(_bus, _table) \ \ @@ -88,8 +92,7 @@ static driver_t _ ## _bus ## _ ## _table ## _driver = { \ DRIVER_MODULE(lkpi_ ## _table, _bus, _ ## _bus ## _ ## _table ## _driver,\ 0, 0); \ \ -MODULE_PNP_INFO("U32:vendor;U32:device;V32:subvendor;V32:subdevice", \ - _bus, lkpi_ ## _table, _table, nitems(_table) - 1) +MODULE_DEVICE_TABLE_BUS_ ## _bus(_bus, _table) #define PCI_ANY_ID -1U diff --git a/sys/dev/bnxt/bnxt_en/bnxt_auxbus_compat.h b/sys/dev/bnxt/bnxt_en/bnxt_auxbus_compat.h index 1d844a67c928..c4c9e789cf3e 100644 --- a/sys/dev/bnxt/bnxt_en/bnxt_auxbus_compat.h +++ b/sys/dev/bnxt/bnxt_en/bnxt_auxbus_compat.h @@ -39,6 +39,7 @@ struct auxiliary_device_id { char name[AUXILIARY_NAME_SIZE]; uint64_t driver_data; }; +#define MODULE_DEVICE_TABLE_BUS_auxiliary(_bus, _table) struct auxiliary_device { struct device dev;