1 | /* |
---|
2 | * This file contains the TTY driver table definition |
---|
3 | * |
---|
4 | * This driver uses the termios pseudo driver. |
---|
5 | * |
---|
6 | * COPYRIGHT (c) 1998 by Radstone Technology |
---|
7 | * |
---|
8 | * |
---|
9 | * THIS FILE IS PROVIDED TO YOU, THE USER, "AS IS", WITHOUT WARRANTY OF ANY |
---|
10 | * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE |
---|
11 | * IMPLIED WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK |
---|
12 | * AS TO THE QUALITY AND PERFORMANCE OF ALL CODE IN THIS FILE IS WITH YOU. |
---|
13 | * |
---|
14 | * You are hereby granted permission to use, copy, modify, and distribute |
---|
15 | * this file, provided that this notice, plus the above copyright notice |
---|
16 | * and disclaimer, appears in all copies. Radstone Technology will provide |
---|
17 | * no support for this code. |
---|
18 | * |
---|
19 | * $Id$ |
---|
20 | */ |
---|
21 | |
---|
22 | #ifndef __LIBCHIP_SERIAL_h |
---|
23 | #define __LIBCHIP_SERIAL_h |
---|
24 | |
---|
25 | #include <ringbuf.h> |
---|
26 | |
---|
27 | /* |
---|
28 | * Types for get and set register routines |
---|
29 | */ |
---|
30 | |
---|
31 | typedef unsigned8 (*getRegister_f)(unsigned32 port, unsigned8 register); |
---|
32 | typedef void (*setRegister_f)( |
---|
33 | unsigned32 port, unsigned8 reg, unsigned8 value); |
---|
34 | typedef unsigned8 (*getData_f)(unsigned32 port); |
---|
35 | typedef void (*setData_f)(unsigned32 port, unsigned8 value); |
---|
36 | |
---|
37 | typedef struct _console_fns { |
---|
38 | boolean (*deviceProbe)(int minor); |
---|
39 | int (*deviceFirstOpen)(int major, int minor, void *arg); |
---|
40 | int (*deviceLastClose)(int major, int minor, void *arg); |
---|
41 | int (*deviceRead)(int minor); |
---|
42 | int (*deviceWrite)(int minor, const char *buf, int len); |
---|
43 | void (*deviceInitialize)(int minor); |
---|
44 | void (*deviceWritePolled)(int minor, char cChar); |
---|
45 | int (*deviceSetAttributes)(int minor, const struct termios *t); |
---|
46 | int deviceOutputUsesInterrupts; |
---|
47 | } console_fns; |
---|
48 | |
---|
49 | typedef struct _console_flow { |
---|
50 | int (*deviceStopRemoteTx)(int minor); |
---|
51 | int (*deviceStartRemoteTx)(int minor); |
---|
52 | } console_flow; |
---|
53 | |
---|
54 | typedef struct _console_tbl { |
---|
55 | char *sDeviceName; |
---|
56 | console_fns *pDeviceFns; |
---|
57 | boolean (*deviceProbe)(int minor); |
---|
58 | console_flow *pDeviceFlow; |
---|
59 | unsigned32 ulMargin; |
---|
60 | unsigned32 ulHysteresis; |
---|
61 | void *pDeviceParams; |
---|
62 | unsigned32 ulCtrlPort1; |
---|
63 | unsigned32 ulCtrlPort2; |
---|
64 | unsigned32 ulDataPort; |
---|
65 | getRegister_f getRegister; |
---|
66 | setRegister_f setRegister; |
---|
67 | getData_f getData; |
---|
68 | setData_f setData; |
---|
69 | unsigned32 ulClock; |
---|
70 | unsigned int ulIntVector; |
---|
71 | } console_tbl; |
---|
72 | |
---|
73 | typedef struct _console_data { |
---|
74 | void *termios_data; |
---|
75 | volatile boolean bActive; |
---|
76 | volatile Ring_buffer_t TxBuffer; |
---|
77 | /* |
---|
78 | * This field may be used for any purpose required by the driver |
---|
79 | */ |
---|
80 | void *pDeviceContext; |
---|
81 | } console_data; |
---|
82 | |
---|
83 | extern console_tbl Console_Port_Tbl[]; |
---|
84 | extern console_data Console_Port_Data[]; |
---|
85 | extern unsigned long Console_Port_Count; |
---|
86 | |
---|
87 | #endif |
---|
88 | /* end of include file */ |
---|