Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 6 Jul 2008 00:12:47 +0200
From:      Bernd Walter <ticso@cicely7.cicely.de>
To:        Hans Petter Selasky <hselasky@c2i.net>
Cc:        usb@freebsd.org, Luigi Rizzo <rizzo@icir.org>, freebsd-current@freebsd.org, ticso@cicely.de, current@freebsd.org
Subject:   Re: may I commit this small umodem patch ?
Message-ID:  <20080705221247.GH41487@cicely7.cicely.de>
In-Reply-To: <20080705215032.GG41487@cicely7.cicely.de>
References:  <20080703140719.GA72315@onelab2.iet.unipi.it> <200807050957.07900.hselasky@c2i.net> <20080705162426.GD41487@cicely7.cicely.de> <200807052256.15792.hselasky@c2i.net> <20080705215032.GG41487@cicely7.cicely.de>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Jul 05, 2008 at 11:50:32PM +0200, Bernd Walter wrote:
> On Sat, Jul 05, 2008 at 10:56:14PM +0200, Hans Petter Selasky wrote:
> > On Saturday 05 July 2008, Bernd Walter wrote:
> > > On Sat, Jul 05, 2008 at 09:57:06AM +0200, Hans Petter Selasky wrote:
> > > >
> > > > Yes, but you know that umodem can drop data, if the buffers overflow ?
> > >
> > > Do you mean the driver can loose data?
> > > It would be good if this is avoidable somehow.
> > > In fact those beasts have some kind of pseudo flow control in that they
> > > don't ack further packets.
> > > Basicly this is nothing more than using a pair of bulk pipes for raw
> > > data, but under the hood of CDC identification.
> > > I personally only use them for uploading firmware to AT91SAM7*
> > > controllers, as luigi does, but since Windows and Linux have generic
> > > drivers this is quite popular.
> > 
> > From what I know the TTY layer which umodem uses will dump data when the 
> > buffers are full. But it there is some kind of framing in the protocol used, 
> > then this is no problem.
> 
> Well - the problem is that there is not special protocol.
> This technology is used as a general purpose interface for almost every
> kind of application that.
> Most protocols are using smal transactions, but this is general purpos
> after all.
> This is quite similar as devices using embedded uart or something like
> the FT245 pseudo uart chips from FTDI.
> I asume even most modern cell phones don't use real uarts.
> 
> I wonder what happens with real USB RS232 with activated RTS/CTS.
> The handshake is handled in the USB device and not under FreeBSD,
> because the USB devices have too large buffers for the OS to react fast
> enough.
> Can we loose data as well?
> If yes we have a problem there as well.
> If not, then there must be some kind of mechanism to sync TTY layer
> with the USB transport speed and we can use the same for pseudo uart.
> 
> I don't think we should drop data ourself, since we have USB handshake
> for speed syncronisation.

After rethinking: I only remember having seen TTY layer dropped data
in the receive path and I can't think that it was every reasonable to
do for sending, since the local application can be throttled.
However - we should not receive from USB if our tty buffer can't hold
further data.
It is up to the USB device to drop data if unavoidable, since only the
device itsel can judge.

-- 
B.Walter <bernd@bwct.de> http://www.bwct.de
Modbus/TCP Ethernet I/O Baugruppen, ARM basierte FreeBSD Rechner uvm.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080705221247.GH41487>