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

More John fixes.

Version 0.27. Tagged as 'NetBSD-0_27'
/* (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"
......@@ -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;
......
......@@ -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);
......
......@@ -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;
......
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