Procházet zdrojové kódy

Allow linking by converting functions to stubs

tags/v0.9.3
Michael Brown před 18 roky
rodič
revize
71754ada2a
2 změnil soubory, kde provedl 25 přidání a 28 odebrání
  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 Zobrazit soubor

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

+ 13
- 18
src/interface/pxe/pxe_tftp.c Zobrazit soubor

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

Načítá se…
Zrušit
Uložit