DragonFly submit List (threaded) for 2011-01
[
Date Prev][
Date Next]
[
Thread Prev][
Thread Next]
[
Date Index][
Thread Index]
Re: [issue1968] ukbd patch
Hallo Alex,
bin btw in chat als randy1 unterwegs.
On 1/25/2011, ""Alex Hornung \(via DragonFly issue tracker\)"
submit@crater.dragonflybsd.org" <"Alex Hornung \(via DragonFly issue
tracker\)"
submit@crater.dragonflybsd.org> wrote:
>
>Alex Hornung <ahornung@gmail.com> added the comment:
>
>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@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".
Das verstehe ich nicht ganz; usbd_get_quirks() bedeutet: wenn es ein
quirk fuer den device gibt, dann...
In der Tat es gibt kein quirk fuer den keyboard, trotzdem setzt der
original code den protocol zu 0.
Aus usb_quirks.h:
#define UQ_NO_SET_PROTO 0x0001 /* cannot handle SET PROTOCOL. */
was bedeuten soll, dass der device den protocol nicht setzen kann, darum
usbd_set_protocol(state->ks_iface, 0) zwingen, was in dem Fall nicht
noetig ist (?)
>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
>
>----------
>status: unread -> chatting
>
>_____________________________________________________
>DragonFly issue tracker <bugs@lists.dragonflybsd.org>
><http://bugs.dragonflybsd.org/issue1968>
>_____________________________________________________
[
Date Prev][
Date Next]
[
Thread Prev][
Thread Next]
[
Date Index][
Thread Index]