From owner-freebsd-stable@FreeBSD.ORG Sat Jan 8 19:38:26 2005 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 12DB016A4CE for ; Sat, 8 Jan 2005 19:38:26 +0000 (GMT) Received: from sccrmhc13.comcast.net (sccrmhc13.comcast.net [204.127.202.64]) by mx1.FreeBSD.org (Postfix) with ESMTP id 48D2A43D48 for ; Sat, 8 Jan 2005 19:38:25 +0000 (GMT) (envelope-from bfoz@bfoz.net) Received: from [192.168.0.5] (c-67-161-34-162.client.comcast.net[67.161.34.162]) by comcast.net (sccrmhc13) with ESMTP id <20050108193824016002bj46e>; Sat, 8 Jan 2005 19:38:24 +0000 Message-ID: <41E036AF.2030407@bfoz.net> Date: Sat, 08 Jan 2005 11:38:23 -0800 From: Brandon Fosdick User-Agent: Mozilla Thunderbird 0.9 (X11/20041111) X-Accept-Language: en-us, en MIME-Version: 1.0 To: "M. Warner Losh" References: <40170.4.248.235.201.1104333403.squirrel@4.248.235.201> <20050102.220156.79545944.imp@bsdimp.com> In-Reply-To: <20050102.220156.79545944.imp@bsdimp.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-stable@freebsd.org Subject: Re: ucom and sio X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Jan 2005 19:38:26 -0000 M. Warner Losh wrote: > In message: <40170.4.248.235.201.1104333403.squirrel@4.248.235.201> > "Brandon Fosdick" writes: > : Judging from the man page, ucom is limited to acting like a tty with no > : support for sio. Is this true? Is there some magic config bit somewhere > : that will enable hidden sio support? > > Ummm, I don't know what you are asking here. ucom supports all the > rs232 stuff w/o problem. I use it all the time with my phone to dial > into the network. Well, then I must be doing something wrong. The man page for ucom would seem to indicate that it is tty only... "The ucom driver attaches to USB modems, serial ports, and other devices that need to look like a tty. The ucom driver shows a behavior like a tty(4). This means that normal programs such as tip(1) or pppd(8) can be used to access the device." If I use tip it works fine. But if I try to write a C program that opens the device it hangs on open, unless I set it to non-blocking. Then open returns and I set it back to blocking then try a read or a write. read() blocks regardless of whether any data has been sent by the other device (a terminal app on my palm pilot for debugging purposes) and write() blocks without sending anything. If I set the device to be non-blocking read() will return the data that was sent by the other device, but write() will still block. Oddly, I get the same behavior on my powerbook, so I thought the adapter was defective. But it works with terminal apps on freebsd, osx and windows, so I'm pretty sure its working. I have no idea what I'm doing wrong though. Once I figure out where I put the code for this thing I'll send the test program I've been using. I always seem to lose something when I travel...