summaryrefslogtreecommitdiffstats
path: root/src/arch/i386
diff options
context:
space:
mode:
authorMichael Brown2015-09-15 14:43:35 +0200
committerMichael Brown2015-09-15 14:43:35 +0200
commit1852803e462b8cdb864d3d07b9c544ef466c22b5 (patch)
tree35a2fc204953e358f1365340f0a31acaf7559976 /src/arch/i386
parent[pxe] Invoke INT 1a,564e when PXE stack is activated (diff)
downloadipxe-1852803e462b8cdb864d3d07b9c544ef466c22b5.tar.gz
ipxe-1852803e462b8cdb864d3d07b9c544ef466c22b5.tar.xz
ipxe-1852803e462b8cdb864d3d07b9c544ef466c22b5.zip
[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>
Diffstat (limited to 'src/arch/i386')
-rw-r--r--src/arch/i386/interface/pxe/pxe_call.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/arch/i386/interface/pxe/pxe_call.c b/src/arch/i386/interface/pxe/pxe_call.c
index 2d89cc4d..0b67880c 100644
--- a/src/arch/i386/interface/pxe/pxe_call.c
+++ b/src/arch/i386/interface/pxe/pxe_call.c
@@ -26,6 +26,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
#include <ipxe/uaccess.h>
#include <ipxe/init.h>
#include <ipxe/profile.h>
+#include <ipxe/netdevice.h>
#include <setjmp.h>
#include <registers.h>
#include <biosint.h>
@@ -358,6 +359,31 @@ int pxe_start_nbp ( void ) {
return 0;
}
+/**
+ * Notify BIOS of existence of network device
+ *
+ * @v netdev Network device
+ * @ret rc Return status code
+ */
+static int pxe_notify ( struct net_device *netdev ) {
+
+ /* Do nothing if we already have a network device */
+ if ( pxe_netdev )
+ return 0;
+
+ /* Activate (and deactivate) PXE stack to notify BIOS */
+ pxe_activate ( netdev );
+ pxe_deactivate();
+
+ return 0;
+}
+
+/** PXE BIOS notification driver */
+struct net_driver pxe_driver __net_driver = {
+ .name = "PXE",
+ .probe = pxe_notify,
+};
+
REQUIRING_SYMBOL ( pxe_api_call );
REQUIRE_OBJECT ( pxe_preboot );
REQUIRE_OBJECT ( pxe_undi );