From owner-freebsd-current@FreeBSD.ORG Mon Jul 16 07:10:13 2007 Return-Path: X-Original-To: current@FreeBSD.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4ED8616A401 for ; Mon, 16 Jul 2007 07:10:13 +0000 (UTC) (envelope-from w0lfie@clear.net.nz) Received: from smtp3.clear.net.nz (smtp3.clear.net.nz [203.97.33.64]) by mx1.freebsd.org (Postfix) with ESMTP id 1EAA813C49D for ; Mon, 16 Jul 2007 07:10:12 +0000 (UTC) (envelope-from w0lfie@clear.net.nz) Received: from clear.net.nz (lb2-srcnat.clear.net.nz [203.97.32.237]) by smtp3.clear.net.nz (CLEAR Net Mail) with SMTP id <0JL900LPRF676300@smtp3.clear.net.nz> for current@FreeBSD.org; Mon, 16 Jul 2007 18:54:08 +1200 (NZST) Date: Mon, 16 Jul 2007 18:54:07 +1200 From: Sam Banks Sender: w0lfie@clear.net.nz To: current@FreeBSD.org Message-id: <469b160f.3c6.2409.12123@clear.net.nz> X-Mailer: CLEAR Net WebMail; webmail.clear.net.nz; user: w0lfie; ip: 121.73.22.121 Priority: normal Cc: Subject: ukbd patch advice X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: w0lfie@clear.net.nz List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jul 2007 07:10:13 -0000 Hey all, I have been having a problem with my particular usb keyboard (0x03 was always being written into the first element of ukbd_data->keycode basically). I have tracked it down to a problem somewhere in between the uhci chipset (same problem with other cuts of uhci chipset), the uhci and/or ukbd drivers and the keyboard. A fix to the problem is to reorder members of the struct ukbd_data. Originally, the members are ordered as modifiers, reserved and keycode[6] (minus a bunch of #define's). If I change this order to reserved, modifiers and keycode[6], my keyboard starts to function as it should (minus lighting up the LED's but that's another email all together :)). With this reordering, it stops other usb keyboards which function with the original code from working. I'm wanting submit a patch for this fix (as other people are experiencing the same problems) but I'm not sure how to do this. I was thinking along the lines of the usb quirks function but it appears outside of a function body, you cannot have the normal if() type statements, only the preprocessor #ifdef types. To me, having a kernel config option for a single keyboard on a single driver seems quite overkill. Does anyone have any suggestions on what I should do or can anyone point me to some code that deals with a similar problem? On a side note, is anyone able to shed any light into why they think the above fix works? I am drawing a bit of a blank to be honest. Is it possible that my fix is only masking the problem? If you need any more info or whatever, yell out. Cheers, Sam.