summaryrefslogtreecommitdiff
path: root/sys/dev/usb/ugen.c
diff options
context:
space:
mode:
authorNathan Binkert <nate@cvs.openbsd.org>2002-05-02 20:08:05 +0000
committerNathan Binkert <nate@cvs.openbsd.org>2002-05-02 20:08:05 +0000
commit587cdcf5ce16c5aed5152f0f3d18dd160f0b0298 (patch)
treef979ced1393dcf5359606845c182ae8bae6dc547 /sys/dev/usb/ugen.c
parentb1dc8814f8402c854f3054f917ec6a6afa3a8a42 (diff)
prefix structure members to avoid name clashes.
From NetBSD
Diffstat (limited to 'sys/dev/usb/ugen.c')
-rw-r--r--sys/dev/usb/ugen.c84
1 files changed, 42 insertions, 42 deletions
diff --git a/sys/dev/usb/ugen.c b/sys/dev/usb/ugen.c
index 0d5b04d8195..8052edd6834 100644
--- a/sys/dev/usb/ugen.c
+++ b/sys/dev/usb/ugen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ugen.c,v 1.17 2001/10/31 04:24:44 nate Exp $ */
+/* $OpenBSD: ugen.c,v 1.18 2002/05/02 20:08:04 nate Exp $ */
/* $NetBSD: ugen.c,v 1.49 2001/10/24 22:31:04 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/ugen.c,v 1.26 1999/11/17 22:33:41 n_hibma Exp $ */
@@ -1064,37 +1064,37 @@ ugen_do_ioctl(struct ugen_softc *sc, int endpt, u_long cmd,
case USB_GET_ALTINTERFACE:
ai = (struct usb_alt_interface *)addr;
err = usbd_device2interface_handle(sc->sc_udev,
- ai->interface_index, &iface);
+ ai->uai_interface_index, &iface);
if (err)
return (EINVAL);
idesc = usbd_get_interface_descriptor(iface);
if (idesc == NULL)
return (EIO);
- ai->alt_no = idesc->bAlternateSetting;
+ ai->uai_alt_no = idesc->bAlternateSetting;
break;
case USB_SET_ALTINTERFACE:
if (!(flag & FWRITE))
return (EPERM);
ai = (struct usb_alt_interface *)addr;
err = usbd_device2interface_handle(sc->sc_udev,
- ai->interface_index, &iface);
+ ai->uai_interface_index, &iface);
if (err)
return (EINVAL);
- err = ugen_set_interface(sc, ai->interface_index, ai->alt_no);
+ err = ugen_set_interface(sc, ai->uai_interface_index, ai->uai_alt_no);
if (err)
return (EINVAL);
break;
case USB_GET_NO_ALT:
ai = (struct usb_alt_interface *)addr;
- cdesc = ugen_get_cdesc(sc, ai->config_index, 0);
+ cdesc = ugen_get_cdesc(sc, ai->uai_config_index, 0);
if (cdesc == NULL)
return (EINVAL);
- idesc = usbd_find_idesc(cdesc, ai->interface_index, 0);
+ idesc = usbd_find_idesc(cdesc, ai->uai_interface_index, 0);
if (idesc == NULL) {
free(cdesc, M_TEMP);
return (EINVAL);
}
- ai->alt_no = usbd_get_no_alts(cdesc, idesc->bInterfaceNumber);
+ ai->uai_alt_no = usbd_get_no_alts(cdesc, idesc->bInterfaceNumber);
free(cdesc, M_TEMP);
break;
case USB_GET_DEVICE_DESC:
@@ -1103,47 +1103,47 @@ ugen_do_ioctl(struct ugen_softc *sc, int endpt, u_long cmd,
break;
case USB_GET_CONFIG_DESC:
cd = (struct usb_config_desc *)addr;
- cdesc = ugen_get_cdesc(sc, cd->config_index, 0);
+ cdesc = ugen_get_cdesc(sc, cd->ucd_config_index, 0);
if (cdesc == NULL)
return (EINVAL);
- cd->desc = *cdesc;
+ cd->ucd_desc = *cdesc;
free(cdesc, M_TEMP);
break;
case USB_GET_INTERFACE_DESC:
id = (struct usb_interface_desc *)addr;
- cdesc = ugen_get_cdesc(sc, id->config_index, 0);
+ cdesc = ugen_get_cdesc(sc, id->uid_config_index, 0);
if (cdesc == NULL)
return (EINVAL);
- if (id->config_index == USB_CURRENT_CONFIG_INDEX &&
- id->alt_index == USB_CURRENT_ALT_INDEX)
- alt = ugen_get_alt_index(sc, id->interface_index);
+ if (id->uid_config_index == USB_CURRENT_CONFIG_INDEX &&
+ id->uid_alt_index == USB_CURRENT_ALT_INDEX)
+ alt = ugen_get_alt_index(sc, id->uid_interface_index);
else
- alt = id->alt_index;
- idesc = usbd_find_idesc(cdesc, id->interface_index, alt);
+ alt = id->uid_alt_index;
+ idesc = usbd_find_idesc(cdesc, id->uid_interface_index, alt);
if (idesc == NULL) {
free(cdesc, M_TEMP);
return (EINVAL);
}
- id->desc = *idesc;
+ id->uid_desc = *idesc;
free(cdesc, M_TEMP);
break;
case USB_GET_ENDPOINT_DESC:
ed = (struct usb_endpoint_desc *)addr;
- cdesc = ugen_get_cdesc(sc, ed->config_index, 0);
+ cdesc = ugen_get_cdesc(sc, ed->ued_config_index, 0);
if (cdesc == NULL)
return (EINVAL);
- if (ed->config_index == USB_CURRENT_CONFIG_INDEX &&
- ed->alt_index == USB_CURRENT_ALT_INDEX)
- alt = ugen_get_alt_index(sc, ed->interface_index);
+ if (ed->ued_config_index == USB_CURRENT_CONFIG_INDEX &&
+ ed->ued_alt_index == USB_CURRENT_ALT_INDEX)
+ alt = ugen_get_alt_index(sc, ed->ued_interface_index);
else
- alt = ed->alt_index;
- edesc = usbd_find_edesc(cdesc, ed->interface_index,
- alt, ed->endpoint_index);
+ alt = ed->ued_alt_index;
+ edesc = usbd_find_edesc(cdesc, ed->ued_interface_index,
+ alt, ed->ued_endpoint_index);
if (edesc == NULL) {
free(cdesc, M_TEMP);
return (EINVAL);
}
- ed->desc = *edesc;
+ ed->ued_desc = *edesc;
free(cdesc, M_TEMP);
break;
case USB_GET_FULL_DESC:
@@ -1154,10 +1154,10 @@ ugen_do_ioctl(struct ugen_softc *sc, int endpt, u_long cmd,
struct usb_full_desc *fd = (struct usb_full_desc *)addr;
int error;
- cdesc = ugen_get_cdesc(sc, fd->config_index, &len);
- if (len > fd->size)
- len = fd->size;
- iov.iov_base = (caddr_t)fd->data;
+ cdesc = ugen_get_cdesc(sc, fd->ufd_config_index, &len);
+ if (len > fd->ufd_size)
+ len = fd->ufd_size;
+ iov.iov_base = (caddr_t)fd->ufd_data;
iov.iov_len = len;
uio.uio_iov = &iov;
uio.uio_iovcnt = 1;
@@ -1172,15 +1172,15 @@ ugen_do_ioctl(struct ugen_softc *sc, int endpt, u_long cmd,
}
case USB_GET_STRING_DESC:
si = (struct usb_string_desc *)addr;
- err = usbd_get_string_desc(sc->sc_udev, si->string_index,
- si->language_id, &si->desc);
+ err = usbd_get_string_desc(sc->sc_udev, si->usd_string_index,
+ si->usd_language_id, &si->usd_desc);
if (err)
return (EINVAL);
break;
case USB_DO_REQUEST:
{
struct usb_ctl_request *ur = (void *)addr;
- int len = UGETW(ur->request.wLength);
+ int len = UGETW(ur->ucr_request.wLength);
struct iovec iov;
struct uio uio;
void *ptr = 0;
@@ -1190,18 +1190,18 @@ ugen_do_ioctl(struct ugen_softc *sc, int endpt, u_long cmd,
if (!(flag & FWRITE))
return (EPERM);
/* Avoid requests that would damage the bus integrity. */
- if ((ur->request.bmRequestType == UT_WRITE_DEVICE &&
- ur->request.bRequest == UR_SET_ADDRESS) ||
- (ur->request.bmRequestType == UT_WRITE_DEVICE &&
- ur->request.bRequest == UR_SET_CONFIG) ||
- (ur->request.bmRequestType == UT_WRITE_INTERFACE &&
- ur->request.bRequest == UR_SET_INTERFACE))
+ if ((ur->ucr_request.bmRequestType == UT_WRITE_DEVICE &&
+ ur->ucr_request.bRequest == UR_SET_ADDRESS) ||
+ (ur->ucr_request.bmRequestType == UT_WRITE_DEVICE &&
+ ur->ucr_request.bRequest == UR_SET_CONFIG) ||
+ (ur->ucr_request.bmRequestType == UT_WRITE_INTERFACE &&
+ ur->ucr_request.bRequest == UR_SET_INTERFACE))
return (EINVAL);
if (len < 0 || len > 32767)
return (EINVAL);
if (len != 0) {
- iov.iov_base = (caddr_t)ur->data;
+ iov.iov_base = (caddr_t)ur->ucr_data;
iov.iov_len = len;
uio.uio_iov = &iov;
uio.uio_iovcnt = 1;
@@ -1209,7 +1209,7 @@ ugen_do_ioctl(struct ugen_softc *sc, int endpt, u_long cmd,
uio.uio_offset = 0;
uio.uio_segflg = UIO_USERSPACE;
uio.uio_rw =
- ur->request.bmRequestType & UT_READ ?
+ ur->ucr_request.bmRequestType & UT_READ ?
UIO_READ : UIO_WRITE;
uio.uio_procp = p;
ptr = malloc(len, M_TEMP, M_WAITOK);
@@ -1219,8 +1219,8 @@ ugen_do_ioctl(struct ugen_softc *sc, int endpt, u_long cmd,
goto ret;
}
}
- err = usbd_do_request_flags(sc->sc_udev, &ur->request,
- ptr, ur->flags, &ur->actlen);
+ err = usbd_do_request_flags(sc->sc_udev, &ur->ucr_request,
+ ptr, ur->ucr_flags, &ur->ucr_actlen);
if (err) {
error = EIO;
goto ret;