On Tue, Dec 14, 2010 at 04:43:23PM +0100, Daniel Gracia wrote:
> El 12/12/2010 0:13, Jonathan Gray escribis:
> >On Tue, Dec 07, 2010 at 10:06:59AM +0100, Daniel Gracia wrote:
> >>Hi there!
> >>
> >>Being in need of uticom driver noticed that it didn't worked out of
> >>the box. Compiled, but opening the serial port twice panics the
> >>kernel.
> >>
> >>With the attached fix applyed to sys/dev/usb/uticom.c it's working
> >>for me now with single port devices.
> >
> >The iface part looks right, but why change the bufsize handling?
> >Dmitry Komissaroff's original code seems to have it the way it
> >currently is.
> 
> Sure original numbers worked ok; just trying to remove some black magic.

such things should be seperate diffs, and these should go to tech.

is the following enough to make it work?

Index: uticom.c
===================================================================
RCS file: /cvs/src/sys/dev/usb/uticom.c,v
retrieving revision 1.7
diff -u -p -r1.7 uticom.c
--- uticom.c    3 Dec 2010 17:02:29 -0000       1.7
+++ uticom.c    14 Dec 2010 20:52:23 -0000
@@ -209,7 +209,6 @@ uticom_attach(struct device *parent, str
        struct uticom_softc *sc = (struct uticom_softc *)self;
        struct usb_attach_arg *uaa = aux;
        usbd_device_handle dev = uaa->device;
-       usbd_interface_handle iface;
        usb_config_descriptor_t *cdesc;
        usb_interface_descriptor_t *id;
        usb_endpoint_descriptor_t *ed;
@@ -381,7 +380,7 @@ fwload_done:
        sc->sc_iface_number = id->bInterfaceNumber;
 
        for (i = 0; i < id->bNumEndpoints; i++) {
-               ed = usbd_interface2endpoint_descriptor(iface, i);
+               ed = usbd_interface2endpoint_descriptor(sc->sc_iface, i);
                if (ed == NULL) {
                        printf("%s: no endpoint descriptor for %d\n",
                            sc->sc_dev.dv_xname, i);
@@ -419,7 +418,7 @@ fwload_done:
        uca.obufsize = UTICOM_OBUFSZ;
        uca.ibufsizepad = UTICOM_IBUFSZ;
        uca.device = dev;
-       uca.iface = iface;
+       uca.iface = sc->sc_iface;
        uca.opkthdrlen = 0;
        uca.methods = &uticom_methods;
        uca.arg = sc;

Reply via email to