PPP and console driver questions

Wendell Thompson wthompson at dsg-test.com
Thu Mar 20 03:12:56 UTC 2003


Questions about RTEMS PPP and the interrupt-driven console code for the 
Coldfire mcu in mcfuart.c:

1. The pppstart() function in ppp_tty.c calls the termios write callback 
function, in the console driver, with a buffer pointer and string 
length. The write function in the driver copies the pointer and uses the 
queue in place. There appears to be no feedback to prevent pppstart from 
calling the write function again before the characters are dequeued, 
thus moving the pointers and skipping part of the queue. It also appears 
that pppstart could overwrite the data in the buffer before the 
interrupt dequeues the previous packet.

Do I understand this correctly? If so, which part of this code needs to 
be corrected - the console driver?

2. The console transmit interrupt calls rtems_termios_dequeue_characters 
with the buffer length that was passed into it by the previous write 
callback. That would mean the dequeue_characters function would 
eventually be limited to the smallest packet size previously 
transmitted, except that the function ignores the length parameter when 
it calls the PPP line discipline function.

Does the console driver need to handle these conditions? It appears that 
it should copy the queued transmit characters into it's own buffer, and 
that buffer must be large enough to handle anything the pppstart 
function will throw at it. Or is it adequate, acceptable, or preferable 
to block in the console write function until the queue is empty?





More information about the users mailing list