From nobody Sun Jul 13 19:31:09 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 4bgFtR1cQWz61N0n; Sun, 13 Jul 2025 19:31:11 +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 4bgFtP5y1Rz3k1b; Sun, 13 Jul 2025 19:31:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752435069; 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=rEaiX0gvhP87QlnOutCWP23EviEnXBJDG6xtMaeYm5E=; b=kpzFepIA0mVqvjp6Ifxc/Nw0ovDWQfNmTvzTFAoXYJk46rdlcDXzq+bqog+tcspom+hQc8 GgKiPllwoFG874F4TsuRLh/LIsWx+fb8jzk0+Sj+FAZDlRWBFUzB0iqNOIsQm7RGqilAAd R4rB12zH9cArt6RNfwwnO5SM3X+tLQ3gc/HiPh33XSB6GssDwjLnyVxWKUt4jqjPYH0YFD Y9CoPyBRC6444rjS7qMX1Pm1+cLNV0BJvCaa1J9QRJb3QBt1XH9xDng7DMCKxsls4ENTQl JXNEYTOVHRAmR7cspn6ZF5BuRsVKer8hJ3LcU52RpIly46hQ9MP7VOicHPaimQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752435069; 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=rEaiX0gvhP87QlnOutCWP23EviEnXBJDG6xtMaeYm5E=; b=EzyoQNMS28C66yAKKiyeFvpXcUZemcuHTE/G0CCi5Id0c3gpEE8EfiUtFW/lALOn9C45k+ TAkwBFhEp7ZBtvE0o4jBugkxxPo6Gk8e355XfJZ+U5FN3oPoedwvyWuXyogQIxeH0AR6wc k4II2+/HSYYm6JqqxvVpcU0EF6wTyblfxL0jwpa/8MUMETNlgZKGPTQRr4sc1ZZwj+Y7TS w+KRJ/FL6val/f5NKZlZD7vYP/AeF0ZvD5tQhWMrASBR2FBj0w5MphOxrFRPMnmh6nyXtp 6853eVvylSQKQtm3ar52qO67gO6z5n0pgRqOmn6vh4SKM8mFSsSsfVSP4s4l2g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752435069; a=rsa-sha256; cv=none; b=jWRg8MFZXahIxH9cA9GLSX2hwfvhystIujlrBo9tQeh+P+DwCZA7OPbNm4r964MU0bk3bH DKTgOs7nHoVthiadI7rk98A+NvnXx0VIzELr7SmcfFjkTbDXP1WKTvdMcSmV+Et2xPg2/3 YPukDG6HlLIJqTgoA5P3mUkTXIgyr1iXzeafotZsQOqqC4CqqSWTQNkMCvpZ98i8tdsrfd x1MbayLnudAoZ7SXLF87jhPcVIxo709fNiuAVAYIbwC+o4+q1Y9KQkR8vk5N68BzaAO3Ht 10j83YkoXJ39Ei2itmswn59j9WLc6m7iZ2BJinALBVoKXZr8FWaGCy///sHC8w== 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 4bgFtP5GNzz6S4; Sun, 13 Jul 2025 19:31:09 +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 56DJV9T0070789; Sun, 13 Jul 2025 19:31:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56DJV9iI070786; Sun, 13 Jul 2025 19:31:09 GMT (envelope-from git) Date: Sun, 13 Jul 2025 19:31:09 GMT Message-Id: <202507131931.56DJV9iI070786@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 87e6f90667e5 - stable/14 - 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 87e6f90667e5a841592d8a2522f90981fd3e3fff Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=87e6f90667e5a841592d8a2522f90981fd3e3fff commit 87e6f90667e5a841592d8a2522f90981fd3e3fff Author: Bjoern A. Zeeb AuthorDate: 2025-06-22 22:50:33 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-07-13 19:25:03 +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 Reviewed by: imp, dumbbell Differential Revision: https://reviews.freebsd.org/D51049 (cherry picked from commit 2f5666c1727c949491f73e6c3277b7b542131714) --- 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 15fedb87e6e6..9d0725089269 100644 --- a/sys/compat/linuxkpi/common/include/linux/pci.h +++ b/sys/compat/linuxkpi/common/include/linux/pci.h @@ -70,6 +70,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) \ \ @@ -86,8 +90,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;