From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756915AbYH0Pz4 (ORCPT ); Wed, 27 Aug 2008 11:55:56 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755340AbYH0Pzo (ORCPT ); Wed, 27 Aug 2008 11:55:44 -0400 Received: from mailer2.option.com ([81.246.70.163]:26523 "EHLO mailer2.option.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753486AbYH0Pzn (ORCPT ); Wed, 27 Aug 2008 11:55:43 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ah0BACsWtUgKAAAZ/2dsb2JhbAAIuVyBaA Message-ID: <48B578F3.1050908@option.com> Date: Wed, 27 Aug 2008 17:55:31 +0200 From: Denis Joseph Barrow User-Agent: Thunderbird 2.0.0.16 (X11/20080724) MIME-Version: 1.0 To: Jeff Garzik CC: greg@kroah.com, Linux USB kernel mailing list , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: question wrt /drivers/char/tty_io.c in pre 2.6.16 code References: <20080820010353.593820280@mini.kroah.org> <20080820010752.GB3365@kroah.com> <48B52064.9070700@pobox.com> In-Reply-To: <48B52064.9070700@pobox.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 27 Aug 2008 15:55:31.0729 (UTC) FILETIME=[55909810:01C9085D] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi all, In kernels prior to 2.6.16 it appears to me have no mechanism for finding out if the tty recieve buffers are full. This is important for me in implementing flow control in the hso serial driver I'm developing I don't want to lose characters. The snippet from allesandro rubini's book doesn't will just blindly flip buffers & overrun if data is pushed in too quickly into the tty layer. for (i = 0; i < data_size; ++i) { if (tty->flip.count >= TTY_FLIPBUF_SIZE) tty_flip_buffer_push(tty); tty_insert_flip_char(tty, data[i], TTY_NORMAL); } tty_flip_buffer_push(tty); The new tty_insert_flip_string returns the number of bytes successfully copied to tty recieve buffers how do I implement this functionality in pre 2.6.16 code, can it be done? Thank you, D.J. Barrow