1;; -----------------------------------------------------------------------
2;;
3;;   Copyright 1999-2008 H. Peter Anvin - All Rights Reserved
4;;
5;;   This program is free software; you can redistribute it and/or modify
6;;   it under the terms of the GNU General Public License as published by
7;;   the Free Software Foundation, Inc., 53 Temple Place Ste 330,
8;;   Boston MA 02111-1307, USA; either version 2 of the License, or
9;;   (at your option) any later version; incorporated herein by reference.
10;;
11;; -----------------------------------------------------------------------
12
13;;
14;; pxe.inc
15;;
16;; PXE opcodes
17;;
18
19%ifndef _PXE_INC
20%define _PXE_INC 1
21
22%define PXENV_TFTP_OPEN					 0x0020
23%define PXENV_TFTP_CLOSE				 0x0021
24%define PXENV_TFTP_READ					 0x0022
25%define PXENV_TFTP_READ_FILE				 0x0023
26%define PXENV_TFTP_READ_FILE_PMODE			 0x0024
27%define PXENV_TFTP_GET_FSIZE				 0x0025
28
29%define PXENV_UDP_OPEN					 0x0030
30%define PXENV_UDP_CLOSE					 0x0031
31%define PXENV_UDP_READ					 0x0032
32%define PXENV_UDP_WRITE					 0x0033
33
34%define PXENV_START_UNDI				 0x0000
35%define PXENV_UNDI_STARTUP				 0x0001
36%define PXENV_UNDI_CLEANUP				 0x0002
37%define PXENV_UNDI_INITIALIZE				 0x0003
38%define PXENV_UNDI_RESET_NIC				 0x0004
39%define PXENV_UNDI_SHUTDOWN				 0x0005
40%define PXENV_UNDI_OPEN					 0x0006
41%define PXENV_UNDI_CLOSE				 0x0007
42%define PXENV_UNDI_TRANSMIT				 0x0008
43%define PXENV_UNDI_SET_MCAST_ADDR			 0x0009
44%define PXENV_UNDI_SET_STATION_ADDR			 0x000A
45%define PXENV_UNDI_SET_PACKET_FILTER			 0x000B
46%define PXENV_UNDI_GET_INFORMATION			 0x000C
47%define PXENV_UNDI_GET_STATISTICS			 0x000D
48%define PXENV_UNDI_CLEAR_STATISTICS			 0x000E
49%define PXENV_UNDI_INITIATE_DIAGS			 0x000F
50%define PXENV_UNDI_FORCE_INTERRUPT			 0x0010
51%define PXENV_UNDI_GET_MCAST_ADDR			 0x0011
52%define PXENV_UNDI_GET_NIC_TYPE				 0x0012
53%define PXENV_UNDI_GET_IFACE_INFO			 0x0013
54%define PXENV_UNDI_ISR					 0x0014
55%define PXENV_STOP_UNDI					 0x0015	; Overlap...?
56%define PXENV_UNDI_GET_STATE				 0x0015	; Overlap...?
57
58%define PXENV_UNLOAD_STACK				 0x0070
59%define PXENV_GET_CACHED_INFO				 0x0071
60%define PXENV_RESTART_DHCP				 0x0072
61%define PXENV_RESTART_TFTP				 0x0073
62%define PXENV_MODE_SWITCH				 0x0074
63%define PXENV_START_BASE				 0x0075
64%define PXENV_STOP_BASE					 0x0076
65
66; gPXE extensions...
67%define PXENV_FILE_OPEN					 0x00e0
68%define PXENV_FILE_CLOSE				 0x00e1
69%define PXENV_FILE_SELECT				 0x00e2
70%define PXENV_FILE_READ					 0x00e3
71%define PXENV_GET_FILE_SIZE				 0x00e4
72%define PXENV_FILE_EXEC					 0x00e5
73%define PXENV_FILE_API_CHECK				 0x00e6
74%define PXENV_FILE_EXIT_HOOK				 0x00e7
75
76; Exit codes
77%define PXENV_EXIT_SUCCESS				 0x0000
78%define PXENV_EXIT_FAILURE				 0x0001
79
80; Status codes
81%define PXENV_STATUS_SUCCESS				 0x00
82%define PXENV_STATUS_FAILURE				 0x01
83%define PXENV_STATUS_BAD_FUNC				 0x02
84%define PXENV_STATUS_UNSUPPORTED			 0x03
85%define PXENV_STATUS_KEEP_UNDI				 0x04
86%define PXENV_STATUS_KEEP_ALL				 0x05
87%define PXENV_STATUS_OUT_OF_RESOURCES			 0x06
88%define PXENV_STATUS_ARP_TIMEOUT			 0x11
89%define PXENV_STATUS_UDP_CLOSED				 0x18
90%define PXENV_STATUS_UDP_OPEN				 0x19
91%define PXENV_STATUS_TFTP_CLOSED			 0x1a
92%define PXENV_STATUS_TFTP_OPEN				 0x1b
93%define PXENV_STATUS_MCOPY_PROBLEM			 0x20
94%define PXENV_STATUS_BIS_INTEGRITY_FAILURE		 0x21
95%define PXENV_STATUS_BIS_VALIDATE_FAILURE		 0x22
96%define PXENV_STATUS_BIS_INIT_FAILURE			 0x23
97%define PXENV_STATUS_BIS_SHUTDOWN_FAILURE		 0x24
98%define PXENV_STATUS_BIS_GBOA_FAILURE			 0x25
99%define PXENV_STATUS_BIS_FREE_FAILURE			 0x26
100%define PXENV_STATUS_BIS_GSI_FAILURE			 0x27
101%define PXENV_STATUS_BIS_BAD_CKSUM			 0x28
102%define PXENV_STATUS_TFTP_CANNOT_ARP_ADDRESS		 0x30
103%define PXENV_STATUS_TFTP_OPEN_TIMEOUT			 0x32
104
105%define PXENV_STATUS_TFTP_UNKNOWN_OPCODE		 0x33
106%define PXENV_STATUS_TFTP_READ_TIMEOUT			 0x35
107%define PXENV_STATUS_TFTP_ERROR_OPCODE			 0x36
108%define PXENV_STATUS_TFTP_CANNOT_OPEN_CONNECTION	 0x38
109%define PXENV_STATUS_TFTP_CANNOT_READ_FROM_CONNECTION	 0x39
110%define PXENV_STATUS_TFTP_TOO_MANY_PACKAGES		 0x3a
111%define PXENV_STATUS_TFTP_FILE_NOT_FOUND		 0x3b
112%define PXENV_STATUS_TFTP_ACCESS_VIOLATION		 0x3c
113%define PXENV_STATUS_TFTP_NO_MCAST_ADDRESS		 0x3d
114%define PXENV_STATUS_TFTP_NO_FILESIZE			 0x3e
115%define PXENV_STATUS_TFTP_INVALID_PACKET_SIZE		 0x3f
116%define PXENV_STATUS_DHCP_TIMEOUT			 0x51
117%define PXENV_STATUS_DHCP_NO_IP_ADDRESS			 0x52
118%define PXENV_STATUS_DHCP_NO_BOOTFILE_NAME		 0x53
119%define PXENV_STATUS_DHCP_BAD_IP_ADDRESS		 0x54
120%define PXENV_STATUS_UNDI_INVALID_FUNCTION		 0x60
121%define PXENV_STATUS_UNDI_MEDIATEST_FAILED		 0x61
122%define PXENV_STATUS_UNDI_CANNOT_INIT_NIC_FOR_MCAST	 0x62
123%define PXENV_STATUS_UNDI_CANNOT_INITIALIZE_NIC		 0x63
124%define PXENV_STATUS_UNDI_CANNOT_INITIALIZE_PHY		 0x64
125%define PXENV_STATUS_UNDI_CANNOT_READ_CONFIG_DATA	 0x65
126%define PXENV_STATUS_UNDI_CANNOT_READ_INIT_DATA		 0x66
127%define PXENV_STATUS_UNDI_BAD_MAC_ADDRESS		 0x67
128%define PXENV_STATUS_UNDI_BAD_EEPROM_CHECKSUM		 0x68
129%define PXENV_STATUS_UNDI_ERROR_SETTING_ISR		 0x69
130%define PXENV_STATUS_UNDI_INVALID_STATE			 0x6a
131%define PXENV_STATUS_UNDI_TRANSMIT_ERROR		 0x6b
132%define PXENV_STATUS_UNDI_INVALID_PARAMETER		 0x6c
133%define PXENV_STATUS_BSTRAP_PROMPT_MENU			 0x74
134%define PXENV_STATUS_BSTRAP_MCAST_ADDR			 0x76
135%define PXENV_STATUS_BSTRAP_MISSING_LIST		 0x77
136%define PXENV_STATUS_BSTRAP_NO_RESPONSE			 0x78
137%define PXENV_STATUS_BSTRAP_FILE_TOO_BIG		 0x79
138%define PXENV_STATUS_BINL_CANCELED_BY_KEYSTROKE		 0xa0
139%define PXENV_STATUS_BINL_NO_PXE_SERVER			 0xa1
140%define PXENV_STATUS_NOT_AVAILABLE_IN_PMODE		 0xa2
141%define PXENV_STATUS_NOT_AVAILABLE_IN_RMODE		 0xa3
142%define PXENV_STATUS_BUSD_DEVICE_NOT_SUPPORTED		 0xb0
143%define PXENV_STATUS_LOADER_NO_FREE_BASE_MEMORY		 0xc0
144%define PXENV_STATUS_LOADER_NO_BC_ROMID			 0xc1
145%define PXENV_STATUS_LOADER_BAD_BC_ROMID		 0xc2
146%define PXENV_STATUS_LOADER_BAD_BC_RUNTIME_IMAGE	 0xc3
147%define PXENV_STATUS_LOADER_NO_UNDI_ROMID		 0xc4
148%define PXENV_STATUS_LOADER_BAD_UNDI_ROMID		 0xc5
149%define PXENV_STATUS_LOADER_BAD_UNDI_DRIVER_IMAGE	 0xc6
150%define PXENV_STATUS_LOADER_NO_PXE_STRUCT		 0xc8
151%define PXENV_STATUS_LOADER_NO_PXENV_STRUCT		 0xc9
152%define PXENV_STATUS_LOADER_UNDI_START			 0xca
153%define PXENV_STATUS_LOADER_BC_START			 0xcb
154
155; UNDI ISR codes
156%define PXENV_UNDI_ISR_IN_START				 1
157%define PXENV_UNDI_ISR_IN_PROCESS			 2
158%define PXENV_UNDI_ISR_IN_GET_NEXT			 3
159
160%define PXENV_UNDI_ISR_OUT_OURS			         0
161%define PXENV_UNDI_ISR_OUT_NOT_OURS			 1
162
163%endif ; _PXE_INC
164