From owner-svn-src-head@freebsd.org Thu Feb 27 19:35:19 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 253C624BE0F; Thu, 27 Feb 2020 19:35:19 +0000 (UTC) (envelope-from hrs@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) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48T2vB3XZ3z4NxK; Thu, 27 Feb 2020 19:35:18 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4B8281DCA8; Thu, 27 Feb 2020 19:35:18 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 01RJZImM035938; Thu, 27 Feb 2020 19:35:18 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01RJZH2N035937; Thu, 27 Feb 2020 19:35:17 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <202002271935.01RJZH2N035937@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Thu, 27 Feb 2020 19:35:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r358402 - head/sys/dev/rtwn/pci X-SVN-Group: head X-SVN-Commit-Author: hrs X-SVN-Commit-Paths: head/sys/dev/rtwn/pci X-SVN-Commit-Revision: 358402 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Feb 2020 19:35:19 -0000 Author: hrs Date: Thu Feb 27 19:35:17 2020 New Revision: 358402 URL: https://svnweb.freebsd.org/changeset/base/358402 Log: Add MODULE_PNP_INFO() to autoload the rtwn_pci(4) kernel module. Reviewed by: imp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D23807 Modified: head/sys/dev/rtwn/pci/rtwn_pci_attach.c head/sys/dev/rtwn/pci/rtwn_pci_attach.h Modified: head/sys/dev/rtwn/pci/rtwn_pci_attach.c ============================================================================== --- head/sys/dev/rtwn/pci/rtwn_pci_attach.c Thu Feb 27 19:07:10 2020 (r358401) +++ head/sys/dev/rtwn/pci/rtwn_pci_attach.c Thu Feb 27 19:35:17 2020 (r358402) @@ -96,15 +96,16 @@ static void rtwn_pci_attach_methods(struct rtwn_softc static const struct rtwn_pci_ident * rtwn_pci_probe_sub(device_t dev) { - const struct rtwn_pci_ident *ident; - int vendor_id, device_id; + int i, vendor_id, device_id; vendor_id = pci_get_vendor(dev); device_id = pci_get_device(dev); - for (ident = rtwn_pci_ident_table; ident->name != NULL; ident++) - if (vendor_id == ident->vendor && device_id == ident->device) - return (ident); + for (i = 0; i < nitems(rtwn_pci_ident_table); i++) { + if (vendor_id == rtwn_pci_ident_table[i].vendor && + device_id == rtwn_pci_ident_table[i].device) + return (&rtwn_pci_ident_table[i]); + } return (NULL); } @@ -788,6 +789,8 @@ static devclass_t rtwn_pci_devclass; DRIVER_MODULE(rtwn_pci, pci, rtwn_pci_driver, rtwn_pci_devclass, NULL, NULL); MODULE_VERSION(rtwn_pci, 1); +MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, rtwn, rtwn_pci_ident_table, + nitems(rtwn_pci_ident_table)); MODULE_DEPEND(rtwn_pci, pci, 1, 1, 1); MODULE_DEPEND(rtwn_pci, wlan, 1, 1, 1); MODULE_DEPEND(rtwn_pci, rtwn, 2, 2, 2); Modified: head/sys/dev/rtwn/pci/rtwn_pci_attach.h ============================================================================== --- head/sys/dev/rtwn/pci/rtwn_pci_attach.h Thu Feb 27 19:07:10 2020 (r358401) +++ head/sys/dev/rtwn/pci/rtwn_pci_attach.h Thu Feb 27 19:35:17 2020 (r358402) @@ -36,7 +36,6 @@ static const struct rtwn_pci_ident rtwn_pci_ident_tabl { 0x10ec, 0x8176, "Realtek RTL8188CE", RTWN_CHIP_RTL8192CE }, { 0x10ec, 0x8179, "Realtek RTL8188EE", RTWN_CHIP_RTL8188EE }, { 0x10ec, 0x8178, "Realtek RTL8192CE", RTWN_CHIP_RTL8192CE }, - { 0, 0, NULL, RTWN_CHIP_MAX_PCI } }; typedef void (*chip_pci_attach)(struct rtwn_pci_softc *);