On Tue, 16 May 2006, Florian Echtler wrote:

> Hello everybody,
> 
> I'm currently trying to write a rudimentary driver for the NaturalPoint
> Optitrack cameras (they directly output thresholded 1-bit video at 120
> FPS, are infrared-only and intended for tracking applications).
> 
> I have obtained some traces under WinXP with SnoopyPro and took the
> usb-skeleton.c as a template. Now, to initialize the device, the Windows
> driver sends several bulk messages to endpoint 0x02, which I tried to
> replicate in the Linux driver. However, this leads to the following
> result:
> 
> 17:34:20 brick uhci_hcd 0000:00:1d.0: host system error, PCI problems?
> 17:34:20 brick uhci_hcd 0000:00:1d.0: host controller halted, very bad!
> 
> The offending piece of code is this:
> 
> char cmd_init[]  = { 0x14, 0x01 };
> 
> ...
> 
> result = usb_bulk_msg(
>         dev->udev,
>         usb_sndbulkpipe( dev->udev, dev->bulk_out_endpointAddr ),
>         &cmd_init, sizeof(cmd_init), &bytes_sent, HZ
>         );

A potential problem here is that your data buffer is allocated either on 
the stack or else statically.  That's not good; all DMA buffers should be 
allocated using kmalloc.

> Afterwards, result is -110 (ETIMEOUT). dev->bulk_out_endpointAddr is
> 0x02, as expected.
> 
> Is this an error on my part? (Presumably yes.) But where's the problem?
> I would be grateful for some hints..

Depending on the kind of system you are using, this may or may not be the 
problem.  On x86 it wouldn't matter, on other architectures it would.

Note also that the last argument to usb_bulk_msg() is supposed to be the
timeout value in milliseconds, not in jiffies.

Alan Stern



-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to