diff --git a/VersionNum b/VersionNum index c031f2125f89d8a6fa3cf0d05be6d341f027ab8c..6a54a7f920867422492790d5cebcd835c307768e 100644 --- a/VersionNum +++ b/VersionNum @@ -1,23 +1,23 @@ -/* (0.26) +/* (0.27) * * This file is automatically maintained by srccommit, do not edit manually. * Last processed by srccommit version: 1.68. * */ -#define Module_MajorVersion_CMHG 0.26 +#define Module_MajorVersion_CMHG 0.27 #define Module_MinorVersion_CMHG -#define Module_Date_CMHG 30 Jun 2004 +#define Module_Date_CMHG 01 Jul 2004 -#define Module_MajorVersion "0.26" -#define Module_Version 26 +#define Module_MajorVersion "0.27" +#define Module_Version 27 #define Module_MinorVersion "" -#define Module_Date "30 Jun 2004" +#define Module_Date "01 Jul 2004" -#define Module_ApplicationDate "30-Jun-04" +#define Module_ApplicationDate "01-Jul-04" #define Module_ComponentName "NetBSD" #define Module_ComponentPath "RiscOS/Sources/HWSupport/USB/NetBSD" -#define Module_FullVersion "0.26" -#define Module_HelpVersion "0.26 (30 Jun 2004)" -#define Module_LibraryVersionInfo "0:26" +#define Module_FullVersion "0.27" +#define Module_HelpVersion "0.27 (01 Jul 2004)" +#define Module_LibraryVersionInfo "0:27" diff --git a/build/c/usbmodule b/build/c/usbmodule index c9b08021575a9e37ad77e7512220c8532f1d47f5..596bb2ed452e3ed1894caafbc78a59cd75ae83f0 100644 --- a/build/c/usbmodule +++ b/build/c/usbmodule @@ -167,7 +167,7 @@ _kernel_oserror* uerror (char* e) void riscos_failed_device (void* p) { //#ifdef STANDALONE -#ifndef RHENIUM +#ifndef RHENIUM _kernel_oserror* e; (void) p; e = uerror (E_BadDevice); @@ -1086,7 +1086,7 @@ struct device* attach_hub (struct device* parent, void* aux) softc->dv_cfdata = (void*) 1; // hub (*uhub_uhub_ca.ca_attach) (parent, softc, aux); - + dprintf (("", "Matched hub\n")); return softc; @@ -1191,7 +1191,7 @@ char* service_call (usbd_device_handle dev, int unit, int link) serv->dev.ifcs = idescs; for (epn = 0, iface = 0; iface < nifs; ++iface) - { + { int ifcepn = dev->ifaces[iface].idesc->bNumEndpoints; dprintf(("", "iface %d, num endpoints = %d, at %p\n", iface, ifcepn, idescs[iface])); memcpy (idescs[iface], dev->ifaces[iface].idesc, @@ -1463,9 +1463,13 @@ struct device* attach_device (struct device* parent, struct usb_attach_arg* aux, if (e != NULL) { dprintf (("", "failed to register: %s\n", e->errmess)); +#if 0 free (dev); free (softc); return NULL; +#else + softc->sc_devfs = 0; +#endif } dprintf (("", "registered driver %p\n", softc->sc_devfs)); @@ -1495,7 +1499,8 @@ int detach_device (struct device* dev, int d) #endif - _swix (DeviceFS_Deregister, _IN(0), udev->sc_devfs); + if (udev->sc_devfs) + _swix (DeviceFS_Deregister, _IN(0), udev->sc_devfs); dprintf (("", "deregistered driver %p\n", udev->sc_devfs)); free (udev); return 0; @@ -2117,8 +2122,7 @@ static void read_cb(usbd_xfer_handle xfer, usbd_private_handle priv, { struct devstream* str = priv; - if ( (status != USBD_NORMAL_COMPLETION) - &&(status != USBD_SHORT_XFER_DONE)) + if ( (status != USBD_NORMAL_COMPLETION)) { dprintf (("", "Bad completion code: %d (%s) %d bytes read\n", status, ccodes[status], xfer->actlen)); @@ -2135,14 +2139,14 @@ static void read_cb(usbd_xfer_handle xfer, usbd_private_handle priv, this is not a interrupt endpoint (the BSD framework restarts repeating transfers) */ /* if we've got a number of bytes including a part packet, then - transfer must have ended.. else.. try more */ + transfer must have ended.. else.. try more */ // if (!(xfer->actlen/UGETW(xfer->pipe->endpoint->edesc->wMaxPacketSize)) && // str->count != str->totalcount) - if(status == USBD_SHORT_XFER_DONE) + if(xfer->actlen < xfer->length) { char zero[ UGETW(xfer->pipe->endpoint->edesc->wMaxPacketSize)]; memset (zero, 0, sizeof zero); - // fill up the rest of the request with garbage! + // fill up the rest of the request with garbage! _kernel_swi_regs r; r.r[0] = BM_InsertBlock; r.r[1] = (int) str->buffer_id; diff --git a/dev/usb/c/usbdi b/dev/usb/c/usbdi index d761df959421fb3877a285e2b0328cdc9107c60c..0ec910685260679e121330c929ae37c43389fd2e 100644 --- a/dev/usb/c/usbdi +++ b/dev/usb/c/usbdi @@ -866,16 +866,13 @@ usb_transfer_complete(usbd_xfer_handle xfer) [pipe->endpoint->edesc->bmAttributes & UE_XFERTYPE]; xfer->done = 1; - if (!xfer->status && xfer->actlen < xfer->length) - { - if (!(xfer->flags & USBD_SHORT_XFER_OK)) { + if (!xfer->status && xfer->actlen < xfer->length + && !(xfer->flags & USBD_SHORT_XFER_OK)) + { DPRINTFN(-1,("usbd_transfer_cb: short transfer %d<%d\n", xfer->actlen, xfer->length)); xfer->status = USBD_SHORT_XFER; } - else - xfer->status = USBD_SHORT_XFER_DONE; - } if (xfer->callback) xfer->callback(xfer, xfer->priv, xfer->status); diff --git a/dev/usb/h/usbdi b/dev/usb/h/usbdi index 260a7bae9380327b85bb7f73b8e5d93497ced63b..09d579d99fe954b08b10a9ee2503c75f22fc84d9 100644 --- a/dev/usb/h/usbdi +++ b/dev/usb/h/usbdi @@ -66,7 +66,6 @@ typedef enum { /* keep in sync with usbd_status_msgs */ USBD_SHORT_XFER, /* 16 */ USBD_STALLED, /* 17 */ USBD_INTERRUPTED, /* 18 */ - USBD_SHORT_XFER_DONE, /* 19 */ USBD_ERROR_MAX /* must be last */ } usbd_status;