Browse Source

[pxe] Fix interoperability with the 3Com DOS UNDI driver

The 3Com DOS UNDI driver fails when run on top of gPXE for two
reasons: firstly because PXENV_UNDI_SET_PACKET_FILTER is unsupported,
and secondly because gPXE enters the NBP without enabling interrupts
on the NIC, and the 3Com driver never calls PXENV_UNDI_OPEN.

Fix by always returning success from PXENV_UNDI_SET_PACKET_FILTER
(which is no worse than the current situation, since we already ignore
the receive packet filter in PXENV_UNDI_OPEN), and by forcibly
enabling interrupts on the NIC within PXENV_UNDI_TRANSMIT.  The latter
is something of a hack, but avoids the need to implement a complete
base-code ISR that we would otherwise need if we were to enter the NBP
with interrupts enabled.
tags/v0.9.8
Michael Brown 15 years ago
parent
commit
4f881ae352
1 changed files with 15 additions and 2 deletions
  1. 15
    2
      src/arch/i386/interface/pxe/pxe_undi.c

+ 15
- 2
src/arch/i386/interface/pxe/pxe_undi.c View File

211
 
211
 
212
 	DBG ( "PXENV_UNDI_TRANSMIT" );
212
 	DBG ( "PXENV_UNDI_TRANSMIT" );
213
 
213
 
214
+	/* Forcibly enable interrupts at this point, to work around
215
+	 * callers that never call PXENV_UNDI_OPEN before attempting
216
+	 * to use the UNDI API.
217
+	 */
218
+	netdev_irq ( pxe_netdev, 1 );
219
+
214
 	/* Identify network-layer protocol */
220
 	/* Identify network-layer protocol */
215
 	switch ( undi_transmit->Protocol ) {
221
 	switch ( undi_transmit->Protocol ) {
216
 	case P_IP:	net_protocol = &ipv4_protocol;	break;
222
 	case P_IP:	net_protocol = &ipv4_protocol;	break;
341
 PXENV_EXIT_t
347
 PXENV_EXIT_t
342
 pxenv_undi_set_packet_filter ( struct s_PXENV_UNDI_SET_PACKET_FILTER
348
 pxenv_undi_set_packet_filter ( struct s_PXENV_UNDI_SET_PACKET_FILTER
343
 			       *undi_set_packet_filter ) {
349
 			       *undi_set_packet_filter ) {
350
+
344
 	DBG ( "PXENV_UNDI_SET_PACKET_FILTER" );
351
 	DBG ( "PXENV_UNDI_SET_PACKET_FILTER" );
345
 
352
 
346
-	undi_set_packet_filter->Status = PXENV_STATUS_UNSUPPORTED;
347
-	return PXENV_EXIT_FAILURE;
353
+	/* Pretend that we succeeded, otherwise the 3Com DOS UNDI
354
+	 * driver refuses to load.  (We ignore the filter value in the
355
+	 * PXENV_UNDI_OPEN call anyway.)
356
+	 */
357
+	DBG ( " %02x", undi_set_packet_filter->filter );
358
+	undi_set_packet_filter->Status = PXENV_STATUS_SUCCESS;
359
+
360
+	return PXENV_EXIT_SUCCESS;
348
 }
361
 }
349
 
362
 
350
 /* PXENV_UNDI_GET_INFORMATION
363
 /* PXENV_UNDI_GET_INFORMATION

Loading…
Cancel
Save