Re: usb/175302: don't mount virtual driver CD for my phone

2013-02-28 Thread Lowell Gilbert
The following reply was made to PR usb/175302; it has been noted by GNATS.

From: Lowell Gilbert 
To: freebsd-gnats-sub...@freebsd.org
Cc: freebsd-usb@FreeBSD.org
Subject: Re: usb/175302: don't mount virtual driver CD for my phone
Date: Thu, 28 Feb 2013 12:10:02 -0500

 This is a duplicate and has been fixed. Please close.
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


Re: usb/175302: don't mount virtual driver CD for my phone

2013-02-28 Thread Lowell Gilbert
This is a duplicate and has been fixed. Please close.
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


Re: usb/175296: [PATCH] disable fake CD mount for Atria HD phone

2013-02-28 Thread Lowell Gilbert
@hps already MFC'd this, so it should be closed.
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


don't mount virtual driver CD for my phone

2013-01-14 Thread Lowell Gilbert

>Submitter-Id:  current-users
>Originator:Lowell Gilbert
>Organization:  The Ilk
>Confidential:  no 
>Synopsis:  don't mount virtual driver CD for my phone
>Severity:  non-critical
>Priority:  low
>Category:  usb
>Class: change-request
>Release:   FreeBSD 9.1-STABLE amd64
>Environment:
System: FreeBSD lowell-desk.lan 9.1-STABLE FreeBSD 9.1-STABLE #9 r245177M: Wed 
Jan 9 06:47:54 EST 2013 r...@lowell-desk.lan:/usr/obj/usr/src/sys/LOWELL64 amd64



>Description:

Add another device that shouldn't auto-mount its faked-up driver CD when 
loaded. 

Sent this in a few minutes ago, but I spelled my own address wrong. I'll 
automate that before my next PR.


>How-To-Repeat:

[Requires my phone.]


>Fix:




I can move this to somewhere more relevant to my not-a-serial-port-device, 
but I'll need guidance on where that should be.


Index: sys/dev/usb/serial/u3g.c
===
--- sys/dev/usb/serial/u3g.c(revision 245177)
+++ sys/dev/usb/serial/u3g.c(working copy)
@@ -555,6 +555,7 @@
U3G_DEV(YISO, C893, 0),
/* Autoinstallers */
U3G_DEV(NOVATEL, ZEROCD, U3GINIT_SCSIEJECT),
+   U3G_DEV(MOTOROLA2, MB886, U3GINIT_SCSIEJECT),
U3G_DEV(OPTION, GTICON322, U3GINIT_REZERO),
U3G_DEV(QUALCOMMINC, ZTE_STOR, U3GINIT_ZTESTOR),
U3G_DEV(QUALCOMMINC, ZTE_STOR2, U3GINIT_SCSIEJECT),
Index: sys/dev/usb/usbdevs
===
--- sys/dev/usb/usbdevs (revision 245177)
+++ sys/dev/usb/usbdevs (working copy)
@@ -2930,6 +2930,7 @@
 /* Motorola products */
 product MOTOROLA MC141555  0x1555  MC141555 hub controller
 product MOTOROLA SB41000x4100  SB4100 USB Cable Modem
+product MOTOROLA2 MB8860x710f  MB886 Mobile Phone (Atria HD)
 product MOTOROLA2 T720C0x2822  T720c
 product MOTOROLA2 A41XV32X 0x2a22  A41x/V32x Mobile Phones
 product MOTOROLA2 E398 0x4810  E398 Mobile Phone
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


[PATCH] disable fake CD mount for Atria HD phone

2013-01-14 Thread Lowell Gilbert

>Submitter-Id:  current-users
>Originator:Lowell Gilbert
>Organization:  The Ilk
>Confidential:  no 
>Synopsis:  [PATCH] disable fake CD mount for Atria HD phone
>Severity:  non-critical
>Priority:  low
>Category:  usb
>Class: change-request
>Release:   FreeBSD 9.1-STABLE amd64
>Environment:
System: FreeBSD lowell-desk.lan 9.1-STABLE FreeBSD 9.1-STABLE #9 r245177M: Wed 
Jan 9 06:47:54 EST 2013 r...@lowell-desk.lan:/usr/obj/usr/src/sys/LOWELL64 amd64



>Description:


Add another device that shouldn't mount the fake CD device presented
for Windows/MAC drivers.

>How-To-Repeat:
Requires Motorola MB886 phone
>Fix:




May not be the most elegant solution, but it works...

===
--- sys/dev/usb/serial/u3g.c(revision 245177)
+++ sys/dev/usb/serial/u3g.c(working copy)
@@ -555,6 +555,7 @@
U3G_DEV(YISO, C893, 0),
/* Autoinstallers */
U3G_DEV(NOVATEL, ZEROCD, U3GINIT_SCSIEJECT),
+   U3G_DEV(MOTOROLA2, MB886, U3GINIT_SCSIEJECT),
U3G_DEV(OPTION, GTICON322, U3GINIT_REZERO),
U3G_DEV(QUALCOMMINC, ZTE_STOR, U3GINIT_ZTESTOR),
U3G_DEV(QUALCOMMINC, ZTE_STOR2, U3GINIT_SCSIEJECT),
Index: sys/dev/usb/usbdevs
===
--- sys/dev/usb/usbdevs (revision 245177)
+++ sys/dev/usb/usbdevs (working copy)
@@ -2930,6 +2930,7 @@
 /* Motorola products */
 product MOTOROLA MC141555  0x1555  MC141555 hub controller
 product MOTOROLA SB41000x4100  SB4100 USB Cable Modem
+product MOTOROLA2 MB8860x710f  MB886 Mobile Phone (Atria HD)
 product MOTOROLA2 T720C0x2822  T720c
 product MOTOROLA2 A41XV32X 0x2a22  A41x/V32x Mobile Phones
 product MOTOROLA2 E398 0x4810  E398 Mobile Phone
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


Re: auto-dismount fake CD (was Re: Android device problems with MTP ID)

2013-01-09 Thread Lowell Gilbert
Hans Petter Selasky  writes:

> See the serial/u3g.c driver and usb/usb_msctest.c and look for SCSI EJECT.

Thanks again!

I had checked usb and cam directories, but I didn't think to check in
serial. This is the first time I ran into such a device, and I wouldn't
have guessed that modems were doing it first.

I could submit a patch now, but I told a few other people I'd include
their devices, so I'll wait a few days. Also, it seems desirable that
the eject functionality should be refactored out of the u3g loading, so
that other people can find it.

At any rate, this works for me:

Index: sys/dev/usb/serial/u3g.c
===
--- sys/dev/usb/serial/u3g.c(revision 245177)
+++ sys/dev/usb/serial/u3g.c(working copy)
@@ -555,6 +555,7 @@
U3G_DEV(YISO, C893, 0),
/* Autoinstallers */
U3G_DEV(NOVATEL, ZEROCD, U3GINIT_SCSIEJECT),
+   U3G_DEV(MOTOROLA2, MB886, U3GINIT_SCSIEJECT),
U3G_DEV(OPTION, GTICON322, U3GINIT_REZERO),
U3G_DEV(QUALCOMMINC, ZTE_STOR, U3GINIT_ZTESTOR),
U3G_DEV(QUALCOMMINC, ZTE_STOR2, U3GINIT_SCSIEJECT),
Index: sys/dev/usb/usbdevs
===
--- sys/dev/usb/usbdevs (revision 245177)
+++ sys/dev/usb/usbdevs (working copy)
@@ -2930,6 +2930,7 @@
 /* Motorola products */
 product MOTOROLA MC141555  0x1555  MC141555 hub controller
 product MOTOROLA SB41000x4100  SB4100 USB Cable Modem
+product MOTOROLA2 MB8860x710f  MB886 Mobile Phone (Atria HD)
 product MOTOROLA2 T720C0x2822  T720c
 product MOTOROLA2 A41XV32X 0x2a22  A41x/V32x Mobile Phones
 product MOTOROLA2 E398 0x4810  E398 Mobile Phone
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


auto-dismount fake CD (was Re: Android device problems with MTP ID)

2013-01-04 Thread Lowell Gilbert
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
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


Re: Android device problems with MTP ID

2013-01-03 Thread Lowell Gilbert
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
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


Re: Android device problems with MTP ID

2013-01-03 Thread Lowell Gilbert
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/
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


Android device problems with MTP ID

2013-01-03 Thread Lowell Gilbert
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 = 0x 
  bDeviceSubClass = 0x 
  bDeviceProtocol = 0x 
  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 = 0x  
bmAttributes = 0x0080 
bMaxPower = 0x00fa 

Interface 0
  bLength = 0x0009 
  bDescriptorType = 0x0004 
  bInterfaceNumber = 0x 
  bAlternateSetting = 0x 
  bNumEndpoints = 0x0002 
  bInterfaceClass = 0x0008 
  bInterfaceSubClass = 0x0006 
  bInterfaceProtocol = 0x0050 
  iInterface = 0x0001  

 Endpoint 0
bLength = 0x0007 
bDescriptorType = 0x0005 
bEndpointAddress = 0x0081  
bmAttributes = 0x0002  
wMaxPacketSize = 0x0200 
bInterval = 0x 
bRefresh = 0x 
bSynchAddress = 0x 

 Endpoint 1
bLength = 0x0007 
bDescriptorType = 0x0005 
bEndpointAddress = 0x0001  
bmAttributes = 0x0002  
wMaxPacketSize = 0x0200 
bInterval = 0x0001 
bRefresh = 0x 
bSynchAddress = 0x 


  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 = 0x 
  bDeviceSubClass = 0x 
  bDeviceProtocol = 0x 
  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 = 0x  
bmAttributes = 0x0080 
bMaxPower = 0x00fa 

Interface 0
  bLength = 0x0009 
  bDescriptorType = 0x0004 
  bInterfaceNumber = 0x 
  bAlternateSetting = 0x 
  bNumEndpoints = 0x0003 
  bInterfaceClass = 0x00ff 
  bInterfaceSubClass = 0x00ff 
  bInterfaceProtocol = 0x 
  iInterface = 0x0005  

 Endpoint 0
bLength = 0x0007 
bDescriptorType = 0x0005 
bEndpointAddress = 0x0081  
bmAttributes = 0x0002  
wMaxPacketSize = 0x0200 
bInterval = 0x 
bRefresh = 0x 
bSynchAddress = 0x 

 Endpoint 1
bLength = 0x0007 
bDescriptorType = 0x0005 
bEndpointAddress = 0x0001  
bmAttributes = 0x0002  
wMaxPacketSize = 0x0200 
bInterval = 0x 

Re: USB disk on CS5536 unstable

2010-10-07 Thread Lowell Gilbert
Anselm Strauss  writes:

> On 10/02/10 16:39, Hans Petter Selasky wrote:
>> On Saturday 02 October 2010 14:44:07 Anselm Strauss wrote:
>>> On 09/30/10 21:38, Hans Petter Selasky wrote:
 On Thursday 30 September 2010 21:10:59 Anselm Strauss wrote:
> Maybe sending it to just the USB list was too specific ...
>
> On 09/30/10 00:08, Anselm Strauss wrote:
>> Hi
>>
>> I have an ALIX board that has an AMD Geode and the CS5536 companion
>> chip with integrated USB on it. When I connect a USB disk I have
>> observed various problems. For example when I run fsck_ufs on a 250 GB
>> partition the process gets stuck in biord state and fsck reports
>> unreadable sectors. When I do a dd over the whole disk and direct it
>> to /dev/null it suddenly returns with no error, but having read only a
>> small fraction of the disk. I tried it with two different disks and
>> two different ALIX boards. I'm pretty sure the disks are okay since I
>> tried them on other hardware.
>>
>> As far as I know there was some trouble with the chip regarding
>> timeouts. Under load after some time the USB just stops responding. I
>> have tried 8.0 and 8.1. Is there any known problem? How can I track
>> this down?
>>
>> Anselm

 If you compile the kernel with USB_DEBUG, then there are some sysctls
 under hw.usb.ehci which you can tweak. Needs to be set before boot.

 --HPS
>>>
>>> Did not know that there were configurable bug workarounds in sysctl.
>>> When I set hw.usb.ehci.lostintrbug=1 in /boot/loader.conf the problems
>>> seem gone.
>>>
>>> Without this setting I got the following kernel message when dd did abort:
>>>
>>> ehci_timeout: xfer=0xc29cd3c8
>>>
>>>
>>> Thanks,
>>> Anselm
>> 
>> Maybe you can report the PCI vendor ID and product so that we can add this 
>> quirk.
>> 
>> --HPS
>
> Not sure what a "PCI vendor ID" is and how to determine it. It's a ALIX
> 2d2 from http://pcengines.ch/alix.

pciconf(8) will tell you.  Try sending "pciconf -l" output.
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"