16#ifndef __TERMIOSTYPES_H
17#define __TERMIOSTYPES_H
23#include <rtems/thread.h>
24#include <sys/ioccom.h>
44 void (*sw_pfn)(
struct termios *tty,
void *arg);
53 volatile unsigned int Head;
54 volatile unsigned int Tail;
55 volatile unsigned int Size;
63 TERMIOS_IRQ_SERVER_DRIVEN
64} rtems_termios_device_mode;
84 void ( *lock_acquire )(
89 void ( *lock_release )(
95void rtems_termios_device_lock_acquire_default(
100void rtems_termios_device_lock_release_default(
119 context->lock_acquire = rtems_termios_device_lock_acquire_default;
120 context->lock_release = rtems_termios_device_lock_release_default;
129#define RTEMS_TERMIOS_DEVICE_CONTEXT_INITIALIZER( name ) \
131 { RTEMS_INTERRUPT_LOCK_INITIALIZER( name ) }, \
132 rtems_termios_device_lock_acquire_default, \
133 rtems_termios_device_lock_release_default \
162 struct termios *term,
217 bool (*set_attributes)(
219 const struct termios *term
233 ioctl_command_t request,
240 rtems_termios_device_mode
mode;
271 rtems_device_major_number major;
272 rtems_device_minor_number minor;
298 rtems_device_major_number major;
299 rtems_device_minor_number minor;
318 int read_start_column;
323 struct termios termios;
330 bool rawInBufSemaphoreWait;
333 unsigned int rawInBufDropped;
340 enum {rob_idle, rob_busy, rob_wait } rawOutBufState;
362 volatile unsigned int flow_ctrl;
363 unsigned int lowwater,highwater;
373 int txTaskCharsDequeued;
421 const char *device_file,
436 return tty->device_context;
479 struct termios *term,
503void rtems_termios_puts (
513extern int rtems_termios_nlinesw;
522typedef uint32_t rtems_termios_baud_t;
559 rtems_termios_baud_t baud
595#define RTEMS_IO_SNDWAKEUP _IOW('t', 11, struct ttywakeup )
596#define RTEMS_IO_RCVWAKEUP _IOW('t', 12, struct ttywakeup )
598#define OLCUC 0x00000100
599#define IUCLC 0x00004000
601#define RTEMS_TERMIOS_NUMBER_BAUD_RATES 25
603extern rtems_mutex rtems_termios_ttyMutex;
RTEMS Associativity Routines.
#define rtems_interrupt_lock_initialize(_lock, _name)
Initializes an interrupt lock.
Definition: intr.h:265
rtems_status_code
Classic API Status.
Definition: status.h:43
Objects_Id rtems_id
Used to manage and manipulate RTEMS object identifiers.
Definition: types.h:83
Watchdog_Interval rtems_interval
Used to manage and manipulate intervals specified by clock ticks.
Definition: types.h:127
#define RTEMS_INLINE_ROUTINE
Definition: basedefs.h:66
ssize_t write(int fd, const void *buffer, size_t count)
Definition: write.c:30
Local ISR lock context for acquire and release pairs.
Definition: isrlock.h:65
ISR lock control.
Definition: isrlock.h:56
Definition: rtemscompat1.h:15
Parameter block for ioctl.
Definition: libio.h:1355
Parameter block for open/close.
Definition: libio.h:1346
Paramameter block for read/write.
Definition: libio.h:1334
An open file data structure.
Definition: libio.h:1320
Termios device context.
Definition: termiostypes.h:75
Termios device flow control handler.
Definition: termiostypes.h:248
Termios device handler.
Definition: termiostypes.h:141
rtems_termios_device_mode mode
Termios device mode.
Definition: termiostypes.h:240
Termios device node for installed devices.
Definition: termiostypes.h:269
Definition: termiostypes.h:483
Definition: termiostypes.h:51
Definition: termiostypes.h:283
rtems_termios_device_handler handler
The device handler.
Definition: termiostypes.h:355
rtems_termios_device_context legacy_device_context
Context for legacy devices using the callbacks.
Definition: termiostypes.h:350
rtems_termios_device_node * device_node
Corresponding device node.
Definition: termiostypes.h:391
rtems_termios_device_context * device_context
Context for device driver.
Definition: termiostypes.h:396
rtems_termios_device_flow flow
The device flow control handler.
Definition: termiostypes.h:360
Definition: termiostypes.h:43
unsigned context
Definition: tlb.h:1
RTEMS_INLINE_ROUTINE void rtems_termios_device_lock_release(rtems_termios_device_context *context, rtems_interrupt_lock_context *lock_context)
Releases the device lock.
Definition: termiostypes.h:461
RTEMS_INLINE_ROUTINE void rtems_termios_device_lock_acquire(rtems_termios_device_context *context, rtems_interrupt_lock_context *lock_context)
Acquires the device lock.
Definition: termiostypes.h:446
struct rtems_termios_device_context rtems_termios_device_context
Termios device context.
int rtems_termios_poll(rtems_libio_t *iop, int events)
Termios poll() filesystem node handler.
void rtems_termios_set_best_baud(struct termios *term, uint32_t baud)
Sets the best baud value in the Termios control.
Definition: termios_setbestbaud.c:21
const rtems_assoc_t rtems_termios_baud_table[]
RTEMS Termios Baud Table.
Definition: termios_baudtable.c:23
int rtems_termios_set_initial_baud(struct rtems_termios_tty *tty, rtems_termios_baud_t baud)
Sets the initial baud in the Termios context tty.
Definition: termios_setinitialbaud.c:23
int rtems_termios_mmap(rtems_libio_t *iop, void **addr, size_t len, int prot, off_t off)
Termios mmap() filter filesystem node handler.
RTEMS_INLINE_ROUTINE void * rtems_termios_get_device_context(const rtems_termios_tty *tty)
Returns the device context of an installed Termios device.
Definition: termiostypes.h:432
int rtems_termios_baud_to_index(rtems_termios_baud_t termios_baud)
Convert Bxxx Constant to Index.
Definition: termios_baud2index.c:24
struct rtems_termios_device_node rtems_termios_device_node
Termios device node for installed devices.
RTEMS_INLINE_ROUTINE void rtems_termios_device_context_initialize(rtems_termios_device_context *context, const char *name)
Initializes a device context.
Definition: termiostypes.h:113
speed_t rtems_termios_number_to_baud(rtems_termios_baud_t baud)
Converts the Integral Baud value baud to the Termios Control Flag Representation.
Definition: termios_num2baud.c:23
rtems_termios_baud_t rtems_termios_baud_to_number(speed_t baud)
Converts the baud flags to an integral baud value.
Definition: termios_baud2num.c:23
int rtems_termios_kqfilter(rtems_libio_t *iop, struct knote *kn)
Termios kqueue() filter filesystem node handler.
rtems_status_code rtems_termios_device_install(const char *device_file, const rtems_termios_device_handler *handler, const rtems_termios_device_flow *flow, rtems_termios_device_context *context)
Installs a Termios device.
Definition: termios.c:128