Hi,

        In hiddev.c (2.4.22 and 2.6.0-test6), setting the value with
HIDIOCSUSAGE triggers the following piece of code:

>                       case HIDIOCSUSAGE:
>                               field->value[uref.usage_index] = uref.value;
>                               return 0;

        However, there may not be a one-to-one mapping between the
"Usage" list and the values list (controls). 

        http://www.usb.org/developers/devclass_docs/Hut1_11.pdf says
(page 40):

> While Local items do not carry over to the next Main item, they may
> apply to more than one control within a single item. For example, if
> an Input item defining five controls is preceded by three Usage
> tags, the three usages would be assigned sequentially to the first
> three controls, and the third usage would also be assigned to the
> fourth and fifth controls. If an item has no controls (Report Count
> = 0), the Local item tags apply to the Main item (usually a
> collection item).

> To assign unique usages to every control in a single Main item,
> simply specify

> each Usage tag sequentially (or use Usage Minimum or Usage Maximum).
> All Local items are unsigned integers.

        It is likely to be the source of the problem reported 
by Jackson Chan, last in June 2003
http://marc.theaimsgroup.com/?l=linux-usb-devel&m=105614111827576&w=2

        Here is the lsusb -v output for the device I'm using.
HIDIOCSUSAGE will only let me access the first Output control. It
should assign the first Usage to the other controls, as suggested in
the HID document above.

----------------------------------------------------------------------
Bus 001 Device 005: ID 06c2:0052  
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0 Interface
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0         8
  idVendor           0x06c2 
  idProduct          0x0052 
  bcdDevice            1.00
  iManufacturer           1 Phidgets Inc.
  iProduct                2 PhidgetTextLCD
  iSerial                 3 01559
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           34
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0x80
    MaxPower               64mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Devices
      bInterfaceSubClass      0 No Subclass
      bInterfaceProtocol      0 None
      iInterface              0 
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.00
          bCountryCode            0
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      32
          Report Descriptor: (length is 32)
            Item(Global): Usage Page, data= [ 0xa0 0xff ] 65440
                            (null)
            Item(Local ): Usage, data= [ 0x01 ] 1
                            (null)
            Item(Main  ): Collection, data= [ 0x01 ] 1
                            Application
            Item(Local ): Usage, data= [ 0x02 ] 2
                            (null)
            Item(Main  ): Collection, data= [ 0x00 ] 0
                            Physical
            Item(Global): Usage Page, data= [ 0xa1 0xff ] 65441
                            (null)
            Item(Local ): Usage, data= [ 0x03 ] 3
                            (null)
            Item(Global): Report Size, data= [ 0x08 ] 8
            Item(Global): Report Count, data= [ 0x02 ] 2
            Item(Main  ): Input, data= [ 0x02 ] 2
                            Data Variable Absolute No_Wrap Linear
                            Preferred_State No_Null_Position Non_Volatile Bitfield
            Item(Local ): Usage, data= [ 0x04 ] 4
                            (null)
            Item(Global): Report Size, data= [ 0x08 ] 8
            Item(Global): Report Count, data= [ 0x08 ] 8
            Item(Main  ): Output, data= [ 0x02 ] 2
                            Data Variable Absolute No_Wrap Linear
                            Preferred_State No_Null_Position Non_Volatile Bitfield
            Item(Main  ): End Collection, data=none
            Item(Main  ): End Collection, data=none
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               none
        wMaxPacketSize          8
        bInterval              10
  Language IDs: (length=4)
     0409 English(US)
----------------------------------------------------------------------

        If I misunderstood the rationale, I'd very much appreciate if
someone could tell me how to set the values without HIDIOCSUSAGE.
        
        Cheers,

-- 
Donate to FSF France online : http://rate.affero.net/fsffrance/
Loic Dachary, 12 bd Magenta, 75010 Paris. Tel: 33 1 42 45 07 97      
http://www.fsffrance.org/   http://www.dachary.org/loic/gpg.txt


-------------------------------------------------------
This SF.net email is sponsored by: The SF.net Donation Program.
Do you like what SourceForge.net is doing for the Open
Source Community?  Make a contribution, and help us add new
features and functionality. Click here: http://sourceforge.net/donate/
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to