Quoting root <[EMAIL PROTECTED]>:

> I am now writing drivers for divio's cameras. I ran into a strange
> problem when I call usb_control_msg() from probe().

I would advise NOT to call anything from probe() because this
code runs in a single shared thread. I could see only one reason
to do that - if you need more than just descriptors to figure out
what it is. Your transfers would probably block, and this is bad.

probe() is not supposed to test the camera, initialize it or do
anything like that. probe() only assigns the interface to the
driver. The driver will do the rest - with all debugging messages,
in personal user context, at its own pace...

probe() should just allocate USB structures (claim the interface)
and leave. All other initialization should be done in user context,
such as open() and read() handlers.

See usbvideo, ibmdrv and ultradrv for examples. Ultradrv is a
simplest camera driver that uses usbvideo library. ibmdrv is a
working driver. Get them from linux-usb CVS at SourceForge,
linked from http://www.linux-usb.org/ibmcam/

> I succeeded calling  usb_control_msg() with the pointer to a local
> variable as the argument 'data'(the seventh argument),
> while the pointer to a global variable failed.

See ibmcam_veio() in ibmcam.c

Cheers,
Dmitri

-- 
Microsoft: where do we want you to go today?

PGP signature

Reply via email to