From owner-svn-src-all@freebsd.org Fri Dec 9 13:47:51 2016 Return-Path: Delivered-To: svn-src-all@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 D1103C6E8E7; Fri, 9 Dec 2016 13:47:51 +0000 (UTC) (envelope-from hselasky@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 916FCC66; Fri, 9 Dec 2016 13:47:51 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB9DloaJ083432; Fri, 9 Dec 2016 13:47:50 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB9DloCF083429; Fri, 9 Dec 2016 13:47:50 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201612091347.uB9DloCF083429@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 9 Dec 2016 13:47:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309732 - in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Dec 2016 13:47:51 -0000 Author: hselasky Date: Fri Dec 9 13:47:50 2016 New Revision: 309732 URL: https://svnweb.freebsd.org/changeset/base/309732 Log: Prefix some _pci_xxx() functions in the Linux KPI with linux_ and make sure the IRQ number used by these functions is unsigned. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/compat/linuxkpi/common/include/linux/interrupt.h 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/interrupt.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/interrupt.h Fri Dec 9 13:41:26 2016 (r309731) +++ head/sys/compat/linuxkpi/common/include/linux/interrupt.h Fri Dec 9 13:47:50 2016 (r309732) @@ -50,11 +50,11 @@ struct irq_ent { void *arg; irqreturn_t (*handler)(int, void *); void *tag; - int irq; + unsigned int irq; }; static inline int -linux_irq_rid(struct device *dev, int irq) +linux_irq_rid(struct device *dev, unsigned int irq) { if (irq == dev->irq) return (0); @@ -64,7 +64,7 @@ linux_irq_rid(struct device *dev, int ir extern void linux_irq_handler(void *); static inline struct irq_ent * -linux_irq_ent(struct device *dev, int irq) +linux_irq_ent(struct device *dev, unsigned int irq) { struct irq_ent *irqe; @@ -85,7 +85,7 @@ request_irq(unsigned int irq, irq_handle int error; int rid; - dev = _pci_find_irq_dev(irq); + dev = linux_pci_find_irq_dev(irq); if (dev == NULL) return -ENXIO; rid = linux_irq_rid(dev, irq); @@ -117,7 +117,7 @@ bind_irq_to_cpu(unsigned int irq, int cp struct irq_ent *irqe; struct device *dev; - dev = _pci_find_irq_dev(irq); + dev = linux_pci_find_irq_dev(irq); if (dev == NULL) return (-ENOENT); @@ -135,7 +135,7 @@ free_irq(unsigned int irq, void *device) struct device *dev; int rid; - dev = _pci_find_irq_dev(irq); + dev = linux_pci_find_irq_dev(irq); if (dev == NULL) return; rid = linux_irq_rid(dev, irq); Modified: head/sys/compat/linuxkpi/common/include/linux/pci.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/pci.h Fri Dec 9 13:41:26 2016 (r309731) +++ head/sys/compat/linuxkpi/common/include/linux/pci.h Fri Dec 9 13:47:50 2016 (r309732) @@ -171,7 +171,7 @@ struct pci_dev { }; static inline struct resource_list_entry * -_pci_get_rle(struct pci_dev *pdev, int type, int rid) +linux_pci_get_rle(struct pci_dev *pdev, int type, int rid) { struct pci_devinfo *dinfo; struct resource_list *rl; @@ -182,18 +182,18 @@ _pci_get_rle(struct pci_dev *pdev, int t } static inline struct resource_list_entry * -_pci_get_bar(struct pci_dev *pdev, int bar) +linux_pci_get_bar(struct pci_dev *pdev, int bar) { struct resource_list_entry *rle; bar = PCIR_BAR(bar); - if ((rle = _pci_get_rle(pdev, SYS_RES_MEMORY, bar)) == NULL) - rle = _pci_get_rle(pdev, SYS_RES_IOPORT, bar); + if ((rle = linux_pci_get_rle(pdev, SYS_RES_MEMORY, bar)) == NULL) + rle = linux_pci_get_rle(pdev, SYS_RES_IOPORT, bar); return (rle); } static inline struct device * -_pci_find_irq_dev(unsigned int irq) +linux_pci_find_irq_dev(unsigned int irq) { struct pci_dev *pdev; @@ -215,7 +215,7 @@ pci_resource_start(struct pci_dev *pdev, { struct resource_list_entry *rle; - if ((rle = _pci_get_bar(pdev, bar)) == NULL) + if ((rle = linux_pci_get_bar(pdev, bar)) == NULL) return (0); return rle->start; } @@ -225,7 +225,7 @@ pci_resource_len(struct pci_dev *pdev, i { struct resource_list_entry *rle; - if ((rle = _pci_get_bar(pdev, bar)) == NULL) + if ((rle = linux_pci_get_bar(pdev, bar)) == NULL) return (0); return rle->count; } @@ -331,7 +331,7 @@ pci_release_region(struct pci_dev *pdev, { struct resource_list_entry *rle; - if ((rle = _pci_get_bar(pdev, bar)) == NULL) + if ((rle = linux_pci_get_bar(pdev, bar)) == NULL) return; bus_release_resource(pdev->dev.bsddev, rle->type, rle->rid, rle->res); } @@ -477,7 +477,7 @@ pci_enable_msix(struct pci_dev *pdev, st pci_release_msi(pdev->dev.bsddev); return avail; } - rle = _pci_get_rle(pdev, SYS_RES_IRQ, 1); + rle = linux_pci_get_rle(pdev, SYS_RES_IRQ, 1); pdev->dev.msix = rle->start; pdev->dev.msix_max = rle->start + avail; for (i = 0; i < nreq; i++) Modified: head/sys/compat/linuxkpi/common/src/linux_pci.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_pci.c Fri Dec 9 13:41:26 2016 (r309731) +++ head/sys/compat/linuxkpi/common/src/linux_pci.c Fri Dec 9 13:47:50 2016 (r309732) @@ -140,8 +140,8 @@ linux_pci_attach(device_t dev) kobject_set_name(&pdev->dev.kobj, device_get_nameunit(dev)); kobject_add(&pdev->dev.kobj, &linux_root_device.kobj, kobject_name(&pdev->dev.kobj)); - rle = _pci_get_rle(pdev, SYS_RES_IRQ, 0); - if (rle) + rle = linux_pci_get_rle(pdev, SYS_RES_IRQ, 0); + if (rle != NULL) pdev->dev.irq = rle->start; else pdev->dev.irq = 255;