Add a length paarmeter to usbd_do_request_flags().

This commit is contained in:
augustss 1999-01-03 01:00:56 +00:00
parent b5a5a3842f
commit bf1154922d
4 changed files with 17 additions and 12 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: usb.c,v 1.9 1998/12/29 03:13:10 augustss Exp $ */
/* $NetBSD: usb.c,v 1.10 1999/01/03 01:00:56 augustss Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -369,7 +369,8 @@ usbioctl(dev, cmd, data, flag, p)
}
}
r = usbd_do_request_flags(sc->sc_bus->devices[addr],
&ur->request, ptr, ur->flags);
&ur->request, ptr,
ur->flags, &ur->actlen);
if (r) {
error = EIO;
goto ret;

View File

@ -1,4 +1,4 @@
/* $NetBSD: usbdi.c,v 1.18 1998/12/29 14:29:53 augustss Exp $ */
/* $NetBSD: usbdi.c,v 1.19 1999/01/03 01:00:56 augustss Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -1035,15 +1035,16 @@ usbd_do_request(dev, req, data)
usb_device_request_t *req;
void *data;
{
return (usbd_do_request_flags(dev, req, data, 0));
return (usbd_do_request_flags(dev, req, data, 0, 0));
}
usbd_status
usbd_do_request_flags(dev, req, data, flags)
usbd_do_request_flags(dev, req, data, flags, actlen)
usbd_device_handle dev;
usb_device_request_t *req;
void *data;
u_int16_t flags;
int *actlen;
{
usbd_request_handle reqh;
usbd_status r;
@ -1074,6 +1075,8 @@ usbd_do_request_flags(dev, req, data, flags)
UGETW(reqh->request.wLength),
reqh->length, reqh->actlen);
#endif
if (actlen)
*actlen = reqh->actlen;
if (r == USBD_STALLED) {
/*
* The control endpoint has stalled. Control endpoints

View File

@ -1,4 +1,4 @@
/* $NetBSD: usbdi.h,v 1.14 1999/01/01 15:25:57 augustss Exp $ */
/* $NetBSD: usbdi.h,v 1.15 1999/01/03 01:00:56 augustss Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -219,7 +219,7 @@ usbd_status usbd_do_request_async
__P((usbd_device_handle pipe, usb_device_request_t *req, void *data));
usbd_status usbd_do_request_flags
__P((usbd_device_handle pipe, usb_device_request_t *req,
void *data, u_int16_t flags));
void *data, u_int16_t flags, int *));
usb_interface_descriptor_t *usbd_get_interface_descriptor
__P((usbd_interface_handle iface));
usb_config_descriptor_t *usbd_get_config_descriptor

View File

@ -1,4 +1,4 @@
/* $NetBSD: usbdi_util.c,v 1.10 1999/01/01 15:25:57 augustss Exp $ */
/* $NetBSD: usbdi_util.c,v 1.11 1999/01/03 01:00:56 augustss Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -478,22 +478,23 @@ usbd_bulk_transfer(reqh, pipe, flags, buf, size, lbl)
usbd_private_handle priv;
void *buffer;
usbd_status r;
int s;
int s, error;
r = usbd_setup_request(reqh, pipe, 0, buf, *size,
flags, USBD_NO_TIMEOUT, usbd_bulk_transfer_cb);
if (r != USBD_NORMAL_COMPLETION)
return (r);
DPRINTFN(1, ("usbd_bulk_transfer: transfer %d bytes\n", *size));
s = splusb();
s = splusb(); /* don't want callback until tsleep() */
r = usbd_transfer(reqh);
if (r != USBD_IN_PROGRESS) {
splx(s);
return (r);
}
if (tsleep((caddr_t)reqh, PZERO | PCATCH, lbl, 0)) {
error = tsleep((caddr_t)reqh, PZERO | PCATCH, lbl, 0);
splx(s);
if (error) {
usbd_abort_pipe(pipe);
splx(s);
return (USBD_INTERRUPTED);
}
usbd_get_request_status(reqh, &priv, &buffer, size, &r);