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?


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 serial support is intended solely for polled IO in RedBoot and for diagnostic output. If you want to have an interrupt driven, flow controlled serial device then implement a proper device driver, don't try to hack the HAL driver. There is plenty of documentation on how to do this and there are plenty of example in the source repository.

I now believe the simple answer to my question is: "Implement the XON/XOFF flow control inside the HAL driver."


Reason: If I enable CTRLC-Interrupts, I accept that all other received characters are lost. So I don't need to buffer anything, just look for XON/XOFF in addition to CTRLC. The character send routine then spins while TX is throttled (as the hardware flow control would do).

The code can go into the cyg_hal_plf_serial_getc_nonblock() routine, so it works for both polling and interrupt operation. It should not be neccessary to put the XON/XOFF through to /dev/haldiag, because it doesn't do buffering anyway, so it wouldn't help to let it know.

Heiko

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