Selaa lähdekoodia

Separated out the Etherboot-specific parts of the old pxe.h header.

tags/v0.9.3
Michael Brown 19 vuotta sitten
vanhempi
commit
fd49648a35
1 muutettua tiedostoa jossa 88 lisäystä ja 0 poistoa
  1. 88
    0
      src/include/pxe_internal.h

+ 88
- 0
src/include/pxe_internal.h Näytä tiedosto

@@ -0,0 +1,88 @@
1
+#ifndef PXE_INTERNAL_H
2
+#define PXE_INTERNAL_H
3
+
4
+/* Union used for PXE API calls; we don't know the type of the
5
+ * structure until we interpret the opcode.  Also, Status is available
6
+ * in the same location for any opcode, and it's convenient to have
7
+ * non-specific access to it.
8
+ */
9
+union u_PXENV_ANY {
10
+	/* Make it easy to read status for any operation */
11
+	PXENV_STATUS_t				Status;
12
+	struct s_PXENV_UNLOAD_STACK		unload_stack;
13
+	struct s_PXENV_GET_CACHED_INFO		get_cached_info;
14
+	struct s_PXENV_RESTART_TFTP		restart_tftp;
15
+	struct s_PXENV_START_UNDI		start_undi;
16
+	struct s_PXENV_STOP_UNDI		stop_undi;
17
+	struct s_PXENV_START_BASE		start_base;
18
+	struct s_PXENV_STOP_BASE		stop_base;
19
+	struct s_PXENV_TFTP_OPEN		tftp_open;
20
+	struct s_PXENV_TFTP_CLOSE		tftp_close;
21
+	struct s_PXENV_TFTP_READ		tftp_read;
22
+	struct s_PXENV_TFTP_READ_FILE		tftp_read_file;
23
+	struct s_PXENV_TFTP_GET_FSIZE		tftp_get_fsize;
24
+	struct s_PXENV_UDP_OPEN			udp_open;
25
+	struct s_PXENV_UDP_CLOSE		udp_close;
26
+	struct s_PXENV_UDP_WRITE		udp_write;
27
+	struct s_PXENV_UDP_READ			udp_read;
28
+	struct s_PXENV_UNDI_STARTUP		undi_startup;
29
+	struct s_PXENV_UNDI_CLEANUP		undi_cleanup;
30
+	struct s_PXENV_UNDI_INITIALIZE		undi_initialize;
31
+	struct s_PXENV_UNDI_RESET_ADAPTER	undi_reset_adapter;
32
+	struct s_PXENV_UNDI_SHUTDOWN		undi_shutdown;
33
+	struct s_PXENV_UNDI_OPEN		undi_open;
34
+	struct s_PXENV_UNDI_CLOSE		undi_close;
35
+	struct s_PXENV_UNDI_TRANSMIT		undi_transmit;
36
+	struct s_PXENV_UNDI_SET_MCAST_ADDRESS	undi_set_mcast_address;
37
+	struct s_PXENV_UNDI_SET_STATION_ADDRESS undi_set_station_address;
38
+	struct s_PXENV_UNDI_SET_PACKET_FILTER	undi_set_packet_filter;
39
+	struct s_PXENV_UNDI_GET_INFORMATION	undi_get_information;
40
+	struct s_PXENV_UNDI_GET_STATISTICS	undi_get_statistics;
41
+	struct s_PXENV_UNDI_CLEAR_STATISTICS	undi_clear_statistics;
42
+	struct s_PXENV_UNDI_INITIATE_DIAGS	undi_initiate_diags;
43
+	struct s_PXENV_UNDI_FORCE_INTERRUPT	undi_force_interrupt;
44
+	struct s_PXENV_UNDI_GET_MCAST_ADDRESS	undi_get_mcast_address;
45
+	struct s_PXENV_UNDI_GET_NIC_TYPE	undi_get_nic_type;
46
+	struct s_PXENV_UNDI_GET_IFACE_INFO	undi_get_iface_info;
47
+	struct s_PXENV_UNDI_GET_STATE		undi_get_state;
48
+	struct s_PXENV_UNDI_ISR			undi_isr;
49
+};
50
+
51
+typedef union u_PXENV_ANY PXENV_ANY_t;
52
+
53
+/* PXE stack status indicator.  See pxe_export.c for further
54
+ * explanation.
55
+ */
56
+typedef enum {
57
+	CAN_UNLOAD = 0,
58
+	MIDWAY,
59
+	READY
60
+} pxe_stack_state_t;
61
+
62
+/* Data structures installed as part of a PXE stack.  Architectures
63
+ * will have extra information to append to the end of this.
64
+ */
65
+#define PXE_TFTP_MAGIC_COOKIE ( ( 'P'<<24 ) | ( 'x'<<16 ) | ( 'T'<<8 ) | 'f' )
66
+typedef struct {
67
+	pxe_t		pxe	__attribute__ ((aligned(16)));
68
+	pxenv_t		pxenv	__attribute__ ((aligned(16)));
69
+	pxe_stack_state_t state;
70
+	union {
71
+		BOOTPLAYER	cached_info;
72
+		char		packet[ETH_FRAME_LEN];
73
+		struct {
74
+			uint32_t magic_cookie;
75
+			unsigned int len;
76
+			int eof;
77
+			char data[TFTP_MAX_PACKET];
78
+		} tftpdata;
79
+		struct {
80
+			char *buffer;
81
+			uint32_t offset;
82
+			uint32_t bufferlen;
83
+		} readfile;
84
+	};
85
+	struct {}	arch_data __attribute__ ((aligned(16)));
86
+} pxe_stack_t;
87
+
88
+#endif /* PXE_INTERNAL_H */

Loading…
Peruuta
Tallenna