From owner-freebsd-questions@FreeBSD.ORG Wed Aug 5 21:01:14 2009 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 B86BB106566B for ; Wed, 5 Aug 2009 21:01:14 +0000 (UTC) (envelope-from bmcgover@cisco.com) Received: from rtp-iport-1.cisco.com (rtp-iport-1.cisco.com [64.102.122.148]) by mx1.freebsd.org (Postfix) with ESMTP id 656998FC16 for ; Wed, 5 Aug 2009 21:01:13 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqQEAN9ueUpAZnmf/2dsb2JhbACKCpATgRuhOoEUCAGHDJBtBYQYgVGGAQ X-IronPort-AV: E=Sophos;i="4.43,330,1246838400"; d="scan'208";a="53076985" Received: from rtp-dkim-2.cisco.com ([64.102.121.159]) by rtp-iport-1.cisco.com with ESMTP; 05 Aug 2009 18:39:03 +0000 Received: from rtp-core-2.cisco.com (rtp-core-2.cisco.com [64.102.124.13]) by rtp-dkim-2.cisco.com (8.12.11/8.12.11) with ESMTP id n75Id3Jh025704 for ; Wed, 5 Aug 2009 14:39:03 -0400 Received: from xbh-rtp-211.amer.cisco.com (xbh-rtp-211.cisco.com [64.102.31.102]) by rtp-core-2.cisco.com (8.13.8/8.14.3) with ESMTP id n75Id3VR019998 for ; Wed, 5 Aug 2009 18:39:03 GMT Received: from xmb-rtp-205.amer.cisco.com ([64.102.31.59]) by xbh-rtp-211.amer.cisco.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 5 Aug 2009 14:39:03 -0400 Received: from 161.44.65.27 ([161.44.65.27]) by xmb-rtp-205.amer.cisco.com ([64.102.31.59]) via Exchange Front-End Server email.cisco.com ([64.102.31.21]) with Microsoft Exchange Server HTTP-DAV ; Wed, 5 Aug 2009 18:39:02 +0000 Received: from bmcgover-pc.cisco.com by email.cisco.com; 05 Aug 2009 14:39:39 -0400 From: Brian McGovern To: freebsd-questions@freebsd.org Content-Type: text/plain Content-Transfer-Encoding: 7bit Organization: Cisco Systems, Inc. Date: Wed, 05 Aug 2009 14:39:39 -0400 Message-Id: <1249497579.39696.78.camel@bmcgover-pc.cisco.com> Mime-Version: 1.0 X-Mailer: Evolution 2.26.0 FreeBSD GNOME Team Port X-OriginalArrivalTime: 05 Aug 2009 18:39:03.0060 (UTC) FILETIME=[01432540:01CA15FC] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; l=2486; t=1249497543; x=1250361543; c=relaxed/simple; s=rtpdkim2001; h=Content-Type:From:Subject:Content-Transfer-Encoding:MIME-Version; d=cisco.com; i=bmcgover@cisco.com; z=From:=20Brian=20McGovern=20 |Subject:=20Writing=20to=20a=20uhid=20device? |Sender:=20 |To:=20freebsd-questions@freebsd.org; bh=sBrN7LaE43Zej7SbquKw7LK1hw8Dg5kC+Up8NrRqr28=; b=ODKmAByDSzHJa3nX0j5EneuJ8D7tL6NiVcMX3+gIUeSHuHyJPyrQyhJcRU XsJCbqcisPVnzzk7i98BQ5Y8c6MO7/So3A6d0V08V8fMc4ELQ0KhjrX6aPUL VniZS8Hqs0; Authentication-Results: rtp-dkim-2; header.From=bmcgover@cisco.com; dkim=pass ( sig from cisco.com/rtpdkim2001 verified; ); Subject: Writing to a uhid device? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: bmcgover@cisco.com List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Aug 2009 21:01:15 -0000 I picked up a Velleman K8055 digital I/O controller that connects to a PC via a USB port. FreeBSD picks up this device as a uhid, and I can see the following elements: bmcgover-pc# usbhidctl -f /dev/uhid2 -r Report descriptor: Collection page=Microsoft usage=0x0001 Input size=8 count=1 page=Microsoft usage=0x0001, logical range 0..255 Input size=8 count=1 page=Microsoft usage=0x0002, logical range 0..255 Input size=8 count=1 page=Microsoft usage=0x0003, logical range 0..255 Input size=8 count=1 page=Microsoft usage=0x0004, logical range 0..255 Input size=8 count=1 page=Microsoft usage=0x0005, logical range 0..255 Input size=8 count=1 page=Microsoft usage=0x0006, logical range 0..255 Input size=8 count=1 page=Microsoft usage=0x0007, logical range 0..255 Input size=8 count=1 page=Microsoft usage=0x0008, logical range 0..255 Output size=8 count=1 page=Microsoft usage=0x0001, logical range 0..255 Output size=8 count=1 page=Microsoft usage=0x0002, logical range 0..255 Output size=8 count=1 page=Microsoft usage=0x0003, logical range 0..255 Output size=8 count=1 page=Microsoft usage=0x0004, logical range 0..255 Output size=8 count=1 page=Microsoft usage=0x0005, logical range 0..255 Output size=8 count=1 page=Microsoft usage=0x0006, logical range 0..255 Output size=8 count=1 page=Microsoft usage=0x0007, logical range 0..255 Output size=8 count=1 page=Microsoft usage=0x0008, logical range 0..255 End collection Total input size 8 bytes Total output size 0 bytes Total feature size 0 bytes Reading from the device 8 bytes at a time does whats expected - I can see the digital and analog inputs, the counters, etc, and all is fine. However, I notice on the above output that the "total output size" is 0, and writing 8 bytes of information to the device seems to do nothing for the outputs. I'm guessing at this point that its an issue somewhere with the driver, but a quick look at uhid_do_write() looks like its doing something, although the behavior changes around sc->sc_oid and sc->sc_osize (possible issue with the 'total output size' being 0, above?). Does anyone have any thoughts or ideas, or better yet, experience with such devices, before I spend a couple of days of banging my head against the wall trying to figure out whats happening "under the hood"? Is there a special/magic process? Or should I just be able to write the 8 bytes, 1 for each output, as I read the input? -B