Re[2]: How to claim only some of USB interfaces of a composite USB device

2012-10-01 Thread geoffrey levand

Tested the patch with FreeBSD 9.1.
It works.
Thanks.

Sun, 30 Sep 2012 21:33:31 +0200 от Hans Petter Selasky hsela...@c2i.net:
   








On Saturday 29 September 2012 11:25:21 geoffrey levand wrote:

 geoffrey levand


Can you verify this patch:

http://svn.freebsd.org/changeset/base/241078


--HPS

___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers

To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org







___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org

Re[2]: How to claim only some of USB interfaces of a composite USB device

2012-09-29 Thread geoffrey levand
Hi,

thanks for the info, it helped me to find a solution but not sure if it's a 
proper one.
Here is the patch i used to fix the problem on FreeBSD 9.1.

Index: sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c
===
--- sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c (revision 240846)
+++ sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c (working copy)
@@ -439,6 +439,7 @@
    struct ubt_softc    *sc = device_get_softc(dev);
    struct usb_endpoint_descriptor  *ed;
    struct usb_interface_descriptor *id;
+   struct usb_interface    *iface;
    uint16_t    wMaxPacketSize;
    uint8_t alt_index, i, j;
    uint8_t iface_index[2] = { 0, 1 };
@@ -555,9 +556,16 @@
    }

    /* Claim all interfaces on the device */
-   for (i = 1; usbd_get_iface(uaa-device, i) != NULL; i ++)
-   usbd_set_parent_iface(uaa-device, i, uaa-info.bIfaceIndex);
+   for (i = 1; (iface = usbd_get_iface(uaa-device, i)) != NULL; i ++) {
+   id = usbd_get_interface_descriptor(iface);

+   if (id  (id-bInterfaceClass == UICLASS_WIRELESS) 
+   (id-bInterfaceSubClass == UISUBCLASS_RF) 
+   (id-bInterfaceProtocol == UIPROTO_BLUETOOTH)) {
+   usbd_set_parent_iface(uaa-device, i, 
uaa-info.bIfaceIndex);
+   }
+   }
+
    return (0); /* success */

 detach:
= EOF ===


regards


Mon, 24 Sep 2012 18:20:07 +0200 от Hans Petter Selasky hsela...@c2i.net:
   








On Sunday 23 September 2012 16:30:53 geoffrey levand wrote:

 Hi,

 

 i have the following problem.

 I have a composite  USB device with multiple USB interfaces. Some of

 interfaces belong to the Bluetooth device and other to the WLAN device.

 The problem is i want my WLAN driver to claim only the interfaces which

 belong to the WLAN device. But ng_ubt kernel driver claims all interfaces

 for itself beginning with the interface 0. Therefore, my WLAN driver

 doesn't work if ng_ubt is loaded first.

 

 The second question is, why FreeBSD USB stack calls the match callback of

 my WLAN driver only once with USB interface index 0. Shouldn't it call the

 match callback for each interface on a USB device ? Linux kernel e.g. does

 it per USB interface.

 

 regards



Hi,



If the interfaces are parented to another interface, they are not probed.



Read the UBT specification at usb.org and provide a patch that will only grab 

bluetooth interfaces.



--HPS

___

freebsd-hackers@freebsd.org mailing list

http://lists.freebsd.org/mailman/listinfo/freebsd-hackers

To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org

   







___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org