On Thu, Dec 12, 2002, Oliver Kurth <[EMAIL PROTECTED]> wrote:
> I am currently trying to write a driver for a wireless usb adapter. There
> already is a driver existing, but it is buggy, the code is messy, and
> so I do not even want to try to fix it. So I thought this is a good
> opportunity to learn writing device drivers.
> 
> The driver needs to load a (propritary) firmware to the device. I do
> this in the probe() function, and the first part of it works. After
> downloading, it has to call usb_reset_device() (at least the old
> driver does). When I do this, the driver hangs. 
> 
> Before the reset, there are a lot of calls to usb_control_msg(), all
> of them work as expected. Then it sleeps for 2 seconds, using
> 
>     set_current_state(TASK_INTERRUPTIBLE);
>     schedule_timeout(2*HZ);
> 
> Shortly after that, usb_reset_device() is called, and it hangs.
> 
> I haven't set any locks.

By "it", do you mean the device or the kernel?

> Where do I have to search for the problem? Is it the device (maybe
> the firmware isn't uploaded correctly (though I have checked
> repeatedly)). BTW, is it true that the 'data' argument in usb_control_msg()
> has to point to kmalloc'ed memory? I previously used static memory, but I
> got problems.

It needs to be DMA capable memory. That happens to be most commonly
memory obtained from kmalloc().

> I am searching for two full days now...
> 
> I am using the uhci driver, kernel 2.4.20, same probs with 2.4.19.

JE



-------------------------------------------------------
This sf.net email is sponsored by:
With Great Power, Comes Great Responsibility 
Learn to use your power at OSDN's High Performance Computing Channel
http://hpc.devchannel.org/
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to