s/usbd_alloc_report_desc/usbd_read_report_desc/

This commit is contained in:
augustss 2001-10-26 17:58:21 +00:00
parent dc901ef1f3
commit 17ba384efc
4 changed files with 14 additions and 15 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: uhid.c,v 1.44 2001/09/15 16:16:28 yamt Exp $ */
/* $NetBSD: uhid.c,v 1.45 2001/10/26 17:58:21 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/uhid.c,v 1.22 1999/11/17 22:33:43 n_hibma Exp $ */
/*
@ -235,7 +235,7 @@ USB_ATTACH(uhid)
}
} else {
desc = NULL;
err = usbd_alloc_report_desc(uaa->iface, &desc, &size,M_USBDEV);
err = usbd_read_report_desc(uaa->iface, &desc, &size,M_USBDEV);
}
if (err) {
printf("%s: no report descriptor\n", USBDEVNAME(sc->sc_dev));

View File

@ -1,4 +1,4 @@
/* $NetBSD: ums.c,v 1.48 2001/10/25 13:45:16 augustss Exp $ */
/* $NetBSD: ums.c,v 1.49 2001/10/26 17:58:21 augustss Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -146,7 +146,7 @@ USB_MATCH(ums)
if (id == NULL || id->bInterfaceClass != UICLASS_HID)
return (UMATCH_NONE);
err = usbd_alloc_report_desc(uaa->iface, &desc, &size, M_TEMP);
err = usbd_read_report_desc(uaa->iface, &desc, &size, M_TEMP);
if (err)
return (UMATCH_NONE);
@ -211,7 +211,7 @@ USB_ATTACH(ums)
if (quirks & UQ_SPUR_BUT_UP)
sc->flags |= UMS_SPUR_BUT_UP;
err = usbd_alloc_report_desc(uaa->iface, &desc, &size, M_TEMP);
err = usbd_read_report_desc(uaa->iface, &desc, &size, M_TEMP);
if (err)
USB_ATTACH_ERROR_RETURN;

View File

@ -1,4 +1,4 @@
/* $NetBSD: usbdi_util.c,v 1.34 2001/07/04 16:23:40 augustss Exp $ */
/* $NetBSD: usbdi_util.c,v 1.35 2001/10/26 17:58:21 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/usbdi_util.c,v 1.14 1999/11/17 22:33:50 n_hibma Exp $ */
/*
@ -335,14 +335,14 @@ usbd_set_idle(usbd_interface_handle iface, int duration, int id)
}
usbd_status
usbd_get_report_descriptor(usbd_device_handle dev, int ifcno, int repid,
usbd_get_report_descriptor(usbd_device_handle dev, int ifcno,
int size, void *d)
{
usb_device_request_t req;
req.bmRequestType = UT_READ_INTERFACE;
req.bRequest = UR_GET_DESCRIPTOR;
USETW2(req.wValue, UDESC_REPORT, repid);
USETW2(req.wValue, UDESC_REPORT, 0); /* report id should be 0 */
USETW(req.wIndex, ifcno);
USETW(req.wLength, size);
return (usbd_do_request(dev, &req, d));
@ -379,7 +379,7 @@ usbd_get_hid_descriptor(usbd_interface_handle ifc)
}
usbd_status
usbd_alloc_report_desc(usbd_interface_handle ifc, void **descp, int *sizep,
usbd_read_report_desc(usbd_interface_handle ifc, void **descp, int *sizep,
usb_malloc_type mem)
{
usb_interface_descriptor_t *id;
@ -400,9 +400,8 @@ usbd_alloc_report_desc(usbd_interface_handle ifc, void **descp, int *sizep,
*descp = malloc(*sizep, mem, M_NOWAIT);
if (*descp == NULL)
return (USBD_NOMEM);
/* XXX should not use 0 Report ID */
err = usbd_get_report_descriptor(dev, id->bInterfaceNumber, 0,
*sizep, *descp);
err = usbd_get_report_descriptor(dev, id->bInterfaceNumber,
*sizep, *descp);
if (err) {
free(*descp, mem);
*descp = NULL;

View File

@ -1,4 +1,4 @@
/* $NetBSD: usbdi_util.h,v 1.22 2000/06/01 14:37:52 augustss Exp $ */
/* $NetBSD: usbdi_util.h,v 1.23 2001/10/26 17:58:22 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/usbdi_util.h,v 1.9 1999/11/17 22:33:50 n_hibma Exp $ */
/*
@ -56,7 +56,7 @@ usbd_status usbd_get_device_status(usbd_device_handle,usb_status_t*);
usbd_status usbd_get_hub_status(usbd_device_handle, usb_hub_status_t *);
usbd_status usbd_set_protocol(usbd_interface_handle dev, int report);
usbd_status usbd_get_report_descriptor(usbd_device_handle dev, int ifcno,
int repid, int size, void *d);
int size, void *d);
struct usb_hid_descriptor *usbd_get_hid_descriptor(usbd_interface_handle ifc);
usbd_status usbd_set_report(usbd_interface_handle iface, int type, int id,
void *data,int len);
@ -65,7 +65,7 @@ usbd_status usbd_set_report_async(usbd_interface_handle iface, int type,
usbd_status usbd_get_report(usbd_interface_handle iface, int type, int id,
void *data, int len);
usbd_status usbd_set_idle(usbd_interface_handle iface, int duration,int id);
usbd_status usbd_alloc_report_desc(usbd_interface_handle ifc, void **descp,
usbd_status usbd_read_report_desc(usbd_interface_handle ifc, void **descp,
int *sizep, usb_malloc_type mem);
usbd_status usbd_get_config(usbd_device_handle dev, u_int8_t *conf);
usbd_status usbd_get_string_desc(usbd_device_handle dev, int sindex,