Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752653Ab0BWNTZ (ORCPT ); Tue, 23 Feb 2010 08:19:25 -0500 Received: from out2.smtp.messagingengine.com ([66.111.4.26]:48543 "EHLO out2.smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752415Ab0BWNTX (ORCPT ); Tue, 23 Feb 2010 08:19:23 -0500 X-Sasl-enc: N7fN8Q5Dfrumxi6ArH+tiR5QoNKV5ciEdZRnIRFXzW9q 1266931162 Message-ID: <4B83D5D7.3040407@imap.cc> Date: Tue, 23 Feb 2010 14:19:19 +0100 From: Tilman Schmidt User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de-AT; rv:1.8.1.23) Gecko/20090825 SeaMonkey/1.1.18 Mnenhy/0.7.6.0 MIME-Version: 1.0 To: Simon Horman CC: Karsten Keil , David Miller , Hansjoerg Lipp , Karsten Keil , isdn4linux@listserv.isdn4linux.de, i4ldeveloper@listserv.isdn4linux.de, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/4] bas_gigaset: collapse CR/LF at end of AT response References: <20100221-patch-gigaset-00.tilman@imap.cc> <20100221-patch-gigaset-02.tilman@imap.cc> <20100223063425.GA28744@verge.net.au> In-Reply-To: <20100223063425.GA28744@verge.net.au> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1241 Lines: 29 Simon Horman schrieb: > I am confused about what the value of MAX_RESP_SIZE means. > Is it a hw restriction? It's an arbitrary limitation in the driver. The hardware specification says nothing about the possible length of AT responses from the device, so we had to draw a line somewhere. 512 bytes have so far proved to be amply sufficient. In practice, the limit is only hit with the M10x devices (which transmit commands and data over the same channel) when the state machine gets out of sync and tries to interpret received payload data as AT responses. > It seems that up to MAX_RESP_SIZE of string-data is permitted if the line > is terminated by CR. But only MAX_RESP_SIZE -1 bytes if the line is > terminated by LF or CR LF. Note that when storing the CR in cs->respdata[0] for possible collapsing with a subsequent LF, the cbytes counter is left at 0, so the CR gets overwritten by the first character of the next response if there's no intervening LF. Thanks for reviewing, Tilman -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/