diff options
author | joe <joe@FreeBSD.org> | 2002-04-30 16:50:25 +0800 |
---|---|---|
committer | joe <joe@FreeBSD.org> | 2002-04-30 16:50:25 +0800 |
commit | 9ef19a08e0d316fb212e4f1d68e5de484ee44fa2 (patch) | |
tree | ad215d7e704a7ec93127d2d4e88a5076d1a8bf10 | |
parent | d93ca66f94b4d35b0b9635c9c68d4d75c1037670 (diff) | |
download | freebsd-ports-gnome-9ef19a08e0d316fb212e4f1d68e5de484ee44fa2.tar.gz freebsd-ports-gnome-9ef19a08e0d316fb212e4f1d68e5de484ee44fa2.tar.zst freebsd-ports-gnome-9ef19a08e0d316fb212e4f1d68e5de484ee44fa2.zip |
Allow pppoa to also compile on older FreeBSDs before the usb.h
structure change.
-rw-r--r-- | net/pppoa/files/patch-ab | 76 |
1 files changed, 51 insertions, 25 deletions
diff --git a/net/pppoa/files/patch-ab b/net/pppoa/files/patch-ab index 9089f09cefc2..5fcc777670e4 100644 --- a/net/pppoa/files/patch-ab +++ b/net/pppoa/files/patch-ab @@ -1,87 +1,113 @@ --- src/pusb-bsd.c.orig Wed Nov 7 19:45:26 2001 -+++ src/pusb-bsd.c Thu Apr 25 21:15:55 2002 -@@ -100,7 +100,7 @@ ++++ src/pusb-bsd.c Tue Apr 30 09:50:20 2002 +@@ -100,7 +100,11 @@ { struct usb_device_info di; -- di.addr = device; ++#if (__FreeBSD_version > 500000 && __FreeBSD_version < 500031) || (__FreeBSD_version < 450001) + di.addr = device; ++#else + di.udi_addr = device; ++#endif if(ioctl(cfd, USB_DEVICEINFO, &di) < 0) continue; -@@ -116,15 +116,15 @@ +@@ -116,15 +120,25 @@ } #endif -- if(di.vendorNo == vendorID && di.productNo == productID) -+ if(di.udi_vendorNo == vendorID && di.udi_productNo == productID) ++#if (__FreeBSD_version > 500000 && __FreeBSD_version < 500031) || (__FreeBSD_version < 450001) + if(di.vendorNo == vendorID && di.productNo == productID) { -- if(strncmp(di.devnames[0], "ugen", 4) != 0) + if(strncmp(di.devnames[0], "ugen", 4) != 0) ++#else ++ if(di.udi_vendorNo == vendorID && di.udi_productNo == productID) ++ { + if(strncmp(di.udi_devnames[0], "ugen", 4) != 0) ++#endif { /* Has a real driver, don't mess with it */ continue; } -- sprintf(prefix, "/dev/%s", di.devnames[0]); ++#if (__FreeBSD_version > 500000 && __FreeBSD_version < 500031) || (__FreeBSD_version < 450001) + sprintf(prefix, "/dev/%s", di.devnames[0]); ++#else + sprintf(prefix, "/dev/%s", di.udi_devnames[0]); ++#endif #if defined(__FreeBSD__) sprintf(buf, "%s", prefix); #else -@@ -199,14 +199,14 @@ +@@ -199,6 +213,7 @@ { struct usb_ctl_request req; -- req.request.bmRequestType = request_type; -- req.request.bRequest = request; -- USETW(req.request.wValue, value); -- USETW(req.request.wIndex, index); -- USETW(req.request.wLength, size); ++#if (__FreeBSD_version > 500000 && __FreeBSD_version < 500031) || (__FreeBSD_version < 450001) + req.request.bmRequestType = request_type; + req.request.bRequest = request; + USETW(req.request.wValue, value); +@@ -206,7 +221,16 @@ + USETW(req.request.wLength, size); + + req.data = buf; +- req.flags = USBD_SHORT_XFER_OK; ++#else + req.ucr_request.bmRequestType = request_type; + req.ucr_request.bRequest = request; + USETW(req.ucr_request.wValue, value); + USETW(req.ucr_request.wIndex, index); + USETW(req.ucr_request.wLength, size); - -- req.data = buf; -- req.flags = USBD_SHORT_XFER_OK; ++ + req.ucr_data = buf; + req.ucr_flags = USBD_SHORT_XFER_OK; ++#endif /* !!! If your kernel is built with DIAGNOSTIC (which it is by !!! default under some versions of NetBSD) this ioctl will fail. -@@ -227,7 +227,7 @@ +@@ -227,7 +251,11 @@ if(ioctl(dev->fd, USB_DO_REQUEST, &req) < 0) return -1; else -- return req.actlen; ++#if (__FreeBSD_version > 500000 && __FreeBSD_version < 500031) || (__FreeBSD_version < 450001) + return req.actlen; ++#else + return req.ucr_actlen; ++#endif } int pusb_set_configuration(pusb_device_t dev, int config) -@@ -249,8 +249,8 @@ +@@ -249,8 +277,13 @@ struct usb_alt_interface intf; int config; -- intf.interface_index = interface; -- intf.alt_no = alternate; ++#if (__FreeBSD_version > 500000 && __FreeBSD_version < 500031) || (__FreeBSD_version < 450001) + intf.interface_index = interface; + intf.alt_no = alternate; ++#else + intf.uai_interface_index = interface; + intf.uai_alt_no = alternate; ++#endif if(ioctl(dev->fd, USB_SET_ALTINTERFACE, &intf) < 0) { -@@ -278,12 +278,12 @@ +@@ -278,12 +311,20 @@ { struct usb_alt_interface intf; -- intf.interface_index = interface; ++#if (__FreeBSD_version > 500000 && __FreeBSD_version < 500031) || (__FreeBSD_version < 450001) + intf.interface_index = interface; ++#else + intf.uai_interface_index = interface; ++#endif if(ioctl(dev->fd, USB_GET_ALTINTERFACE, &intf) < 0) return -1; -- return intf.alt_no; ++#if (__FreeBSD_version > 500000 && __FreeBSD_version < 500031) || (__FreeBSD_version < 450001) + return intf.alt_no; ++#else + return intf.uai_alt_no; ++#endif } pusb_endpoint_t pusb_endpoint_open(pusb_device_t dev, int epnum, int flags) |