From owner-freebsd-hackers@FreeBSD.ORG Wed Jun 25 06:09:56 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0195737B401 for ; Wed, 25 Jun 2003 06:09:56 -0700 (PDT) Received: from cs.huji.ac.il (cs.huji.ac.il [132.65.16.30]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5F1714400B for ; Wed, 25 Jun 2003 06:09:55 -0700 (PDT) (envelope-from danny@cs.huji.ac.il) Received: from pampa.cs.huji.ac.il ([132.65.80.32] ident=danny) by cs.huji.ac.il with esmtp id 19VA21-000FQ4-00; Wed, 25 Jun 2003 16:09:49 +0300 X-Mailer: exmh version 2.6.3 04/04/2003 with nmh-1.0.4 To: ticso@cicely.de In-reply-to: Your message of Wed, 25 Jun 2003 14:37:38 +0200 . Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 25 Jun 2003 16:09:49 +0300 From: Danny Braniss Message-Id: cc: freebsd-hackers@freebsd.org Subject: Re: USB, select/poll for ucom X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jun 2003 13:09:56 -0000 [...] > > i turned debug on and i could not see any calls to ucomread, > > the program calls select(...) - but select does not initiate anything, > > it justs waits to be woken when something is received (in the case of reading), > > now, unless im wrong - which well could be :-), the read in this case must be > > started - usb is a master/slave protocol, and this is not happening. > > Because you don't talk to ucom directly - you talk to tty layer. > See src/sys/kern/tty* > > > if(select(fdset,...)) { > > if(FD_ISSET(ifd, fdset)) > > read(ifd, ... > > ... > > } > > danny > > PS: im using 5.1-current, and im trying to get a Towitoko smartcard reader to > > work. > > Forget it - if I'm not wrong Towitoko readers use 7 bit transfers and > that's your problem. > It's doesn't with at least uplcom and uftdi - Towitoko is using PL2303 > chips in their own USB product. > The only thing you can do to get this working is by fixing 7 bit > transfers. You are correct, the Towitoko/USB is using PL2303: ucom0: Prolific Technology PL2303 Serial adapter (ATEN/IOGEAR UC232A), rev 1.10/2.02, addr 2 debugging the RS232, i see that it starts at 1200bps/7bits but switches to 9600 bps/ 8 bits very early on, i'll have to check the Towitoko driver to see if it can do without the initial 1200/7bits. danny