ukbd patch
Alex Hornung
ahornung at gmail.com
Tue Jan 25 00:12:59 PST 2011
On 25/01/11 06:29, Magliano Andrea wrote:
> Without this patch uhci driver doesn't generate an interrupt when Fn key is pressed on Apple usb keyboard (it took me days to realize this...).
With this patch that code is probably skipped unconditionally in the
normal case.
> I just want to map Fn key to 'insert' keycode. For that it's than enough to set ukbd_trtab[1]=102 in ukbd.c ,but i don't know if to hardcode this violates any standard. Does it?
Why don't you just set the quirk NO_SET_PROTO for that device? That will
have the same effect.
> 0001-set-usb-quirk-the-right-way.patch
>
>
> From 639a855e36f1bf7b1d6120ba5c2bd1a871614ead Mon Sep 17 00:00:00 2001
> From: Charlie <root at randy.andy.net>
> Date: Tue, 25 Jan 2011 06:58:43 +0100
> Subject: [PATCH] set usb quirk the right way
>
> ---
> sys/dev/usbmisc/ukbd/ukbd.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/sys/dev/usbmisc/ukbd/ukbd.c b/sys/dev/usbmisc/ukbd/ukbd.c
> index 2099921..e3adf78 100644
> --- a/sys/dev/usbmisc/ukbd/ukbd.c
> +++ b/sys/dev/usbmisc/ukbd/ukbd.c
> @@ -1460,7 +1460,7 @@ bLength=%d bDescriptorType=%d bEndpointAddress=%d-%s bmAttributes=%d wMaxPacketS
> return EINVAL;
> }
>
> - if ((usbd_get_quirks(state->ks_uaa->device)->uq_flags & UQ_NO_SET_PROTO) == 0) {
> + if (usbd_get_quirks(state->ks_uaa->device)->uq_flags & UQ_NO_SET_PROTO) {
This makes no sense. The original condition was: "If we are asked not to
set a proto skip this section, otherwise call usbd_set_protocol".
Now it is: "If we are asked not to set a proto, set a proto.".
> err = usbd_set_protocol(state->ks_iface, 0);
> DPRINTFN(5, ("ukbd:init_keyboard: protocol set\n"));
> if (err) {
> -- 1.7.3.2
More information about the Submit
mailing list