summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libc/termios.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Split initialization and reserve resources from termios to reduceJoel Sherrill1999-05-271-59/+15
| | | | size of mininum application.
* Disable IXON by default based on comment from Eric NorumJoel Sherrill1999-04-011-1/+1
| | | | | | | | | | | | | | | <e.norum@sk.sympatico.ca> and concerns from Thomas Doerfler <td@imd.m.ISAR.de> when he submitted the patch: Since enabling XON/XOFF has such a major performance hit on `smart' output devices I think it should be *off* by default. I think some thought should be given to adding hooks for hardware that can support XON/XOFF without software intervention, or for hardware like the 68360 SCC's that can use large buffers, but still handle special characters immediately. The patch you sent is a very good start, though. I just think that the software flow control should be off -- to match the way the serial I/O support has worked up until now.
* Patch from Thomas Doerfler <td@imd.m.ISAR.de> to add flow control:Joel Sherrill1999-03-311-32/+272
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some lines for "documentation": ====================================== One thing should be noted: when XON/XOFF is enabled, the serial device will always work with one-character buffers, so the interrupt load for the CPU might get higer, especially on devices like MC68360 and MPC860, where the serial channels are capable of using big buffers. But, once again, this only happens when XON/XOFF is actually selected. Please note that the flag IXON is set by default, so outgoing XON/XOFF flow control is enabled by default. XON/XOFF is controlled using the "standard" fields IXON/IXOFF in the termios structure. The termios flag IXANY is not (yet) supported. Hardware handshake for the incoming data stream is controlled using the standard flag CRTSCTS. If this flag is set, whenever the receive buffer is almost full, the driver function "device.stopRemoteTx()" is called, when the receive buffer has more space available, "device.startRemoteTx()" is called again. If the driver does not provide these interface functions (entries in device structure are NULL pointers), then these calls are suppressed. Changes of the flow control options during operation should work at any time, but this has not been extensively tested. No changes to the device driver interface are needed. ================================================ One critical point when using this patch might be, that any BSP using this version of termios will now have outgoing flow control enabled by default, so the behaviour of these BSPs will change here. The option IXON has already been set in older termios by default, but it did not work until this patch. Maybe this option should be switched off by default, what do you think?
* Patch from Aleksey (Quality Quorum <qqi@world.std.com>):Joel Sherrill1998-09-231-3/+9
| | | | | | | | | | | 1. Finally fixes raw interrupts for pc386 2. Makes some minor cleanup in console and startup 3. Makes rtems_termios_dequeue_characters() to return count of outstanding chars - it allows to simplify console isrs a little bit. 4. pc386 uart modified to be friendlier to termios parameter changes, to have minor performance improvement and to take advantage of of above termios modification.
* Patch from Eric Norum:Joel Sherrill1998-09-211-7/+2
| | | | | | | | I fixed the problems noted by Victor Vengerov. 1) Fix typo in cfsetispeed(). 2) In rtems_termios_open, ensure that args->iop->data1 is set before calling device-specific open routine.
* Fix from Eric Norum <eric@skatter.usask.ca>:Joel Sherrill1998-08-211-14/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "Thomas Doerfler" <td@imd.m.isar.de> wrote: > > While implementing/testing the console/termios support for > PPC403 in RTEMS-4.0.0-beta3, I am stuck at a certain location in > termios.c: > > During "rtems_termios_initialize", the main control data structure > "*tty" is allocated using malloc(). (Note, that malloc does not > clear the allocated memory and my BSP does not clear memory during > startup). Furtheron, a lot of fields of that structure are > initialized, but the field "rawOutBufState" is not, and therefore > keeps an arbitrary contents. > > When "osend()" is called the first time(with the serial device > driver working in interrupt mode), termios gets stuck and will not > call the device drivers output function. > > My questions now are: > > - anybody already experienced this bug? > - is it a bug at all or did I do anything fundamentally wrong? > - is there already a common bugfix for that? > > I don't like poking around in other people code, as long as I am > not absolutely sure, what I do... Yes, there's a bug there. I thought that Joel had patched this already, but here's a patch to fix this. This patch also addresses a concern that many others have raised regarding enabling and disabling of transmitter interrupts. First, here's the example I've been using of a simple UART-style interrupt-driven driver: =============================================================== void device_write_routine (int minor, char *buf, int count) { UART->control_register &= ~UART_TRANSMITTER_READY; UART->output_register = *buf; UART->control_register |= UART_TRANSMIT_INTERRUPT_ENABLE; } void device_transmit_interrupt_routine (int vector) { UART->control_register &= ~UART_TRANSMIT_INTERRUPT_ENABLE; rtems_termios_dequeue_characters (device_ttyp, 1); } ============================================================== Several people have expressed their concern about the disable/enable of transmitter interrupts for every character. On some machines this disable/enable is an expensive operation. With the attached patch applied you can write the two routines as: ============================================================== void device_write_routine (int minor, char *buf, int count) { code_to_clear_transmitter_ready_status (); if (device_ttyp->rawOutBufState == rob_idle) code_to_enable_transmitter_interrupts (); code_to_send_one_character_to_transmitter (*buf); } void device_transmit_interrupt_routine (int vector) { rtems_termios_dequeue_characters (device_ttyp, 1); if (device_ttyp->rawOutBufState == rob_idle) code_to_disable_transmitter_interrupts (); } ===============================================================
* Added initialization of missing termios structure entries.Joel Sherrill1998-08-211-2/+3
|
* Closed window thanks to patch from Eric Norum.Joel Sherrill1998-07-281-5/+3
|
* Initialized tty->refcount to 0. When (for whatever reason) malloc()Joel Sherrill1998-07-171-0/+3
| | | | | | | | | | | | | | returned a buffer which was not zero-filled, the reference count was not correct. When the application exitted, the "lastClose" handler was not being called to flush the output. This problem had manifested itself on a variety of platforms. The function rtems_termios_dequeue_characters() incorrectly incremented the buffer pointers when it was invoked and there were no characters in the ring buffer. This problem had also manifested itself on a variety of platforms. The symptom was a strange repeating of the data in the transmitter buffer when the transmitter serial device was supposed to go idle.
* Patch from Dario Alcocer <alcocer@connectnet.com>. His comments:Joel Sherrill1998-07-171-0/+2
| | | | | | | | | Haven't had a chance to do an extensive shake-out of 980710, but it builds just fine on FreeBSD 2.2.5 (after termios is fixed using the attached patch), and the tests run fine. FYI: FreeBSD doesn't support System V IPC out of the box, but one only needs to add three options to the kernel build configuration file, recompile the kernel, and you're ready.
* Added freebsd support from Dario Alcocer <alcocer@connectnet.com>.Joel Sherrill1998-06-181-0/+14
|
* Added tcdrain(), cfgetospeed(0, cfsetospeed(), cfgetispeed(), andJoel Sherrill1998-05-221-0/+30
| | | | cfsetispeed().
* Patch to add return status to rtems_termios_enqueue_raw_characters fromJoel Sherrill1998-05-201-1/+3
| | | | | | | | | | | | | | | Eric Norum per request from Geoffroy Montel: > The rtems_termios_enqueue_raw_characters function type is void. > The problem is that I can't return an error message if the input > buffer is full. > Could we add a return value? Sure, but what would you do with the overflow indication? POSIX says, ``when the input limit is reached, the saved characters are thrown away without notice''. Anyhow, the change is so small I've done it and enclosed the patch.
* Patch from Eric Norum to switch to termios callback structure, addJoel Sherrill1998-05-041-28/+21
| | | | | support for device driver support on tcsetattr(), and hardware flow control callbacks.
* Patch from Eric Norum:Joel Sherrill1998-01-191-0/+1
| | | | | With this in place, it is possible to fdopen a TCP stream socket and getc/fprintf/etc. on the STDIO stream!
* Jennifer found some uninitialized variables:Joel Sherrill1998-01-161-1/+7
| | | | | | + major and minor number elements in rtems_termios_open. + arg->ioctl_return in rtems_termios_ioctl routine.
* Changed initial settings of first time.Joel Sherrill1998-01-061-3/+5
|
* Corrected prototypes for all termios console write driver entries toJoel Sherrill1997-12-221-2/+2
| | | | properly reflect the const on the buffer pointer being passed in.
* interrupt driven change from Eric NorumJoel Sherrill1997-11-151-82/+189
|
* Set return code to avoid spurious errors.Joel Sherrill1997-11-101-0/+1
|
* added katsutoshi ShibuyaJoel Sherrill1997-10-241-1/+8
|
* Changed prototype of read routine.Joel Sherrill1997-10-231-13/+6
|
* fixed commentJoel Sherrill1997-10-231-2/+1
|
* New termios.c from Eric Norum.Joel Sherrill1997-10-231-601/+642
| | | | Added new entry point to add in per physical port resource requirements.
* Converted from using a message queue for the raw input queue to using aJoel Sherrill1997-10-211-49/+35
| | | | ring buffer in conjunction with a counting semaphore.
* Added termios submission from Eric Norum and Katsutoshi Shibuya.Joel Sherrill1997-10-211-0/+760