From owner-freebsd-bluetooth@FreeBSD.ORG Sun Jun 26 03:46:37 2011 Return-Path: Delivered-To: freebsd-bluetooth@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 40583106564A for ; Sun, 26 Jun 2011 03:46:37 +0000 (UTC) (envelope-from jamesbrandongooch@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id C62598FC14 for ; Sun, 26 Jun 2011 03:46:36 +0000 (UTC) Received: by wyg24 with SMTP id 24so1111789wyg.13 for ; Sat, 25 Jun 2011 20:46:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=GQBM0cZQPVcoplGWggVU2DmA7v304jhjJi03Ovm4WSM=; b=i3H0SGMlOGLA+fZwAmCyTBQnrXm4iwdsNnyqPcGSdDHM2+qLk4HiTDeNWDeIVYwze2 51QQzJ18T++aiGRmfZx+xyWGEM4RwO0Md/RspfdMVqZ3NV9WI3SUpHJQ1BJJLBpOeQkr V3erybi91gUG2e1Q5FzsGZrs9SqmgrqdN7rOU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=RyWOIr5nBtqBBuFJU4Zv1HwmoVXQaWI7cC5KU8NklxOzOzmjPj237NSeHPkPB+zLpf SWagWRA+hvupxepdDM3wy0nWa/NOZk0cNei30GL53BLn3+9G1vMOhyBVSMFCdy7P/id/ YZH9QcLecAj5cZTr7ryqThXpIvqMeL6I7WzBI= MIME-Version: 1.0 Received: by 10.216.63.143 with SMTP id a15mr1001139wed.65.1309059995184; Sat, 25 Jun 2011 20:46:35 -0700 (PDT) Received: by 10.216.65.203 with HTTP; Sat, 25 Jun 2011 20:46:35 -0700 (PDT) In-Reply-To: References: Date: Sat, 25 Jun 2011 22:46:35 -0500 Message-ID: From: Brandon Gooch To: Maksim Yevmenkin Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: "freebsd-bluetooth@freebsd.org" , freebsd-usb@freebsd.org Subject: Re: Broadcom BCM2046B1 in HCI mode? 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: Sun, 26 Jun 2011 03:46:37 -0000 On Wed, Jun 22, 2011 at 11:17 AM, Maksim Yevmenkin wrote: > On Tuesday, June 21, 2011, Brandon Gooch wr= ote: >> I have one of these in my notebook: >> >> uhub4: on usbus0 >> >> This is a bluetooth device in HID mode, but I'd like to switch it to >> HCI mode. I found the following in rc.conf(5): >> >> =A0=A0 =A0 ubthidhci_enable >> =A0=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (bool) If set to ``YES'', change the = USB Bluetooth controller >> =A0=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 from HID mode to HCI mode. =A0You als= o need to specify the >> =A0=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 location of USB Bluetooth controller = with the >> =A0=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ubthidhci_busnum and ubthidhci_addr v= ariables. >> >> =A0=A0 =A0 ubthidhci_busnum >> =A0=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Bus number where the USB Bluetooth co= ntroller is located. >> =A0=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Check the output of usbconfig(8) on y= our system to find this >> =A0=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 information. >> >> =A0=A0 =A0 ubthidhci_addr >> =A0=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Bus address of the USB Bluetooth cont= roller. =A0Check the out- >> =A0=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 put of usbconfig(8) on your system to= find this information. >> >> So I added the appropriate directives to /etc/rc.conf, to no avail: >> >> ubthidhci_enable=3D"YES" >> ubthidhci_busnum=3D"0" >> ubthidhci_addr=3D"5" >> >> This basically calls usbconfig(8) at system start-up in the following wa= y: >> >> /usr/sbin/usbconfig -u 0 -a 5 do_request 0x40 0 0 0 0 > /dev/null 2>&1 >> >> Running this command manually, I see this output: >> >> REQUEST =3D >> >> ...which I've read as potentially being OK, as the operation still may >> have successfully completed -- it hasn't :( >> >> So, has anyone had any luck using this rc.conf(5) directive, or does >> anyone on this list have a modified usbconfig(8) command that may help >> me coax HCI from this device? > > > Switching device between hid and hci modes is s something that is > device / manufacturer specific. It could be that this particular > device need different request or something like that. I would suggest > to look at linux tool called hid2hci. It has support for different > devices from different manufacturers. > > Thanks, > Max > That was an excellent suggestion, so I went and checked it out. In fact, I verified that it indeed does the trick in a couple of recent Linux distros. So can someone help me decipher the byte sequence I need to provide to usbconfig(8)? The hid2hci utility has this function defined for dealing with the device in question: http://git.kernel.org/?p=3Dbluetooth/bluez.git;a=3Dblob;f=3Dtools/hid2hci.c= ;h=3D45a3a3db8b29411ee193e480f5ce8a82a40103d1;hb=3D7822123d08b176ef8b3e8aae= cbc3c8ff25a33483#l122 static int usb_switch_dell(struct usb_dev_handle *dev, enum mode mode) ... char report[] =3D { 0x7f, 0x00, 0x00, 0x00 }; ... report[1] =3D 0x13; .... err =3D usb_control_msg(dev, USB_ENDPOINT_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE, USB_REQ_SET_CONFIGURATION, 0x7f | (0x03 << 8), 0, report, sizeof(report), 5000); ... And according to: http://lxr.linux.no/#linux+v2.6.39/include/linux/usb.h#L1400 usb_control_msg() is prototyped: extern int usb_control_msg(struct usb_device *dev, unsigned int pipe, __u8 request, __u8 requesttype, __u16 value, __u16 index, void *data, __u16 size, int timeout); ...and I'd like to know what this means in terms of the following (from src/usr.sbin/usbconfig/usbconfig.c): libusb20_dev_request_sync(pdev, &opt->setup, opt->buffer, &actlen, 5000 /* 5 seconds */ , 0)) which is prototyped as: libusb20_dev_request_sync(struct libusb20_device *pdev, struct LIBUSB20_CONTROL_SETUP_DECODED *setup, void *data, uint16_t *pactlen, uint32_t timeout, uint8_t flags); I'm looking for something like the following: # usbconfig -u 0 -a 5 do_request 0x37f 0x13 0 0 0 However, this isn't correct I know, but I could use some help sorting it out -- any takers? -Brandon (Bad form: I'm cross-posting) From owner-freebsd-bluetooth@FreeBSD.ORG Sun Jun 26 05:03:04 2011 Return-Path: Delivered-To: freebsd-bluetooth@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60453106564A for ; Sun, 26 Jun 2011 05:03:04 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe05.c2i.net [212.247.154.130]) by mx1.freebsd.org (Postfix) with ESMTP id 112D28FC20 for ; Sun, 26 Jun 2011 05:03:02 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.1 cv=7KD0iiTHYGd0xbPMAUtcJ3OZoqPCTpa2X22hnPESm4A= c=1 sm=1 a=SvYTsOw2Z4kA:10 a=uYOExMtR3AgA:10 a=WQU8e4WWZSUA:10 a=8nJEP1OIZ-IA:10 a=CL8lFSKtTFcA:10 a=i9M/sDlu2rpZ9XS819oYzg==:17 a=pGLkceISAAAA:8 a=VwQbUJbxAAAA:8 a=1nfGWUGlAAAA:8 a=xbU7mWCAinygaXXFtVcA:9 a=XFxqMdqDK0fjI2IDBncA:7 a=wPNLvfGTeEIA:10 a=MSl-tDqOz04A:10 a=Tg7oEr8spFhzmkyB:21 a=71lIdpBemrfgIryE:21 a=i9M/sDlu2rpZ9XS819oYzg==:117 Received: from [188.126.198.129] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe05.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 143226464; Sun, 26 Jun 2011 06:52:58 +0200 From: Hans Petter Selasky To: freebsd-usb@freebsd.org Date: Sun, 26 Jun 2011 06:51:17 +0200 User-Agent: KMail/1.13.5 (FreeBSD/8.2-STABLE; KDE/4.4.5; amd64; ; ) References: In-Reply-To: X-Face: *nPdTl_}RuAI6^PVpA02T?$%Xa^>@hE0uyUIoiha$pC:9TVgl.Oq,NwSZ4V" =?iso-8859-1?q?=7CLR=2E+tj=7Dg5=0A=09=25V?=,x^qOs~mnU3]Gn; cQLv&.N>TrxmSFf+p6(30a/{)KUU!s}w\IhQBj}[g}bj0I3^glmC( =?iso-8859-1?q?=0A=09=3AAuzV9=3A=2EhESm-x4h240C=609=3Dw?= MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201106260651.17090.hselasky@c2i.net> Cc: "freebsd-bluetooth@freebsd.org" Subject: Re: Broadcom BCM2046B1 in HCI mode? 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: Sun, 26 Jun 2011 05:03:04 -0000 On Sunday 26 June 2011 05:46:35 Brandon Gooch wrote: > On Wed, Jun 22, 2011 at 11:17 AM, Maksim Yevmenkin > > wrote: > > On Tuesday, June 21, 2011, Brandon Gooch wrote: > >> I have one of these in my notebook: > >> > >> uhub4: on usbus0 > >> > >> This is a bluetooth device in HID mode, but I'd like to switch it to > >> HCI mode. I found the following in rc.conf(5): > >> > >> ubthidhci_enable > >> (bool) If set to ``YES'', change the USB Bluetooth > >> controller from HID mode to HCI mode. You also need to specify the > >> location of USB Bluetooth controller with the > >> ubthidhci_busnum and ubthidhci_addr variables. > >> > >> ubthidhci_busnum > >> Bus number where the USB Bluetooth controller is > >> located. Check the output of usbconfig(8) on your system to find this > >> information. > >> > >> ubthidhci_addr > >> Bus address of the USB Bluetooth controller. Check the > >> out- put of usbconfig(8) on your system to find this information. > >> > >> So I added the appropriate directives to /etc/rc.conf, to no avail: > >> > >> ubthidhci_enable="YES" > >> ubthidhci_busnum="0" > >> ubthidhci_addr="5" > >> > >> This basically calls usbconfig(8) at system start-up in the following > >> way: > >> > >> /usr/sbin/usbconfig -u 0 -a 5 do_request 0x40 0 0 0 0 > /dev/null 2>&1 > >> > >> Running this command manually, I see this output: > >> > >> REQUEST = > >> > >> ...which I've read as potentially being OK, as the operation still may > >> have successfully completed -- it hasn't :( > >> > >> So, has anyone had any luck using this rc.conf(5) directive, or does > >> anyone on this list have a modified usbconfig(8) command that may help > >> me coax HCI from this device? > > > > Switching device between hid and hci modes is s something that is > > device / manufacturer specific. It could be that this particular > > device need different request or something like that. I would suggest > > to look at linux tool called hid2hci. It has support for different > > devices from different manufacturers. > > > > Thanks, > > Max > > That was an excellent suggestion, so I went and checked it out. In > fact, I verified that it indeed does the trick in a couple of recent > Linux distros. > > So can someone help me decipher the byte sequence I need to provide to > usbconfig(8)? > > The hid2hci utility has this function defined for dealing with the > device in question: > > http://git.kernel.org/?p=bluetooth/bluez.git;a=blob;f=tools/hid2hci.c;h=45a > 3a3db8b29411ee193e480f5ce8a82a40103d1;hb=7822123d08b176ef8b3e8aaecbc3c8ff25 > a33483#l122 > > static int usb_switch_dell(struct usb_dev_handle *dev, enum mode mode) > ... > char report[] = { 0x7f, 0x00, 0x00, 0x00 }; > ... > report[1] = 0x13; > .... > err = usb_control_msg(dev, > USB_ENDPOINT_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE, > USB_REQ_SET_CONFIGURATION, 0x7f | (0x03 << 8), 0, > report, sizeof(report), 5000); > ... > > And according to: > > http://lxr.linux.no/#linux+v2.6.39/include/linux/usb.h#L1400 > > usb_control_msg() is prototyped: > > extern int usb_control_msg(struct usb_device *dev, unsigned int pipe, > __u8 request, __u8 requesttype, __u16 value, __u16 index, > void *data, __u16 size, int timeout); > > ...and I'd like to know what this means in terms of the following > (from src/usr.sbin/usbconfig/usbconfig.c): > > libusb20_dev_request_sync(pdev, &opt->setup, > opt->buffer, &actlen, 5000 /* 5 seconds */ , 0)) > > which is prototyped as: > > libusb20_dev_request_sync(struct libusb20_device *pdev, > struct LIBUSB20_CONTROL_SETUP_DECODED *setup, void *data, > uint16_t *pactlen, uint32_t timeout, uint8_t flags); > > I'm looking for something like the following: > > # usbconfig -u 0 -a 5 do_request 0x37f 0x13 0 0 0 > > However, this isn't correct I know, but I could use some help sorting > it out -- any takers? > Hi, Try this: usbconfig -d X.Y do_request 0x21 0x09 0x037f 0x0000 0x04 0x7f 0x13 0x00 0x00 --HPS From owner-freebsd-bluetooth@FreeBSD.ORG Sun Jun 26 15:56:42 2011 Return-Path: Delivered-To: freebsd-bluetooth@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A78F106566B; Sun, 26 Jun 2011 15:56:42 +0000 (UTC) (envelope-from jamesbrandongooch@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 977468FC0A; Sun, 26 Jun 2011 15:56:41 +0000 (UTC) Received: by wwe6 with SMTP id 6so3845597wwe.31 for ; Sun, 26 Jun 2011 08:56:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=AFyfer/Nic1qKYZ++KZ2s+6sjaSMzCLqPUVf6W2vmQc=; b=mHsVL1gCM+RXf5J5VpKhZhQ5VBjnA5Ebge0duUImBpJjCrGG/xJYffPXyeqxbyzYac +V5skn1EJhrKZwkiLGgbOKCSErh2TdY0iyABVTabwUBExqzp1qKViu+HIexuQibLbYGI vmxlyuKYhF2rIFfy2sSdZfIFMeamFZnex2rkU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=q82axNc18Up3QRoPnRE4IB1O4jWSzE3wwxNdNFOptqQGSYy6jrUEyrdmX1G40U2mgT edRec59p+Qoac7gGOfPajQ2F/r6L4tO32mAGuNjPwTQVc5cMKYszxT3BLrOtN216xrM3 4de8iWjHvmwGTiznNG4FCmXW4GQzgCS0H+5BQ= MIME-Version: 1.0 Received: by 10.216.232.13 with SMTP id m13mr1459805weq.110.1309103800294; Sun, 26 Jun 2011 08:56:40 -0700 (PDT) Received: by 10.216.65.203 with HTTP; Sun, 26 Jun 2011 08:56:40 -0700 (PDT) In-Reply-To: <201106260651.17090.hselasky@c2i.net> References: <201106260651.17090.hselasky@c2i.net> Date: Sun, 26 Jun 2011 10:56:40 -0500 Message-ID: From: Brandon Gooch To: Hans Petter Selasky Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: "freebsd-bluetooth@freebsd.org" , freebsd-usb@freebsd.org Subject: Re: Broadcom BCM2046B1 in HCI mode? 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: Sun, 26 Jun 2011 15:56:42 -0000 On Sat, Jun 25, 2011 at 11:51 PM, Hans Petter Selasky wr= ote: > On Sunday 26 June 2011 05:46:35 Brandon Gooch wrote: >> On Wed, Jun 22, 2011 at 11:17 AM, Maksim Yevmenkin >> >> wrote: >> > On Tuesday, June 21, 2011, Brandon Gooch > wrote: >> >> I have one of these in my notebook: >> >> >> >> uhub4: on usbu= s0 >> >> >> >> This is a bluetooth device in HID mode, but I'd like to switch it to >> >> HCI mode. I found the following in rc.conf(5): >> >> >> >> =A0 =A0 =A0ubthidhci_enable >> >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(bool) If set to ``YES'', change t= he USB Bluetooth >> >> controller from HID mode to HCI mode. =A0You also need to specify the >> >> location of USB Bluetooth controller with the >> >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0ubthidhci_busnum and ubthidhci_add= r variables. >> >> >> >> =A0 =A0 =A0ubthidhci_busnum >> >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Bus number where the USB Bluetooth= controller is >> >> located. Check the output of usbconfig(8) on your system to find this >> >> information. >> >> >> >> =A0 =A0 =A0ubthidhci_addr >> >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Bus address of the USB Bluetooth c= ontroller. =A0Check the >> >> out- put of usbconfig(8) on your system to find this information. >> >> >> >> So I added the appropriate directives to /etc/rc.conf, to no avail: >> >> >> >> ubthidhci_enable=3D"YES" >> >> ubthidhci_busnum=3D"0" >> >> ubthidhci_addr=3D"5" >> >> >> >> This basically calls usbconfig(8) at system start-up in the following >> >> way: >> >> >> >> /usr/sbin/usbconfig -u 0 -a 5 do_request 0x40 0 0 0 0 > /dev/null 2>&= 1 >> >> >> >> Running this command manually, I see this output: >> >> >> >> REQUEST =3D >> >> >> >> ...which I've read as potentially being OK, as the operation still ma= y >> >> have successfully completed -- it hasn't :( >> >> >> >> So, has anyone had any luck using this rc.conf(5) directive, or does >> >> anyone on this list have a modified usbconfig(8) command that may hel= p >> >> me coax HCI from this device? >> > >> > Switching device between hid and hci modes is s something that is >> > device / manufacturer specific. It could be that this particular >> > device need different request or something like that. I would suggest >> > to look at linux tool called hid2hci. It has support for different >> > devices from different manufacturers. >> > >> > Thanks, >> > Max >> >> That was an excellent suggestion, so I went and checked it out. In >> fact, I verified that it indeed does the trick in a couple of recent >> Linux distros. >> >> So can someone help me decipher the byte sequence I need to provide to >> usbconfig(8)? >> >> The hid2hci utility has this function defined for dealing with the >> device in question: >> >> http://git.kernel.org/?p=3Dbluetooth/bluez.git;a=3Dblob;f=3Dtools/hid2hc= i.c;h=3D45a >> 3a3db8b29411ee193e480f5ce8a82a40103d1;hb=3D7822123d08b176ef8b3e8aaecbc3c= 8ff25 >> a33483#l122 >> >> static int usb_switch_dell(struct usb_dev_handle *dev, enum mode mode) >> ... >> =A0 =A0 =A0 =A0 char report[] =3D { 0x7f, 0x00, 0x00, 0x00 }; >> ... >> =A0 =A0 =A0 =A0 report[1] =3D 0x13; >> .... >> =A0 =A0 =A0 =A0 err =3D usb_control_msg(dev, >> =A0 =A0 =A0 =A0 =A0 =A0 USB_ENDPOINT_OUT | USB_TYPE_CLASS | USB_RECIP_IN= TERFACE, >> =A0 =A0 =A0 =A0 =A0 =A0 USB_REQ_SET_CONFIGURATION, 0x7f | (0x03 << 8), 0= , >> =A0 =A0 =A0 =A0 =A0 =A0 report, sizeof(report), 5000); >> ... >> >> And according to: >> >> http://lxr.linux.no/#linux+v2.6.39/include/linux/usb.h#L1400 >> >> usb_control_msg() is prototyped: >> >> extern int usb_control_msg(struct usb_device *dev, unsigned int pipe, >> =A0 =A0 =A0 =A0 =A0__u8 request, __u8 requesttype, __u16 value, __u16 in= dex, >> =A0 =A0 =A0 =A0 =A0void *data, __u16 size, int timeout); >> >> ...and I'd like to know what this means in terms of the following >> (from src/usr.sbin/usbconfig/usbconfig.c): >> >> libusb20_dev_request_sync(pdev, &opt->setup, >> =A0 =A0 opt->buffer, &actlen, 5000 /* 5 seconds */ , 0)) >> >> which is prototyped as: >> >> libusb20_dev_request_sync(struct libusb20_device *pdev, >> =A0 =A0 =A0 =A0 =A0struct LIBUSB20_CONTROL_SETUP_DECODED *setup, void *d= ata, >> =A0 =A0 =A0 =A0 =A0uint16_t *pactlen, uint32_t timeout, uint8_t flags); >> >> I'm looking for something like the following: >> >> # usbconfig -u 0 -a 5 do_request 0x37f 0x13 0 0 0 >> >> However, this isn't correct I know, but I could use some help sorting >> it out -- any takers? >> > > Hi, > > Try this: > > usbconfig -d X.Y do_request 0x21 0x09 0x037f 0x0000 0x04 0x7f 0x13 0x00 0= x00 > > --HPS It worked, albeit after addressing the correct ugen(4) device: dmesg(8): ... ugen0.7: at usbus0 ... Then: # usbconfig -d ugen0.7 do_request 0x21 0x09 0x037f 0x0000 0x04 0x7f 0x13 0x00 0x00 dmesg(8): ... ugen0.8: at usbus0 ... And after: # kldload ng_ubt dmesg(8): ubt0: on usbus0 For now, can we add another (optional) parameter for rc.conf, to allow an override of the do_request parameters? So, in /etc/rc.d/ubthidhci, we could pass a value in $ubthidhci_req (or whatever) that could be worked into: command_args=3D"-u ${ubthidhci_busnum} -a ${ubthidhci_addr} do_request ${ubthidhci_req} > /dev/null 2>&1" Further, we could document known devices somewhere, allowing users to select the appropriate values themselves -- maybe even in the form of: ubthidhci_enable=3D"YES" ubthidhci_busnum=3D"0" ubthidhci_addr=3D"7" ubthidhci_devtype=3D"BCM2046B1" Hans, I don't see an easy way to automate any of this for now, although you're working on an auto-configuration system for USB devices (possibly to be generalized for other devices later). Can this be a facet of that system? Thanks for the help everyone! -Brandon From owner-freebsd-bluetooth@FreeBSD.ORG Sun Jun 26 18:19:04 2011 Return-Path: Delivered-To: freebsd-bluetooth@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C7E63106564A; Sun, 26 Jun 2011 18:19:04 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe05.c2i.net [212.247.154.130]) by mx1.freebsd.org (Postfix) with ESMTP id 134998FC17; Sun, 26 Jun 2011 18:19:03 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.1 cv=7KD0iiTHYGd0xbPMAUtcJ3OZoqPCTpa2X22hnPESm4A= c=1 sm=1 a=SvYTsOw2Z4kA:10 a=uYOExMtR3AgA:10 a=WQU8e4WWZSUA:10 a=8nJEP1OIZ-IA:10 a=CL8lFSKtTFcA:10 a=i9M/sDlu2rpZ9XS819oYzg==:17 a=8kQB0OdkAAAA:8 a=pGLkceISAAAA:8 a=VwQbUJbxAAAA:8 a=1nfGWUGlAAAA:8 a=NF_Y-S50xOgsUT6BtYcA:9 a=tna3AafCve94yiV7Y2cA:7 a=wPNLvfGTeEIA:10 a=9aOQ2cSd83gA:10 a=MSl-tDqOz04A:10 a=LLiL0JaOtTRhVl_D:21 a=a0Z-dLHaVQ1XJsc9:21 a=i9M/sDlu2rpZ9XS819oYzg==:117 Received: from [188.126.198.129] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe05.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 143389188; Sun, 26 Jun 2011 20:19:01 +0200 From: Hans Petter Selasky To: Brandon Gooch Date: Sun, 26 Jun 2011 20:17:20 +0200 User-Agent: KMail/1.13.5 (FreeBSD/8.2-STABLE; KDE/4.4.5; amd64; ; ) References: <201106260651.17090.hselasky@c2i.net> In-Reply-To: X-Face: *nPdTl_}RuAI6^PVpA02T?$%Xa^>@hE0uyUIoiha$pC:9TVgl.Oq,NwSZ4V" =?iso-8859-1?q?=7CLR=2E+tj=7Dg5=0A=09=25V?=,x^qOs~mnU3]Gn; cQLv&.N>TrxmSFf+p6(30a/{)KUU!s}w\IhQBj}[g}bj0I3^glmC( =?iso-8859-1?q?=0A=09=3AAuzV9=3A=2EhESm-x4h240C=609=3Dw?= MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201106262017.20468.hselasky@c2i.net> Cc: "freebsd-bluetooth@freebsd.org" , freebsd-usb@freebsd.org Subject: Re: Broadcom BCM2046B1 in HCI mode? 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: Sun, 26 Jun 2011 18:19:04 -0000 On Sunday 26 June 2011 17:56:40 Brandon Gooch wrote: > On Sat, Jun 25, 2011 at 11:51 PM, Hans Petter Selasky wrote: > > On Sunday 26 June 2011 05:46:35 Brandon Gooch wrote: > >> On Wed, Jun 22, 2011 at 11:17 AM, Maksim Yevmenkin > >> > >> wrote: > >> > On Tuesday, June 21, 2011, Brandon Gooch > > > > wrote: > >> >> I have one of these in my notebook: > >> >> > >> >> uhub4: on > >> >> usbus0 > >> >> > >> >> This is a bluetooth device in HID mode, but I'd like to switch it to > >> >> HCI mode. I found the following in rc.conf(5): > >> >> > >> >> ubthidhci_enable > >> >> (bool) If set to ``YES'', change the USB Bluetooth > >> >> controller from HID mode to HCI mode. You also need to specify the > >> >> location of USB Bluetooth controller with the > >> >> ubthidhci_busnum and ubthidhci_addr variables. > >> >> > >> >> ubthidhci_busnum > >> >> Bus number where the USB Bluetooth controller is > >> >> located. Check the output of usbconfig(8) on your system to find this > >> >> information. > >> >> > >> >> ubthidhci_addr > >> >> Bus address of the USB Bluetooth controller. Check > >> >> the out- put of usbconfig(8) on your system to find this > >> >> information. > >> >> > >> >> So I added the appropriate directives to /etc/rc.conf, to no avail: > >> >> > >> >> ubthidhci_enable="YES" > >> >> ubthidhci_busnum="0" > >> >> ubthidhci_addr="5" > >> >> > >> >> This basically calls usbconfig(8) at system start-up in the following > >> >> way: > >> >> > >> >> /usr/sbin/usbconfig -u 0 -a 5 do_request 0x40 0 0 0 0 > /dev/null > >> >> 2>&1 > >> >> > >> >> Running this command manually, I see this output: > >> >> > >> >> REQUEST = > >> >> > >> >> ...which I've read as potentially being OK, as the operation still > >> >> may have successfully completed -- it hasn't :( > >> >> > >> >> So, has anyone had any luck using this rc.conf(5) directive, or does > >> >> anyone on this list have a modified usbconfig(8) command that may > >> >> help me coax HCI from this device? > >> > > >> > Switching device between hid and hci modes is s something that is > >> > device / manufacturer specific. It could be that this particular > >> > device need different request or something like that. I would suggest > >> > to look at linux tool called hid2hci. It has support for different > >> > devices from different manufacturers. > >> > > >> > Thanks, > >> > Max > >> > >> That was an excellent suggestion, so I went and checked it out. In > >> fact, I verified that it indeed does the trick in a couple of recent > >> Linux distros. > >> > >> So can someone help me decipher the byte sequence I need to provide to > >> usbconfig(8)? > >> > >> The hid2hci utility has this function defined for dealing with the > >> device in question: > >> > >> http://git.kernel.org/?p=bluetooth/bluez.git;a=blob;f=tools/hid2hci.c;h= > >> 45a > >> 3a3db8b29411ee193e480f5ce8a82a40103d1;hb=7822123d08b176ef8b3e8aaecbc3c8 > >> ff25 a33483#l122 > >> > >> static int usb_switch_dell(struct usb_dev_handle *dev, enum mode mode) > >> ... > >> char report[] = { 0x7f, 0x00, 0x00, 0x00 }; > >> ... > >> report[1] = 0x13; > >> .... > >> err = usb_control_msg(dev, > >> USB_ENDPOINT_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE, > >> USB_REQ_SET_CONFIGURATION, 0x7f | (0x03 << 8), 0, > >> report, sizeof(report), 5000); > >> ... > >> > >> And according to: > >> > >> http://lxr.linux.no/#linux+v2.6.39/include/linux/usb.h#L1400 > >> > >> usb_control_msg() is prototyped: > >> > >> extern int usb_control_msg(struct usb_device *dev, unsigned int pipe, > >> __u8 request, __u8 requesttype, __u16 value, __u16 index, > >> void *data, __u16 size, int timeout); > >> > >> ...and I'd like to know what this means in terms of the following > >> (from src/usr.sbin/usbconfig/usbconfig.c): > >> > >> libusb20_dev_request_sync(pdev, &opt->setup, > >> opt->buffer, &actlen, 5000 /* 5 seconds */ , 0)) > >> > >> which is prototyped as: > >> > >> libusb20_dev_request_sync(struct libusb20_device *pdev, > >> struct LIBUSB20_CONTROL_SETUP_DECODED *setup, void *data, > >> uint16_t *pactlen, uint32_t timeout, uint8_t flags); > >> > >> I'm looking for something like the following: > >> > >> # usbconfig -u 0 -a 5 do_request 0x37f 0x13 0 0 0 > >> > >> However, this isn't correct I know, but I could use some help sorting > >> it out -- any takers? > > > > Hi, > > > > Try this: > > > > usbconfig -d X.Y do_request 0x21 0x09 0x037f 0x0000 0x04 0x7f 0x13 0x00 > > 0x00 > > > > --HPS > > It worked, albeit after addressing the correct ugen(4) device: > > dmesg(8): > ... > ugen0.7: at usbus0 > ... > > Then: > # usbconfig -d ugen0.7 do_request 0x21 0x09 0x037f 0x0000 0x04 0x7f > 0x13 0x00 0x00 > > dmesg(8): > ... > ugen0.8: at usbus0 > ... > > And after: > > # kldload ng_ubt > > dmesg(8): > > ubt0: 224/1, rev 2.00/1.73, addr 8> on usbus0 > > For now, can we add another (optional) parameter for rc.conf, to allow > an override of the do_request parameters? > > So, in /etc/rc.d/ubthidhci, we could pass a value in $ubthidhci_req > (or whatever) that could be worked into: > > command_args="-u ${ubthidhci_busnum} -a ${ubthidhci_addr} do_request > ${ubthidhci_req} > /dev/null 2>&1" > > Further, we could document known devices somewhere, allowing users to > select the appropriate values themselves -- maybe even in the form of: > > ubthidhci_enable="YES" > ubthidhci_busnum="0" > ubthidhci_addr="7" > ubthidhci_devtype="BCM2046B1" > > Hans, I don't see an easy way to automate any of this for now, > although you're working on an auto-configuration system for USB > devices (possibly to be generalized for other devices later). Can this > be a facet of that system? > > Thanks for the help everyone! There is something similar in the u3g driver. Look at that: /sys/dev/usb/serial/u3g.c --HPS From owner-freebsd-bluetooth@FreeBSD.ORG Tue Jun 28 01:01:49 2011 Return-Path: Delivered-To: bluetooth@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DFE75106564A for ; Tue, 28 Jun 2011 01:01:49 +0000 (UTC) (envelope-from freebsd-bluetooth@herveybayaustralia.com.au) Received: from mail.unitedinsong.com.au (mail.unitedinsong.com.au [150.101.178.33]) by mx1.freebsd.org (Postfix) with ESMTP id 4DDE68FC19 for ; Tue, 28 Jun 2011 01:01:49 +0000 (UTC) Received: from laptop1.herveybayaustralia.com.au (laptop1.herveybayaustralia.com.au [192.168.0.186]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.unitedinsong.com.au (Postfix) with ESMTPS id E85265C22; Tue, 28 Jun 2011 11:11:01 +1000 (EST) Message-ID: <4E092850.9090103@herveybayaustralia.com.au> Date: Tue, 28 Jun 2011 11:03:12 +1000 From: Da Rock User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.16) Gecko/20110204 Thunderbird/3.0.11 ThunderBrowse/3.3.4 MIME-Version: 1.0 To: Maksim Yevmenkin References: <4DF46049.6080206@herveybayaustralia.com.au> <4DF53A6F.9080701@herveybayaustralia.com.au> <4DF705C9.7020606@herveybayaustralia.com.au> <4DF7F13C.6090208@herveybayaustralia.com.au> <4DF8430C.3010104@herveybayaustralia.com.au> <4DFA7AB4.3010405@herveybayaustralia.com.au> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: bluetooth@freebsd.org Subject: Re: Asus bluetooth device - 0x1712 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: Tue, 28 Jun 2011 01:01:50 -0000 On 06/17/11 08:11, Maksim Yevmenkin wrote: > On Thu, Jun 16, 2011 at 2:50 PM, Da Rock > wrote: > >> On 06/17/11 03:22, Maksim Yevmenkin wrote: >> >>> [...] >>> >>> >>> >>>>>> Probably would if it recognised the product then. What is the correct >>>>>> way >>>>>> to >>>>>> do this then? I know about usbdevs, and the awk script to run, but does >>>>>> anything then need to be added to the driver to pick it up, or should >>>>>> that >>>>>> be all thats needed? >>>>>> >>>>>> >>>>> it does not look at the product. it looks at interface class, subclass >>>>> and protocol. are you sure you are loading ng_ubt(4) from loader.conf? >>>>> are there any error messages from ng_ubt(4) in /var/log/messages? >>>>> >>>>> >>>> devd.conf problem then? I haven't got it in loader.conf, but I did >>>> kldload- >>>> dmesg output (although the last 2 lines disappear when unloaded/loaded: >>>> >>>> ubt0: >>>> on >>>> usbus5 >>>> WARNING: attempt to domain_add(bluetooth) after domainfinalize() >>>> WARNING: attempt to domain_add(netgraph) after domainfinalize() >>>> >>>> >>> if you get ubt0 line then device was recognized and attached. >>> >>> those two WARNING messages are harmless >>> >>> >>> >>>> But ls dev shows no devices, and I can't start bluetooth services: >>>> >>>> >>> ng_ubt(4) does NOT create device nodes in /dev. this question pops up >>> very often. handbook should really be updated to mention this. >>> >>> >>> >>>> /etc/rc.d/bluetooth: ERROR: Unable to setup Bluetooth stack for device >>>> ubt0 >>>> >>>> If it should work, then what am I doing wrong? >>>> >>>> >>> devd(8) will start/stop stack for you automatically. please check >>> devd.conf (look at ubt secion). there is no need to start stack by >>> hand any more. the error is because you are trying to start the stack >>> when its already been started. again, handbook should be updated to >>> reflect that. >>> >> Thanks Max. Sounds like there is updating required in the handbook- but how >> do I test whether its actually working or not? Those are the tests to show >> it works. Perhaps some more decisive tests should be included? >> > well, you could use hccontrol(8) and try to issue a couple of > diagnostic commands, i.e. read_bd_addr, read_local_name, etc. to see > if your device responds to those. Great- that worked. Apologies for the delay in reply, been a tad busy on a few things. > obexapp from ports (comms/obexapp) > is often used to transfer files to/from mobile phones/pdas. > Not all that useful in my experience, plus no need with the 'droid- just use sftp :) > rfcomm_pppd(8) and rfcomm_sppd(1) in combination with ppp(8) are often > used to create data link, i.e. use mobile phone data connection to > connect to the internet. btpand(8) can be used to build > ethernet-over-bluetooth lan. bthidd(8) can be used to connect your > bluetooth keyboard/mouse to your freebsd pc etc. etc. bluetooth audio > is lacking, i might get around to implementing a2dp profile and > possibly avrcp profile but no promises. > > in other word, try to use it and if something does not work - ask > and/or implement it :) > I'll check it out. I did read bluetooth.com, but there are no technical documents available there. Any particular place I should start looking? Also, how about power saving capabilities? Is it possible to turn it off- obviously apart from unloading the kernel module? > thanks, > max > From owner-freebsd-bluetooth@FreeBSD.ORG Tue Jun 28 23:00:45 2011 Return-Path: Delivered-To: bluetooth@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16722106566B for ; Tue, 28 Jun 2011 23:00:45 +0000 (UTC) (envelope-from plunky@rya-online.net) Received: from mail.ukfsn.org (mail.ukfsn.org [77.75.108.10]) by mx1.freebsd.org (Postfix) with ESMTP id C57948FC0A for ; Tue, 28 Jun 2011 23:00:44 +0000 (UTC) Received: from localhost (smtp-filter.ukfsn.org [192.168.54.205]) by mail.ukfsn.org (Postfix) with ESMTP id 0993DDEC39; Wed, 29 Jun 2011 00:00:43 +0100 (BST) Received: from mail.ukfsn.org ([192.168.54.25]) by localhost (smtp-filter.ukfsn.org [192.168.54.205]) (amavisd-new, port 10024) with ESMTP id XMkTrtH-paxJ; Wed, 29 Jun 2011 00:00:42 +0100 (BST) Received: from galant.ukfsn.org (unknown [89.194.128.172]) by mail.ukfsn.org (Postfix) with ESMTP id AE052DEC07; Wed, 29 Jun 2011 00:00:41 +0100 (BST) Received: by galant.ukfsn.org (Postfix, from userid 1000) id 4D4A92600AC; Wed, 29 Jun 2011 00:00:01 +0100 (BST) Date: Wed, 29 Jun 2011 00:00:01 +0100 (BST) From: Iain Hibbert To: Da Rock In-Reply-To: <4E092850.9090103@herveybayaustralia.com.au> Message-ID: References: <4DF46049.6080206@herveybayaustralia.com.au> <4DF53A6F.9080701@herveybayaustralia.com.au> <4DF705C9.7020606@herveybayaustralia.com.au> <4DF7F13C.6090208@herveybayaustralia.com.au> <4DF8430C.3010104@herveybayaustralia.com.au> <4DFA7AB4.3010405@herveybayaustralia.com.au> <4E092850.9090103@herveybayaustralia.com.au> User-Agent: Alpine 2.00 (NEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: bluetooth@freebsd.org Subject: Re: Asus bluetooth device - 0x1712 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: Tue, 28 Jun 2011 23:00:45 -0000 On Tue, 28 Jun 2011, Da Rock wrote: > I'll check it out. I did read bluetooth.com, but there are no technical > documents available there. Any particular place I should start looking? "About the Technology"->"How it works"->"Bluetooth Technical Information" though I see they actually moved the files back to bluetooth.org again https://www.bluetooth.org/Technical/Specifications/adopted.htm regards, iain From owner-freebsd-bluetooth@FreeBSD.ORG Wed Jun 29 08:55:18 2011 Return-Path: Delivered-To: bluetooth@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE31A106566C for ; Wed, 29 Jun 2011 08:55:18 +0000 (UTC) (envelope-from freebsd-bluetooth@herveybayaustralia.com.au) Received: from mail.unitedinsong.com.au (mail.unitedinsong.com.au [150.101.178.33]) by mx1.freebsd.org (Postfix) with ESMTP id 75E308FC13 for ; Wed, 29 Jun 2011 08:55:18 +0000 (UTC) Received: from laptop1.herveybayaustralia.com.au (laptop1.herveybayaustralia.com.au [192.168.0.186]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.unitedinsong.com.au (Postfix) with ESMTPS id 6A00B5C22; Wed, 29 Jun 2011 19:04:34 +1000 (EST) Message-ID: <4E0AE8C8.9090001@herveybayaustralia.com.au> Date: Wed, 29 Jun 2011 18:56:40 +1000 From: Da Rock User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.16) Gecko/20110204 Thunderbird/3.0.11 ThunderBrowse/3.3.4 MIME-Version: 1.0 To: Iain Hibbert References: <4DF46049.6080206@herveybayaustralia.com.au> <4DF53A6F.9080701@herveybayaustralia.com.au> <4DF705C9.7020606@herveybayaustralia.com.au> <4DF7F13C.6090208@herveybayaustralia.com.au> <4DF8430C.3010104@herveybayaustralia.com.au> <4DFA7AB4.3010405@herveybayaustralia.com.au> <4E092850.9090103@herveybayaustralia.com.au> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: bluetooth@freebsd.org Subject: Re: Asus bluetooth device - 0x1712 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: Wed, 29 Jun 2011 08:55:18 -0000 On 06/29/11 09:00, Iain Hibbert wrote: > On Tue, 28 Jun 2011, Da Rock wrote: > > >> I'll check it out. I did read bluetooth.com, but there are no technical >> documents available there. Any particular place I should start looking? >> > "About the Technology"->"How it works"->"Bluetooth Technical Information" > > though I see they actually moved the files back to bluetooth.org again > > https://www.bluetooth.org/Technical/Specifications/adopted.htm > Ah, bingo! Just what I was looking for- thanks Iain. > regards, > iain >