Re: keyboard driver problem?

From: Hans Petter Selasky <hselasky_at_c2i.net>
Date: Sun, 2 Jan 2011 15:30:27 +0100
On Sunday 02 January 2011 15:22:32 I Think wrote:
> I've tried already to change both UKBD_NMOD and UKBD_NKEYCODE, but where is
> no result.
> #define UKBD_NKEYCODE                 8 // doesn't work too
> 
>  > usbconfig -u 4 -a 2 dump_device_desc dump_curr_config_desc
> 
> ugen4.2: <USB Device A4TECH> at usbus4, cfg=0 md=HOST spd=FULL (12Mbps)
> pwr=ON
> 
>   bLength = 0x0012
>   bDescriptorType = 0x0001
>   bcdUSB = 0x0110
>   bDeviceClass = 0x0000
>   bDeviceSubClass = 0x0000
>   bDeviceProtocol = 0x0000
>   bMaxPacketSize0 = 0x0008
>   idVendor = 0x09da
>   idProduct = 0x054f
>   bcdDevice = 0x0102
>   iManufacturer = 0x0001  <A4TECH>
>   iProduct = 0x0002  <USB Device>
>   iSerialNumber = 0x0000  <no string>
>   bNumConfigurations = 0x0001
> 
> 
>  Configuration index 0
> 
>     bLength = 0x0009
>     bDescriptorType = 0x0002
>     wTotalLength = 0x003b
>     bNumInterfaces = 0x0002
>     bConfigurationValue = 0x0001
>     iConfiguration = 0x0000  <no string>
>     bmAttributes = 0x00a0
>     bMaxPower = 0x0032
> 
>     Interface 0
>       bLength = 0x0009
>       bDescriptorType = 0x0004
>       bInterfaceNumber = 0x0000
>       bAlternateSetting = 0x0000
>       bNumEndpoints = 0x0001
>       bInterfaceClass = 0x0003
>       bInterfaceSubClass = 0x0001
>       bInterfaceProtocol = 0x0001
>       iInterface = 0x0000  <no string>
> 
>       Additional Descriptor
> 
>       bLength = 0x09
>       bDescriptorType = 0x21
>       bDescriptorSubType = 0x11
>        RAW dump:
>        0x00 | 0x09, 0x21, 0x11, 0x01, 0x00, 0x01, 0x22, 0x84,
>        0x08 | 0x00
> 
>      Endpoint 0
>         bLength = 0x0007
>         bDescriptorType = 0x0005
>         bEndpointAddress = 0x0081
>         bmAttributes = 0x0003
>         wMaxPacketSize = 0x000c
>         bInterval = 0x0001
>         bRefresh = 0x0000
>         bSynchAddress = 0x0000
> 
> 
>     Interface 1
>       bLength = 0x0009
>       bDescriptorType = 0x0004
>       bInterfaceNumber = 0x0001
>       bAlternateSetting = 0x0000
>       bNumEndpoints = 0x0001
>       bInterfaceClass = 0x0003
>       bInterfaceSubClass = 0x0001
>       bInterfaceProtocol = 0x0002
>       iInterface = 0x0000  <no string>
> 
>       Additional Descriptor
> 
>       bLength = 0x09
>       bDescriptorType = 0x21
>       bDescriptorSubType = 0x11
>        RAW dump:
>        0x00 | 0x09, 0x21, 0x11, 0x01, 0x00, 0x01, 0x22, 0x57,
>        0x08 | 0x00
> 
>      Endpoint 0
>         bLength = 0x0007
>         bDescriptorType = 0x0005
>         bEndpointAddress = 0x0082
>         bmAttributes = 0x0003
>         wMaxPacketSize = 0x0008
>         bInterval = 0x0001
>         bRefresh = 0x0000
>         bSynchAddress = 0x0000
> 
> 

You could maybe try this. Lookup the following code in ukbd.c. Add the lines 
marked with +

                if (sc->sc_kbd_id != 0) {
                        /* check and remove HID ID byte */
                        usbd_copy_out(pc, 0, &id, 1);
                        if (id != sc->sc_kbd_id) {
                                DPRINTF("wrong HID ID\n");
                                goto tr_setup;
                        }
                        offset = 1;
                        len--;
                } else {
                        offset = 0;
                }

+	if (len == 12) {
+		offset += 2;
+		len -= 2;
+	}
+	if (len == 11) {
+		offset += 1;
+		len -= 1;
+	}

--HPS
Received on Sun Jan 02 2011 - 13:30:22 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:10 UTC