On Wed, 3 Sep 2003 19:18:35 +1000 David Findlay <[EMAIL PROTECTED]> wrote:

| 
| I'm writing my device driver for a webcam here, using usbvideo.h. I'm using 
| ibmcam.c as an example of how to build a usb video driver. 
| 
| This is my id_table:
| 
| static struct usb_device_id id_table[] = {
|       { USB_DEVICE_VER(VOLCANO_DG640E_VENDOR_ID, VOLCANO_DG640E_PRODUCT_ID, 0x0002,
| 0x0002) },
|       { }
| };
| 
| Largely copied from ibmcam.c. What do the values 0x0002, 0x0002 do in 
| id_table? 
| 
| Please forgive me for asking all these stupid questions. I'm trying to learn 
| as quickly as I can. Thanks,

You need to familiarize yourself with the linux/include/linux/usb*.h files.

>From 2.4.21, usb.h says:

#define USB_DEVICE_VER(vend,prod,lo,hi) \
        match_flags: USB_DEVICE_ID_MATCH_DEVICE_AND_VERSION, idVendor: (vend), 
idProduct: (prod), bcdDevice_lo: (lo), bcdDevice_hi: (hi)

so this macro specifies vendorID, productID, Device version (low threshold),
and Device version (high threshold).

Then device matching is done on all of those parameters.
In the ibmcam example, that entry only matches the VENDOR/PRODUCT IDs
with device version == 2.


--
~Randy


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to