Kaynağa Gözat

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

tags/v1.0.0-rc1
Michael Brown 14 yıl önce
ebeveyn
işleme
45044acea7
1 değiştirilmiş dosya ile 8 ekleme ve 4 silme
  1. 8
    4
      src/arch/i386/interface/pcbios/ibft.c

+ 8
- 4
src/arch/i386/interface/pcbios/ibft.c Dosyayı Görüntüle

@@ -37,6 +37,7 @@ FILE_LICENCE ( BSD2 );
37 37
 #include <gpxe/acpi.h>
38 38
 #include <gpxe/in.h>
39 39
 #include <gpxe/netdevice.h>
40
+#include <gpxe/ethernet.h>
40 41
 #include <gpxe/dhcp.h>
41 42
 #include <gpxe/iscsi.h>
42 43
 #include <gpxe/ibft.h>
@@ -251,6 +252,7 @@ static const char * ibft_string ( struct ibft_string_block *strings,
251 252
 static int ibft_fill_nic ( struct ibft_nic *nic,
252 253
 			   struct ibft_string_block *strings,
253 254
 			   struct net_device *netdev ) {
255
+	struct ll_protocol *ll_protocol = netdev->ll_protocol;
254 256
 	struct in_addr netmask_addr = { 0 };
255 257
 	unsigned int netmask_count = 0;
256 258
 	int rc;
@@ -279,10 +281,12 @@ static int ibft_fill_nic ( struct ibft_nic *nic,
279 281
 	DBG ( "iBFT NIC subnet = /%d\n", nic->subnet_mask_prefix );
280 282
 
281 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 290
 	nic->pci_bus_dev_func = netdev->dev->desc.location;
287 291
 	DBG ( "iBFT NIC PCI = %04x\n", nic->pci_bus_dev_func );
288 292
 

Loading…
İptal
Kaydet