From owner-freebsd-hackers@freebsd.org Tue Dec 20 18:41:47 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14E9CC87404 for ; Tue, 20 Dec 2016 18:41:47 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E7E671689 for ; Tue, 20 Dec 2016 18:41:46 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: f566ee32-c6e3-11e6-8c89-112185c90658 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound1.ore.mailhop.org (Halon) with ESMTPSA id f566ee32-c6e3-11e6-8c89-112185c90658; Tue, 20 Dec 2016 18:41:46 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id uBKIfbkQ004011; Tue, 20 Dec 2016 11:41:37 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1482259297.48539.30.camel@freebsd.org> Subject: Re: USB ppbus? From: Ian Lepore To: George Mitchell , freebsd-hackers@freebsd.org Date: Tue, 20 Dec 2016 11:41:37 -0700 In-Reply-To: References: <35e62a59-556a-68bf-3b9d-017108f12f38@m5p.com> <930e14f6-d8a8-7f50-21b4-6e76c2057f31@selasky.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Dec 2016 18:41:47 -0000 On Tue, 2016-12-20 at 13:15 -0500, George Mitchell wrote: > On 12/20/16 12:57, Hans Petter Selasky wrote: > > > > On 12/19/16 20:19, George Mitchell wrote: > > > > > > I have a USB cable that terminates in a DB25 connector.  Inside > > > is a > > > Prolific Technology PL2305: > > > http://prolificusa.com/files/ds_pl2305I_v1.0.pdf > > > It probes as a ulpt.  I would love if there existed such a thing > > > as > > > a uppi device.  Does it sound possible to get to such a result by > > > extending the ppbus code to know about USB?  Or might it be > > > simpler > > > to try to add the ppi ioctls (PPIGDATA, etc.) to ulpt.c?   -- > > > George > > Hi George, > > > > There is currently no such thing. ulpt only provides a raw > > character > > device. The ppbus could possibly be implemented in userspace using > > libcuse. > > > > --HPS > > > > [...] > Thanks for the response.  I think I could kludge the ioctls I want > into > ulpt.c by learning more about the USB system works.  Possibly.  On a > good day.                                                    -- > George > IMO, ppbus solves a 1990s problem that we don't much have anymore: multiplexing multiple concurrent (or time-slice-shared) users of a single parallel port that may have multiple non-printer devices daisy- chained on it. If the only thing you're looking for is the ability to treat some of the DB25 pins as gpio pins, just adding the ioctls to ulpt.c might be the way to go. Another possiblity, if all you're after is gpio on the end of a usb wire, is to use an FTDI usb-serial adapter and then use either the existing ioctl() interface in the uftdi driver (see uftdi(4) manpage), or libusb and libftdi (I'm not sure the latter has ever been ported to freebsd). -- Ian