From owner-svn-src-head@freebsd.org Tue Jul 4 01:05:21 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1E9F9F35A7; Tue, 4 Jul 2017 01:05:21 +0000 (UTC) (envelope-from markj@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 mx1.freebsd.org (Postfix) with ESMTPS id B0E003AFC; Tue, 4 Jul 2017 01:05:21 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6415Kpl008105; Tue, 4 Jul 2017 01:05:20 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6415KWo008103; Tue, 4 Jul 2017 01:05:20 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201707040105.v6415KWo008103@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 4 Jul 2017 01:05:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320635 - in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Commit-Revision: 320635 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.23 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: Tue, 04 Jul 2017 01:05:22 -0000 Author: markj Date: Tue Jul 4 01:05:20 2017 New Revision: 320635 URL: https://svnweb.freebsd.org/changeset/base/320635 Log: Add a field for the class code to struct pci_driver. Fill out some previously uninitialized fields as well. MFC after: 1 week Modified: head/sys/compat/linuxkpi/common/include/linux/pci.h head/sys/compat/linuxkpi/common/src/linux_pci.c Modified: head/sys/compat/linuxkpi/common/include/linux/pci.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/pci.h Tue Jul 4 00:48:50 2017 (r320634) +++ head/sys/compat/linuxkpi/common/include/linux/pci.h Tue Jul 4 01:05:20 2017 (r320635) @@ -56,8 +56,9 @@ struct pci_device_id { uint32_t vendor; uint32_t device; - uint32_t subvendor; + uint32_t subvendor; uint32_t subdevice; + uint32_t class; uint32_t class_mask; uintptr_t driver_data; }; @@ -202,7 +203,8 @@ struct pci_dev { uint16_t vendor; unsigned int irq; unsigned int devfn; - u8 revision; + uint32_t class; + uint8_t revision; }; static inline struct resource_list_entry * Modified: head/sys/compat/linuxkpi/common/src/linux_pci.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_pci.c Tue Jul 4 00:48:50 2017 (r320634) +++ head/sys/compat/linuxkpi/common/src/linux_pci.c Tue Jul 4 01:05:20 2017 (r320635) @@ -129,8 +129,11 @@ linux_pci_attach(device_t dev) pdev->dev.parent = &linux_root_device; pdev->dev.bsddev = dev; INIT_LIST_HEAD(&pdev->dev.irqents); + pdev->devfn = PCI_DEVFN(pci_get_slot(dev), pci_get_function(dev)); pdev->device = id->device; pdev->vendor = id->vendor; + pdev->class = pci_get_class(dev); + pdev->revision = pci_get_revid(dev); pdev->dev.dma_mask = &pdev->dma_mask; pdev->pdrv = pdrv; kobject_init(&pdev->dev.kobj, &linux_dev_ktype);