source: rtems/c/src/libchip/serial/serial.h @ 94365d9

4.104.114.84.95
Last change on this file since 94365d9 was 94365d9, checked in by Joel Sherrill <joel.sherrill@…>, on 09/04/03 at 18:53:19

2003-09-04 Joel Sherrill <joel@…>

  • ide/ata.c, ide/ata.h, ide/ata_internal.h, ide/ide_controller.c, ide/ide_ctrl.h, ide/ide_ctrl_cfg.h, ide/ide_ctrl_io.h, network/cs8900.c, network/cs8900.c.bsp, network/cs8900.h, network/dec21140.c, network/elnk.c, network/open_eth.c, network/sonic.c, network/sonic.h, rtc/icm7170.c, rtc/icm7170.h, rtc/icm7170_reg.c, rtc/icm7170_reg2.c, rtc/icm7170_reg4.c, rtc/icm7170_reg8.c, rtc/m48t08.c, rtc/m48t08.h, rtc/m48t08_reg.c, rtc/m48t08_reg2.c, rtc/m48t08_reg4.c, rtc/m48t08_reg8.c, rtc/rtc.h, rtc/rtcprobe.c, serial/mc68681.c, serial/mc68681.h, serial/mc68681_p.h, serial/mc68681_reg.c, serial/mc68681_reg2.c, serial/mc68681_reg4.c, serial/mc68681_reg8.c, serial/serial.h, serial/z85c30.c, serial/z85c30.h, serial/z85c30_p.h, serial/z85c30_reg.c: URL for license changed.
  • Property mode set to 100644
File size: 5.3 KB
Line 
1/*
2 *  This file contains the TTY driver table definition
3 *
4 *  This driver uses the termios pseudo driver.
5 *
6 *  COPYRIGHT (c) 1989-1999.
7 *  On-Line Applications Research Corporation (OAR).
8 *
9 *  The license and distribution terms for this file may be
10 *  found in the file LICENSE in this distribution or at
11 *  http://www.rtems.com/license/LICENSE.
12 *
13 *  $Id$
14 */
15
16#ifndef __LIBCHIP_SERIAL_h
17#define __LIBCHIP_SERIAL_h
18
19#include <termios.h>
20
21/*
22 *  Types for get and set register routines
23 */
24
25typedef unsigned8 (*getRegister_f)(unsigned32 port, unsigned8 register);
26typedef void      (*setRegister_f)(
27                            unsigned32 port, unsigned8 reg, unsigned8 value);
28typedef unsigned8 (*getData_f)(unsigned32 port);
29typedef void      (*setData_f)(unsigned32 port, unsigned8 value);
30
31typedef struct _console_fns {
32  boolean (*deviceProbe)(int minor);
33  int     (*deviceFirstOpen)(int major, int minor, void *arg);
34  int     (*deviceLastClose)(int major, int minor, void *arg);
35  int     (*deviceRead)(int minor);
36  int     (*deviceWrite)(int minor, const char *buf, int len);
37  void    (*deviceInitialize)(int minor);
38  void    (*deviceWritePolled)(int minor, char cChar);
39  int     (*deviceSetAttributes)(int minor, const struct termios *t);
40  int       deviceOutputUsesInterrupts;
41} console_fns;
42
43typedef struct _console_flow {
44  int (*deviceStopRemoteTx)(int minor);
45  int (*deviceStartRemoteTx)(int minor);
46} console_flow;
47
48typedef enum {
49  SERIAL_MC68681,              /* Motorola MC68681 or Exar 88681 */
50  SERIAL_NS16550,              /* National Semiconductor NS16550 */
51  SERIAL_Z85C30,               /* Zilog Z85C30 */
52  SERIAL_CUSTOM                /* BSP specific driver */
53} console_devs;
54
55/*
56 * Each field is interpreted thus:
57 *
58 * sDeviceName  This is the name of the device.
59 *
60 * deviceType   This indicates the chip type.  It is especially important when
61 *              multiple devices share the same interrupt vector and must be
62 *              distinguished.
63 *
64 * pDeviceFns   This is a pointer to the set of driver routines to use.
65 *
66 * pDeviceFlow  This is a pointer to the set of flow control routines to
67 *              use. Serial device drivers will typically supply RTSCTS
68 *              and DTRCTS handshake routines for DCE to DCE communication,
69 *              however for DCE to DTE communication, no such routines
70 *              should be necessary as RTS will be driven automatically
71 *              when the transmitter is active.
72 *
73 * ulMargin     The high water mark in the input buffer is set to the buffer
74 *              size less ulMargin. Once this level is reached, the driver's
75 *              flow control routine used to stop the remote transmitter will
76 *              be called. This figure should be greater than or equal to
77 *              the number of stages of FIFO between the transmitter and
78 *              receiver.
79 *
80 *              NOTE: At the current time, this parameter is hard coded
81 *                    in termios and this number is ignored.
82 *
83 * ulHysteresis After the high water mark specified by ulMargin has been
84 *              reached, the driver's routine to re-start the remote
85 *              transmitter will be called once the level in the input
86 *              buffer has fallen by ulHysteresis bytes.
87 *
88 *              NOTE: At the current time, this parameter is hard coded
89 *                    in termios and this number is ignored.
90 *
91 * pDeviceParams This contains either device specific data or a pointer to a
92 *              device specific structure containing additional information
93 *              not provided in this table.
94 *
95 * ulCtrlPort1  This is the primary control port number for the device. This
96 *              may be used to specify different instances of the same device
97 *              type.
98 *
99 * ulCtrlPort2  This is the secondary control port number, of use when a given
100 *              device has more than one available channel.
101 *
102 * ulDataPort   This is the port number for the data port of the device
103 *
104 * getRegister  This is the routine used to read register values.
105 *
106 * setRegister  This is the routine used to write register values.
107 *
108 * getData      This is the routine used to read the data register (RX).
109 *
110 * setData      This is the routine used to write the data register (TX).
111 *
112 * ulClock      This is the baud rate clock speed.
113 *
114 * ulIntVector  This encodes the interrupt vector of the device.
115 */
116
117typedef struct _console_tbl {
118  char          *sDeviceName;
119  console_devs   deviceType;
120  console_fns   *pDeviceFns;
121  boolean      (*deviceProbe)(int minor);
122  console_flow  *pDeviceFlow;
123  unsigned32     ulMargin;
124  unsigned32     ulHysteresis;
125  void          *pDeviceParams;
126  unsigned32     ulCtrlPort1;
127  unsigned32     ulCtrlPort2;
128  unsigned32     ulDataPort;
129  getRegister_f  getRegister;
130  setRegister_f  setRegister;
131  getData_f      getData;
132  setData_f      setData;
133  unsigned32     ulClock;
134  unsigned int   ulIntVector;
135} console_tbl;
136
137typedef struct _console_data {
138  void                   *termios_data;
139  volatile boolean        bActive;
140  /*
141   * This field may be used for any purpose required by the driver
142   */
143  void                   *pDeviceContext;
144} console_data;
145
146extern console_tbl  Console_Port_Tbl[];
147extern console_data Console_Port_Data[];
148extern unsigned long  Console_Port_Count;
149
150#endif
151/* end of include file */
Note: See TracBrowser for help on using the repository browser.