|
@@ -30,6 +30,7 @@
|
30
|
30
|
#include <gpxe/efi/Protocol/PciIo.h>
|
31
|
31
|
#include <gpxe/efi/Protocol/SimpleNetwork.h>
|
32
|
32
|
#include <gpxe/efi/Protocol/ComponentName2.h>
|
|
33
|
+#include <gpxe/efi/Protocol/NetworkInterfaceIdentifier.h>
|
33
|
34
|
#include <config/general.h>
|
34
|
35
|
|
35
|
36
|
/** @file
|
|
@@ -62,6 +63,8 @@ struct efi_snp_device {
|
62
|
63
|
unsigned int rx_count_interrupts;
|
63
|
64
|
/** Outstanding RX packet count (via WaitForPacket event) */
|
64
|
65
|
unsigned int rx_count_events;
|
|
66
|
+ /** The network interface identifier */
|
|
67
|
+ EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL nii;
|
65
|
68
|
/** Device name */
|
66
|
69
|
wchar_t name[ sizeof ( ( ( struct net_device * ) NULL )->name ) ];
|
67
|
70
|
/** The device path
|
|
@@ -88,6 +91,18 @@ static EFI_GUID efi_component_name2_protocol_guid
|
88
|
91
|
static EFI_GUID efi_device_path_protocol_guid
|
89
|
92
|
= EFI_DEVICE_PATH_PROTOCOL_GUID;
|
90
|
93
|
|
|
94
|
+/** Efi network interface identifier GUID */
|
|
95
|
+static EFI_GUID efi_nii_protocol_guid = {
|
|
96
|
+ /* No, this isn't the GUID defined as
|
|
97
|
+ * EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL_GUID in
|
|
98
|
+ * Protocol/NetworkInterfaceIdentifier.h. That GUID gets
|
|
99
|
+ * ignored by the EFI network stack. You have to use this one
|
|
100
|
+ * instead.
|
|
101
|
+ */
|
|
102
|
+ 0x1ACED566, 0x76ED, 0x4218,
|
|
103
|
+ { 0xBC, 0x81, 0x76, 0x7F, 0x1F, 0x97, 0x7A, 0x89 }
|
|
104
|
+};
|
|
105
|
+
|
91
|
106
|
/** EFI PCI I/O protocol GUID */
|
92
|
107
|
static EFI_GUID efi_pci_io_protocol_guid
|
93
|
108
|
= EFI_PCI_IO_PROTOCOL_GUID;
|
|
@@ -936,6 +951,12 @@ efi_snp_driver_start ( EFI_DRIVER_BINDING_PROTOCOL *driver,
|
936
|
951
|
snpdev->mode.State = EfiSimpleNetworkStopped;
|
937
|
952
|
efi_snp_set_mode ( snpdev );
|
938
|
953
|
|
|
954
|
+ /* Populate the NII structure */
|
|
955
|
+ snpdev->nii.Revision =
|
|
956
|
+ EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL_REVISION;
|
|
957
|
+ strncpy ( snpdev->nii.StringId, "gPXE",
|
|
958
|
+ sizeof ( snpdev->nii.StringId ) );
|
|
959
|
+
|
939
|
960
|
/* Populate the device name */
|
940
|
961
|
for ( i = 0 ; i < sizeof ( netdev->name ) ; i++ ) {
|
941
|
962
|
/* Damn Unicode names */
|
|
@@ -965,6 +986,7 @@ efi_snp_driver_start ( EFI_DRIVER_BINDING_PROTOCOL *driver,
|
965
|
986
|
&snpdev->handle,
|
966
|
987
|
&efi_simple_network_protocol_guid, &snpdev->snp,
|
967
|
988
|
&efi_device_path_protocol_guid, &snpdev->path,
|
|
989
|
+ &efi_nii_protocol_guid, &snpdev->nii,
|
968
|
990
|
NULL ) ) != 0 ) {
|
969
|
991
|
DBGC ( snpdev, "SNPDEV %p could not install protocols: "
|
970
|
992
|
"%s\n", snpdev, efi_strerror ( efirc ) );
|
|
@@ -979,6 +1001,7 @@ efi_snp_driver_start ( EFI_DRIVER_BINDING_PROTOCOL *driver,
|
979
|
1001
|
snpdev->handle,
|
980
|
1002
|
&efi_simple_network_protocol_guid, &snpdev->snp,
|
981
|
1003
|
&efi_device_path_protocol_guid, &snpdev->path,
|
|
1004
|
+ &efi_nii_protocol_guid, &snpdev->nii,
|
982
|
1005
|
NULL );
|
983
|
1006
|
err_install_protocol_interface:
|
984
|
1007
|
bs->CloseEvent ( snpdev->snp.WaitForPacket );
|
|
@@ -1027,6 +1050,7 @@ efi_snp_driver_stop ( EFI_DRIVER_BINDING_PROTOCOL *driver,
|
1027
|
1050
|
snpdev->handle,
|
1028
|
1051
|
&efi_simple_network_protocol_guid, &snpdev->snp,
|
1029
|
1052
|
&efi_device_path_protocol_guid, &snpdev->path,
|
|
1053
|
+ &efi_nii_protocol_guid, &snpdev->nii,
|
1030
|
1054
|
NULL );
|
1031
|
1055
|
bs->CloseEvent ( snpdev->snp.WaitForPacket );
|
1032
|
1056
|
netdev_put ( snpdev->netdev );
|