Kaynağa Gözat

Allow linking by converting functions to stubs

tags/v0.9.3
Michael Brown 18 yıl önce
ebeveyn
işleme
71754ada2a
2 değiştirilmiş dosya ile 25 ekleme ve 28 silme
  1. 12
    10
      src/interface/pxe/pxe_preboot.c
  2. 13
    18
      src/interface/pxe/pxe_tftp.c

+ 12
- 10
src/interface/pxe/pxe_preboot.c Dosyayı Görüntüle

@@ -23,8 +23,6 @@
23 23
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 24
  */
25 25
 
26
-#if 0
27
-
28 26
 #include "pxe.h"
29 27
 #include "pxe_callbacks.h"
30 28
 
@@ -39,8 +37,8 @@ PXENV_EXIT_t pxenv_unload_stack ( struct s_PXENV_UNLOAD_STACK *unload_stack ) {
39 37
 	int success;
40 38
 
41 39
 	DBG ( "PXENV_UNLOAD_STACK" );
42
-	success = ensure_pxe_state ( CAN_UNLOAD );
43 40
 
41
+#if 0
44 42
 	/* We need to call cleanup() at some point.  The network card
45 43
 	 * has already been disabled by ENSURE_CAN_UNLOAD(), but for
46 44
 	 * the sake of completeness we should call the console_fini()
@@ -58,6 +56,7 @@ PXENV_EXIT_t pxenv_unload_stack ( struct s_PXENV_UNLOAD_STACK *unload_stack ) {
58 56
 		unload_stack->Status = PXENV_STATUS_KEEP_ALL;
59 57
 		return PXENV_EXIT_FAILURE;
60 58
 	}
59
+#endif
61 60
 
62 61
 	unload_stack->Status = PXENV_STATUS_SUCCESS;
63 62
 	return PXENV_EXIT_SUCCESS;
@@ -69,10 +68,9 @@ PXENV_EXIT_t pxenv_unload_stack ( struct s_PXENV_UNLOAD_STACK *unload_stack ) {
69 68
  */
70 69
 PXENV_EXIT_t pxenv_get_cached_info ( struct s_PXENV_GET_CACHED_INFO
71 70
 				     *get_cached_info ) {
72
-	BOOTPLAYER_t *cached_info = &pxe_stack->cached_info;
73 71
 	DBG ( "PXENV_GET_CACHED_INFO %d", get_cached_info->PacketType );
74
-	ENSURE_READY ( get_cached_info );
75 72
 
73
+#if 0
76 74
 	/* Fill in cached_info structure in our pxe_stack */
77 75
 
78 76
 	/* I don't think there's actually any way we can be called in
@@ -128,6 +126,7 @@ PXENV_EXIT_t pxenv_get_cached_info ( struct s_PXENV_GET_CACHED_INFO
128 126
 		 * have a way to detect this already.
129 127
 		 */
130 128
 	}
129
+#endif
131 130
 
132 131
 	get_cached_info->Status = PXENV_STATUS_SUCCESS;
133 132
 	return PXENV_EXIT_SUCCESS;
@@ -142,8 +141,8 @@ PXENV_EXIT_t pxenv_restart_tftp ( struct s_PXENV_TFTP_READ_FILE
142 141
 	PXENV_EXIT_t tftp_exit;
143 142
 
144 143
 	DBG ( "PXENV_RESTART_TFTP" );
145
-	ENSURE_READY ( restart_tftp );
146 144
 
145
+#if 0
147 146
 	/* Words cannot describe the complete mismatch between the PXE
148 147
 	 * specification and any possible version of reality...
149 148
 	 */
@@ -156,6 +155,7 @@ PXENV_EXIT_t pxenv_restart_tftp ( struct s_PXENV_TFTP_READ_FILE
156 155
 
157 156
 	/* Fire up the new NBP */
158 157
 	restart_tftp->Status = xstartpxe();
158
+#endif
159 159
 
160 160
 	/* Not sure what "SUCCESS" actually means, since we can only
161 161
 	 * return if the new NBP failed to boot...
@@ -171,8 +171,8 @@ PXENV_EXIT_t pxenv_start_undi ( struct s_PXENV_START_UNDI *start_undi ) {
171 171
 	unsigned char bus, devfn;
172 172
 
173 173
 	DBG ( "PXENV_START_UNDI" );
174
-	ENSURE_MIDWAY(start_undi);
175 174
 
175
+#if 0
176 176
 	/* Record PCI bus & devfn passed by caller, so we know which
177 177
 	 * NIC they want to use.
178 178
 	 *
@@ -201,6 +201,8 @@ PXENV_EXIT_t pxenv_start_undi ( struct s_PXENV_START_UNDI *start_undi ) {
201 201
 		pci->dev.bus = bus;
202 202
 		pci->dev.devfn = devfn;
203 203
 	}
204
+#endif
205
+
204 206
 #endif
205 207
 
206 208
 	start_undi->Status = PXENV_STATUS_SUCCESS;
@@ -214,10 +216,12 @@ PXENV_EXIT_t pxenv_start_undi ( struct s_PXENV_START_UNDI *start_undi ) {
214 216
 PXENV_EXIT_t pxenv_stop_undi ( struct s_PXENV_STOP_UNDI *stop_undi ) {
215 217
 	DBG ( "PXENV_STOP_UNDI" );
216 218
 
219
+#if 0
217 220
 	if ( ! ensure_pxe_state(CAN_UNLOAD) ) {
218 221
 		stop_undi->Status = PXENV_STATUS_KEEP_UNDI;
219 222
 		return PXENV_EXIT_FAILURE;
220 223
 	}
224
+#endif
221 225
 
222 226
 	stop_undi->Status = PXENV_STATUS_SUCCESS;
223 227
 	return PXENV_EXIT_SUCCESS;
@@ -229,7 +233,7 @@ PXENV_EXIT_t pxenv_stop_undi ( struct s_PXENV_STOP_UNDI *stop_undi ) {
229 233
  */
230 234
 PXENV_EXIT_t pxenv_start_base ( struct s_PXENV_START_BASE *start_base ) {
231 235
 	DBG ( "PXENV_START_BASE" );
232
-	/* ENSURE_READY ( start_base ); */
236
+
233 237
 	start_base->Status = PXENV_STATUS_UNSUPPORTED;
234 238
 	return PXENV_EXIT_FAILURE;
235 239
 }
@@ -249,5 +253,3 @@ PXENV_EXIT_t pxenv_stop_base ( struct s_PXENV_STOP_BASE *stop_base ) {
249 253
 	stop_base->Status = PXENV_STATUS_SUCCESS;
250 254
 	return PXENV_EXIT_SUCCESS;
251 255
 }
252
-
253
-#endif

+ 13
- 18
src/interface/pxe/pxe_tftp.c Dosyayı Görüntüle

@@ -22,8 +22,6 @@
22 22
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 23
  */
24 24
 
25
-#if 0
26
-
27 25
 #include "pxe.h"
28 26
 
29 27
 static int pxe_tftp_read_block ( unsigned char *data, unsigned int block,
@@ -109,13 +107,9 @@ static int pxe_tftp_read_block ( unsigned char *data, unsigned int block,
109 107
  * other PXE API call "if an MTFTP connection is active".
110 108
  */
111 109
 PXENV_EXIT_t pxenv_tftp_open ( struct s_PXENV_TFTP_OPEN *tftp_open ) {
112
-	struct sockaddr_in tftp_server;
113
-	struct tftpreq_info_t request;
114
-	struct tftpblk_info_t block;
115
-
116 110
 	DBG ( "PXENV_TFTP_OPEN" );
117
-	ENSURE_READY ( tftp_open );
118 111
 
112
+#if 0
119 113
 	/* Set server address and port */
120 114
 	tftp_server.sin_addr.s_addr = tftp_open->ServerIPAddress
121 115
 		? tftp_open->ServerIPAddress
@@ -146,6 +140,7 @@ PXENV_EXIT_t pxenv_tftp_open ( struct s_PXENV_TFTP_OPEN *tftp_open ) {
146 140
 	pxe_stack->tftpdata.len = block.len;
147 141
 	pxe_stack->tftpdata.eof = block.eof;
148 142
 	memcpy ( pxe_stack->tftpdata.data, block.data, block.len );
143
+#endif
149 144
 
150 145
 	tftp_open->Status = PXENV_STATUS_SUCCESS;
151 146
 	return PXENV_EXIT_SUCCESS;
@@ -174,7 +169,7 @@ PXENV_EXIT_t pxenv_tftp_open ( struct s_PXENV_TFTP_OPEN *tftp_open ) {
174 169
  */
175 170
 PXENV_EXIT_t pxenv_tftp_close ( struct s_PXENV_TFTP_CLOSE *tftp_close ) {
176 171
 	DBG ( "PXENV_TFTP_CLOSE" );
177
-	ENSURE_READY ( tftp_close );
172
+
178 173
 	tftp_close->Status = PXENV_STATUS_SUCCESS;
179 174
 	return PXENV_EXIT_SUCCESS;
180 175
 }
@@ -246,11 +241,9 @@ PXENV_EXIT_t pxenv_tftp_close ( struct s_PXENV_TFTP_CLOSE *tftp_close ) {
246 241
  * @ref pxe_x86_pmode16 "implementation note" for more details.)
247 242
  */
248 243
 PXENV_EXIT_t pxenv_tftp_read ( struct s_PXENV_TFTP_READ *tftp_read ) {
249
-	struct tftpblk_info_t block;
250
-
251 244
 	DBG ( "PXENV_TFTP_READ" );
252
-	ENSURE_READY ( tftp_read );
253 245
 
246
+#if 0
254 247
 	/* Do we have a block pending */
255 248
 	if ( pxe_stack->tftpdata.magic_cookie == PXE_TFTP_MAGIC_COOKIE ) {
256 249
 		block.data = pxe_stack->tftpdata.data;
@@ -271,6 +264,7 @@ PXENV_EXIT_t pxenv_tftp_read ( struct s_PXENV_TFTP_READ *tftp_read ) {
271 264
 	memcpy ( SEGOFF16_TO_PTR(tftp_read->Buffer), block.data, block.len );
272 265
 	DBG ( " %d to %hx:%hx", block.len, tftp_read->Buffer.segment,
273 266
 	      tftp_read->Buffer.offset );
267
+#endif
274 268
  
275 269
 	tftp_read->Status = PXENV_STATUS_SUCCESS;
276 270
 	return PXENV_EXIT_SUCCESS;
@@ -369,14 +363,11 @@ PXENV_EXIT_t pxenv_tftp_read ( struct s_PXENV_TFTP_READ *tftp_read ) {
369 363
  */
370 364
 PXENV_EXIT_t pxenv_tftp_read_file ( struct s_PXENV_TFTP_READ_FILE
371 365
 				    *tftp_read_file ) {
372
-	struct sockaddr_in tftp_server;
373
-	int rc;
374
-
375 366
 	DBG ( "PXENV_TFTP_READ_FILE %s to [%x,%x)", tftp_read_file->FileName,
376 367
 	      tftp_read_file->Buffer,
377 368
 	      tftp_read_file->Buffer + tftp_read_file->BufferSize );
378
-	ENSURE_READY ( tftp_read_file );
379 369
 
370
+#if 0
380 371
 	/* inserted by Klaus Wittemeier */
381 372
 	/* KERNEL_BUF stores the name of the last required file */
382 373
 	/* This is a fix to make Microsoft Remote Install Services work (RIS) */
@@ -399,10 +390,13 @@ PXENV_EXIT_t pxenv_tftp_read_file ( struct s_PXENV_TFTP_READ_FILE
399 390
 		tftp_read_file->Status = PXENV_STATUS_FAILURE;
400 391
 		return PXENV_EXIT_FAILURE;
401 392
 	}
393
+#endif
394
+
402 395
 	tftp_read_file->Status = PXENV_STATUS_SUCCESS;
403 396
 	return PXENV_EXIT_SUCCESS;
404 397
 }
405 398
 
399
+#if 0
406 400
 static int pxe_tftp_read_block ( unsigned char *data,
407 401
 				 unsigned int block __unused,
408 402
 				 unsigned int len, int eof ) {
@@ -415,6 +409,7 @@ static int pxe_tftp_read_block ( unsigned char *data,
415 409
 	pxe_stack->readfile.offset += len;
416 410
 	return eof ? 0 : 1;
417 411
 }
412
+#endif
418 413
 
419 414
 /**
420 415
  * TFTP GET FILE SIZE
@@ -463,8 +458,8 @@ PXENV_EXIT_t pxenv_tftp_get_fsize ( struct s_PXENV_TFTP_GET_FSIZE
463 458
 	int rc;
464 459
 
465 460
 	DBG ( "PXENV_TFTP_GET_FSIZE" );
466
-	ENSURE_READY ( tftp_get_fsize );
467 461
 
462
+#if 0
468 463
 	pxe_stack->readfile.buffer = NULL;
469 464
 	pxe_stack->readfile.bufferlen = 0;
470 465
 	pxe_stack->readfile.offset = 0;
@@ -476,6 +471,8 @@ PXENV_EXIT_t pxenv_tftp_get_fsize ( struct s_PXENV_TFTP_GET_FSIZE
476 471
 		return PXENV_EXIT_FAILURE;
477 472
 	}
478 473
 	tftp_get_fsize->FileSize = pxe_stack->readfile.offset;
474
+#endif
475
+
479 476
 	tftp_get_fsize->Status = PXENV_STATUS_SUCCESS;
480 477
 	return PXENV_EXIT_SUCCESS;
481 478
 }
@@ -623,5 +620,3 @@ Note to future API designers at Intel: try to understand the
623 620
 underlying network protocol first!
624 621
 
625 622
 */
626
-
627
-#endif

Loading…
İptal
Kaydet