From owner-p4-projects@FreeBSD.ORG Tue Mar 2 22:27:50 2010 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 380651065673; Tue, 2 Mar 2010 22:27:50 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F0A88106566C for ; Tue, 2 Mar 2010 22:27:49 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id DE3A88FC0A for ; Tue, 2 Mar 2010 22:27:49 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id o22MRnvM011979 for ; Tue, 2 Mar 2010 22:27:49 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id o22MRnje011977 for perforce@freebsd.org; Tue, 2 Mar 2010 22:27:49 GMT (envelope-from hselasky@FreeBSD.org) Date: Tue, 2 Mar 2010 22:27:49 GMT Message-Id: <201003022227.o22MRnje011977@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 175283 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2010 22:27:50 -0000 http://p4web.freebsd.org/chv.cgi?CH=175283 Change 175283 by hselasky@hselasky_laptop001 on 2010/03/02 22:27:23 USB input: - extend search for Apple Function Key. - patch by: HPS @ PR: usb/144414 Affected files ... .. //depot/projects/usb/src/sys/dev/usb/input/ukbd.c#45 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb/input/ukbd.c#45 (text+ko) ==== @@ -883,7 +883,7 @@ err = usbd_req_get_hid_desc(uaa->device, NULL, &hid_ptr, &hid_len, M_TEMP, uaa->info.bIfaceIndex); if (err == 0) { - uint8_t temp_id; + uint8_t apple_keys = 0; /* investigate if this is an Apple Keyboard */ if (hid_locate(hid_ptr, hid_len, @@ -893,18 +893,20 @@ if (flags & HIO_VARIABLE) sc->sc_flags |= UKBD_FLAG_APPLE_EJECT | UKBD_FLAG_APPLE_SWAP; - if (hid_locate(hid_ptr, hid_len, - HID_USAGE2(0xFFFF, 0x0003), - hid_input, 0, &sc->sc_loc_apple_fn, &flags, - &temp_id)) { - if (flags & HIO_VARIABLE) - sc->sc_flags |= UKBD_FLAG_APPLE_FN | - UKBD_FLAG_APPLE_SWAP; - if (temp_id != sc->sc_kbd_id) { - DPRINTF("HID IDs mismatch\n"); - } - } - } else { + DPRINTFN(1, "Found Apple eject-key\n"); + apple_keys = 1; + } + if (hid_locate(hid_ptr, hid_len, + HID_USAGE2(0xFFFF, 0x0003), + hid_input, 0, &sc->sc_loc_apple_fn, &flags, + &sc->sc_kbd_id)) { + if (flags & HIO_VARIABLE) + sc->sc_flags |= UKBD_FLAG_APPLE_FN | + UKBD_FLAG_APPLE_SWAP; + DPRINTFN(1, "Found Apple FN-key\n"); + apple_keys = 1; + } + if (apple_keys == 0) { /* * Assume the first HID ID contains the * keyboard data