MFNetBSD: ohci.c (1.109), uhci.c (1.144), uhub.c (1.56), usb.c (1.57),

usbdi.c (1.86), usbdivar.h (1.66)
	  [Some partial, because most of this was merged in a while ago]

    date: 2001/11/20 13:48:03;  author: augustss;
    Keep track of device speed for USB 2.0.
This commit is contained in:
Josef Karthauser 2002-04-07 11:19:05 +00:00
parent 3b0f6960df
commit 05f37aafc4
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=94068
6 changed files with 25 additions and 11 deletions

View File

@ -2156,7 +2156,7 @@ Static usb_device_descriptor_t ohci_devd = {
{0x00, 0x01}, /* USB version */
UDCLASS_HUB, /* class */
UDSUBCLASS_HUB, /* subclass */
0, /* protocol */
UDPROTO_FSHUB, /* protocol */
64, /* max packet */
{0},{0},{0x00,0x01}, /* device id */
1,2,0, /* string indicies */
@ -2184,7 +2184,7 @@ Static usb_interface_descriptor_t ohci_ifcd = {
1,
UICLASS_HUB,
UISUBCLASS_HUB,
0,
UIPROTO_FSHUB,
0
};

View File

@ -1,4 +1,4 @@
/* $NetBSD: uhci.c,v 1.142 2001/10/25 02:08:13 augustss Exp $ */
/* $NetBSD: uhci.c,v 1.144 2001/11/20 13:48:32 augustss Exp $ */
/* $FreeBSD$ */
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: uhub.c,v 1.55 2001/11/16 02:21:54 augustss Exp $ */
/* $NetBSD: uhub.c,v 1.56 2001/11/20 13:48:03 augustss Exp $ */
/* $FreeBSD$ */
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: usb.c,v 1.56 2001/11/13 07:55:30 augustss Exp $ */
/* $NetBSD: usb.c,v 1.57 2001/11/20 13:48:04 augustss Exp $ */
/* $FreeBSD$ */
/*
@ -203,6 +203,7 @@ USB_ATTACH(usb)
usbd_device_handle dev;
usbd_status err;
int usbrev;
int speed;
struct usb_event ue;
sc->sc_dev = self;
@ -222,8 +223,17 @@ USB_ATTACH(usb)
#endif
usbrev = sc->sc_bus->usbrev;
printf(": USB revision %s", usbrev_str[usbrev]);
if (usbrev != USBREV_1_0 && usbrev != USBREV_1_1) {
switch (usbrev) {
case USBREV_1_0:
case USBREV_1_1:
speed = USB_SPEED_FULL;
break;
case USBREV_2_0:
speed = USB_SPEED_HIGH;
break;
default:
printf(", not supported\n");
sc->sc_dying = 1;
USB_ATTACH_ERROR_RETURN;
}
printf("\n");
@ -243,13 +253,14 @@ USB_ATTACH(usb)
if (sc->sc_bus->soft == NULL) {
printf("%s: can't register softintr\n", USBDEVNAME(sc->sc_dev));
sc->sc_dying = 1;
USB_ATTACH_ERROR_RETURN;
}
#else
callout_init(&sc->sc_bus->softi);
#endif
#endif
err = usbd_new_device(USBDEV(sc->sc_dev), sc->sc_bus, 0, 0, 0,
err = usbd_new_device(USBDEV(sc->sc_dev), sc->sc_bus, 0, speed, 0,
&sc->sc_port);
if (!err) {
dev = sc->sc_port.device;

View File

@ -126,8 +126,9 @@ usbd_dump_device(struct usbd_device *dev)
if (dev == NULL)
return;
printf(" bus=%p default_pipe=%p\n", dev->bus, dev->default_pipe);
printf(" address=%d config=%d depth=%d lowspeed=%d self_powered=%d power=%d langid=%d\n",
dev->address, dev->config, dev->depth, dev->lowspeed,
printf(" address=%d config=%d depth=%d speed=%d self_powered=%d "
"power=%d langid=%d\n",
dev->address, dev->config, dev->depth, dev->speed,
dev->self_powered, dev->power, dev->langid);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: usbdivar.h,v 1.64 2001/11/10 16:54:56 augustss Exp $ */
/* $NetBSD: usbdivar.h,v 1.66 2001/11/20 13:48:04 augustss Exp $ */
/* $FreeBSD$ */
/*
@ -78,7 +78,7 @@ struct usbd_port {
u_int8_t portno;
u_int8_t restartcnt;
#define USBD_RESTART_MAX 5
struct usbd_device *device;
struct usbd_device *device; /* Connected device */
struct usbd_device *parent; /* The ports hub */
};
@ -141,6 +141,8 @@ struct usbd_device {
#define USBD_NOLANG (-1)
usb_event_cookie_t cookie; /* unique connection id */
struct usbd_port *powersrc; /* upstream hub port, or 0 */
struct usbd_device *myhub; /* upstream hub */
struct usbd_device *myhighhub; /* closest high speed hub */
struct usbd_endpoint def_ep; /* for pipe 0 */
usb_endpoint_descriptor_t def_ep_desc; /* for pipe 0 */
struct usbd_interface *ifaces; /* array of all interfaces */