Marcin Cieslak wrote:
Steve Clark wrote:

Is there any detailed documentation on the FreeBSD usb device driver api?


This chapter helped me a lot to understand how this all works:

http://www.freebsd.org/doc/en_US.ISO8859-1/books/arch-handbook/usb.html


I sort of have it working by hacking ubsa.c to look for the sierra vendor id and product id of 0xfff in the usb_match function and return match. Then in the usb_attach code I look again for the vendor and product id of 0xfff and then send the control message to put it in modem mode.
   if ( uaa->vendor == USB_VENDOR_SIERRA && uaa->product == 0xfff )


It maybe a good idea to add 0xFFF to the usbdevs.
Does the "umass" driver attach to the 0xFFF device? I would recommend adding this as a quirk to umass.c then.

Actually I am not sure. The device when in TRU-Install mode looks like umass 
device,
it has a place to insert a microSD card, and also cdrom drive that when mounted 
has
the software to install on windows. When it is put in modem mode the cdrom 
disappears
but the umass device is still there. One other thing is that when installed on 
a linux
system there are 3 serial ports. The first port is used for the modem, one is 
used for a
builtin gps receiver and I think the 3rd passes signal strength information to 
the windows
software.

There are patches attached (ubsa.c_patch, umass_c.patch, usbdevs.patch) I am using to kill the "zeroconf" CD on the UMTS. They do not always work - i.e. umass_attach does not wait until the device is really detached. But setting USB_DEBUG helps :-)


   {
       ubsa_request_real( sc, 0x0b, 1, 0x40 );
       ucom->sc_dying = 1;
               goto error;
   }


This puts in modem mode with product id of 0x0023 which i have plugged into usbdevs and also put in ubsa.c so now I get a ucom device and can successfully run ppp. The problem I am running into now is sometime after it remove the device I will get a page fault panic in the kernel.


What kind of panic is this?


I think it is related to the sending the
control_message - something is not cleaned up when I "goto error" in the USB_ATTACH function.


http://www.freebsd.org/cgi/query-pr.cgi?pr=121755

Yeah this looks like the panic I am getting. One of my fellow workers needed the
usb device - so I am waiting for us to get another to continue testing.


There are two patches, one to ohci_pci.c, the other to usb_subr.c. One of them is not correct - after kldunloading the module you may run into problems. But it makes everyday life easier - at least you can remove the card and re-insert.

And finally, you will need something to increase your ubsa buffers, I am using the ubsa.c_buffers_patch attached. (Crude, but cleaner than
http://www.freebsd.org/cgi/query-pr.cgi?pr=119227)

For the time being I just hard coded larger buffers - like I see you did below.

Thanks for your input. When I get my replacement modem I'll let you know
how I make out.

--Marcin


....<SNIP>

I am attaching an lsusb listing from a linux system FYI.

Thanks,
Steve
Bus 003 Device 004: ID 1199:0023 Sierra Wireless, Inc. 
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x1199 Sierra Wireless, Inc.
  idProduct          0x0023 
  bcdDevice            0.02
  iManufacturer           1 Sierra Wireless, Incorporated
  iProduct                2 Sierra Wireless Compass 597 EVDO Modem
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           90
    bNumInterfaces          2
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower                0mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           7
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass    255 Vendor Specific Subclass
      bInterfaceProtocol    255 Vendor Specific Protocol
      iInterface              3 Data Interface
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0010  1x 16 bytes
        bInterval             128
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x84  EP 4 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x04  EP 4 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x85  EP 5 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x05  EP 5 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         8 Mass Storage
      bInterfaceSubClass      6 SCSI
      bInterfaceProtocol     80 Bulk (Zip)
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x86  EP 6 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x07  EP 7 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to