Hello.
I'm writing a driver for a digital camera (FujiFilm FinePix F601 Zoom)
that also works as a webcam. The manufacturer doesn't release any
technical specifications (as usual), so I had to reverse engineering
the protocol. Using libusb, I've wrote a program that interoperate
successfully with the camera. Now, I want to write a Linux kernel module,
but I've some questions/doubts...
Information from /proc/bus/usb/devices:
T: Bus=01 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 2 Spd=12 MxCh= 0
D: Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
P: Vendor=04cb ProdID=0109 Rev= 1.00
S: Product=USB PC Camera
S: SerialNumber=Y-338^^^^^020311XFJX0004001122
C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr= 2mA
I: If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=21 Prot=ff Driver=(none)
E: Ad=81(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=83(I) Atr=03(Int.) MxPS= 8 Ivl=1ms
Simplified protocol:
Step Action/comment
----------------------------------------------------------------------
(open_device)
0 Reset input endpoints (83 and 81).
1 Send control message.
2 Read endpoint 81; Should read 0x00 0x02, otherwise jump to 0.
3 Read endpoint 83; Should read 0x00 0x00, otherwise jump to 0.
(read_device)
4 Send control message.
5 Read endpoint 81; Should read JPEG (0xff 0xd8 0xff 0xdb ...)
6 Read endpoint 83; Should read 0x00 0x00.
7 Go to step 4.
(close_device)
8 Send control message.
9 Read endpoint 83; Should read 0x00 0x20.
All control messages use this setup (little-endian order):
bmRequestType: 0x21 (Host to device, Class, Interface)
bRequest: 0x00
wValue: 0x0000
wIndex: 0x0000
wLength: 0x0c00 (12 bytes)
Comments about this protocol:
* All control message have 12 bytes big-endian order, but I don't know
what those data means...
* Endpoint 83 seems a "last command status".
* Endpoint 02 is never used.
* Each frame is in standard JPEG format, 320x240 24-bit, ~15 KBytes.
Questions:
1) Does this protocol seem familiar?
2) With libusb, I can forget about step 0... Is this correct for a kernel
module?
3) What timeout should I use? HZ*10 as in usb-skeleton.c?
4) Should I use usb_control_msg()/usb_bulk_msg() or usb_alloc_urb() and
usb_submit_urb()? Also, can I use usb_bulk_msg() to send messages to
interrupt endpoint (83)?
5) With libusb, I can read 15KB in step 5, but usb-skeleton.c only
transfers wMaxPacketSize bytes at one time. Does that mean that I can
only read 64 bytes (MxPS=64)?
Thanks in advance by the time wasted reading this, any help is appreciated.
Best regards,
Rui Saraiva
PS: Please CC any reply to me, as I'm not subscribed to this mailing list.
-------------------------------------------------------
This SF.net email is sponsored by: Scholarships for Techies!
Can't afford IT training? All 2003 ictp students receive scholarships.
Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more.
www.ictp.com/training/sourceforge.asp
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel