From owner-freebsd-current@FreeBSD.ORG Sun May 25 17:06:07 2008 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 540F41065686 for ; Sun, 25 May 2008 17:06:07 +0000 (UTC) (envelope-from chuckr@telenix.org) Received: from mail3.sea5.speakeasy.net (mail3.sea5.speakeasy.net [69.17.117.5]) by mx1.freebsd.org (Postfix) with ESMTP id 3400E8FC0A for ; Sun, 25 May 2008 17:06:07 +0000 (UTC) (envelope-from chuckr@telenix.org) Received: (qmail 29170 invoked from network); 25 May 2008 16:39:26 -0000 Received: from april.chuckr.org (HELO chuckr.org) (chuckr@[66.92.151.30]) (envelope-sender ) by mail3.sea5.speakeasy.net (qmail-ldap-1.03) with AES256-SHA encrypted SMTP for ; 25 May 2008 16:39:26 -0000 Message-ID: <4839945E.5090500@telenix.org> Date: Sun, 25 May 2008 12:31:26 -0400 From: Chuck Robey User-Agent: Thunderbird 2.0.0.6 (X11/20071107) MIME-Version: 1.0 To: freebsd-current@freebsd.org X-Enigmail-Version: 0.95.5 OpenPGP: id=F3DCA0E9; url=http://pgp.mit.edu Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: my usb prog X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 May 2008 17:06:07 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Man, I'm just not sure if I am making a mistake posting here, but I tried the usb list, and no answer to either subject, so I am risking bothering you. If I'm wrong, and you jump all over me, I will learn that way, at least, not to do it again. Ok, 2 parts below, here's part 1: I've been working trying to get my UC-Logic graphic tablet to work under - -current. First thing I did, I began with an equivalent of a "Hello, world" and added different features so I could get more experience playing with uhid0 (where dmesg puts my tablet). One part of it is a reader/dumper of the descriptor using libusbhid, and one part it printed out, the usage page, kept on printing as a 0x0D (the number of a Digitizer) instead of what I thought it should have been, the word "Digitizer". I looked over libusbhid, and found a small change I could put into usage.c to get the right part to print ... cvs diff: Diffing . Index: usage.c =================================================================== RCS file: /home/ncvs/src/lib/libusbhid/usage.c,v retrieving revision 1.8 diff -u -r1.8 usage.c - --- usage.c 9 Apr 2003 01:52:48 -0000 1.8 +++ usage.c 24 May 2008 16:34:17 -0000 @@ -164,7 +164,7 @@ errx(1, "no hid table"); for (k = 0; k < npages; k++) - - if (pages[k].usage == i) + if (pages[k].usage == HID_PAGE(i)) return pages[k].name; sprintf(b, "0x%04x", i); return b; I wanted to apply this myself, but I wanted someone else to verify it looks ok to apply. I used to be pretty active wtih ports, but didn't work in src before (publicly), so if you'd just NOT apply this, just tell me if it's ok or not, I will see about applying it. I have a freebsd.org ssh login from long while back, it still works, so if this is a good diff, please leave it to me to do, ok? ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2nd part is that my other prog, a uhid0 dumper, which is the first part of a Xinput module for my tablet, is not able to correctly dump the uhid0. At first it looked like: while(nread = read(udev, buf, 1024) > 0){ for(i=0; i 0){ fprintf(stderr,";%d",nread); for(i=0; i<5; i++) fprintf(stderr,":%x",buf[i]); } Well, the funny thing is, the data coming out changes! I get the strong notion that I really outght to simply read the number of bytes that the report descriptor tells me to, but the first code sample above, shouldn't it work just as I wrote it? What am I doing wrong? Or, is it possible that the uhid code is wrong, I should maybe read the uhid driver and fix something? I can easily dump enough of the desciptor to find out how much to read, no problem there, I just can't figure out why the "correct" approach fails. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIOZRez62J6PPcoOkRAi0TAJ9aV1dY4SMBSmyqv9hHski3J0IlkQCeLHex zz42d1+2Tf6SERctKLE/+gM= =mWZN -----END PGP SIGNATURE-----