> Index: dev/usb/ukbd.c

> @@ -227,6 +234,25 @@ ukbd_attach(struct device *parent, struc
>       if (hidkbd_attach(self, kbd, 1, qflags, repid, desc, dlen) != 0)
>               return;
>  
> +     /* check for apple keyboards that need Fn-key help */
> +     if (uha->uaa->vendor == USB_VENDOR_APPLE) {
> +             uhidev_get_report_desc(sc->sc_hdev.sc_parent, &desc, &size);
> +             d = hid_start_parse(desc, size, hid_input);
> +             while (hid_get_item(d, &h)) {
> +                     if (HID_GET_USAGE_PAGE(h.usage) == 0x00ff &&
> +                         HID_GET_USAGE(h.usage) == 0x0003 &&
> +                         h.kind == hid_input && (h.flags & HIO_VARIABLE)) {

Any reason not to use hid_locate() here?

> +                             sc->sc_apple_fn = 1;
> +                             sc->sc_apple_fn_loc = h.loc;
> +                             sc->sc_munge = ukbd_apple_munge;
> +#ifdef DIAGNOSTIC
> +                             printf(", apple Fn-key help\n");
> +#endif

I think this is not worth adding a message (and it will confuse dmesg
output because of the newline).

Miod

Reply via email to