Commit a5e474f7 authored by Kevin Bracey's avatar Kevin Bracey
Browse files

More John fixes.

Version 0.27. Tagged as 'NetBSD-0_27'
parent e7c1e36d
/* (0.26) /* (0.27)
* *
* This file is automatically maintained by srccommit, do not edit manually. * This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.68. * 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_MinorVersion_CMHG
#define Module_Date_CMHG 30 Jun 2004 #define Module_Date_CMHG 01 Jul 2004
#define Module_MajorVersion "0.26" #define Module_MajorVersion "0.27"
#define Module_Version 26 #define Module_Version 27
#define Module_MinorVersion "" #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_ComponentName "NetBSD"
#define Module_ComponentPath "RiscOS/Sources/HWSupport/USB/NetBSD" #define Module_ComponentPath "RiscOS/Sources/HWSupport/USB/NetBSD"
#define Module_FullVersion "0.26" #define Module_FullVersion "0.27"
#define Module_HelpVersion "0.26 (30 Jun 2004)" #define Module_HelpVersion "0.27 (01 Jul 2004)"
#define Module_LibraryVersionInfo "0:26" #define Module_LibraryVersionInfo "0:27"
...@@ -167,7 +167,7 @@ _kernel_oserror* uerror (char* e) ...@@ -167,7 +167,7 @@ _kernel_oserror* uerror (char* e)
void riscos_failed_device (void* p) void riscos_failed_device (void* p)
{ {
//#ifdef STANDALONE //#ifdef STANDALONE
#ifndef RHENIUM #ifndef RHENIUM
_kernel_oserror* e; _kernel_oserror* e;
(void) p; (void) p;
e = uerror (E_BadDevice); e = uerror (E_BadDevice);
...@@ -1086,7 +1086,7 @@ struct device* attach_hub (struct device* parent, void* aux) ...@@ -1086,7 +1086,7 @@ struct device* attach_hub (struct device* parent, void* aux)
softc->dv_cfdata = (void*) 1; // hub softc->dv_cfdata = (void*) 1; // hub
(*uhub_uhub_ca.ca_attach) (parent, softc, aux); (*uhub_uhub_ca.ca_attach) (parent, softc, aux);
dprintf (("", "Matched hub\n")); dprintf (("", "Matched hub\n"));
return softc; return softc;
...@@ -1191,7 +1191,7 @@ char* service_call (usbd_device_handle dev, int unit, int link) ...@@ -1191,7 +1191,7 @@ char* service_call (usbd_device_handle dev, int unit, int link)
serv->dev.ifcs = idescs; serv->dev.ifcs = idescs;
for (epn = 0, iface = 0; iface < nifs; ++iface) for (epn = 0, iface = 0; iface < nifs; ++iface)
{ {
int ifcepn = dev->ifaces[iface].idesc->bNumEndpoints; int ifcepn = dev->ifaces[iface].idesc->bNumEndpoints;
dprintf(("", "iface %d, num endpoints = %d, at %p\n", iface, ifcepn, idescs[iface])); dprintf(("", "iface %d, num endpoints = %d, at %p\n", iface, ifcepn, idescs[iface]));
memcpy (idescs[iface], dev->ifaces[iface].idesc, memcpy (idescs[iface], dev->ifaces[iface].idesc,
...@@ -1463,9 +1463,13 @@ struct device* attach_device (struct device* parent, struct usb_attach_arg* aux, ...@@ -1463,9 +1463,13 @@ struct device* attach_device (struct device* parent, struct usb_attach_arg* aux,
if (e != NULL) if (e != NULL)
{ {
dprintf (("", "failed to register: %s\n", e->errmess)); dprintf (("", "failed to register: %s\n", e->errmess));
#if 0
free (dev); free (dev);
free (softc); free (softc);
return NULL; return NULL;
#else
softc->sc_devfs = 0;
#endif
} }
dprintf (("", "registered driver %p\n", softc->sc_devfs)); dprintf (("", "registered driver %p\n", softc->sc_devfs));
...@@ -1495,7 +1499,8 @@ int detach_device (struct device* dev, int d) ...@@ -1495,7 +1499,8 @@ int detach_device (struct device* dev, int d)
#endif #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)); dprintf (("", "deregistered driver %p\n", udev->sc_devfs));
free (udev); free (udev);
return 0; return 0;
...@@ -2117,8 +2122,7 @@ static void read_cb(usbd_xfer_handle xfer, usbd_private_handle priv, ...@@ -2117,8 +2122,7 @@ static void read_cb(usbd_xfer_handle xfer, usbd_private_handle priv,
{ {
struct devstream* str = priv; struct devstream* str = priv;
if ( (status != USBD_NORMAL_COMPLETION) if ( (status != USBD_NORMAL_COMPLETION))
&&(status != USBD_SHORT_XFER_DONE))
{ {
dprintf (("", "Bad completion code: %d (%s) %d bytes read\n", dprintf (("", "Bad completion code: %d (%s) %d bytes read\n",
status, ccodes[status], xfer->actlen)); status, ccodes[status], xfer->actlen));
...@@ -2135,14 +2139,14 @@ static void read_cb(usbd_xfer_handle xfer, usbd_private_handle priv, ...@@ -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 this is not a interrupt endpoint (the BSD framework restarts
repeating transfers) */ repeating transfers) */
/* if we've got a number of bytes including a part packet, then /* 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)) && // if (!(xfer->actlen/UGETW(xfer->pipe->endpoint->edesc->wMaxPacketSize)) &&
// str->count != str->totalcount) // str->count != str->totalcount)
if(status == USBD_SHORT_XFER_DONE) if(xfer->actlen < xfer->length)
{ {
char zero[ UGETW(xfer->pipe->endpoint->edesc->wMaxPacketSize)]; char zero[ UGETW(xfer->pipe->endpoint->edesc->wMaxPacketSize)];
memset (zero, 0, sizeof zero); 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; _kernel_swi_regs r;
r.r[0] = BM_InsertBlock; r.r[0] = BM_InsertBlock;
r.r[1] = (int) str->buffer_id; r.r[1] = (int) str->buffer_id;
......
...@@ -866,16 +866,13 @@ usb_transfer_complete(usbd_xfer_handle xfer) ...@@ -866,16 +866,13 @@ usb_transfer_complete(usbd_xfer_handle xfer)
[pipe->endpoint->edesc->bmAttributes & UE_XFERTYPE]; [pipe->endpoint->edesc->bmAttributes & UE_XFERTYPE];
xfer->done = 1; xfer->done = 1;
if (!xfer->status && xfer->actlen < xfer->length) if (!xfer->status && xfer->actlen < xfer->length
{ && !(xfer->flags & USBD_SHORT_XFER_OK))
if (!(xfer->flags & USBD_SHORT_XFER_OK)) { {
DPRINTFN(-1,("usbd_transfer_cb: short transfer %d<%d\n", DPRINTFN(-1,("usbd_transfer_cb: short transfer %d<%d\n",
xfer->actlen, xfer->length)); xfer->actlen, xfer->length));
xfer->status = USBD_SHORT_XFER; xfer->status = USBD_SHORT_XFER;
} }
else
xfer->status = USBD_SHORT_XFER_DONE;
}
if (xfer->callback) if (xfer->callback)
xfer->callback(xfer, xfer->priv, xfer->status); xfer->callback(xfer, xfer->priv, xfer->status);
......
...@@ -66,7 +66,6 @@ typedef enum { /* keep in sync with usbd_status_msgs */ ...@@ -66,7 +66,6 @@ typedef enum { /* keep in sync with usbd_status_msgs */
USBD_SHORT_XFER, /* 16 */ USBD_SHORT_XFER, /* 16 */
USBD_STALLED, /* 17 */ USBD_STALLED, /* 17 */
USBD_INTERRUPTED, /* 18 */ USBD_INTERRUPTED, /* 18 */
USBD_SHORT_XFER_DONE, /* 19 */
USBD_ERROR_MAX /* must be last */ USBD_ERROR_MAX /* must be last */
} usbd_status; } usbd_status;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment