J?rgen Keil :
> And I suspect that's the problem!  Since it's using
> the keyboard in boot protocol mode, it shouldn't 
> try to find out the keyboard's packet size from 
> looking at / parsing the HID descriptor.  I suspect
> that would only be a valid strategy if the boot
> protocol is disabled.
>   
 From the MacBook Pro internal keyboard report descriptor, the report ID 
1 is used to identify the keyboard usage. According to the HID spec, the 
report ID should be transferred as one byte prefix. After the internal 
keyboard is set into Boot protocol mode, its 8 bytes data don't include 
the one byte prefix (report ID 0x01). I tried disabling the boot 
protocol on the Macbook. But I failed to see the one byte report ID 
prefix was included in the keyboard data. Could you verify this on your 
MacBook pro? It seems there is not a close relationship between report 
ID and boot protocol on the actual hardware. I saw in CR6674852 that one 
byte report ID prefix appeared in the IBM keyboard data.
Or the MacBook pro internal USB keyboard does not conform to the HID 
spec at the point.

> I suspect that when an usb keyboard is used in boot
> protocol mode, it should just use an expected keyboard
> data packet size of USB_KBD_DEFAULT_PACKET_SIZE  (=8)
> bytes (without looking at the  HID descriptors)!
>   
The codes of getting the packet size by parsing the report descriptor 
have been there years. If the value parsed from the actual hardware is 
replaced with that defined in spec, it is possible to bring some regression.
>
> dtracing in usbkbm_rput() reveals that the MacBook Pro USB
> keyboard is sending standard 8 bytes boot protocol packets,
> but they are dropped on the floor because the usbkbm module
> thinks that the correct packets size is 0 (zero!) bytes - apparently
> that size of 0 bytes doesn't make any sense at all.
>   
The reason why the value is equal to 0 at the line 560 is that the 
report id 0 (default) is passed to hidparser_get_packet_size() as the 
argument. The actual report ID is 1.

Therefore, if the close relationship between report ID and boot protocol 
exists, the complete fix seems to be to disable the boot protocol and 
add the report ID support in usbkbm.

Regards,
Strony


Reply via email to