Messages in this thread | | | Date | Tue, 23 Nov 1999 08:57:41 -0800 (PST) | From | Linux Lists <> | Subject | TTY Flip buffers |
| |
Hello,
I was looking at the TTY flip buffers, and I noticed that its structure declaration is as follows:
#define TTY_FLIPBUF_SIZE 512
struct tty_flip_buffer { struct tq_struct tqueue; struct semaphore pty_sem; char *char_buf_ptr; unsigned char *flag_buf_ptr; int count; int buf_num; unsigned char char_buf[2*TTY_FLIPBUF_SIZE]; char flag_buf[2*TTY_FLIPBUF_SIZE]; unsigned char slop[4]; /* N.B. bug overwrites buffer by 1 */ };
Note that the char_buf buffer size is 2*TTY_FLIPBUF_SIZE. However, all serial drivers check the value TTY_FLIPBUF_SIZE in order to know whether the buffer is full or not.
Is this correct?? Shouldn't the serial drivers be checking for 2*TTY_FLIPBUF_SIZE?? Aren't the serial drivers subutilizing the flip buffers in this way??
Another question: if I want to use a larger flip buffer, can I just allocate the required memory amount and set the pointers char_buf_ptr and flag_buf_ptr?? If not, I don't see the reason for the existence of these pointers ...
Thanks in advance for your comments.
Regards, Ivan
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |