Browse Source

[iscsi] Use the "Ethernet-compatible" MAC address in the iBFT

tags/v1.0.0-rc1
Michael Brown 15 years ago
parent
commit
45044acea7
1 changed files with 8 additions and 4 deletions
  1. 8
    4
      src/arch/i386/interface/pcbios/ibft.c

+ 8
- 4
src/arch/i386/interface/pcbios/ibft.c View File

37
 #include <gpxe/acpi.h>
37
 #include <gpxe/acpi.h>
38
 #include <gpxe/in.h>
38
 #include <gpxe/in.h>
39
 #include <gpxe/netdevice.h>
39
 #include <gpxe/netdevice.h>
40
+#include <gpxe/ethernet.h>
40
 #include <gpxe/dhcp.h>
41
 #include <gpxe/dhcp.h>
41
 #include <gpxe/iscsi.h>
42
 #include <gpxe/iscsi.h>
42
 #include <gpxe/ibft.h>
43
 #include <gpxe/ibft.h>
251
 static int ibft_fill_nic ( struct ibft_nic *nic,
252
 static int ibft_fill_nic ( struct ibft_nic *nic,
252
 			   struct ibft_string_block *strings,
253
 			   struct ibft_string_block *strings,
253
 			   struct net_device *netdev ) {
254
 			   struct net_device *netdev ) {
255
+	struct ll_protocol *ll_protocol = netdev->ll_protocol;
254
 	struct in_addr netmask_addr = { 0 };
256
 	struct in_addr netmask_addr = { 0 };
255
 	unsigned int netmask_count = 0;
257
 	unsigned int netmask_count = 0;
256
 	int rc;
258
 	int rc;
279
 	DBG ( "iBFT NIC subnet = /%d\n", nic->subnet_mask_prefix );
281
 	DBG ( "iBFT NIC subnet = /%d\n", nic->subnet_mask_prefix );
280
 
282
 
281
 	/* Extract values from net-device configuration */
283
 	/* Extract values from net-device configuration */
282
-	memcpy ( nic->mac_address, netdev->ll_addr,
283
-		 sizeof ( nic->mac_address ) );
284
-	DBG ( "iBFT NIC MAC = %s\n",
285
-	      netdev->ll_protocol->ntoa ( nic->mac_address ) );
284
+	if ( ( rc = ll_protocol->eth_addr ( netdev->ll_addr,
285
+					    nic->mac_address ) ) != 0 ) {
286
+		DBG ( "Could not determine iBFT MAC: %s\n", strerror ( rc ) );
287
+		return rc;
288
+	}
289
+	DBG ( "iBFT NIC MAC = %s\n", eth_ntoa ( nic->mac_address ) );
286
 	nic->pci_bus_dev_func = netdev->dev->desc.location;
290
 	nic->pci_bus_dev_func = netdev->dev->desc.location;
287
 	DBG ( "iBFT NIC PCI = %04x\n", nic->pci_bus_dev_func );
291
 	DBG ( "iBFT NIC PCI = %04x\n", nic->pci_bus_dev_func );
288
 
292
 

Loading…
Cancel
Save