MFNetBSD: uhid.c (1.45), ums.c (1.49), usbdi_util.c (1.35), usbdi_util.h (1.23)

date: 2001/10/26 17:58:21;  author: augustss;
    s/usbd_alloc_report_desc/usbd_read_report_desc/
This commit is contained in:
Josef Karthauser 2002-04-07 17:13:00 +00:00
parent 41c6cb53dd
commit 8c8cd21069
4 changed files with 15 additions and 16 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$ */
/*
@ -248,7 +248,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) {

View File

@ -179,7 +179,7 @@ USB_MATCH(ums)
if (!id || 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);
@ -237,7 +237,7 @@ USB_ATTACH(ums)
USB_ATTACH_ERROR_RETURN;
}
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.33 2000/06/01 15:51:27 augustss Exp $ */
/* $NetBSD: usbdi_util.c,v 1.35 2001/10/26 17:58:21 augustss Exp $ */
/* $FreeBSD$ */
/*
@ -320,14 +320,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));
@ -361,8 +361,8 @@ usbd_get_hid_descriptor(usbd_interface_handle ifc)
}
usbd_status
usbd_alloc_report_desc(usbd_interface_handle ifc, void **descp, int *sizep,
usb_malloc_type mem)
usbd_read_report_desc(usbd_interface_handle ifc, void **descp, int *sizep,
usb_malloc_type mem)
{
usb_interface_descriptor_t *id;
usb_hid_descriptor_t *hid;
@ -380,9 +380,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$ */
/*
@ -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,8 +65,8 @@ 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,
int *sizep, usb_malloc_type mem);
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,
int langid, usb_string_descriptor_t *sdesc);