This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: hal_diag serial driver: using XON/XOFF flow control?


On Wed, Jun 23, 2004 at 02:21:27PM +0200, Heiko Panther wrote:
> Hi List,
> 
> my hal_diag.c serial driver is all set up to handle incoming XON/XOFF 
> messages, that is, it has an ISR and handles the incoming interrupts by 
> reading a char. I'm using the hal_diag driver to do my debug logging, so I 
> have /dev/haldiag and /dev/ttydiag on top of it. As I get it, these are 
> associated with the serial channel from serial.c which provides for the 
> flow control.
> 
> Now the problem seems to be that the HAL doesn't send characters that come 
> in on interrupt to the serial driver. It just checks for CTRL-C and that's 
> it. So that would mean I have to do polling (by issuing read's to the 
> serial port) in order to get flow control for outgoing data. It also means 
> that characters are lost which are received on interrupt.
> 
> Am I overlooking something? If not, I would like to implement XON/XOFF for 
> the HAL diag driver. Looks like getting the received character to the 
> serial driver needs some architectural change in the common HAL. Am I 
> better off with reimplementing flow control inside the hal diag driver? 
> What do you suggest?

The HAL driver should be as simple as possible, polling based, no
interrupts. You want it to work under the worst possible conditions eg
when the system is crashing becasue of an exception inside an
interrupt hander etc. 

You then do a full blown driver as a seperate package. This is
generally interrupt driver and can have flow control etc. You then
include this package in your configuration and use that device for
traffic which requires flow control.

I hope this helps,

                Andrew

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]