From owner-freebsd-usb@FreeBSD.ORG Thu Jan 3 19:35:04 2013 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C427B325 for ; Thu, 3 Jan 2013 19:35:04 +0000 (UTC) (envelope-from Lowell@Be-Well.Ilk.Org) Received: from asbnvacz-mailrelay01.megapath.net (asbnvacz-mailrelay01.megapath.net [207.145.128.243]) by mx1.freebsd.org (Postfix) with ESMTP id 8FA4FDBB for ; Thu, 3 Jan 2013 19:35:04 +0000 (UTC) Received: from mail8.sea5.speakeasy.net (mail8.sea5.speakeasy.net [69.17.117.53]) by asbnvacz-mailrelay01.megapath.net (Postfix) with ESMTP id 40F5AA71636 for ; Thu, 3 Jan 2013 14:34:58 -0500 (EST) Received: (qmail 18395 invoked from network); 3 Jan 2013 19:34:57 -0000 Received: by simscan 1.4.0 ppid: 7195, pid: 26748, t: 0.4816s scanners: clamav: 0.88.2/m:52/d:13495 Received: from unknown (HELO be-well.ilk.org) ([66.92.78.145]) (envelope-sender ) by mail8.sea5.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 3 Jan 2013 19:34:57 -0000 Received: from lowell-desk.lan (lowell-desk.lan [172.30.250.8]) by be-well.ilk.org (Postfix) with ESMTP id C05C633C32; Thu, 3 Jan 2013 14:34:51 -0500 (EST) Received: by lowell-desk.lan (Postfix, from userid 1147) id B595C39855; Thu, 3 Jan 2013 14:34:50 -0500 (EST) From: Lowell Gilbert To: freebsd-usb@freebsd.org, hselasky@c2i.net, Subject: Android device problems with MTP ID Date: Thu, 03 Jan 2013 14:34:50 -0500 Message-ID: <44d2xmrrfp.fsf@lowell-desk.lan> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jan 2013 19:35:04 -0000 Hi. As of the some recent releases of Android, umass support is gone and MTP support is the normal way for a computer to access a phone over USB. I have a pair of Android devices; one seems to be using MTP okay, and I'll try to move forward working with that, but the other doesn't seem to be offering the MTP interface on the bus. On my (updated to Android 4.1.1) phone, MTP only works if the phone's USB debugging option is enabled. If it is, usbconfig(8) sees a ugen(4) interface of MTP type; but otherwise it just shows up as a CD device. I also have a tablet, running Android 4.0.4, and it reports as MTP rather than umass. The tools that come with libmtp (and thus, probably, tools like gmtp) talk to it at least somewhat. Presenting the phone as a CD is intentional in the update. The CD is a real CD device (well, virtual, but it simulates one okay; it is at least mountable), and it contains Windows drivers for using the device as MTP. The problem is that the CD (a umass interface) is the *only* one that shows up. As far as I can gather, the device is expected to revert to MTP mode in a short period of time if the CD isn't mounted, and I can't seem to get it to do that. I've included the usbconfig output for the phone for both the regular and debug modes at the bottom of the message, but I don't expect that you will be able to get much more out of it than I have. I appreciate any advice. Thanks, Lowell Gilbert ================================================================ Phone in normal mode: ==== [5001] (lowell-desk) ~> usbconfig -d 2.2 dump_device_desc ugen2.2: at usbus2, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON bLength = 0x0012 bDescriptorType = 0x0001 bcdUSB = 0x0200 bDeviceClass = 0x0000 bDeviceSubClass = 0x0000 bDeviceProtocol = 0x0000 bMaxPacketSize0 = 0x0040 idVendor = 0x22b8 idProduct = 0x710f bcdDevice = 0x0228 iManufacturer = 0x0002 iProduct = 0x0003 iSerialNumber = 0x0004 bNumConfigurations = 0x0001 [5002] (lowell-desk) ~> usbconfig -d 2.2 dump_curr_config_desc ugen2.2: at usbus2, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON Configuration index 0 bLength = 0x0009 bDescriptorType = 0x0002 wTotalLength = 0x0020 bNumInterfaces = 0x0001 bConfigurationValue = 0x0001 iConfiguration = 0x0000 bmAttributes = 0x0080 bMaxPower = 0x00fa Interface 0 bLength = 0x0009 bDescriptorType = 0x0004 bInterfaceNumber = 0x0000 bAlternateSetting = 0x0000 bNumEndpoints = 0x0002 bInterfaceClass = 0x0008 bInterfaceSubClass = 0x0006 bInterfaceProtocol = 0x0050 iInterface = 0x0001 Endpoint 0 bLength = 0x0007 bDescriptorType = 0x0005 bEndpointAddress = 0x0081 bmAttributes = 0x0002 wMaxPacketSize = 0x0200 bInterval = 0x0000 bRefresh = 0x0000 bSynchAddress = 0x0000 Endpoint 1 bLength = 0x0007 bDescriptorType = 0x0005 bEndpointAddress = 0x0001 bmAttributes = 0x0002 wMaxPacketSize = 0x0200 bInterval = 0x0001 bRefresh = 0x0000 bSynchAddress = 0x0000 ================================================================ Phone in "USB debug" mode: ==== [5001] (lowell-desk) ~> usbconfig -d 2.2 dump_device_desc ugen2.2: at usbus2, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON bLength = 0x0012 bDescriptorType = 0x0001 bcdUSB = 0x0200 bDeviceClass = 0x0000 bDeviceSubClass = 0x0000 bDeviceProtocol = 0x0000 bMaxPacketSize0 = 0x0040 idVendor = 0x22b8 idProduct = 0x2e33 bcdDevice = 0x0228 iManufacturer = 0x0002 iProduct = 0x0003 iSerialNumber = 0x0004 bNumConfigurations = 0x0001 [5002] (lowell-desk) ~> usbconfig -d 2.2 dump_curr_config_desc ugen2.2: at usbus2, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON Configuration index 0 bLength = 0x0009 bDescriptorType = 0x0002 wTotalLength = 0x005c bNumInterfaces = 0x0003 bConfigurationValue = 0x0001 iConfiguration = 0x0000 bmAttributes = 0x0080 bMaxPower = 0x00fa Interface 0 bLength = 0x0009 bDescriptorType = 0x0004 bInterfaceNumber = 0x0000 bAlternateSetting = 0x0000 bNumEndpoints = 0x0003 bInterfaceClass = 0x00ff bInterfaceSubClass = 0x00ff bInterfaceProtocol = 0x0000 iInterface = 0x0005 Endpoint 0 bLength = 0x0007 bDescriptorType = 0x0005 bEndpointAddress = 0x0081 bmAttributes = 0x0002 wMaxPacketSize = 0x0200 bInterval = 0x0000 bRefresh = 0x0000 bSynchAddress = 0x0000 Endpoint 1 bLength = 0x0007 bDescriptorType = 0x0005 bEndpointAddress = 0x0001 bmAttributes = 0x0002 wMaxPacketSize = 0x0200 bInterval = 0x0000 bRefresh = 0x0000 bSynchAddress = 0x0000 Endpoint 2 bLength = 0x0007 bDescriptorType = 0x0005 bEndpointAddress = 0x0082 bmAttributes = 0x0003 wMaxPacketSize = 0x001c bInterval = 0x0006 bRefresh = 0x0000 bSynchAddress = 0x0000 Interface 1 bLength = 0x0009 bDescriptorType = 0x0004 bInterfaceNumber = 0x0001 bAlternateSetting = 0x0000 bNumEndpoints = 0x0003 bInterfaceClass = 0x0002 bInterfaceSubClass = 0x000a bInterfaceProtocol = 0x0001 iInterface = 0x0014 Endpoint 0 bLength = 0x0007 bDescriptorType = 0x0005 bEndpointAddress = 0x0083 bmAttributes = 0x0002 wMaxPacketSize = 0x0200 bInterval = 0x0000 bRefresh = 0x0000 bSynchAddress = 0x0000 Endpoint 1 bLength = 0x0007 bDescriptorType = 0x0005 bEndpointAddress = 0x0002 bmAttributes = 0x0002 wMaxPacketSize = 0x0200 bInterval = 0x0000 bRefresh = 0x0000 bSynchAddress = 0x0000 Endpoint 2 bLength = 0x0007 bDescriptorType = 0x0005 bEndpointAddress = 0x0003 bmAttributes = 0x0003 wMaxPacketSize = 0x0040 bInterval = 0x0001 bRefresh = 0x0000 bSynchAddress = 0x0000 Interface 2 bLength = 0x0009 bDescriptorType = 0x0004 bInterfaceNumber = 0x0002 bAlternateSetting = 0x0000 bNumEndpoints = 0x0002 bInterfaceClass = 0x00ff bInterfaceSubClass = 0x0042 bInterfaceProtocol = 0x0001 iInterface = 0x0015 Endpoint 0 bLength = 0x0007 bDescriptorType = 0x0005 bEndpointAddress = 0x0084 bmAttributes = 0x0002 wMaxPacketSize = 0x0200 bInterval = 0x0000 bRefresh = 0x0000 bSynchAddress = 0x0000 Endpoint 1 bLength = 0x0007 bDescriptorType = 0x0005 bEndpointAddress = 0x0004 bmAttributes = 0x0002 wMaxPacketSize = 0x0200 bInterval = 0x0000 bRefresh = 0x0000 bSynchAddress = 0x0000 From owner-freebsd-usb@FreeBSD.ORG Thu Jan 3 19:42:50 2013 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E4FF8805 for ; Thu, 3 Jan 2013 19:42:50 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe04.c2i.net [212.247.154.98]) by mx1.freebsd.org (Postfix) with ESMTP id 7C1A6E4D for ; Thu, 3 Jan 2013 19:42:49 +0000 (UTC) X-T2-Spam-Status: No, hits=-1.0 required=5.0 tests=ALL_TRUSTED Received: from [176.74.213.204] (account mc467741@c2i.net HELO laptop015.hselasky.homeunix.org) by mailfe04.swip.net (CommuniGate Pro SMTP 5.4.4) with ESMTPA id 363003393; Thu, 03 Jan 2013 20:37:41 +0100 From: Hans Petter Selasky To: Lowell Gilbert Subject: Re: Android device problems with MTP ID Date: Thu, 3 Jan 2013 20:39:16 +0100 User-Agent: KMail/1.13.7 (FreeBSD/9.1-PRERELEASE; KDE/4.8.4; amd64; ; ) References: <44d2xmrrfp.fsf@lowell-desk.lan> In-Reply-To: <44d2xmrrfp.fsf@lowell-desk.lan> X-Face: ?p&W)c(+80hU; '{.$5K+zq{oC6y| /D'an*6mw>j'f:eBsex\Gi, Cc: freebsd-usb@freebsd.org X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jan 2013 19:42:51 -0000 On Thursday 03 January 2013 20:34:50 Lowell Gilbert wrote: > Hi. > > As of the some recent releases of Android, umass support is gone and MTP > support is the normal way for a computer to access a phone over USB. > I have a pair of Android devices; one seems to be using MTP okay, and > I'll try to move forward working with that, but the other doesn't seem > to be offering the MTP interface on the bus. > > On my (updated to Android 4.1.1) phone, MTP only works if the phone's > USB debugging option is enabled. If it is, usbconfig(8) sees a ugen(4) > interface of MTP type; but otherwise it just shows up as a CD device. > > I also have a tablet, running Android 4.0.4, and it reports as MTP > rather than umass. The tools that come with libmtp (and thus, probably, > tools like gmtp) talk to it at least somewhat. > > Presenting the phone as a CD is intentional in the update. The CD is a > real CD device (well, virtual, but it simulates one okay; it is at least > mountable), and it contains Windows drivers for using the device as > MTP. The problem is that the CD (a umass interface) is the *only* one > that shows up. As far as I can gather, the device is expected to revert > to MTP mode in a short period of time if the CD isn't mounted, and I > can't seem to get it to do that. > > I've included the usbconfig output for the phone for both the regular > and debug modes at the bottom of the message, but I don't expect that > you will be able to get much more out of it than I have. > > I appreciate any advice. > > Thanks, > Lowell Gilbert Hi, Try to use cdcontrol to eject the CD. --HPS From owner-freebsd-usb@FreeBSD.ORG Thu Jan 3 19:58:23 2013 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1A1AED3A for ; Thu, 3 Jan 2013 19:58:23 +0000 (UTC) (envelope-from Lowell@Be-Well.Ilk.Org) Received: from asbnvacz-mailrelay01.megapath.net (asbnvacz-mailrelay01.megapath.net [207.145.128.243]) by mx1.freebsd.org (Postfix) with ESMTP id E6909F20 for ; Thu, 3 Jan 2013 19:58:22 +0000 (UTC) Received: from mail7.sea5.speakeasy.net (mail7.sea5.speakeasy.net [69.17.117.52]) by asbnvacz-mailrelay01.megapath.net (Postfix) with ESMTP id 09C08A71C24 for ; Thu, 3 Jan 2013 14:58:21 -0500 (EST) Received: (qmail 14060 invoked from network); 3 Jan 2013 19:58:21 -0000 Received: by simscan 1.4.0 ppid: 29059, pid: 29249, t: 0.1662s scanners: clamav: 0.88.2/m:52/d:13513 Received: from unknown (HELO be-well.ilk.org) ([66.92.78.145]) (envelope-sender ) by mail7.sea5.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 3 Jan 2013 19:58:21 -0000 Received: from lowell-desk.lan (lowell-desk.lan [172.30.250.8]) by be-well.ilk.org (Postfix) with ESMTP id 8E82933C32; Thu, 3 Jan 2013 14:58:15 -0500 (EST) Received: by lowell-desk.lan (Postfix, from userid 1147) id 688BB39855; Thu, 3 Jan 2013 14:58:15 -0500 (EST) From: Lowell Gilbert To: Hans Petter Selasky Subject: Re: Android device problems with MTP ID References: <44d2xmrrfp.fsf@lowell-desk.lan> <201301032039.16448.hselasky@c2i.net> Date: Thu, 03 Jan 2013 14:58:15 -0500 In-Reply-To: <201301032039.16448.hselasky@c2i.net> (Hans Petter Selasky's message of "Thu, 3 Jan 2013 20:39:16 +0100") Message-ID: <448v8arqco.fsf@lowell-desk.lan> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain Cc: freebsd-usb@freebsd.org X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jan 2013 19:58:23 -0000 Hans Petter Selasky writes: > On Thursday 03 January 2013 20:34:50 Lowell Gilbert wrote: >> On my (updated to Android 4.1.1) phone, MTP only works if the phone's >> USB debugging option is enabled. If it is, usbconfig(8) sees a ugen(4) >> interface of MTP type; but otherwise it just shows up as a CD device. > Try to use cdcontrol to eject the CD. Thanks! That works! [And I can see the logic behind it, even, from a firmware point of view.] I should be able to automate the eject command through devd, I think. It would be nice to put something in the tree that would do that, but being sure not to catch cases you'd want such a feature would be error-prone. I'll move forward on making MTP more convenient on FreeBSD. A lot of devices are starting to force it on us, and it keeps the device usable while the computer is accessing its files. Thanks again! Be well. Lowell -- http://be-well.ilk.org/~lowell/ From owner-freebsd-usb@FreeBSD.ORG Thu Jan 3 20:03:27 2013 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id CA676B6 for ; Thu, 3 Jan 2013 20:03:27 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe02.c2i.net [212.247.154.34]) by mx1.freebsd.org (Postfix) with ESMTP id 609A8F7F for ; Thu, 3 Jan 2013 20:03:26 +0000 (UTC) X-T2-Spam-Status: No, hits=-1.0 required=5.0 tests=ALL_TRUSTED Received: from [176.74.213.204] (account mc467741@c2i.net HELO laptop015.hselasky.homeunix.org) by mailfe02.swip.net (CommuniGate Pro SMTP 5.4.4) with ESMTPA id 364994727; Thu, 03 Jan 2013 21:03:18 +0100 From: Hans Petter Selasky To: Lowell Gilbert Subject: Re: Android device problems with MTP ID Date: Thu, 3 Jan 2013 21:04:54 +0100 User-Agent: KMail/1.13.7 (FreeBSD/9.1-PRERELEASE; KDE/4.8.4; amd64; ; ) References: <44d2xmrrfp.fsf@lowell-desk.lan> <201301032039.16448.hselasky@c2i.net> <448v8arqco.fsf@lowell-desk.lan> In-Reply-To: <448v8arqco.fsf@lowell-desk.lan> X-Face: ?p&W)c(+80hU; '{.$5K+zq{oC6y| /D'an*6mw>j'f:eBsex\Gi, Cc: freebsd-usb@freebsd.org X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jan 2013 20:03:27 -0000 On Thursday 03 January 2013 20:58:15 Lowell Gilbert wrote: > Hans Petter Selasky writes: > > On Thursday 03 January 2013 20:34:50 Lowell Gilbert wrote: > >> On my (updated to Android 4.1.1) phone, MTP only works if the phone's > >> USB debugging option is enabled. If it is, usbconfig(8) sees a ugen(4) > >> interface of MTP type; but otherwise it just shows up as a CD device. > > > > Try to use cdcontrol to eject the CD. > > Thanks! That works! [And I can see the logic behind it, even, from a > firmware point of view.] > > I should be able to automate the eject command through devd, I think. > It would be nice to put something in the tree that would do that, but > being sure not to catch cases you'd want such a feature would be > error-prone. > > I'll move forward on making MTP more convenient on FreeBSD. A lot of > devices are starting to force it on us, and it keeps the device usable > while the computer is accessing its files. > > Thanks again! > > Be well. > Lowell There might be a quirk for that. See usbconfig, and send a patch for that if you figure it out :-) --HPS From owner-freebsd-usb@FreeBSD.ORG Thu Jan 3 20:31:48 2013 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C12EE5D5 for ; Thu, 3 Jan 2013 20:31:48 +0000 (UTC) (envelope-from Lowell@Be-Well.Ilk.Org) Received: from asbnvacz-mailrelay01.megapath.net (asbnvacz-mailrelay01.megapath.net [207.145.128.243]) by mx1.freebsd.org (Postfix) with ESMTP id 88EE6190 for ; Thu, 3 Jan 2013 20:31:48 +0000 (UTC) Received: from mail7.sea5.speakeasy.net (mail7.sea5.speakeasy.net [69.17.117.52]) by asbnvacz-mailrelay01.megapath.net (Postfix) with ESMTP id BB721A71B08 for ; Thu, 3 Jan 2013 15:31:47 -0500 (EST) Received: (qmail 7781 invoked from network); 3 Jan 2013 20:31:47 -0000 Received: by simscan 1.4.0 ppid: 13646, pid: 21462, t: 0.1896s scanners: clamav: 0.88.2/m:52/d:13513 Received: from unknown (HELO be-well.ilk.org) ([66.92.78.145]) (envelope-sender ) by mail7.sea5.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 3 Jan 2013 20:31:47 -0000 Received: from lowell-desk.lan (lowell-desk.lan [172.30.250.8]) by be-well.ilk.org (Postfix) with ESMTP id 7E46833C1D; Thu, 3 Jan 2013 15:31:41 -0500 (EST) Received: by lowell-desk.lan (Postfix, from userid 1147) id 2957B39855; Thu, 3 Jan 2013 15:31:41 -0500 (EST) From: Lowell Gilbert To: Hans Petter Selasky Subject: Re: Android device problems with MTP ID References: <44d2xmrrfp.fsf@lowell-desk.lan> <201301032039.16448.hselasky@c2i.net> <448v8arqco.fsf@lowell-desk.lan> <201301032104.54225.hselasky@c2i.net> Date: Thu, 03 Jan 2013 15:31:41 -0500 In-Reply-To: <201301032104.54225.hselasky@c2i.net> (Hans Petter Selasky's message of "Thu, 3 Jan 2013 21:04:54 +0100") Message-ID: <44sj6iqa8i.fsf@lowell-desk.lan> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain Cc: freebsd-usb@freebsd.org X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jan 2013 20:31:48 -0000 Hans Petter Selasky writes: > On Thursday 03 January 2013 20:58:15 Lowell Gilbert wrote: >> Hans Petter Selasky writes: >> > On Thursday 03 January 2013 20:34:50 Lowell Gilbert wrote: >> >> On my (updated to Android 4.1.1) phone, MTP only works if the phone's >> >> USB debugging option is enabled. If it is, usbconfig(8) sees a ugen(4) >> >> interface of MTP type; but otherwise it just shows up as a CD device. >> > >> > Try to use cdcontrol to eject the CD. >> >> Thanks! That works! [And I can see the logic behind it, even, from a >> firmware point of view.] >> >> I should be able to automate the eject command through devd, I think. >> It would be nice to put something in the tree that would do that, but >> being sure not to catch cases you'd want such a feature would be >> error-prone. >> >> I'll move forward on making MTP more convenient on FreeBSD. A lot of >> devices are starting to force it on us, and it keeps the device usable >> while the computer is accessing its files. >> >> Thanks again! >> >> Be well. >> Lowell > > There might be a quirk for that. > > See usbconfig, and send a patch for that if you figure it out :-) This is going to apply to a *lot* of devices, so adding adding all of the devices individually seems like it would be a losing battle. If I'm wrong, or if it's worth doing anyway, I'd certainly be willing to do the code. There might be a way to tell that this needs to be done from the usbconfig info, or even from the contents of the ISO, but I don't see it. Maybe if I look deeper into the USB descriptor encodings I'll find something. I'd be happy to accept advice. At the very least, I'll document whatever I do so other people can imitate it. Be well. Lowell From owner-freebsd-usb@FreeBSD.ORG Fri Jan 4 04:45:32 2013 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 098E3B8F for ; Fri, 4 Jan 2013 04:45:32 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-la0-f45.google.com (mail-la0-f45.google.com [209.85.215.45]) by mx1.freebsd.org (Postfix) with ESMTP id 8ADFF931 for ; Fri, 4 Jan 2013 04:45:31 +0000 (UTC) Received: by mail-la0-f45.google.com with SMTP id ep20so8971777lab.4 for ; Thu, 03 Jan 2013 20:45:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:from:date:message-id:subject:to:content-type; bh=1+yU3Qjk5CAK3QM8t9of9gkLYTTvcwv6932h1H0yXnk=; b=oxnrOGcXZKv5swsTxAtl1EzFHcWizSaUCicamjg9lesAsCOYabczf/sQ4r8cg4ZhE/ Qp5teS8lAxcBQZZYQ51nPFnsyGgINU1Pz3rRbZvZXEqhHXToaPOLFlX+8sRGl4fTi/bZ CkV1evmj7loc5Z7Puwam7LvOfpScWOKmWPlZ0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type :x-gm-message-state; bh=1+yU3Qjk5CAK3QM8t9of9gkLYTTvcwv6932h1H0yXnk=; b=SC+AC1Js+hUu3GWupFUfLZOINN3xmmCcQXauPyYbxTwxXWTFjHt+aq4PI4wMkFXCxy Nb241ULwz2rr2mSBnf6X2XoojoWg5jFHINg91EV2WCgwqmNZVj54Vcp2/Ie+vG0ejC4j RFkiFg0/AVC+BNNKv6hLnwnSoe+H9Z9CcA9T0zVLVzVXkqP8avAdaPR+V/XZ8LTfR4im +JxhoBvc3dbZiQQ48Ac+cX0WK9oBykwWvtmNAp3ddIDgwO1IE34Yk0OmXVVTtiwF1piB EF40E1Fyaim2aCptCXjuBeIv5V4eHS55d+QyCLMnH6OEEaFjrsJtbv3rF1TRf+193QG9 A4sQ== Received: by 10.112.10.232 with SMTP id l8mr20960187lbb.69.1357274730205; Thu, 03 Jan 2013 20:45:30 -0800 (PST) MIME-Version: 1.0 Received: by 10.112.75.200 with HTTP; Thu, 3 Jan 2013 20:45:00 -0800 (PST) From: Eitan Adler Date: Thu, 3 Jan 2013 23:45:00 -0500 Message-ID: Subject: regression: if_rue device doesn't attach on HEAD To: freebsd-usb@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQnIv067TUHXeSuKy5rUoipRNbscStsW5sDLpAvpPRe2K06eXADE1Y57plRfhdF3uYYp61Ou X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jan 2013 04:45:32 -0000 I have a USB nic which worked in 9.1 but regressed in HEAD and appears as an unrecognized device. I have not had time to properly bisect this issue. Any suggestions or pointers are appreciated: ugen2.3: bLength = 0x0012 bDescriptorType = 0x0001 bDeviceClass = 0x0000 bDeviceSubClass = 0x0000 bDeviceProtocol = 0x0000 bMaxPacketSize0 = 0x0000 idVendor = 0x0bda idProduct = 0x8150 bcdDevice = 0x0100 iManufacturer = 0x0001 iProduct = 0x0002 iSerialNumber = 0x0003 <8628> bNumConfigurations = 0x0001 -- Eitan Adler From owner-freebsd-usb@FreeBSD.ORG Fri Jan 4 05:30:00 2013 Return-Path: Delivered-To: freebsd-usb@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BF7E81AD for ; Fri, 4 Jan 2013 05:30:00 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id A6F77A3C for ; Fri, 4 Jan 2013 05:30:00 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id r045U0wf000562 for ; Fri, 4 Jan 2013 05:30:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id r045U0qM000557; Fri, 4 Jan 2013 05:30:00 GMT (envelope-from gnats) Resent-Date: Fri, 4 Jan 2013 05:30:00 GMT Resent-Message-Id: <201301040530.r045U0qM000557@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-usb@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, jov Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 882BA19E for ; Fri, 4 Jan 2013 05:25:32 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 6FD00A32 for ; Fri, 4 Jan 2013 05:25:32 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.5/8.14.5) with ESMTP id r045PWAE047250 for ; Fri, 4 Jan 2013 05:25:32 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.5/8.14.5/Submit) id r045PW02047249; Fri, 4 Jan 2013 05:25:32 GMT (envelope-from nobody) Message-Id: <201301040525.r045PW02047249@red.freebsd.org> Date: Fri, 4 Jan 2013 05:25:32 GMT From: jov To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: usb/174963: buffalo wli-uc-gn wireless card sometimes unusable and emit "run0: wcid=xx out of range" X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jan 2013 05:30:00 -0000 >Number: 174963 >Category: usb >Synopsis: buffalo wli-uc-gn wireless card sometimes unusable and emit "run0: wcid=xx out of range" >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-usb >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Jan 04 05:30:00 UTC 2013 >Closed-Date: >Last-Modified: >Originator: jov >Release: 9.1 release >Organization: >Environment: fresh system,no custom kernel.but now I can't get it because I rebuild the kernel with the patch. >Description: I think the hardware is ok because I can use it in Win7. And in Freebsd 9.1,it works for sometime,but sometimes after system reboot or I plug out & plug in the card it my unusable.on the console it emmit: "run0: wcid=xx out of range" where xx is 91,87 and etc. it seams the wifi is connected because ifconfig wlan0 cmd shows the right ssid and bssid ,but inet addr is always 0.0.0.0 >How-To-Repeat: I plug out & plug in the card some times >Fix: thanks for PseudoCylon 's help, his patch solves the problem. Reboot or re-plug-in shouldn't be a cause of the problem. Receiving an association ID larger than device's max (64) is the problem. You must be using a high-end AP. Reboot or re-plug-in initiate re-association and just happen to receive a large association ID. AK --begin patch-- diff --git a/dev/usb/wlan/if_run.c b/dev/usb/wlan/if_run.c index 3d2577f..ed11d97 100644 --- a/dev/usb/wlan/if_run.c +++ b/dev/usb/wlan/if_run.c @@ -2019,7 +2019,8 @@ run_key_set_cb(void *arg) wcid = 0; /* NB: update WCID0 for group keys */ base = RT2860_SKEY(RUN_VAP(vap)->rvp_id, k->wk_keyix); } else { - wcid = RUN_AID2WCID(associd); + wcid = (vap->iv_opmode == IEEE80211_M_STA) ? + 1 : RUN_AID2WCID(associd); base = RT2860_PKEY(wcid); } @@ -2374,9 +2375,12 @@ run_newassoc(struct ieee80211_node *ni, int isnew) struct run_softc *sc = ic->ic_ifp->if_softc; uint8_t rate; uint8_t ridx; - uint8_t wcid = RUN_AID2WCID(ni->ni_associd); + uint8_t wcid; int i, j; + wcid = (vap->iv_opmode == IEEE80211_M_STA) ? + 1 : RUN_AID2WCID(ni->ni_associd); + if (wcid > RT2870_WCID_MAX) { device_printf(sc->sc_dev, "wcid=%d out of range\n", wcid); return; @@ -3044,8 +3048,12 @@ run_tx(struct run_softc *sc, struct mbuf *m, struct ieee80211_node *ni) txd->flags = qflags; txwi = (struct rt2860_txwi *)(txd + 1); txwi->xflags = xflags; - txwi->wcid = IEEE80211_IS_MULTICAST(wh->i_addr1) ? - 0 : RUN_AID2WCID(ni->ni_associd); + if (IEEE80211_IS_MULTICAST(wh->i_addr1)) + txwi->wcid = 0; + else { + txwi->wcid = (vap->iv_opmode == IEEE80211_M_STA) ? + 1 : RUN_AID2WCID(ni->ni_associd); + } /* clear leftover garbage bits */ txwi->flags = 0; txwi->txop = 0; >Release-Note: >Audit-Trail: >Unformatted: From owner-freebsd-usb@FreeBSD.ORG Fri Jan 4 08:24:53 2013 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DDA19385 for ; Fri, 4 Jan 2013 08:24:53 +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 78ED0387 for ; Fri, 4 Jan 2013 08:24:52 +0000 (UTC) X-T2-Spam-Status: No, hits=-1.0 required=5.0 tests=ALL_TRUSTED Received: from [176.74.213.204] (account mc467741@c2i.net HELO laptop015.hselasky.homeunix.org) by mailfe05.swip.net (CommuniGate Pro SMTP 5.4.4) with ESMTPA id 360056744; Fri, 04 Jan 2013 09:19:44 +0100 From: Hans Petter Selasky To: freebsd-usb@freebsd.org Subject: Re: regression: if_rue device doesn't attach on HEAD Date: Fri, 4 Jan 2013 09:21:19 +0100 User-Agent: KMail/1.13.7 (FreeBSD/9.1-PRERELEASE; KDE/4.8.4; amd64; ; ) References: In-Reply-To: X-Face: ?p&W)c(+80hU; '{.$5K+zq{oC6y| /D'an*6mw>j'f:eBsex\Gi, X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jan 2013 08:24:53 -0000 On Friday 04 January 2013 05:45:00 Eitan Adler wrote: > I have a USB nic which worked in 9.1 but regressed in HEAD and appears > as an unrecognized device. > > I have not had time to properly bisect this issue. > > Any suggestions or pointers are appreciated: > > ugen2.3: > > bLength = 0x0012 > bDescriptorType = 0x0001 > bDeviceClass = 0x0000 > bDeviceSubClass = 0x0000 > bDeviceProtocol = 0x0000 > bMaxPacketSize0 = 0x0000 > > idVendor = 0x0bda > idProduct = 0x8150 > bcdDevice = 0x0100 > iManufacturer = 0x0001 > iProduct = 0x0002 > iSerialNumber = 0x0003 <8628> > > bNumConfigurations = 0x0001 Did you kldload if_rue? Did you enable devd? --HPS From owner-freebsd-usb@FreeBSD.ORG Fri Jan 4 14:29:57 2013 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 795B5227 for ; Fri, 4 Jan 2013 14:29:57 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-la0-f41.google.com (mail-la0-f41.google.com [209.85.215.41]) by mx1.freebsd.org (Postfix) with ESMTP id C337A6A5 for ; Fri, 4 Jan 2013 14:29:56 +0000 (UTC) Received: by mail-la0-f41.google.com with SMTP id em20so9837027lab.28 for ; Fri, 04 Jan 2013 06:29:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=MtJpSJPb6wLiW2CxW2HMNxPZ9ZJttl3wwRDtpmZVOu0=; b=cR8lofK+eFzNBymcEkP0/tUM3ZD53kQ0kSU4hwKBqYZwjcZ9xNjAvWH5vRBuw86y1Q v8oQgcgu7qEQd1JjNTLnbrw+4ACJDA9e4Rj2NjWGX1cpbqy6AAv1lz3HFzAuQ4uejbCl emPmdUphY1CdzNHmQjT54oO4aIgvXI2HIuTMo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:x-gm-message-state; bh=MtJpSJPb6wLiW2CxW2HMNxPZ9ZJttl3wwRDtpmZVOu0=; b=I2eP83hCfeUEoRqE87A9o7SsNtgp5kFfX2akKKXchPOxXuv9AzdF/hdHLDWxPB9LRK pUshUrses8zNlE3d0Z2axbPqP0PNBel5SrmL8nKey7+KB5odXlOUCjua6C/phnWFX94q D7r6zs6NTlIq6dHjKh3WV0584zPl9APJEU+K6o9MTZJWi2ft+rvuaP3NYkRLucStMSaY zuwwV/E3ivqnAK/brejswXTWKwDTB5ogaTDh3i/Ww747FEf0V1/GDt2ImV+GRM1Rb/Sn 7EwEKmW1/cmLYxRk8IthedrfAbL0PvTGX/2vifOpKZGMcKzGvnJBgZVOJERyDkf7IfjG 6XPA== Received: by 10.152.106.163 with SMTP id gv3mr49891177lab.55.1357309790066; Fri, 04 Jan 2013 06:29:50 -0800 (PST) MIME-Version: 1.0 Received: by 10.112.75.200 with HTTP; Fri, 4 Jan 2013 06:29:18 -0800 (PST) In-Reply-To: <201301040921.19078.hselasky@c2i.net> References: <201301040921.19078.hselasky@c2i.net> From: Eitan Adler Date: Fri, 4 Jan 2013 09:29:18 -0500 Message-ID: Subject: Re: regression: if_rue device doesn't attach on HEAD To: Hans Petter Selasky Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQnre5no1ZXHAzmV7lA7XD12yaBlUqTM2E5gfqz10WqJv3f+pDQLWAZgnFmpdoj+/Na4MM4l Cc: freebsd-usb@freebsd.org X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jan 2013 14:29:57 -0000 On 4 January 2013 03:21, Hans Petter Selasky wrote: > Did you kldload if_rue? > Did you enable devd? Default & Default - it worked in 9.1 so I assumed it should work the same in HEAD. I'll try explicitly doing so when I get home. -- Eitan Adler From owner-freebsd-usb@FreeBSD.ORG Fri Jan 4 20:50:01 2013 Return-Path: Delivered-To: freebsd-usb@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8712966F for ; Fri, 4 Jan 2013 20:50:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 5DE8B87F for ; Fri, 4 Jan 2013 20:50:01 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id r04Ko1vM061534 for ; Fri, 4 Jan 2013 20:50:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id r04Ko1mg061530; Fri, 4 Jan 2013 20:50:01 GMT (envelope-from gnats) Date: Fri, 4 Jan 2013 20:50:01 GMT Message-Id: <201301042050.r04Ko1mg061530@freefall.freebsd.org> To: freebsd-usb@FreeBSD.org Cc: From: dfilter@FreeBSD.ORG (dfilter service) Subject: Re: usb/174963: commit references a PR X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: dfilter service List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jan 2013 20:50:01 -0000 The following reply was made to PR usb/174963; it has been noted by GNATS. From: dfilter@FreeBSD.ORG (dfilter service) To: bug-followup@FreeBSD.org Cc: Subject: Re: usb/174963: commit references a PR Date: Fri, 4 Jan 2013 20:44:30 +0000 (UTC) Author: hselasky Date: Fri Jan 4 20:44:17 2013 New Revision: 245047 URL: http://svnweb.freebsd.org/changeset/base/245047 Log: Fix for "run0: wcid=xx out of range" error message. MFC after: 1 week PR: usb/174963 Submitted by: PseudoCylon Modified: head/sys/dev/usb/wlan/if_run.c Modified: head/sys/dev/usb/wlan/if_run.c ============================================================================== --- head/sys/dev/usb/wlan/if_run.c Fri Jan 4 19:29:23 2013 (r245046) +++ head/sys/dev/usb/wlan/if_run.c Fri Jan 4 20:44:17 2013 (r245047) @@ -2019,7 +2019,8 @@ run_key_set_cb(void *arg) wcid = 0; /* NB: update WCID0 for group keys */ base = RT2860_SKEY(RUN_VAP(vap)->rvp_id, k->wk_keyix); } else { - wcid = RUN_AID2WCID(associd); + wcid = (vap->iv_opmode == IEEE80211_M_STA) ? + 1 : RUN_AID2WCID(associd); base = RT2860_PKEY(wcid); } @@ -2374,9 +2375,12 @@ run_newassoc(struct ieee80211_node *ni, struct run_softc *sc = ic->ic_ifp->if_softc; uint8_t rate; uint8_t ridx; - uint8_t wcid = RUN_AID2WCID(ni->ni_associd); + uint8_t wcid; int i, j; + wcid = (vap->iv_opmode == IEEE80211_M_STA) ? + 1 : RUN_AID2WCID(ni->ni_associd); + if (wcid > RT2870_WCID_MAX) { device_printf(sc->sc_dev, "wcid=%d out of range\n", wcid); return; @@ -3044,8 +3048,12 @@ run_tx(struct run_softc *sc, struct mbuf txd->flags = qflags; txwi = (struct rt2860_txwi *)(txd + 1); txwi->xflags = xflags; - txwi->wcid = IEEE80211_IS_MULTICAST(wh->i_addr1) ? - 0 : RUN_AID2WCID(ni->ni_associd); + if (IEEE80211_IS_MULTICAST(wh->i_addr1)) { + txwi->wcid = 0; + } else { + txwi->wcid = (vap->iv_opmode == IEEE80211_M_STA) ? + 1 : RUN_AID2WCID(ni->ni_associd); + } /* clear leftover garbage bits */ txwi->flags = 0; txwi->txop = 0; _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" From owner-freebsd-usb@FreeBSD.ORG Fri Jan 4 21:32:09 2013 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id CD41025F for ; Fri, 4 Jan 2013 21:32:09 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-la0-f45.google.com (mail-la0-f45.google.com [209.85.215.45]) by mx1.freebsd.org (Postfix) with ESMTP id 4C860A34 for ; Fri, 4 Jan 2013 21:32:08 +0000 (UTC) Received: by mail-la0-f45.google.com with SMTP id ep20so10516708lab.32 for ; Fri, 04 Jan 2013 13:32:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=BPADYlDPdXj4EKPT0PwmQX9HL8Y+jDbIiZQ1/tzu3jY=; b=JGrp7yCnDctLFvL3XXcqRI28EDBsUQs+xDn4yE1S1Bd+xNpx9k3Z7aDP2OajHtmkCn E8rFaNqJSXeb9KTrqv1U8NpYggc8N38W6jd9sQoDr5/I4Y4O0CMCR/leXoNqGEO2W50O 9CRHoT9s8hODTClfcHK769G6491bpziEEUwOM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:x-gm-message-state; bh=BPADYlDPdXj4EKPT0PwmQX9HL8Y+jDbIiZQ1/tzu3jY=; b=RW9Ny8H6UHr14HLU6+pWbGci8jdeTCMMKhsM3TLmjf1RaYB5zoVVr1k4sO+1ooFV55 8CzKUCSFczb3Au/VH7/LJSvqBANCKmHBJz+bDdCSDLJlrZl9QRjHdS2XLS2XFbWd6HxI xHiGvyKrtP2OU6fPd9l33A0Qoht6AXtHR5xHjCvz0RJaYXaTeF3tGp+QlASPUhzgJyws tngI1DBFJ6zrSf8Nl5QBf3Vuy6m6CySxTX1vFPzhSEn1kuo78jgFJRgRDAkA7w0eQBt4 qiTIvs7Q0ZyH9YYDZfZUfrLPZ3H0XhhhIhHpf5wIjxXFA+zxNXbwkL23kc4+7NqfZOhh 6pYQ== Received: by 10.112.47.38 with SMTP id a6mr22241689lbn.93.1357335121737; Fri, 04 Jan 2013 13:32:01 -0800 (PST) MIME-Version: 1.0 Received: by 10.112.75.200 with HTTP; Fri, 4 Jan 2013 13:31:31 -0800 (PST) In-Reply-To: <201301040921.19078.hselasky@c2i.net> References: <201301040921.19078.hselasky@c2i.net> From: Eitan Adler Date: Fri, 4 Jan 2013 16:31:31 -0500 Message-ID: Subject: Re: regression: if_rue device doesn't attach on HEAD To: Hans Petter Selasky Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQkU8JZTJYTJc1dn63TrwleLiPHQTMq2Z7ksXe/XTqtOl9ftAh0hjN5ZXHpmfIG7Ayli+v73 Cc: freebsd-usb@freebsd.org X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jan 2013 21:32:09 -0000 On 4 January 2013 03:21, Hans Petter Selasky wrote: > > Did you kldload if_rue? Yes. This did nothing to help. > Did you enable devd? Yes, this was already enabled. Use(full|less) debug info: I now see xhci_do_command: Command timeout! device init 2 failed USB_ERR_TIMEOUT which I did not see before in dmesg. -- Eitan Adler From owner-freebsd-usb@FreeBSD.ORG Fri Jan 4 21:33:20 2013 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C8FB2297 for ; Fri, 4 Jan 2013 21:33:20 +0000 (UTC) (envelope-from Lowell@Be-Well.Ilk.Org) Received: from asbnvacz-mailrelay01.megapath.net (asbnvacz-mailrelay01.megapath.net [207.145.128.243]) by mx1.freebsd.org (Postfix) with ESMTP id 933BDA3D for ; Fri, 4 Jan 2013 21:33:20 +0000 (UTC) Received: from mail8.sea5.speakeasy.net (mail8.sea5.speakeasy.net [69.17.117.53]) by asbnvacz-mailrelay01.megapath.net (Postfix) with ESMTP id 2E49EA71455 for ; Fri, 4 Jan 2013 16:33:14 -0500 (EST) Received: (qmail 4586 invoked from network); 4 Jan 2013 21:33:13 -0000 Received: by simscan 1.4.0 ppid: 26871, pid: 27899, t: 0.1925s scanners: clamav: 0.88.2/m:52/d:13495 Received: from unknown (HELO be-well.ilk.org) ([66.92.78.145]) (envelope-sender ) by mail8.sea5.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 4 Jan 2013 21:33:13 -0000 Received: by be-well.ilk.org (Postfix, from userid 1147) id E5FE733C32; Fri, 4 Jan 2013 16:33:12 -0500 (EST) From: Lowell Gilbert To: freebsd-usb@freebsd.org Subject: auto-dismount fake CD (was Re: Android device problems with MTP ID) References: <44d2xmrrfp.fsf@lowell-desk.lan> <201301032039.16448.hselasky@c2i.net> <448v8arqco.fsf@lowell-desk.lan> <201301032104.54225.hselasky@c2i.net> Date: Fri, 04 Jan 2013 16:33:12 -0500 In-Reply-To: <201301032104.54225.hselasky@c2i.net> (Hans Petter Selasky's message of "Thu, 3 Jan 2013 21:04:54 +0100") Message-ID: <4438ygbplz.fsf_-_@be-well.ilk.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain Cc: Lowell Gilbert X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jan 2013 21:33:20 -0000 Hans Petter Selasky writes: > On Thursday 03 January 2013 20:58:15 Lowell Gilbert wrote: >> Hans Petter Selasky writes: >> > On Thursday 03 January 2013 20:34:50 Lowell Gilbert wrote: >> >> On my (updated to Android 4.1.1) phone, MTP only works if the phone's >> >> USB debugging option is enabled. If it is, usbconfig(8) sees a ugen(4) >> >> interface of MTP type; but otherwise it just shows up as a CD device. >> > >> > Try to use cdcontrol to eject the CD. >> >> Thanks! That works! [And I can see the logic behind it, even, from a >> firmware point of view.] >> >> I should be able to automate the eject command through devd, I think. >> It would be nice to put something in the tree that would do that, but >> being sure not to catch cases you'd want such a feature would be >> error-prone. >> >> I'll move forward on making MTP more convenient on FreeBSD. A lot of >> devices are starting to force it on us, and it keeps the device usable >> while the computer is accessing its files. >> >> Thanks again! >> >> Be well. >> Lowell > > There might be a quirk for that. > > See usbconfig, and send a patch for that if you figure it out :-) I was wrong about being able to do this in userland; devd doesn't have the device name, and devfs doesn't have enough information to identify the disk as being bogus (as well as not currently having a mechanism to do anything to the device except ownership/permissions/etc.). So I guess a quirk would be the best way to do it, and I don't see any existing functionality that even resembles this. Is this something that would be worth my while to create? I wouldn't mind writing it if it were generally useful, but I don't know for a fact that anyone else would want to use it. A scheme flexible enough to have a hope of working with future devices would be substantially more complicated than I need for my own purposes, so I'd like to know if anyone else would want it also. Thanks, Lowell From owner-freebsd-usb@FreeBSD.ORG Fri Jan 4 21:39:48 2013 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5BE7F303 for ; Fri, 4 Jan 2013 21:39:48 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe02.c2i.net [212.247.154.34]) by mx1.freebsd.org (Postfix) with ESMTP id DE8ABA66 for ; Fri, 4 Jan 2013 21:39:47 +0000 (UTC) X-T2-Spam-Status: No, hits=-1.0 required=5.0 tests=ALL_TRUSTED Received: from [176.74.213.204] (account mc467741@c2i.net HELO laptop015.hselasky.homeunix.org) by mailfe02.swip.net (CommuniGate Pro SMTP 5.4.4) with ESMTPA id 365317944; Fri, 04 Jan 2013 22:39:40 +0100 From: Hans Petter Selasky To: Eitan Adler Subject: Re: regression: if_rue device doesn't attach on HEAD Date: Fri, 4 Jan 2013 22:41:15 +0100 User-Agent: KMail/1.13.7 (FreeBSD/9.1-PRERELEASE; KDE/4.8.4; amd64; ; ) References: <201301040921.19078.hselasky@c2i.net> In-Reply-To: X-Face: ?p&W)c(+80hU; '{.$5K+zq{oC6y| /D'an*6mw>j'f:eBsex\Gi, Cc: freebsd-usb@freebsd.org X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jan 2013 21:39:48 -0000 On Friday 04 January 2013 22:31:31 Eitan Adler wrote: > On 4 January 2013 03:21, Hans Petter Selasky wrote: > > Did you kldload if_rue? > > Yes. This did nothing to help. > > > Did you enable devd? > > Yes, this was already enabled. > > Use(full|less) debug info: > > I now see xhci_do_command: Command timeout! > device init 2 failed USB_ERR_TIMEOUT > > which I did not see before in dmesg. Hi, This typically means set address failed, which in the XHCI is done in "HW". I'll look into if I find some time. Not sure what we can do about it. You can try set first set config 255 and the config 0 on the parent HUB of this device using usbconfig. --HPS From owner-freebsd-usb@FreeBSD.ORG Fri Jan 4 21:46:04 2013 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id F0B913AF for ; Fri, 4 Jan 2013 21:46:04 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe08.c2i.net [212.247.154.226]) by mx1.freebsd.org (Postfix) with ESMTP id 89E8AA96 for ; Fri, 4 Jan 2013 21:46:03 +0000 (UTC) X-T2-Spam-Status: No, hits=-1.0 required=5.0 tests=ALL_TRUSTED Received: from [176.74.213.204] (account mc467741@c2i.net HELO laptop015.hselasky.homeunix.org) by mailfe08.swip.net (CommuniGate Pro SMTP 5.4.4) with ESMTPA id 365858526; Fri, 04 Jan 2013 22:40:55 +0100 From: Hans Petter Selasky To: freebsd-usb@freebsd.org Subject: Re: auto-dismount fake CD (was Re: Android device problems with MTP ID) Date: Fri, 4 Jan 2013 22:42:30 +0100 User-Agent: KMail/1.13.7 (FreeBSD/9.1-PRERELEASE; KDE/4.8.4; amd64; ; ) References: <44d2xmrrfp.fsf@lowell-desk.lan> <201301032104.54225.hselasky@c2i.net> <4438ygbplz.fsf_-_@be-well.ilk.org> In-Reply-To: <4438ygbplz.fsf_-_@be-well.ilk.org> X-Face: ?p&W)c(+80hU; '{.$5K+zq{oC6y| /D'an*6mw>j'f:eBsex\Gi, Cc: Lowell Gilbert X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jan 2013 21:46:05 -0000 On Friday 04 January 2013 22:33:12 Lowell Gilbert wrote: > Hans Petter Selasky writes: > > On Thursday 03 January 2013 20:58:15 Lowell Gilbert wrote: > >> Hans Petter Selasky writes: > >> > On Thursday 03 January 2013 20:34:50 Lowell Gilbert wrote: > >> >> On my (updated to Android 4.1.1) phone, MTP only works if the phone's > >> >> USB debugging option is enabled. If it is, usbconfig(8) sees a > >> >> ugen(4) interface of MTP type; but otherwise it just shows up as a > >> >> CD device. > >> > > >> > Try to use cdcontrol to eject the CD. > >> > >> Thanks! That works! [And I can see the logic behind it, even, from a > >> firmware point of view.] > >> > >> I should be able to automate the eject command through devd, I think. > >> It would be nice to put something in the tree that would do that, but > >> being sure not to catch cases you'd want such a feature would be > >> error-prone. > >> > >> I'll move forward on making MTP more convenient on FreeBSD. A lot of > >> devices are starting to force it on us, and it keeps the device usable > >> while the computer is accessing its files. > >> > >> Thanks again! > >> > >> Be well. > >> > >> Lowell > > > > There might be a quirk for that. > > > > See usbconfig, and send a patch for that if you figure it out :-) > > I was wrong about being able to do this in userland; devd doesn't have > the device name, and devfs doesn't have enough information to identify > the disk as being bogus (as well as not currently having a mechanism to > do anything to the device except ownership/permissions/etc.). > > So I guess a quirk would be the best way to do it, and I don't see any > existing functionality that even resembles this. Is this something that > would be worth my while to create? > > I wouldn't mind writing it if it were generally useful, but I don't know > for a fact that anyone else would want to use it. A scheme flexible > enough to have a hope of working with future devices would be > substantially more complicated than I need for my own purposes, so I'd > like to know if anyone else would want it also. > See the serial/u3g.c driver and usb/usb_msctest.c and look for SCSI EJECT. --HPS From owner-freebsd-usb@FreeBSD.ORG Fri Jan 4 21:51:16 2013 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 65B5D4F8 for ; Fri, 4 Jan 2013 21:51:16 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-la0-f43.google.com (mail-la0-f43.google.com [209.85.215.43]) by mx1.freebsd.org (Postfix) with ESMTP id E67A6AB9 for ; Fri, 4 Jan 2013 21:51:15 +0000 (UTC) Received: by mail-la0-f43.google.com with SMTP id eg20so10318994lab.2 for ; Fri, 04 Jan 2013 13:51:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=jzBzbV+lIBjy3Iume/s5s1k1NamY7ezXFZ8dP88Th4E=; b=RNXI217lA10uPXT111kc//n2XhZTLwNdF5bG+mVVzaoymZkU6tcWCRmFm843mksda9 3MFV0ZSZKnP98eBFJKtyk4wV99tdxuFy6Xraz/oWBNqyoeTvPzTo6Hi/cdXP65t4TD/t rdWLu9MQmsBmjM+saGW7r8sjG8gPoh/k8QFiU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:x-gm-message-state; bh=jzBzbV+lIBjy3Iume/s5s1k1NamY7ezXFZ8dP88Th4E=; b=bch5/wVk8ZTueSD2mNHXWHggDJs0NoqIEWdedH7+JqdeNnIqOYuukSEXY9CxEGMe+m Iy0ffnAYIulIEju9lc2S1mHGtv4NXgnZa0GT9m2D6yZI7ZCNVkhjJuUlC9gCG4mcc00w F4wv6LJ5FvkQ6x8VdDO6H2qvL5W8CYI9RraOaT4dA2ihqhqYv1IeyKSoD0R8Khoue9NL rtnXBTR5mX54UpfMSW9uQfTZ5GBDAEWzzNbL7JYK0X/qPonLjQLhNZq2BFlRK5pEKcHE 8+3MHYnfA6na/fLAP9at6LYE791Ii7gwAMy3+WoBfvFNQZ0SVrZBvLOFZjXXns0gJ8KF OmPA== Received: by 10.112.10.232 with SMTP id l8mr22050781lbb.69.1357336268614; Fri, 04 Jan 2013 13:51:08 -0800 (PST) MIME-Version: 1.0 Received: by 10.112.75.200 with HTTP; Fri, 4 Jan 2013 13:50:38 -0800 (PST) In-Reply-To: <201301042241.15044.hselasky@c2i.net> References: <201301040921.19078.hselasky@c2i.net> <201301042241.15044.hselasky@c2i.net> From: Eitan Adler Date: Fri, 4 Jan 2013 16:50:38 -0500 Message-ID: Subject: Re: regression: if_rue device doesn't attach on HEAD To: Hans Petter Selasky Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQlCgD1RzkbvyAPCHsy1lKYtvT+HAYJcetN4yc8au+dCM4tpQ7XJbuuoeT4NGl0vlrOfT9hm Cc: freebsd-usb@freebsd.org X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jan 2013 21:51:16 -0000 On 4 January 2013 16:41, Hans Petter Selasky wrote: > This typically means set address failed, which in the XHCI is done in "HW". > I'll look into if I find some time. Not sure what we can do about it. As I mentioned - it works in 9.1 so *something* regressed. > You can try set first set config 255 and the config 0 on the parent HUB of > this device using usbconfig. I'm not sure what you mean here. What command should I run? -- Eitan Adler From owner-freebsd-usb@FreeBSD.ORG Fri Jan 4 21:56:43 2013 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8C4405EF for ; Fri, 4 Jan 2013 21:56:43 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe06.c2i.net [212.247.154.162]) by mx1.freebsd.org (Postfix) with ESMTP id 21050AE8 for ; Fri, 4 Jan 2013 21:56:42 +0000 (UTC) X-T2-Spam-Status: No, hits=-1.0 required=5.0 tests=ALL_TRUSTED Received: from [176.74.213.204] (account mc467741@c2i.net HELO laptop015.hselasky.homeunix.org) by mailfe06.swip.net (CommuniGate Pro SMTP 5.4.4) with ESMTPA id 363268158; Fri, 04 Jan 2013 22:56:39 +0100 From: Hans Petter Selasky To: Eitan Adler Subject: Re: regression: if_rue device doesn't attach on HEAD Date: Fri, 4 Jan 2013 22:58:14 +0100 User-Agent: KMail/1.13.7 (FreeBSD/9.1-PRERELEASE; KDE/4.8.4; amd64; ; ) References: <201301042241.15044.hselasky@c2i.net> In-Reply-To: X-Face: ?p&W)c(+80hU; '{.$5K+zq{oC6y| /D'an*6mw>j'f:eBsex\Gi, Cc: freebsd-usb@freebsd.org X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jan 2013 21:56:43 -0000 On Friday 04 January 2013 22:50:38 Eitan Adler wrote: > On 4 January 2013 16:41, Hans Petter Selasky wrote: > > This typically means set address failed, which in the XHCI is done in > > "HW". I'll look into if I find some time. Not sure what we can do about > > it. > > As I mentioned - it works in 9.1 so *something* regressed. > > > You can try set first set config 255 and the config 0 on the parent HUB > > of this device using usbconfig. > > I'm not sure what you mean here. What command should I run? What XHCI hardware is this? --HPS From owner-freebsd-usb@FreeBSD.ORG Fri Jan 4 22:05:30 2013 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A10AD72E for ; Fri, 4 Jan 2013 22:05:30 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe09.c2i.net [212.247.155.2]) by mx1.freebsd.org (Postfix) with ESMTP id 372C6B34 for ; Fri, 4 Jan 2013 22:05:29 +0000 (UTC) X-T2-Spam-Status: No, hits=-1.0 required=5.0 tests=ALL_TRUSTED Received: from [176.74.213.204] (account mc467741@c2i.net HELO laptop015.hselasky.homeunix.org) by mailfe09.swip.net (CommuniGate Pro SMTP 5.4.4) with ESMTPA id 190751651; Fri, 04 Jan 2013 23:00:21 +0100 From: Hans Petter Selasky To: Eitan Adler Subject: Re: regression: if_rue device doesn't attach on HEAD Date: Fri, 4 Jan 2013 23:01:56 +0100 User-Agent: KMail/1.13.7 (FreeBSD/9.1-PRERELEASE; KDE/4.8.4; amd64; ; ) References: <201301042241.15044.hselasky@c2i.net> In-Reply-To: X-Face: ?p&W)c(+80hU; '{.$5K+zq{oC6y| /D'an*6mw>j'f:eBsex\Gi, Cc: freebsd-usb@freebsd.org X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jan 2013 22:05:30 -0000 On Friday 04 January 2013 22:50:38 Eitan Adler wrote: > On 4 January 2013 16:41, Hans Petter Selasky wrote: > > This typically means set address failed, which in the XHCI is done in > > "HW". I'll look into if I find some time. Not sure what we can do about > > it. > Hi, > As I mentioned - it works in 9.1 so *something* regressed. The only which I can think of which caused this is the recently added ETRON patches. You can look in the xhci.c revision history and revert from the top? There aren't that many patches made in that area. > > You can try set first set config 255 and the config 0 on the parent HUB > > of this device using usbconfig. > > I'm not sure what you mean here. What command should I run? usbconfig -d X.1 set_config 255 usbconfig -d X.1 set_config 0 --HPS