From owner-freebsd-questions@FreeBSD.ORG Sat Aug 21 08:53:53 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E1B5B10656A6 for ; Sat, 21 Aug 2010 08:53:53 +0000 (UTC) (envelope-from chungyeol.lee@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id A6E178FC08 for ; Sat, 21 Aug 2010 08:53:53 +0000 (UTC) Received: by iwn36 with SMTP id 36so4357124iwn.13 for ; Sat, 21 Aug 2010 01:53:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:subject :message-id:reply-to:mime-version:content-type:content-disposition :organazation:user-agent; bh=Y/PIYk1mp62kvhh2/hg7gn12lgzfKVgklTS8hH+lOBo=; b=H66Krqg14eSuoICuTqEDUca0SxhIw3w9Da9lXh2Bfl1MFdes6NyIaKPb+RynNHRDsS FRGnI1p5bJUcRJfTIBsNVnunKcl0YjmL6ORfrJKmqL3iygIbsMu4hiaoAaVTa4TgkmzI NscRhw0a3+VuJZsiIITBYy/R/KGrWS1QQJmrQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:subject:message-id:reply-to:mime-version:content-type :content-disposition:organazation:user-agent; b=t/mTa09prXInYf//Vxsdw4tOSbBfnTCZKfj7WQliVb90m3UZSk7aqyKpDlrYnGhc6F ZbBmJmQXzJgul3f8fmdB5YWVA9haU64SfBaYIKLzsdbE/LECoHo5lwd2xmPYXpdVD/pA QDatWG6flkjumq05cWnV6dEy2XYOlByJnN7vY= Received: by 10.231.174.5 with SMTP id r5mr2962729ibz.132.1282378994219; Sat, 21 Aug 2010 01:23:14 -0700 (PDT) Received: from genie.honey.home ([124.57.9.45]) by mx.google.com with ESMTPS id j2sm3514581iba.18.2010.08.21.01.23.11 (version=SSLv3 cipher=RC4-MD5); Sat, 21 Aug 2010 01:23:13 -0700 (PDT) Date: Sat, 21 Aug 2010 17:23:06 +0900 From: "Lee, Chung-Yeol" To: freebsd-questions@freebsd.org Message-ID: <20100821082306.GA2204@genie.honey.home> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="/9DWx/yDrRhgMJTb" Content-Disposition: inline Organazation: KAIST User-Agent: Mutt/1.5.20 (2009-06-14) Subject: Use extra buttons of Kensington Slimblade Trackball X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: "Lee, Chung-Yeol" List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Aug 2010 08:53:54 -0000 --/9DWx/yDrRhgMJTb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, While I'm searching how to use the extra buttons in Kensington Slimblade Trackball, I made a patch for myself based on the linux driver. I confirmed it works as intended. However, I have no experience with the FreeBSD kernel and I'm not sure that I modified it in a correct way. -- especially, I don't know should I use usb_quirks? Can somebody check the attached diff file so that I can send problem report? Thanks. --/9DWx/yDrRhgMJTb Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="ums.diff" --- ums_orig.c 2010-08-21 16:43:53.000000000 +0900 +++ ums.c 2010-08-21 16:47:48.000000000 +0900 @@ -405,7 +405,7 @@ { struct ums_info *info = &sc->sc_info[index]; uint32_t flags; - uint8_t i; + uint8_t i, j; if (hid_locate(buf, len, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_X), hid_input, index, &info->sc_loc_x, &flags, &info->sc_iid_x)) { @@ -483,6 +483,16 @@ break; } } + + /* Detect other buttons */ + for (j = 0; j < 2; j++) { + if (!hid_locate(buf, len, HID_USAGE2(HUP_MICROSOFT, (j + 1)), + hid_input, index, &info->sc_loc_btn[i], NULL, + &info->sc_iid_btn[i])) { + break; + } + i++; + } info->sc_buttons = i; if (i > sc->sc_buttons) --/9DWx/yDrRhgMJTb--