소스 검색

[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 8 년 전
부모
커밋
1852803e46
1개의 변경된 파일26개의 추가작업 그리고 0개의 파일을 삭제
  1. 26
    0
      src/arch/i386/interface/pxe/pxe_call.c

+ 26
- 0
src/arch/i386/interface/pxe/pxe_call.c 파일 보기

@@ -26,6 +26,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
26 26
 #include <ipxe/uaccess.h>
27 27
 #include <ipxe/init.h>
28 28
 #include <ipxe/profile.h>
29
+#include <ipxe/netdevice.h>
29 30
 #include <setjmp.h>
30 31
 #include <registers.h>
31 32
 #include <biosint.h>
@@ -358,6 +359,31 @@ int pxe_start_nbp ( void ) {
358 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 387
 REQUIRING_SYMBOL ( pxe_api_call );
362 388
 REQUIRE_OBJECT ( pxe_preboot );
363 389
 REQUIRE_OBJECT ( pxe_undi );

Loading…
취소
저장