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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
|
//**********************************************************************
//**********************************************************************
//** **
//** (C)Copyright 1985-2009, American Megatrends, Inc. **
//** **
//** All Rights Reserved. **
//** **
//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **
//** **
//** Phone: (770)-246-8600 **
//** **
//**********************************************************************
//**********************************************************************
// $Header: /Alaska/BIN/Modules/Terminal/TerminalBoard.h 4 12/08/11 6:30a Jittenkumarp $
//
// $Revision: 4 $
//
// $Date: 12/08/11 6:30a $
//**********************************************************************
// Revision History
// ----------------
// $Log: /Alaska/BIN/Modules/Terminal/TerminalBoard.h $
//
// 4 12/08/11 6:30a Jittenkumarp
// [TAG] EIP74239
// [Category] New Feature
// [Description] Added "Intel Key" ESC sequence support for Serial
// Redirection.
// [Files] Terminal.sdl, TerminalBoard.h
//
// 3 7/13/11 2:51a Rajeshms
// [TAG]- EIP 36616
// [Category]- New Feature
// [Description]- Add Setup option for Various Putty keyPad support in
// Terminal driver.
// [Files]- Terminal.c, Terminal.h, Terminal.sd, Terminal.sdl,
// Terminal.uni, TerminalBoard.h, TerminalSetup.c, TerminalSimpleTextIn.c
//
// 2 4/12/11 4:31a Rameshr
// [TAG]- EIP 57688
// [Category]- New Feature
// [Description]- Add Setup option for Vt-UTF8 combo key support in
// terminal driver
// [Files]- Terminal.c, Terminal.h, Terminal.sd, Terminal.sdl ,
// Terminal.uni, Terminalboard.h, TerminalSetup.c, TerminalSimpletextin.c
//
// 1 7/17/09 2:54p Rameshr
// Initial check-in
//
//
//**********************************************************************
//<AMI_FHDR_START>
//--------------------------------------------------------------------------
//
// Name: TerminalBoard.h
//
// Description: Board file for the Terminal Module.
//
//--------------------------------------------------------------------------
//<AMI_FHDR_END>
#ifndef _TERMINAL_BOARD_H__
#define _TERMINAL_BOARD_H__
#include <Protocol\SimpleTextIn.h>
#include <Protocol\SimpleTextInEx.h>
#include <Protocol\AmiKeycode.h>
#define ESC_SEQ_STATE_ARRAY_END_MARKER {0,0,0,0,0}
#define RESET 0xFFFF
#define ASCII_ESC 0x1B
#define GLOBAL_ALL PUTTY_VT100 | PUTTY_LINUX | PUTTY_XTERMR6 | PUTTY_SCO | PUTTY_ESCN | PUTTY_VT400
typedef struct _STATE_DESCRIPTION STATE_DESCRIPTION;
//
// Esc Sequence defination.
//
struct _STATE_DESCRIPTION{
CHAR16 InputChar;
STATE_DESCRIPTION *NextEscSeqState;
UINT16 EfiInputKeyScanCode;
CHAR16 EfiInputKeyUnicodeChar;
UINT8 KeyPad;
};
STATE_DESCRIPTION EscSeqStateArrayEndMarker = ESC_SEQ_STATE_ARRAY_END_MARKER;
STATE_DESCRIPTION *EscSeqStateArrayEndMarkerPtr = &EscSeqStateArrayEndMarker;
STATE_DESCRIPTION PuttyLinuxEscSeq[] =
{
{'A', NULL, EFI_SCAN_F1, 0, PUTTY_LINUX},
{'B', NULL, EFI_SCAN_F2, 0, PUTTY_LINUX},
{'C', NULL, EFI_SCAN_F3, 0, PUTTY_LINUX},
{'D', NULL, EFI_SCAN_F4, 0, PUTTY_LINUX},
{'E', NULL, EFI_SCAN_F5, 0, PUTTY_LINUX},
ESC_SEQ_STATE_ARRAY_END_MARKER
};
STATE_DESCRIPTION PuttyLinuxF6[] =
{
{'~', NULL, EFI_SCAN_F6, 0, PUTTY_LINUX | PUTTY_XTERMR6 | PUTTY_ESCN | PUTTY_VT400},
ESC_SEQ_STATE_ARRAY_END_MARKER
};
STATE_DESCRIPTION PuttyLinuxF7[] =
{
{'~', NULL, EFI_SCAN_F7, 0, PUTTY_LINUX | PUTTY_XTERMR6 | PUTTY_ESCN | PUTTY_VT400},
ESC_SEQ_STATE_ARRAY_END_MARKER
};
STATE_DESCRIPTION PuttyLinuxF8[] =
{
{'~', NULL, EFI_SCAN_F8, 0, PUTTY_LINUX | PUTTY_XTERMR6 | PUTTY_ESCN | PUTTY_VT400},
ESC_SEQ_STATE_ARRAY_END_MARKER
};
STATE_DESCRIPTION PuttyLinuxF9[] =
{
{'~', NULL, EFI_SCAN_F9, 0, PUTTY_LINUX | PUTTY_XTERMR6 | PUTTY_ESCN | PUTTY_VT400},
ESC_SEQ_STATE_ARRAY_END_MARKER
};
STATE_DESCRIPTION PuttyLinuxF10[] =
{
{'~', NULL, EFI_SCAN_F10, 0, PUTTY_LINUX | PUTTY_XTERMR6 | PUTTY_ESCN | PUTTY_VT400},
ESC_SEQ_STATE_ARRAY_END_MARKER
};
STATE_DESCRIPTION PuttyLinuxF11[] =
{
{'~', NULL, EFI_SCAN_F11, 0, PUTTY_LINUX | PUTTY_XTERMR6 | PUTTY_ESCN | PUTTY_VT400},
ESC_SEQ_STATE_ARRAY_END_MARKER
};
STATE_DESCRIPTION PuttyLinuxF12[] =
{
{'~', NULL, EFI_SCAN_F12, 0, PUTTY_LINUX | PUTTY_XTERMR6 | PUTTY_ESCN | PUTTY_VT400},
ESC_SEQ_STATE_ARRAY_END_MARKER
};
STATE_DESCRIPTION PuttyXterm86F5[] =
{
{'~', NULL, EFI_SCAN_F5, 0, PUTTY_XTERMR6 | PUTTY_ESCN | PUTTY_VT400},
ESC_SEQ_STATE_ARRAY_END_MARKER
};
STATE_DESCRIPTION PuttyEscNF1[] =
{
{'~', NULL, EFI_SCAN_F1, 0, PUTTY_ESCN | PUTTY_VT400},
ESC_SEQ_STATE_ARRAY_END_MARKER
};
STATE_DESCRIPTION PuttyEscNF2[] =
{
{'~', NULL, EFI_SCAN_F2, 0, PUTTY_ESCN | PUTTY_VT400},
ESC_SEQ_STATE_ARRAY_END_MARKER
};
STATE_DESCRIPTION PuttyEscNF3[] =
{
{'~', NULL, EFI_SCAN_F3, 0, PUTTY_ESCN | PUTTY_VT400},
ESC_SEQ_STATE_ARRAY_END_MARKER
};
STATE_DESCRIPTION PuttyEscNF4[] =
{
{'~', NULL, EFI_SCAN_F4, 0, PUTTY_ESCN | PUTTY_VT400},
ESC_SEQ_STATE_ARRAY_END_MARKER
};
STATE_DESCRIPTION PuttyVt100EscSeq1[] =
{
{'~', NULL, EFI_SCAN_HOME, 0, PUTTY_VT100 | PUTTY_LINUX | PUTTY_XTERMR6 | PUTTY_ESCN },
{'~', NULL, EFI_SCAN_INS, 0, PUTTY_VT400},
{'7', PuttyLinuxF6, 0, 0, PUTTY_LINUX | PUTTY_XTERMR6 | PUTTY_ESCN | PUTTY_VT400},
{'8', PuttyLinuxF7, 0, 0, PUTTY_LINUX | PUTTY_XTERMR6 | PUTTY_ESCN | PUTTY_VT400},
{'9', PuttyLinuxF8, 0, 0, PUTTY_LINUX | PUTTY_XTERMR6 | PUTTY_ESCN | PUTTY_VT400},
{'5', PuttyXterm86F5, 0, 0, PUTTY_XTERMR6 | PUTTY_ESCN | PUTTY_VT400},
{'1', PuttyEscNF1, 0, 0, PUTTY_ESCN | PUTTY_VT400},
{'2', PuttyEscNF2, 0, 0, PUTTY_ESCN | PUTTY_VT400},
{'3', PuttyEscNF3, 0, 0, PUTTY_ESCN | PUTTY_VT400},
{'4', PuttyEscNF4, 0, 0, PUTTY_ESCN | PUTTY_VT400},
ESC_SEQ_STATE_ARRAY_END_MARKER
};
STATE_DESCRIPTION PuttyVt100EscSeq2[] =
{
{'~', NULL, EFI_SCAN_INS, 0, PUTTY_VT100 | PUTTY_LINUX | PUTTY_XTERMR6 | PUTTY_ESCN},
{'~', NULL, EFI_SCAN_HOME, 0, PUTTY_VT400},
{'0', PuttyLinuxF9, 0, 0, PUTTY_LINUX | PUTTY_XTERMR6 | PUTTY_ESCN | PUTTY_VT400},
{'1', PuttyLinuxF10, 0, 0, PUTTY_LINUX | PUTTY_XTERMR6 | PUTTY_ESCN | PUTTY_VT400},
{'3', PuttyLinuxF11, 0, 0, PUTTY_LINUX | PUTTY_XTERMR6 | PUTTY_ESCN | PUTTY_VT400},
{'4', PuttyLinuxF12, 0, 0, PUTTY_LINUX | PUTTY_XTERMR6 | PUTTY_ESCN | PUTTY_VT400},
ESC_SEQ_STATE_ARRAY_END_MARKER
};
STATE_DESCRIPTION PuttyVt100EscSeq3[] =
{
{'~', NULL, EFI_SCAN_DEL, 0, PUTTY_VT100 | PUTTY_LINUX | PUTTY_XTERMR6 | PUTTY_ESCN | PUTTY_VT400},
ESC_SEQ_STATE_ARRAY_END_MARKER
};
STATE_DESCRIPTION PuttyVt100EscSeq4[] =
{
{'~', NULL, EFI_SCAN_END, 0, PUTTY_VT100 | PUTTY_LINUX | PUTTY_XTERMR6 | PUTTY_ESCN | PUTTY_VT400},
ESC_SEQ_STATE_ARRAY_END_MARKER
};
STATE_DESCRIPTION PuttyVt100EscSeq5[] =
{
{'~', NULL, EFI_SCAN_PGUP, 0, PUTTY_VT100 | PUTTY_LINUX | PUTTY_XTERMR6 | PUTTY_ESCN | PUTTY_VT400},
ESC_SEQ_STATE_ARRAY_END_MARKER
};
STATE_DESCRIPTION PuttyVt100EscSeq6[] =
{
{'~', NULL, EFI_SCAN_PGDN, 0, PUTTY_VT100 | PUTTY_LINUX | PUTTY_XTERMR6 | PUTTY_ESCN | PUTTY_VT400},
ESC_SEQ_STATE_ARRAY_END_MARKER
};
STATE_DESCRIPTION PuttyVt400EscSeq3[] =
{
{'~', NULL, EFI_SCAN_PGUP, 0, PUTTY_VT400},
ESC_SEQ_STATE_ARRAY_END_MARKER
};
STATE_DESCRIPTION PuttyVt400EscSeq4[] =
{
{'~', NULL, EFI_SCAN_DEL, 0, PUTTY_VT400},
ESC_SEQ_STATE_ARRAY_END_MARKER
};
STATE_DESCRIPTION PuttyVt400EscSeq5[] =
{
{'~', NULL, EFI_SCAN_END, 0, PUTTY_VT400},
ESC_SEQ_STATE_ARRAY_END_MARKER
};
STATE_DESCRIPTION PuttyVt400EscSeq6[] =
{
{'~', NULL, EFI_SCAN_PGDN, 0, PUTTY_VT400},
ESC_SEQ_STATE_ARRAY_END_MARKER
};
STATE_DESCRIPTION OemEscSeqStateArray[]=
{
{'P', NULL, EFI_SCAN_F1, 0, GLOBAL_ALL},
{'Q', NULL, EFI_SCAN_F2, 0, GLOBAL_ALL},
{'w', NULL, EFI_SCAN_F3, 0, GLOBAL_ALL},
{'x', NULL, EFI_SCAN_F4, 0, GLOBAL_ALL},
{'t', NULL, EFI_SCAN_F5, 0, GLOBAL_ALL},
{'u', NULL, EFI_SCAN_F6, 0, GLOBAL_ALL},
{'q', NULL, EFI_SCAN_F7, 0, GLOBAL_ALL},
{'r', NULL, EFI_SCAN_F8, 0, GLOBAL_ALL},
{'p', NULL, EFI_SCAN_F9, 0, GLOBAL_ALL},
{'M', NULL, EFI_SCAN_F10,0, GLOBAL_ALL},
ESC_SEQ_STATE_ARRAY_END_MARKER
};
STATE_DESCRIPTION CursorPositionEscSeqStateArray[] =
{
{'C', NULL, EFI_SCAN_RIGHT, 0, GLOBAL_ALL},
{'D', NULL, EFI_SCAN_LEFT, 0, GLOBAL_ALL},
{'A', NULL, EFI_SCAN_UP, 0, GLOBAL_ALL},
{'B', NULL, EFI_SCAN_DN, 0, GLOBAL_ALL},
{'H', NULL, EFI_SCAN_HOME, 0, GLOBAL_ALL},
{'K', NULL, EFI_SCAN_END, 0, GLOBAL_ALL},
{'1', PuttyVt100EscSeq1, 0, 0, PUTTY_VT100 | PUTTY_LINUX | PUTTY_XTERMR6 | PUTTY_ESCN | PUTTY_VT400 },
{'2', PuttyVt100EscSeq2, 0, 0, PUTTY_VT100 | PUTTY_LINUX | PUTTY_XTERMR6 | PUTTY_ESCN | PUTTY_VT400 },
{'3', PuttyVt100EscSeq3, 0, 0, PUTTY_VT100 | PUTTY_LINUX | PUTTY_XTERMR6 | PUTTY_ESCN },
{'4', PuttyVt100EscSeq4, 0, 0, PUTTY_VT100 | PUTTY_LINUX | PUTTY_XTERMR6 | PUTTY_ESCN },
{'5', PuttyVt100EscSeq5, 0, 0, PUTTY_VT100 | PUTTY_LINUX | PUTTY_XTERMR6 | PUTTY_ESCN },
{'6', PuttyVt100EscSeq6, 0, 0, PUTTY_VT100 | PUTTY_LINUX | PUTTY_XTERMR6 | PUTTY_ESCN },
{'3', PuttyVt400EscSeq3, 0, 0, PUTTY_VT400},
{'4', PuttyVt400EscSeq4, 0, 0, PUTTY_VT400},
{'5', PuttyVt400EscSeq5, 0, 0, PUTTY_VT400},
{'6', PuttyVt400EscSeq6, 0, 0, PUTTY_VT400},
{'[', PuttyLinuxEscSeq, 0, 0, PUTTY_LINUX},
{'M', NULL, EFI_SCAN_F1, 0, PUTTY_SCO},
{'N', NULL, EFI_SCAN_F2, 0, PUTTY_SCO},
#if OEM_ESC_SEQUENCES
{'O', OemEscSeqStateArray, 0, 0, GLOBAL_ALL},
#else
{'O', NULL, EFI_SCAN_F3, 0, PUTTY_SCO},
#endif
{'P', NULL, EFI_SCAN_F4, 0, PUTTY_SCO},
{'Q', NULL, EFI_SCAN_F5, 0, PUTTY_SCO},
{'R', NULL, EFI_SCAN_F6, 0, PUTTY_SCO},
{'S', NULL, EFI_SCAN_F7, 0, PUTTY_SCO},
{'T', NULL, EFI_SCAN_F8, 0, PUTTY_SCO},
{'U', NULL, EFI_SCAN_F9, 0, PUTTY_SCO},
{'V', NULL, EFI_SCAN_F10, 0, PUTTY_SCO},
{'W', NULL, EFI_SCAN_F11, 0, PUTTY_SCO},
{'X', NULL, EFI_SCAN_F12, 0, PUTTY_SCO},
{'I', NULL, EFI_SCAN_PGUP, 0, PUTTY_SCO},
{'G', NULL, EFI_SCAN_PGDN, 0, PUTTY_SCO},
{'F', NULL, EFI_SCAN_END, 0, PUTTY_SCO},
{'L', NULL, EFI_SCAN_INS, 0, PUTTY_SCO},
{0x7F, NULL, EFI_SCAN_DEL, 0, PUTTY_SCO},
ESC_SEQ_STATE_ARRAY_END_MARKER
};
STATE_DESCRIPTION FunctionKeyEscSeqStateArray[] =
{
{'P', NULL, EFI_SCAN_F1, 0, GLOBAL_ALL},
{'Q', NULL, EFI_SCAN_F2, 0, GLOBAL_ALL},
{'R', NULL, EFI_SCAN_F3, 0, GLOBAL_ALL},
{'S', NULL, EFI_SCAN_F4, 0, GLOBAL_ALL},
{'T', NULL, EFI_SCAN_F5, 0, PUTTY_VT100},
{'U', NULL, EFI_SCAN_F6, 0, PUTTY_VT100},
{'V', NULL, EFI_SCAN_F7, 0, PUTTY_VT100},
{'W', NULL, EFI_SCAN_F8, 0, PUTTY_VT100},
{'X', NULL, EFI_SCAN_F9, 0, PUTTY_VT100},
{'Y', NULL, EFI_SCAN_F10, 0, PUTTY_VT100},
{'Z', NULL, EFI_SCAN_F11, 0, PUTTY_VT100},
{'[', NULL, EFI_SCAN_F12, 0, PUTTY_VT100},
ESC_SEQ_STATE_ARRAY_END_MARKER
};
STATE_DESCRIPTION ResetSequenceState5[] =
{
{'R', NULL, RESET, 0, GLOBAL_ALL},
ESC_SEQ_STATE_ARRAY_END_MARKER
};
STATE_DESCRIPTION ResetSequenceState4[] =
{
{ASCII_ESC, ResetSequenceState5, 0, 0, GLOBAL_ALL},
ESC_SEQ_STATE_ARRAY_END_MARKER
};
STATE_DESCRIPTION ResetSequenceState3[] =
{
{'r', ResetSequenceState4, 0, 0, GLOBAL_ALL},
ESC_SEQ_STATE_ARRAY_END_MARKER
};
STATE_DESCRIPTION ResetSequenceState2[] =
{
{ASCII_ESC, ResetSequenceState3, 0, 0, GLOBAL_ALL},
ESC_SEQ_STATE_ARRAY_END_MARKER
};
STATE_DESCRIPTION EscSeqStateArray[] =
{
{'[', CursorPositionEscSeqStateArray,
0, 0, GLOBAL_ALL},
{'O', FunctionKeyEscSeqStateArray,
0, 0, GLOBAL_ALL},
{'R', ResetSequenceState2,
0, 0, GLOBAL_ALL},
ESC_SEQ_STATE_ARRAY_END_MARKER
};
STATE_DESCRIPTION Vtutf8EscSeqStateArray[] =
{
{'[', CursorPositionEscSeqStateArray,
0, 0, GLOBAL_ALL},
{'O', FunctionKeyEscSeqStateArray,
0, 0, GLOBAL_ALL},
{'h', NULL, EFI_SCAN_HOME, 0, GLOBAL_ALL},
{'k', NULL, EFI_SCAN_END, 0, GLOBAL_ALL},
{'+', NULL, EFI_SCAN_INS, 0, GLOBAL_ALL},
{'-', NULL, EFI_SCAN_DEL, 0, GLOBAL_ALL},
{'?', NULL, EFI_SCAN_PGUP, 0, GLOBAL_ALL},
{'/', NULL, EFI_SCAN_PGDN, 0, GLOBAL_ALL},
{'1', NULL, EFI_SCAN_F1, 0, GLOBAL_ALL},
{'2', NULL, EFI_SCAN_F2, 0, GLOBAL_ALL},
{'3', NULL, EFI_SCAN_F3, 0, GLOBAL_ALL},
{'4', NULL, EFI_SCAN_F4, 0, GLOBAL_ALL},
{'5', NULL, EFI_SCAN_F5, 0, GLOBAL_ALL},
{'6', NULL, EFI_SCAN_F6, 0, GLOBAL_ALL},
{'7', NULL, EFI_SCAN_F7, 0, GLOBAL_ALL},
{'8', NULL, EFI_SCAN_F8, 0, GLOBAL_ALL},
{'9', NULL, EFI_SCAN_F9, 0, GLOBAL_ALL},
{'0', NULL, EFI_SCAN_F10, 0, GLOBAL_ALL},
{'!', NULL, EFI_SCAN_F11, 0, GLOBAL_ALL},
{'@', NULL, EFI_SCAN_F12, 0, GLOBAL_ALL},
{'R', ResetSequenceState2,
0, 0, GLOBAL_ALL},
ESC_SEQ_STATE_ARRAY_END_MARKER
};
#endif
//****************************************************************************
//****************************************************************************
//** **
//** (C)Copyright 1985-2008, American Megatrends, Inc. **
//** **
//** All Rights Reserved. **
//** **
//** 5555 Oakbrook Pkwy, Norcross, GA 30093 **
//** **
//** Phone (770)-246-8600 **
//** **
//****************************************************************************
//****************************************************************************
|