Hi,
>From ca87e942de0c2b389b8797d41a906c946c5c441d Mon Sep 17 00:00:00 2001 From: Paul Fertser <[EMAIL PROTECTED]> Date: Thu, 4 Dec 2008 20:27:39 +0300 Subject: [PATCH] Fixed a bug with a 2048-sized transfer from modem
As the circular buffer is used to hold the incoming data from the modem, its free size must be one byte less than is actually available or we'll get readp == writep and the buffer will be considered empty. --- src/gsm0710muxd.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/gsm0710muxd.c b/src/gsm0710muxd.c index bb49d73..0b9e7ad 100644 --- a/src/gsm0710muxd.c +++ b/src/gsm0710muxd.c @@ -194,7 +194,7 @@ typedef struct Serial * tells how much free space there is in the buffer */ //int gsm0710_buffer_free(GSM0710_Buffer *buf); -#define gsm0710_buffer_free(buf) ((buf->readp > buf->writep) ? (buf->readp - buf->writep) : (GSM0710_BUFFER_SIZE - (buf->writep-buf->readp))) +#define gsm0710_buffer_free(buf) ((buf->readp > buf->writep) ? (buf->readp - buf->writep) : (GSM0710_BUFFER_SIZE - (buf->writep-buf->readp)) - 1) ////////////////////////////////// constants & globals static unsigned char close_channel_cmd[] = { GSM0710_CONTROL_CLD | GSM0710_CR, GSM0710_EA | (0 << 1) }; -- 1.5.2.2
-- Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software! mailto:[EMAIL PROTECTED]
_______________________________________________ Smartphones-userland mailing list Smartphones-userland@linuxtogo.org http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/smartphones-userland