Browse Source

[pxe] Notify BIOS via INT 1a,564e for each new network device

Use INT 1a,564e to notify the BIOS of each network device that we
detect.  This provides an opportunity for the BIOS to implement
platform policy such as changing the MAC address by issuing a call to
PXENV_UNDI_SET_STATION_ADDRESS.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 9 years ago
parent
commit
1852803e46
1 changed files with 26 additions and 0 deletions
  1. 26
    0
      src/arch/i386/interface/pxe/pxe_call.c

+ 26
- 0
src/arch/i386/interface/pxe/pxe_call.c View File

26
 #include <ipxe/uaccess.h>
26
 #include <ipxe/uaccess.h>
27
 #include <ipxe/init.h>
27
 #include <ipxe/init.h>
28
 #include <ipxe/profile.h>
28
 #include <ipxe/profile.h>
29
+#include <ipxe/netdevice.h>
29
 #include <setjmp.h>
30
 #include <setjmp.h>
30
 #include <registers.h>
31
 #include <registers.h>
31
 #include <biosint.h>
32
 #include <biosint.h>
358
 	return 0;
359
 	return 0;
359
 }
360
 }
360
 
361
 
362
+/**
363
+ * Notify BIOS of existence of network device
364
+ *
365
+ * @v netdev		Network device
366
+ * @ret rc		Return status code
367
+ */
368
+static int pxe_notify ( struct net_device *netdev ) {
369
+
370
+	/* Do nothing if we already have a network device */
371
+	if ( pxe_netdev )
372
+		return 0;
373
+
374
+	/* Activate (and deactivate) PXE stack to notify BIOS */
375
+	pxe_activate ( netdev );
376
+	pxe_deactivate();
377
+
378
+	return 0;
379
+}
380
+
381
+/** PXE BIOS notification driver */
382
+struct net_driver pxe_driver __net_driver = {
383
+	.name = "PXE",
384
+	.probe = pxe_notify,
385
+};
386
+
361
 REQUIRING_SYMBOL ( pxe_api_call );
387
 REQUIRING_SYMBOL ( pxe_api_call );
362
 REQUIRE_OBJECT ( pxe_preboot );
388
 REQUIRE_OBJECT ( pxe_preboot );
363
 REQUIRE_OBJECT ( pxe_undi );
389
 REQUIRE_OBJECT ( pxe_undi );

Loading…
Cancel
Save