PPP and console driver questions

Thomas Doerfler Thomas.Doerfler at imd-systems.de
Thu Mar 20 07:42:21 UTC 2003


Hello,

this bug has been detected a year ago, a patch is 
available... Have a look at

www.rtems.com/cgi-bin/gnatsweb.pl

login: guest
password: guest

look at PR162

wkr,
	Thomas.

> 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?
> 

--------------------------------------------
IMD Ingenieurbuero fuer Microcomputertechnik
Thomas Doerfler           Herbststrasse 8
D-82178 Puchheim          Germany
email:    Thomas.Doerfler at imd-systems.de
PGP public key available at: http://www.imd-
systems.de/pgp_keys.htm




More information about the users mailing list