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 )(
95 void rtems_termios_device_lock_acquire_default(
100 void 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;
417 const char *device_file,
447 ( *context->lock_acquire )( context, lock_context );
462 ( *context->lock_release )( context, lock_context );
475 struct termios *term,
499 void rtems_termios_puts (
509 extern int rtems_termios_nlinesw;
518 typedef uint32_t rtems_termios_baud_t;
555 rtems_termios_baud_t baud
591 #define RTEMS_IO_SNDWAKEUP _IOW('t', 11, struct ttywakeup ) 592 #define RTEMS_IO_RCVWAKEUP _IOW('t', 12, struct ttywakeup ) 594 #define OLCUC 0x00000100 595 #define IUCLC 0x00004000 597 #define RTEMS_TERMIOS_NUMBER_BAUD_RATES 25 599 extern rtems_mutex rtems_termios_ttyMutex;
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
RTEMS Associativity Routines.
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
Parameter block for open/close.
Definition: libio.h:1346
rtems_termios_device_context * device_context
Context for device driver.
Definition: termiostypes.h:392
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:457
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.
Watchdog_Interval rtems_interval
Used to manage and manipulate intervals specified by clock ticks.
Definition: types.h:127
Termios device context.
Definition: termiostypes.h:75
#define RTEMS_INLINE_ROUTINE
Definition: basedefs.h:65
struct rtems_termios_device_node rtems_termios_device_node
Termios device node for installed devices.
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
Termios device node for installed devices.
Definition: termiostypes.h:269
Parameter block for ioctl.
Definition: libio.h:1355
ssize_t write(int fd, const void *buffer, size_t count)
Definition: write.c:30
Paramameter block for read/write.
Definition: libio.h:1334
int rtems_termios_poll(rtems_libio_t *iop, int events)
Termios poll() filesystem node handler.
const rtems_assoc_t rtems_termios_baud_table[]
RTEMS Termios Baud Table.
Definition: termios_baudtable.c:23
Definition: termiostypes.h:479
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
Definition: rtemscompat1.h:15
ISR lock control.
Definition: isrlock.h:56
rtems_termios_device_context legacy_device_context
Context for legacy devices using the callbacks.
Definition: termiostypes.h:350
rtems_status_code
Classic API Status.
Definition: status.h:43
Definition: termiostypes.h:283
rtems_termios_device_node * device_node
Corresponding device node.
Definition: termiostypes.h:387
#define rtems_interrupt_lock_initialize(_lock, _name)
Initializes an interrupt lock.
Definition: intr.h:265
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:442
Definition: termiostypes.h:43
struct rtems_termios_device_context rtems_termios_device_context
Termios device context.
int rtems_termios_baud_to_index(rtems_termios_baud_t termios_baud)
Convert Bxxx Constant to Index.
Definition: termios_baud2index.c:24
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:428
unsigned context
Definition: tlb.h:108
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
An open file data structure.
Definition: libio.h:1320
int rtems_termios_mmap(rtems_libio_t *iop, void **addr, size_t len, int prot, off_t off)
Termios mmap() filter filesystem node handler.
Objects_Id rtems_id
Used to manage and manipulate RTEMS object identifiers.
Definition: types.h:83
Definition: termiostypes.h:51
Local ISR lock context for acquire and release pairs.
Definition: isrlock.h:65
Termios device flow control handler.
Definition: termiostypes.h:248
rtems_termios_device_flow flow
The device flow control handler.
Definition: termiostypes.h:360
rtems_termios_device_mode mode
Termios device mode.
Definition: termiostypes.h:240
rtems_termios_device_handler handler
The device handler.
Definition: termiostypes.h:355
Termios device handler.
Definition: termiostypes.h:141