git: 0dbec9979143 - main - emulators/parallels-tools: Remove devclass from DRIVER_MODULE on recent main.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 22 Aug 2022 18:15:24 UTC
The branch main has been updated by jhb (doc, src committer):
URL: https://cgit.FreeBSD.org/ports/commit/?id=0dbec99791436fa18f29b490d73d0e442a585a95
commit 0dbec99791436fa18f29b490d73d0e442a585a95
Author: John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2022-08-22 18:12:58 +0000
Commit: John Baldwin <jhb@FreeBSD.org>
CommitDate: 2022-08-22 18:12:58 +0000
emulators/parallels-tools: Remove devclass from DRIVER_MODULE on recent main.
While here, quiet some set bet unused warnings by removing two unused
variables and correcting the check for bus_setup_intr failing.
Differential Revision: https://reviews.freebsd.org/D35944
---
.../parallels-tools/files/patch-pvmnet-if_pvmnet.c | 42 ++++++++++++++++++++--
1 file changed, 39 insertions(+), 3 deletions(-)
diff --git a/emulators/parallels-tools/files/patch-pvmnet-if_pvmnet.c b/emulators/parallels-tools/files/patch-pvmnet-if_pvmnet.c
index bd79032b44b2..d7e100bf4dea 100644
--- a/emulators/parallels-tools/files/patch-pvmnet-if_pvmnet.c
+++ b/emulators/parallels-tools/files/patch-pvmnet-if_pvmnet.c
@@ -1,6 +1,31 @@
--- pvmnet/if_pvmnet.c.orig 2014-02-14 14:09:06 UTC
+++ pvmnet/if_pvmnet.c
-@@ -364,12 +364,20 @@ pvmnetintr(void *arg)
+@@ -245,20 +245,21 @@ static driver_t pvmnet_driver = {
+ sizeof(struct pvmnet_softc)
+ };
+
++#if __FreeBSD_version >= 1400058
++DRIVER_MODULE(pvmnet, pci, pvmnet_driver, 0, 0);
++#else
+ static devclass_t pvmnet_devclass;
+
+ DRIVER_MODULE(pvmnet, pci, pvmnet_driver, pvmnet_devclass, 0, 0);
++#endif
+
+ static int
+ pvmnet_probe(device_t dev)
+ {
+ uint16_t devid, vendor;
+- uint16_t revid, sdevid;
+
+ vendor = pci_get_vendor(dev);
+ devid = pci_get_device(dev);
+- revid = pci_get_revid(dev);
+- sdevid = pci_get_subdevice(dev);
+
+ if (vendor != 0x10ec || devid != 0x8029)
+ return (ENXIO);
+@@ -364,12 +365,20 @@ pvmnetintr(void *arg)
for (offset = io_get_rcv_offset(sc);
(size = io_get_packet_size(sc, offset)); offset += FULL_PACKET_SIZE(size)) {
if (size > ETHER_MAX_LEN) {
@@ -21,7 +46,7 @@
continue;
}
m->m_pkthdr.rcvif = ifp;
-@@ -379,7 +387,11 @@ pvmnetintr(void *arg)
+@@ -379,7 +388,11 @@ pvmnetintr(void *arg)
m->m_pkthdr.len = m->m_len = size;
io_read_data(sc, offset, m);
@@ -33,7 +58,18 @@
PVMNET_UNLOCK(sc);
(*ifp->if_input)(ifp, m);
-@@ -538,7 +550,11 @@ pvmnet_start_locked(struct ifnet *ifp)
+@@ -427,8 +440,8 @@ static int pvmnet_alloc_resources(device_t dev)
+
+ error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET | INTR_MPSAFE,
+ NULL, pvmnetintr, sc, &sc->irq_handle);
+- if (!res)
+- return ENXIO;
++ if (error)
++ return error;
+ return (0);
+ }
+
+@@ -538,7 +551,11 @@ pvmnet_start_locked(struct ifnet *ifp)
io_notify_sndbuf_full(sc);
break;
}