kern/75710: [cue] cue0 device configuration causes kernel panic
Derrick Brashear
dbrashear at sinenomine.net
Wed Aug 29 17:20:12 PDT 2007
The following reply was made to PR kern/75710; it has been noted by GNATS.
From: Derrick Brashear <dbrashear at sinenomine.net>
To: bug-followup at FreeBSD.org
Cc:
Subject: Re: kern/75710: [cue] cue0 device configuration causes kernel panic
Date: Wed, 29 Aug 2007 20:18:48 -0400
Still broken (it breaks the network on the machine somehow; an
outgoing ping on the machines' other, non-cue interface gets one
reply; one dup'd packet, and nothing further, and inbound ssh connects
and hangs) but no more crashing.
--- ./if_cue.c?rev=1.57.2.3;content-type=text
%2Fplain;only_with_tag=RELENG_6_2
Sun Oct 9 03:59:36 2005
+++ /usr/src/sys/dev/usb/if_cue.c Thu Aug 30 01:02:38 2007
@@ -448,10 +450,13 @@
usb_interface_descriptor_t *id;
usb_endpoint_descriptor_t *ed;
int i;
+ usbd_interface_handle iface;
+ usbd_status err;
bzero(sc, sizeof(struct cue_softc));
+
+
sc->cue_dev = self;
- sc->cue_iface = uaa->iface;
sc->cue_udev = uaa->device;
sc->cue_unit = device_get_unit(self);
@@ -461,7 +466,16 @@
USB_ATTACH_ERROR_RETURN;
}
- id = usbd_get_interface_descriptor(uaa->iface);
+ err = usbd_device2interface_handle(uaa->device,
CUE_IFACE_IDX, &iface);
+ if (err) {
+ printf("cue%d: getting interface handle failed\n",
+ sc->cue_unit);
+ USB_ATTACH_ERROR_RETURN;
+ }
+
+ sc->cue_iface = iface;
+
+ id = usbd_get_interface_descriptor(sc->cue_iface);
usbd_devinfo(uaa->device, 0, devinfo);
device_set_desc_copy(self, devinfo);
@@ -469,12 +483,12 @@
/* Find endpoints. */
for (i = 0; i < id->bNumEndpoints; i++) {
- ed = usbd_interface2endpoint_descriptor(uaa->iface, i);
+ ed = usbd_interface2endpoint_descriptor(iface, i);
if (!ed) {
printf("cue%d: couldn't get ep %d\n",
sc->cue_unit, i);
USB_ATTACH_ERROR_RETURN;
- }
+ }
if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_IN &&
UE_GET_XFERTYPE(ed->bmAttributes) == UE_BULK) {
sc->cue_ed[CUE_ENDPT_RX] = ed-
>bEndpointAddress;
More information about the freebsd-bugs
mailing list