I am trying to write a loadable driver for a usb STV0680 based camera
(pencam). I already have a command line program which will allow the
user to download images from the camera, but I am writing the driver to
make use of the camera's video function. I have run into the same
problem using several different starting codes (ibmcam, ultracam); the
most recent is based on the usb-skeleton.c code. I put in the
Vendor/Product IDs, everything seems OK (the driver finds the camera).
Now I have to send a series of about a dozen vendor specific commands
to the camera to initialize it for video mode (or to download still
pictures). These codes were obtained from the Windows sniff usb program,
and work in the command line program, which uses libusb. When I try to
send these codes to the device using usb_control_msg(dev, pipe, reqest,
req-type, ...), the driver crashes:
invalid operand: 0000
CPU : 0
and register dumps.
(One example of command values is req-type=0xc1, request=0x8a, value=0,
index=0, lenght=9).
I put these vendor-specific commands in a function called at the end of
the pencam_probe function, after everything else has been initialized
and set up. In my function, I first call the usb_set_interface and
_configuration, which themselves call usb_control_msg, and they return
with value 0, indicating they work. Then I try my commands with
usb_control_msg and I get the crash (even 1 call will do it). As near as
I can tell, I am using the correct values for usb_device and
usb(snd)rcvpipe(..) (same references that work with the
usb_set_configuration and _interface).
Is there some extra command or setup procedure that has to be called
before calling usb_control_msg? Or is there another function (other than
the _probe) where I should be sending the camera initialization commands
from? From a comment in the _ioctl function, it looks as if I might be
able to do it there, but can I use the _control_msg, or do I need to put
all the commands in a buffer? Thanks,
Kevin
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel