Re: USB related panic on 8.2-PRERELEASE

2010-12-12 Thread Oleg Nauman
On Sun, Dec 12, 2010 at 12:48 AM, Nick Hibma n...@van-laarhoven.org wrote:
 But we will continue the saga about this strange USB modem, if no
 objections from your side :)
 Is it possible to apply some quirk or some another workaround which
 will solve the issue with endless USB_ERR_STALLED reported while it
 trying to attach its builtin cardreader?

 Nick, do you have any hints on this?

 It says in the messages log (a view messages ago) that it does not support 
 GET MAX LUN.

 It is derived error I think
When it attaches finally, it report no errors at all:

Dec 12 10:38:36 rainhaven kernel: ugen5.2: PANTECH at usbus5
Dec 12 10:38:36 rainhaven kernel: umodem0: PANTECH PANTECH USB MODEM, class 2/0
, rev 2.00/1.00, addr 2 on usbus5
Dec 12 10:38:36 rainhaven kernel: umodem0: data interface 1, has CM over data, h
as break
Dec 12 10:38:36 rainhaven kernel: umass0: PANTECH PANTECH USB MODEM, class 2/0,
 rev 2.00/1.00, addr 2 on usbus5
Dec 12 10:38:37 rainhaven root: /usr/local/etc/rc.d/webcamd: WARNING: failed to
start webcamd
Dec 12 10:38:37 rainhaven kernel: da0 at umass-sim0 bus 0 scbus2 target 0 lun 0
Dec 12 10:38:37 rainhaven kernel: da0: PANTECH Mass Storage 0001
Removable Direct Access SCSI-0 device
Dec 12 10:38:37 rainhaven kernel:
Dec 12 10:38:37 rainhaven kernel: da0: 40.000MB/s transfers
Dec 12 10:38:37 rainhaven kernel: da0: 952MB (1950720 512 byte
sectors: 64H 32S/T 952C)
Dec 12 10:38:37 rainhaven root: Unknown USB device: vendor 0x106c
product 0x3711 bus uhub5
Dec 12 10:38:37 rainhaven kernel: GEOM: da0: partition 1 does not
start on a track boundary.
Dec 12 10:38:37 rainhaven kernel: GEOM: da0: partition 1 does not end
on a track boundary.


You can quirk that:

 While the device is attached use the following command:

        usbconfig -d ugenX.Y add_quirk UQ_MSC_NO_GETMAXLUN

 I was trying that but it not helps. Another question that it is very
tricky because USB subsystem probes to (re)attach modem too quickly so
usbconfig reports Device not configured or No device match or lack
of permissions.
I will recompile the kernel with USB_DEBUG option enabled and provide
you with some additional info.

Thank you for our help.


 where ugenX.Y is the ugen device for the device that causes you trouble. 
 usbconfig will add a quirk using the PID/VID/RID for the device it finds at 
 that location.

 If that works, let me know, and I will commit the quirk into the quirk table.

 Nick

 freebsd-current@ removed from CC list
___
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 related panic on 8.2-PRERELEASE

2010-12-12 Thread Nick Hibma
 It is derived error I think
 When it attaches finally, it report no errors at all:

Whatever it is, the quirk should resolve it. MAX LUN is not necessary per se I 
think.

 Dec 12 10:38:36 rainhaven kernel: ugen5.2: PANTECH at usbus5
 Dec 12 10:38:36 rainhaven kernel: umodem0: PANTECH PANTECH USB MODEM, class 
 2/0
 , rev 2.00/1.00, addr 2 on usbus5
 Dec 12 10:38:36 rainhaven kernel: umodem0: data interface 1, has CM over 
 data, h
 as break
 Dec 12 10:38:36 rainhaven kernel: umass0: PANTECH PANTECH USB MODEM, class 
 2/0,
 rev 2.00/1.00, addr 2 on usbus5
 Dec 12 10:38:37 rainhaven root: /usr/local/etc/rc.d/webcamd: WARNING: failed 
 to
 start webcamd
 Dec 12 10:38:37 rainhaven kernel: da0 at umass-sim0 bus 0 scbus2 target 0 lun  0
 Dec 12 10:38:37 rainhaven kernel: da0: PANTECH Mass Storage 0001
 Removable Direct Access SCSI-0 device
 Dec 12 10:38:37 rainhaven kernel:
 Dec 12 10:38:37 rainhaven kernel: da0: 40.000MB/s transfers
 Dec 12 10:38:37 rainhaven kernel: da0: 952MB (1950720 512 byte
 sectors: 64H 32S/T 952C)
 Dec 12 10:38:37 rainhaven root: Unknown USB device: vendor 0x106c
 product 0x3711 bus uhub5

This is a bogus devd entry that is confusing. I will remove that remark

 Dec 12 10:38:37 rainhaven kernel: GEOM: da0: partition 1 does not
 start on a track boundary.
 Dec 12 10:38:37 rainhaven kernel: GEOM: da0: partition 1 does not end
 on a track boundary.

GEOM finds it. So it works.

 You can quirk that:
 
 While the device is attached use the following command:
 
usbconfig -d ugenX.Y add_quirk UQ_MSC_NO_GETMAXLUN
 
 I was trying that but it not helps. Another question that it is very
 tricky because USB subsystem probes to (re)attach modem too quickly so
 usbconfig reports Device not configured or No device match or lack
 of permissions.
 I will recompile the kernel with USB_DEBUG option enabled and provide
 you with some additional info.
 
 Thank you for our help.

Compile your kernel without usb and load it as a module, or at least load umass 
as a module.

Without umass the device should stay and you can add the quirk, then load umass 
and try again.

Nick___
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


static usb device configuration

2010-12-12 Thread Emanuel Haupt
Is there any way I can make sure that the following device:

ugen1.3: product 0x6001 vendor 0x0403 at usbus1, cfg=0 md=HOST spd=FULL 
(12Mbps) pwr=ON

  bLength = 0x0012 
  bDescriptorType = 0x0001 
  bcdUSB = 0x0200 
  bDeviceClass = 0x 
  bDeviceSubClass = 0x 
  bDeviceProtocol = 0x 
  bMaxPacketSize0 = 0x0008 
  idVendor = 0x0403 
  idProduct = 0x6001 
  bcdDevice = 0x0400 
  iManufacturer = 0x  no string
  iProduct = 0x  no string
  iSerialNumber = 0x0003  Reader 195
  bNumConfigurations = 0x0001 

Is always registered as:

/dev/usb/1.3.0

Using a pattern match on iSerialNumber could achieve that but how would
I configure something like that?

According to the /etc/devd.conf manpage I could create a symlink but that 
wouldn't solve my problem.

Emanuel
___
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: static usb device configuration

2010-12-12 Thread Hans Petter Selasky
On Sunday 12 December 2010 19:49:24 Emanuel Haupt wrote:
 Is there any way I can make sure that the following device:
 
 ugen1.3: product 0x6001 vendor 0x0403 at usbus1, cfg=0 md=HOST spd=FULL
 (12Mbps) pwr=ON
 
   bLength = 0x0012
   bDescriptorType = 0x0001
   bcdUSB = 0x0200
   bDeviceClass = 0x
   bDeviceSubClass = 0x
   bDeviceProtocol = 0x
   bMaxPacketSize0 = 0x0008
   idVendor = 0x0403
   idProduct = 0x6001
   bcdDevice = 0x0400
   iManufacturer = 0x  no string
   iProduct = 0x  no string
   iSerialNumber = 0x0003  Reader 195
   bNumConfigurations = 0x0001
 
 Is always registered as:
 
 /dev/usb/1.3.0

No, this is currently not possible unless you find the USB port which is 
enumerated first (I.E. has the lowest second number.)

--HPS
___
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: static usb device configuration

2010-12-12 Thread Andrew Thompson
On 13 December 2010 07:49, Emanuel Haupt eha...@freebsd.org wrote:
 Is there any way I can make sure that the following device:

 ugen1.3: product 0x6001 vendor 0x0403 at usbus1, cfg=0 md=HOST spd=FULL 
 (12Mbps) pwr=ON

  bLength = 0x0012
  bDescriptorType = 0x0001
  bcdUSB = 0x0200
  bDeviceClass = 0x
  bDeviceSubClass = 0x
  bDeviceProtocol = 0x
  bMaxPacketSize0 = 0x0008
  idVendor = 0x0403
  idProduct = 0x6001
  bcdDevice = 0x0400
  iManufacturer = 0x  no string
  iProduct = 0x  no string
  iSerialNumber = 0x0003  Reader 195
  bNumConfigurations = 0x0001

 Is always registered as:

 /dev/usb/1.3.0

You would be better making a symlink using devd rules, something like

notify 100 {
match system  USB;
match subsystem   DEVICE;
match typeATTACH;
match vendor  0x0403;
match product 0x6001;
action ln -s /dev/$cdev /dev/mydevice;
};


Andrew
___
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


Lego NXT brick communication error with libusb

2010-12-12 Thread Rene Ladan
Hi,

I am writing a port [1] to control the Lego NXT brick with ROS, but when
I run a test program it fails (permissions for the USB device are 666).
This is on:

% uname -a
FreeBSD acer 9.0-CURRENT FreeBSD 9.0-CURRENT #5 r216351M: Fri Dec 10
14:13:33 CET 2010 r...@acer:/usr/obj/usr/src/sys/ACER  amd64

% rosrun nxt_python color_sensor_test.py
Traceback (most recent call last):
  File
/usr/local/ros/stacks/nxt/nxt_python/sensor_tests/color_sensor_test.py, line
42, in module
test_sensors(sock.connect())
  File /usr/local/ros/stacks/nxt/nxt_python/src/nxt/usbsock.py, line
44, in connect
self.handle.reset()
usb.USBError: Unknown error

Looking into usbsock.py:
  self.handle = self.device.open()
  self.handle.setConfiguration(1)
  self.handle.claimInterface(0)
  self.handle.reset()
where self.device points to the USB end point for the NXT device (vendor
0x694, product 0x2)

However, if I run the same program as root it fails a bit later:

# rosrun nxt_python color_sensor_test.py
-1
Traceback (most recent call last):
  File
/usr/local/ros/stacks/nxt/nxt_python/sensor_tests/color_sensor_test.py, line
42, in module
test_sensors(sock.connect())
  File
/usr/local/ros/stacks/nxt/nxt_python/sensor_tests/color_sensor_test.py, line
11, in test_sensors
cs = ColorSensor(b, PORT_1)
  File /usr/local/ros/stacks/nxt/nxt_python/src/nxt/sensor.py, line
256, in __init__
self.set_light_color(None)
  File /usr/local/ros/stacks/nxt/nxt_python/src/nxt/sensor.py, line
278, in set_light_color
self.set_input_mode()
  File /usr/local/ros/stacks/nxt/nxt_python/src/nxt/sensor.py, line
71, in set_input_mode
self.mode)
  File /usr/local/ros/stacks/nxt/nxt_python/src/nxt/brick.py, line 22,
in poll
self.sock.send(str(ogram))
  File /usr/local/ros/stacks/nxt/nxt_python/src/nxt/usbsock.py, line
65, in send
self.handle.bulkWrite(self.blk_out.address, data)
usb.USBError: Unknown error

where self.handle is initialized in the same way as above.

It works in Ubuntu 10.10, both native and when running from VirtualBox 4
(which has USB passthrough) under the above FreeBSD.

Does anybody have an idea what could be wrong?

Thanks,
Rene

[1] ftp://rene-ladan.nl/pub/freebsd/ros-nxt-0.1.0.tar.bz2
SIZE = 3842
SHA256 = a7a30bc5ef77230d6846577d3a4b1c7262d1c654ed32fcf0d8701c07c0867bea
-- 
http://www.rene-ladan.nl/

GPG fingerprint = ADBC ECCD EB5F A6B4 549F  600D 8C9E 647A E564 2BFC
(subkeys.pgp.net)
___
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: static usb device configuration

2010-12-12 Thread Emanuel Haupt
Andrew Thompson thom...@freebsd.org wrote:
 On 13 December 2010 07:49, Emanuel Haupt eha...@freebsd.org wrote:
  Is there any way I can make sure that the following device:
 
  ugen1.3: product 0x6001 vendor 0x0403 at usbus1, cfg=0 md=HOST
  spd=FULL (12Mbps) pwr=ON
 
   bLength = 0x0012
   bDescriptorType = 0x0001
   bcdUSB = 0x0200
   bDeviceClass = 0x
   bDeviceSubClass = 0x
   bDeviceProtocol = 0x
   bMaxPacketSize0 = 0x0008
   idVendor = 0x0403
   idProduct = 0x6001
   bcdDevice = 0x0400
   iManufacturer = 0x  no string
   iProduct = 0x  no string
   iSerialNumber = 0x0003  Reader 195
   bNumConfigurations = 0x0001
 
  Is always registered as:
 
  /dev/usb/1.3.0
 
 You would be better making a symlink using devd rules, something like
 
 notify 100 {
 match system  USB;
 match subsystem   DEVICE;
 match typeATTACH;
 match vendor  0x0403;
 match product 0x6001;
 action ln -s /dev/$cdev /dev/mydevice;
 };

Unfortunately the program in question uses libusb and the configuration
only allows to define the device by specifying busnum:devaddr and
there are multiple identical devices around with only iSerialNumber
being different from each other. Somehow I need to make sure the
devices in the USB hub are always recognized in the same order.

I guess one solution would be to generate the configuration each time
the program starts.

Emanuel
___
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: static usb device configuration

2010-12-12 Thread Emanuel Haupt
Hans Petter Selasky hsela...@c2i.net wrote:
 On Sunday 12 December 2010 19:49:24 Emanuel Haupt wrote:
  Is there any way I can make sure that the following device:
  
  ugen1.3: product 0x6001 vendor 0x0403 at usbus1, cfg=0 md=HOST
  spd=FULL (12Mbps) pwr=ON
  
bLength = 0x0012
bDescriptorType = 0x0001
bcdUSB = 0x0200
bDeviceClass = 0x
bDeviceSubClass = 0x
bDeviceProtocol = 0x
bMaxPacketSize0 = 0x0008
idVendor = 0x0403
idProduct = 0x6001
bcdDevice = 0x0400
iManufacturer = 0x  no string
iProduct = 0x  no string
iSerialNumber = 0x0003  Reader 195
bNumConfigurations = 0x0001
  
  Is always registered as:
  
  /dev/usb/1.3.0
 
 No, this is currently not possible unless you find the USB port which
 is enumerated first (I.E. has the lowest second number.)

When you say 'currently', is there something like that planed?

Emanuel
___
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