From owner-freebsd-bluetooth@FreeBSD.ORG Thu Jul 12 03:00:00 2007 Return-Path: X-Original-To: freebsd-bluetooth@freebsd.org Delivered-To: freebsd-bluetooth@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B283B16A469 for ; Thu, 12 Jul 2007 03:00:00 +0000 (UTC) (envelope-from rpaulo@fnop.net) Received: from core.fnop.net (mx.fnop.net [82.102.11.82]) by mx1.freebsd.org (Postfix) with ESMTP id 29D8813C4BC for ; Thu, 12 Jul 2007 03:00:00 +0000 (UTC) (envelope-from rpaulo@fnop.net) Received: from core.fnop.net (mx.fnop.net [82.102.11.82]) by core.fnop.net (Postfix) with ESMTP id DF988690D69 for ; Thu, 12 Jul 2007 03:32:19 +0100 (WEST) Received: by core.fnop.net (Postfix, from userid 1015) id AAE61690DAB; Thu, 12 Jul 2007 03:32:19 +0100 (WEST) X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) on core.fnop.net X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO,RCVD_IN_NJABL_DUL autolearn=no version=3.1.7 Received: from epsilon.local (87-196-146-232.net.novis.pt [87.196.146.232]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by core.fnop.net (Postfix) with ESMTP id 0D8E4690D69 for ; Thu, 12 Jul 2007 03:32:18 +0100 (WEST) Message-ID: <469593F2.1040703@fnop.net> Date: Thu, 12 Jul 2007 03:37:38 +0100 From: Rui Paulo User-Agent: Thunderbird 2.0.0.4 (X11/20070704) MIME-Version: 1.0 To: freebsd-bluetooth@freebsd.org Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP Subject: HCI - HID proxy X-BeenThere: freebsd-bluetooth@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Using Bluetooth in FreeBSD environments List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jul 2007 03:00:00 -0000 Hi, For my SoC project I developed a userland utility that switches an ubt(4) controller from HID to HCI and vice versa. I have some design issues still being worked out, namely: 1) What's the best way to integrate this into the existing bluetooth utilities ? Create a new utility called, for example, ubthid2hci ? Name suggestions are welcome. 2) According to the hid2hci Linux utility, there are several dongles out there that need this tweak in order to work. I was thinking we could create a text file with the vendors/products and their bootup mode (HCI or HID); use ubthid2hci to read that file and then switch the device to HCI mode (or HID mode if the user requested it). This is mostly what the Linux hid2hci utility does, except that the vendor/product table is inside the program. 3) Fix libusb and use hid2hci on FreeBSD. Comments? Regards. -- Rui Paulo From owner-freebsd-bluetooth@FreeBSD.ORG Thu Jul 12 17:21:13 2007 Return-Path: X-Original-To: freebsd-bluetooth@freebsd.org Delivered-To: freebsd-bluetooth@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C1B8F16A46C for ; Thu, 12 Jul 2007 17:21:13 +0000 (UTC) (envelope-from rpaulo@fnop.net) Received: from core.fnop.net (mx.fnop.net [82.102.11.82]) by mx1.freebsd.org (Postfix) with ESMTP id 55EEA13C45A for ; Thu, 12 Jul 2007 17:21:13 +0000 (UTC) (envelope-from rpaulo@fnop.net) Received: from core.fnop.net (mx.fnop.net [82.102.11.82]) by core.fnop.net (Postfix) with ESMTP id 95E12690DC3; Thu, 12 Jul 2007 18:15:46 +0100 (WEST) Received: by core.fnop.net (Postfix, from userid 1015) id 3D39F690DCD; Thu, 12 Jul 2007 18:15:46 +0100 (WEST) X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) on core.fnop.net X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,FORGED_RCVD_HELO autolearn=ham version=3.1.7 Received: from epsilon.local (62.169.115.40.rev.optimus.pt [62.169.115.40]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by core.fnop.net (Postfix) with ESMTP id E04E5690DC3; Thu, 12 Jul 2007 18:15:44 +0100 (WEST) Message-ID: <46966301.7060004@fnop.net> Date: Thu, 12 Jul 2007 18:21:05 +0100 From: Rui Paulo User-Agent: Thunderbird 2.0.0.4 (X11/20070704) MIME-Version: 1.0 To: Anish Mistry References: <469593F2.1040703@fnop.net> <200707121307.38442.amistry@am-productions.biz> In-Reply-To: <200707121307.38442.amistry@am-productions.biz> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP Cc: freebsd-bluetooth@freebsd.org Subject: Re: HCI - HID proxy X-BeenThere: freebsd-bluetooth@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Using Bluetooth in FreeBSD environments List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jul 2007 17:21:13 -0000 Anish Mistry wrote: > On Wednesday 11 July 2007, Rui Paulo wrote: >> Hi, >> For my SoC project I developed a userland utility that switches an >> ubt(4) controller from HID to HCI and vice versa. >> >> I have some design issues still being worked out, namely: >> 1) What's the best way to integrate this into the existing >> bluetooth utilities ? Create a new utility called, for example, >> ubthid2hci ? Name suggestions are welcome. > If you haven't seen it, I created a utility just for logitech devices > a while back. > http://lists.freebsd.org/pipermail/freebsd-bluetooth/2006-December/000824.html Cool, that's something we also need. :-) > >> 2) According to the hid2hci Linux utility, there are several >> dongles out there that need this tweak in order to work. I was >> thinking we could create a text file with the vendors/products and >> their bootup mode (HCI or HID); use ubthid2hci to read that file >> and then switch the device to HCI mode (or HID mode if the user >> requested it). >> This is mostly what the Linux hid2hci utility does, except that the >> vendor/product table is inside the program. > > Couldn't we create something that is run through devd and the checks > options from rc.conf? So we'd have that table file you mention, and > we could put the enable/disable options in the rc.conf file. eg. > ubthid2hci_enable="YES" > ubthid2hci_flags="list of vendor/product id pairs here that we want to > be used as HCI devices" I would prefer if this list was a file and not a command line. Maybe /usr/share/misc/usb_hidhci_map. Anyway, if you want to use devd it would be something like: attach 100 { match "vendor" "0x05ac"; match "product" "0x1000"; action "/usr/bin/ubthid2hci -m 0 $device-name"; }; And then repeat this for every device that needs to be switched to HCI mode. This has the problem of not being able to switch the device to HID mode because when you try to do that, devd will automatically switch it back to HCI mode if this attach rule is present. I don't think this is a serious issue because the HID mode is normally only needed before the operating system has booted. >> 3) Fix libusb and use hid2hci on FreeBSD. > Isn't hid2hci GPL'd? We'd want a BSD licensed utility since it'd be > in the base. Yes, when I suggested this it had the implication of using hid2hci from ports. -- Rui Paulo From owner-freebsd-bluetooth@FreeBSD.ORG Thu Jul 12 17:21:35 2007 Return-Path: X-Original-To: freebsd-bluetooth@freebsd.org Delivered-To: freebsd-bluetooth@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 46FB416A400 for ; Thu, 12 Jul 2007 17:21:35 +0000 (UTC) (envelope-from amistry@am-productions.biz) Received: from mail.united-ware.com (am-productions.biz [69.61.164.22]) by mx1.freebsd.org (Postfix) with ESMTP id 43EF513C457 for ; Thu, 12 Jul 2007 17:21:33 +0000 (UTC) (envelope-from amistry@am-productions.biz) Received: from [192.168.1.100] (cpe-71-72-80-132.columbus.res.rr.com [71.72.80.132]) (authenticated bits=0) by mail.united-ware.com (8.13.8/8.13.8) with ESMTP id l6CHbsZ7071281 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 12 Jul 2007 13:38:01 -0400 (EDT) (envelope-from amistry@am-productions.biz) From: Anish Mistry Organization: AM Productions To: freebsd-bluetooth@freebsd.org Date: Thu, 12 Jul 2007 13:07:28 -0400 User-Agent: KMail/1.9.6 References: <469593F2.1040703@fnop.net> In-Reply-To: <469593F2.1040703@fnop.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart24168859.W8CBzh8RJt"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200707121307.38442.amistry@am-productions.biz> X-Spam-Status: No, score=-2.4 required=5.0 tests=MYFREEBSD2,RCVD_IN_PBL, RDNS_DYNAMIC autolearn=failed version=3.2.1 X-Spam-Checker-Version: SpamAssassin 3.2.1 (2007-05-02) on mail.united-ware.com X-Virus-Scanned: ClamAV 0.90.3/3645/Thu Jul 12 10:42:47 2007 on mail.united-ware.com X-Virus-Status: Clean Cc: Subject: Re: HCI - HID proxy X-BeenThere: freebsd-bluetooth@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Using Bluetooth in FreeBSD environments List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jul 2007 17:21:35 -0000 --nextPart24168859.W8CBzh8RJt Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Wednesday 11 July 2007, Rui Paulo wrote: > Hi, > For my SoC project I developed a userland utility that switches an > ubt(4) controller from HID to HCI and vice versa. > > I have some design issues still being worked out, namely: > 1) What's the best way to integrate this into the existing > bluetooth utilities ? Create a new utility called, for example, > ubthid2hci ? Name suggestions are welcome. If you haven't seen it, I created a utility just for logitech devices=20 a while back. http://lists.freebsd.org/pipermail/freebsd-bluetooth/2006-December/000824.h= tml > 2) According to the hid2hci Linux utility, there are several > dongles out there that need this tweak in order to work. I was > thinking we could create a text file with the vendors/products and > their bootup mode (HCI or HID); use ubthid2hci to read that file > and then switch the device to HCI mode (or HID mode if the user > requested it). > This is mostly what the Linux hid2hci utility does, except that the > vendor/product table is inside the program. Couldn't we create something that is run through devd and the checks=20 options from rc.conf? So we'd have that table file you mention, and=20 we could put the enable/disable options in the rc.conf file. eg. ubthid2hci_enable=3D"YES" ubthid2hci_flags=3D"list of vendor/product id pairs here that we want to=20 be used as HCI devices" > 3) Fix libusb and use hid2hci on FreeBSD. Isn't hid2hci GPL'd? We'd want a BSD licensed utility since it'd be=20 in the base. > Comments? Looking forward to your results, as it will make life with these=20 devices much easier. :) =2D-=20 Anish Mistry amistry@am-productions.biz AM Productions http://am-productions.biz/ --nextPart24168859.W8CBzh8RJt Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQBGll/axqA5ziudZT0RAujMAKCFUQtRVsLkTtLco+zfe1gcCIz1uwCggGya dVxuBTsa/IUjF2ZMc2FP9Uo= =9g9q -----END PGP SIGNATURE----- --nextPart24168859.W8CBzh8RJt-- From owner-freebsd-bluetooth@FreeBSD.ORG Thu Jul 12 17:44:04 2007 Return-Path: X-Original-To: freebsd-bluetooth@freebsd.org Delivered-To: freebsd-bluetooth@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9557016A475 for ; Thu, 12 Jul 2007 17:44:04 +0000 (UTC) (envelope-from amistry@am-productions.biz) Received: from mail.united-ware.com (am-productions.biz [69.61.164.22]) by mx1.freebsd.org (Postfix) with ESMTP id 427BB13C469 for ; Thu, 12 Jul 2007 17:44:04 +0000 (UTC) (envelope-from amistry@am-productions.biz) Received: from [192.168.1.100] (cpe-71-72-80-132.columbus.res.rr.com [71.72.80.132]) (authenticated bits=0) by mail.united-ware.com (8.13.8/8.13.8) with ESMTP id l6CIHj5e071778 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 12 Jul 2007 14:17:53 -0400 (EDT) (envelope-from amistry@am-productions.biz) From: Anish Mistry Organization: AM Productions To: Rui Paulo Date: Thu, 12 Jul 2007 13:47:20 -0400 User-Agent: KMail/1.9.6 References: <469593F2.1040703@fnop.net> <200707121307.38442.amistry@am-productions.biz> <46966301.7060004@fnop.net> In-Reply-To: <46966301.7060004@fnop.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart11387425.FL82KvIdj9"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200707121347.29676.amistry@am-productions.biz> X-Spam-Status: No, score=-2.4 required=5.0 tests=MYFREEBSD3,RCVD_IN_PBL, RDNS_DYNAMIC autolearn=failed version=3.2.1 X-Spam-Checker-Version: SpamAssassin 3.2.1 (2007-05-02) on mail.united-ware.com X-Virus-Scanned: ClamAV 0.90.3/3645/Thu Jul 12 10:42:47 2007 on mail.united-ware.com X-Virus-Status: Clean Cc: freebsd-bluetooth@freebsd.org Subject: Re: HCI - HID proxy X-BeenThere: freebsd-bluetooth@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Using Bluetooth in FreeBSD environments List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jul 2007 17:44:04 -0000 --nextPart11387425.FL82KvIdj9 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Thursday 12 July 2007, you wrote: > Anish Mistry wrote: > > On Wednesday 11 July 2007, Rui Paulo wrote: > >> Hi, > >> For my SoC project I developed a userland utility that switches > >> an ubt(4) controller from HID to HCI and vice versa. > >> > >> I have some design issues still being worked out, namely: > >> 1) What's the best way to integrate this into the existing > >> bluetooth utilities ? Create a new utility called, for example, > >> ubthid2hci ? Name suggestions are welcome. > > > > If you haven't seen it, I created a utility just for logitech > > devices a while back. > > http://lists.freebsd.org/pipermail/freebsd-bluetooth/2006-Decembe > >r/000824.html > > Cool, that's something we also need. :-) > > >> 2) According to the hid2hci Linux utility, there are several > >> dongles out there that need this tweak in order to work. I was > >> thinking we could create a text file with the vendors/products > >> and their bootup mode (HCI or HID); use ubthid2hci to read that > >> file and then switch the device to HCI mode (or HID mode if the > >> user requested it). > >> This is mostly what the Linux hid2hci utility does, except that > >> the vendor/product table is inside the program. > > > > Couldn't we create something that is run through devd and the > > checks options from rc.conf? So we'd have that table file you > > mention, and we could put the enable/disable options in the > > rc.conf file. eg. ubthid2hci_enable=3D"YES" > > ubthid2hci_flags=3D"list of vendor/product id pairs here that we > > want to be used as HCI devices" > > I would prefer if this list was a file and not a command line. > Maybe /usr/share/misc/usb_hidhci_map. We could actually just make this make a devd includeable config file=20 using the "directory" directive for devd.conf. So this way if=20 someone wanted an override they'd just created a custom entry in=20 devd.conf with a higher priority. > Anyway, if you want to use devd it would be something like: > > attach 100 { > match "vendor" "0x05ac"; > match "product" "0x1000"; > action "/usr/bin/ubthid2hci -m 0 $device-name"; > }; > > And then repeat this for every device that needs to be switched to > HCI mode. This has the problem of not being able to switch the > device to HID mode because when you try to do that, devd will > automatically switch it back to HCI mode if this attach rule is > present. I don't think this is a serious issue because the HID mode > is normally only needed before the operating system has booted. Right. Actually that brings up a good point. Is there a way (API)=20 that allows us to enable/disable certain devd entries at runtime? If=20 not I think that this might be a useful feature. If this was=20 available we'd then be able to programmatically disable an entry when=20 we want to switch back to HID mode without having to change the=20 devd.conf file. > >> 3) Fix libusb and use hid2hci on FreeBSD. > > > > Isn't hid2hci GPL'd? We'd want a BSD licensed utility since it'd > > be in the base. > > Yes, when I suggested this it had the implication of using hid2hci > from ports. Ok. =2D-=20 Anish Mistry amistry@am-productions.biz AM Productions http://am-productions.biz/ --nextPart11387425.FL82KvIdj9 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQBGlmkxxqA5ziudZT0RAghFAJ916aUbj9UTajTgRWTyq3LGrLFGOQCgoNRi r7uwJkMC0iXuC991TNj4+Wk= =FgUX -----END PGP SIGNATURE----- --nextPart11387425.FL82KvIdj9-- From owner-freebsd-bluetooth@FreeBSD.ORG Thu Jul 12 18:30:46 2007 Return-Path: X-Original-To: freebsd-bluetooth@freebsd.org Delivered-To: freebsd-bluetooth@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C1D0316A41F for ; Thu, 12 Jul 2007 18:30:46 +0000 (UTC) (envelope-from rpaulo@fnop.net) Received: from core.fnop.net (mx.fnop.net [82.102.11.82]) by mx1.freebsd.org (Postfix) with ESMTP id 3C62813C4BB for ; Thu, 12 Jul 2007 18:30:46 +0000 (UTC) (envelope-from rpaulo@fnop.net) Received: from core.fnop.net (mx.fnop.net [82.102.11.82]) by core.fnop.net (Postfix) with ESMTP id BCF77690DCD; Thu, 12 Jul 2007 19:25:19 +0100 (WEST) Received: by core.fnop.net (Postfix, from userid 1015) id 7DD9A690DD2; Thu, 12 Jul 2007 19:25:19 +0100 (WEST) X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) on core.fnop.net X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,FORGED_RCVD_HELO autolearn=ham version=3.1.7 Received: from epsilon.local (62.169.115.40.rev.optimus.pt [62.169.115.40]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by core.fnop.net (Postfix) with ESMTP id 5CEB1690DCD; Thu, 12 Jul 2007 19:25:18 +0100 (WEST) Message-ID: <4696734F.4040201@fnop.net> Date: Thu, 12 Jul 2007 19:30:39 +0100 From: Rui Paulo User-Agent: Thunderbird 2.0.0.4 (X11/20070704) MIME-Version: 1.0 To: Anish Mistry References: <469593F2.1040703@fnop.net> <200707121307.38442.amistry@am-productions.biz> <46966301.7060004@fnop.net> <200707121347.29676.amistry@am-productions.biz> In-Reply-To: <200707121347.29676.amistry@am-productions.biz> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP Cc: freebsd-bluetooth@freebsd.org Subject: Re: HCI - HID proxy X-BeenThere: freebsd-bluetooth@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Using Bluetooth in FreeBSD environments List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jul 2007 18:30:46 -0000 Anish Mistry wrote: >> Anyway, if you want to use devd it would be something like: >> >> attach 100 { >> match "vendor" "0x05ac"; >> match "product" "0x1000"; >> action "/usr/bin/ubthid2hci -m 0 $device-name"; >> }; >> >> And then repeat this for every device that needs to be switched to >> HCI mode. This has the problem of not being able to switch the >> device to HID mode because when you try to do that, devd will >> automatically switch it back to HCI mode if this attach rule is >> present. I don't think this is a serious issue because the HID mode >> is normally only needed before the operating system has booted. > > Right. Actually that brings up a good point. Is there a way (API) > that allows us to enable/disable certain devd entries at runtime? If > not I think that this might be a useful feature. If this was > available we'd then be able to programmatically disable an entry when > we want to switch back to HID mode without having to change the > devd.conf file. AFAIK, no. -- Rui Paulo