-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathcci.h
160 lines (139 loc) · 3.44 KB
/
cci.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
#ifndef CCI_H
#define CCI_H
/*--------------------------------------------------------------------------
**
** Copyright (c) 2024 Joachim Siebold
**
** Name: cci.h
**
** Description:
** This file defines CCI constants, types, variables, macros and
** function prototypes.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License version 3 as
** published by the Free Software Foundation.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License version 3 for more details.
**
** You should have received a copy of the GNU General Public License
** version 3 along with this program in file "license-gpl-3.0.txt".
** If not, see <http://www.gnu.org/licenses/gpl-3.0.txt>.
**
**--------------------------------------------------------------------------
*/
/*
** -------------
** Include Files
** -------------
*/
#if defined(_WIN32)
#include <winsock.h>
#else
#include <netdb.h>
#endif
/*
** -------------
** CCI Constants
** -------------
*/
#define BlkOffP 6
#define BlkOffSP 7
#define BlkOffLt 8
#define BlkOffTt 9
#define CciWaitForTcbTimeout 5
/*
** -------------------
** CCI Macro Functions
** -------------------
*/
/*
** --------------------
** CCI Type Definitions
** --------------------
*/
/*
** CCI Line Control Block
*/
typedef enum
{
cciTIP=1,
cciMODE4,
cciHASP,
cciBSC
} cciTipType;
typedef enum
{
cciLnConfNotConfigured=0,
cciLnConfConfigured,
cciLnConfEnableRequested,
cciLnConfOperationalNoTcbs,
cciLnConfOperationalTcbsConfigured,
cciLnConfDisableRequested,
cciLnConfInoperativeNoTcbs,
cciLnConfInoperativeTcbsConfigured,
cciLnConfDisconnectRequested,
cciLnConfInoperativeWaiting
} cciLnConfState;
typedef enum
{
cciLnStatOperational=0,
cciLnStatInoperative=4,
cciLnStatNoRing,
cciLnStatStop
} cciLnState;
typedef struct ccilcb
{
u8 port;
cciLnConfState configState;
cciLnState lineState;
u8 lineType;
u8 terminalType;
u8 speedIndex;
u8 numTerminals;
} cciLcb;
/*
** -------------------------------
** CCI Function Prototypes
** -------------------------------
*/
/*
** cci_hip.c
*/
bool cciHipUplineBlock(NpuBuffer *bp);
bool cciHipDownlineBlock(NpuBuffer *bp);
bool cciHipIsReady(void);
/*
** cci_svm.c
*/
void cciSvmInit(void);
void cciSvmReset(void);
void cciSvmNpuInitResponse(void);
void cciSvmProcessBuffer(NpuBuffer *bp);
bool cciSvmConnectTerminal(Pcb *pp);
void cciSvmSendDiscRequest(Tcb *tp);
bool cciSvmIsReady();
/*
** cci_tip.c
*/
void cciTipInit(void);
void cciTipReset(void);
void cciTipProcessBuffer(NpuBuffer *bp, int priority);
void cciTipNotifySent(Tcb *tp, u8 blockSeqNo);
void cciTipInputReset(Tcb *tp);
void cciTipSendUserBreak(Tcb *tp, u8 bt);
void cciTipDiscardOutputQ(Tcb *tp);
void cciTipConfigureTerminal(Tcb *tp);
Tcb *cciTipFindTcbForCN(u8 cn);
void cciTipSendBlock(Tcb *tp, int len);
void cciTipSendMsg(Tcb *tp, int len);
/*
** cci_async.c
*/
void cciAsyncProcessDownlineData(Tcb *tp, NpuBuffer *bp, bool last);
void cciAsyncProcessUplineNormal(Tcb *tp);
#endif /* CCI_H */
/*--------------------------- End Of File ------------------------------*/