summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libc/termios.c (unfollow)
Commit message (Collapse)AuthorFilesLines
1999-05-27Split initialization and reserve resources from termios to reduceJoel Sherrill1-59/+15
size of mininum application.
1999-04-01Disable IXON by default based on comment from Eric NorumJoel Sherrill1-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.
1999-03-31Patch from Thomas Doerfler <td@imd.m.ISAR.de> to add flow control:Joel Sherrill1-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?
1998-09-23Patch from Aleksey (Quality Quorum <qqi@world.std.com>):Joel Sherrill1-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.
1998-09-21Patch from Eric Norum:Joel Sherrill1-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.
1998-08-21Fix from Eric Norum <eric@skatter.usask.ca>:Joel Sherrill1-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 (); } ===============================================================
1998-08-21Added initialization of missing termios structure entries.Joel Sherrill1-2/+3
1998-07-28Closed window thanks to patch from Eric Norum.Joel Sherrill1-5/+3
1998-07-17Initialized tty->refcount to 0. When (for whatever reason) malloc()Joel Sherrill1-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.
1998-07-17Patch from Dario Alcocer <alcocer@connectnet.com>. His comments:Joel Sherrill1-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.
1998-06-18Added freebsd support from Dario Alcocer <alcocer@connectnet.com>.Joel Sherrill1-0/+14
1998-05-22Added tcdrain(), cfgetospeed(0, cfsetospeed(), cfgetispeed(), andJoel Sherrill1-0/+30
cfsetispeed().
1998-05-20Patch to add return status to rtems_termios_enqueue_raw_characters fromJoel Sherrill1-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.
1998-05-04Patch from Eric Norum to switch to termios callback structure, addJoel Sherrill1-28/+21
support for device driver support on tcsetattr(), and hardware flow control callbacks.
1998-01-19Patch from Eric Norum:Joel Sherrill1-0/+1
With this in place, it is possible to fdopen a TCP stream socket and getc/fprintf/etc. on the STDIO stream!
1998-01-16Jennifer found some uninitialized variables:Joel Sherrill1-1/+7
+ major and minor number elements in rtems_termios_open. + arg->ioctl_return in rtems_termios_ioctl routine.
1998-01-06Changed initial settings of first time.Joel Sherrill1-3/+5
1997-12-22Corrected prototypes for all termios console write driver entries toJoel Sherrill1-2/+2
properly reflect the const on the buffer pointer being passed in.
1997-11-15interrupt driven change from Eric NorumJoel Sherrill1-82/+189
1997-11-10Set return code to avoid spurious errors.Joel Sherrill1-0/+1
1997-10-24added katsutoshi ShibuyaJoel Sherrill1-1/+8
1997-10-23Changed prototype of read routine.Joel Sherrill1-13/+6
1997-10-23fixed commentJoel Sherrill1-2/+1
1997-10-23New termios.c from Eric Norum.Joel Sherrill1-601/+642
Added new entry point to add in per physical port resource requirements.
1997-10-21Converted from using a message queue for the raw input queue to using aJoel Sherrill1-49/+35
ring buffer in conjunction with a counting semaphore.
1997-10-21Added termios submission from Eric Norum and Katsutoshi Shibuya.Joel Sherrill1-0/+760