How to debug a misbehaving usb device (DYMO LabelManager PC)?

Torfinn Ingolfsen torfinn.ingolfsen at broadpark.no
Sat Jul 9 21:20:58 UTC 2011


On Sat, 09 Jul 2011 22:44:44 +0200
Hans Petter Selasky <hselasky at c2i.net> wrote:

> You could try to change in /sys/dev/usb/usb_device.c:
> 
>         /* Set the actual configuration value. */
>         err = usbd_req_set_config(udev, NULL, cdp->bConfigurationValue);
>         if (err) {
>                 goto done;
>         }
> 
> Into:
> 
>         /* Set the actual configuration value. */
>         err = usbd_req_set_config(udev, NULL, cdp->bConfigurationValue);
>         if (err && 0) {
>                 goto done;
>         }
>         err = 0;
> 
> I think the device has received the set config, though there appears to be 
> something wrong about the STALL part, which I think we can safely ignore.

Ok, I did that change and rebuilt the kernel. Like this:
root at kg-v7# uname -a
FreeBSD kg-v7.kg4.no 8.2-STABLE FreeBSD 8.2-STABLE #7: Sat Jul  9 23:00:31 CEST 2011     root at kg-v7.kg4.no:/usr/obj/usr/src/sys/GENERIC  amd64

Attaching the device, and
root at kg-v7# usbconfig -d 0.3
ugen0.3: <product 0x0011 vendor 0x0922> at usbus0, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON
root at kg-v7# usbconfig -d 0.3 dump_curr_config_desc
ugen0.3: <product 0x0011 vendor 0x0922> at usbus0, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON


 Configuration index 0

    bLength = 0x0009 
    bDescriptorType = 0x0002 
    wTotalLength = 0x0021 
    bNumInterfaces = 0x0002 
    bConfigurationValue = 0x0007 
    iConfiguration = 0x0001  <retrieving string failed>
    bmAttributes = 0x0002 
    bMaxPower = 0x0001 

    Interface 0
      bLength = 0x0009 
      bDescriptorType = 0x0004 
      bInterfaceNumber = 0x0000 
      bAlternateSetting = 0x0000 
      bNumEndpoints = 0x0002 
      bInterfaceClass = 0x0007 
      bInterfaceSubClass = 0x0001 
      bInterfaceProtocol = 0x0002 
      iInterface = 0x0000  <no string>

     Endpoint 0
        bLength = 0x0007 
        bDescriptorType = 0x0005 
        bEndpointAddress = 0x0081  <IN>
        bmAttributes = 0x0002  <BULK>
        wMaxPacketSize = 0x0008 
        bInterval = 0x0000 
        bRefresh = 0x0000 
        bSynchAddress = 0x0000 

     Endpoint 1
        bLength = 0x0008 
        bDescriptorType = 0x0005 
        bEndpointAddress = 0x0002  <OUT>
        bmAttributes = 0x0003  <INTERRUPT>
        wMaxPacketSize = 0x0008 
        bInterval = 0x0004 
        bRefresh = 0x00ff 
        bSynchAddress = 0x0000 

>From /var/log/messages I get:
Jul  9 23:17:27 kg-v7 kernel: ugen0.3: <vendor 0x0922> at usbus0
Jul  9 23:17:27 kg-v7 kernel: ulpt0: <vendor 0x0922 product 0x0011, class 0/0, rev 1.10/1.00, addr 3> on usbus0
Jul  9 23:17:27 kg-v7 kernel: device_attach: ulpt0 attach returned 12

But as I am not going to use ulpt, I'm not worrieed about that.
Now off to try VirtualBox.
Thanks for helping!
-- 
Torfinn



More information about the freebsd-usb mailing list