Quellcode durchsuchen

[iscsi] Include 802.1Q VLAN identifier in iBFT

The iBFT NIC section has a VLAN field which must be filled in so that
iSCSI booting works over VLANs.

Unfortunately it is unclear from the IBM specification linked in
ibft.c whether the VLAN field is just the 802.1Q VLAN Identifier or
the full 802.1Q TCI.  For now just fill in the VID, the Priority Code
Point and Drop Eligible Indicator could be set in the future if it
turns out they should be present too.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Stefan Hajnoczi vor 11 Jahren
Ursprung
Commit
7d64abbc5d
1 geänderte Dateien mit 3 neuen und 0 gelöschten Zeilen
  1. 3
    0
      src/drivers/block/ibft.c

+ 3
- 0
src/drivers/block/ibft.c Datei anzeigen

@@ -37,6 +37,7 @@ FILE_LICENCE ( BSD2 );
37 37
 #include <ipxe/in.h>
38 38
 #include <ipxe/netdevice.h>
39 39
 #include <ipxe/ethernet.h>
40
+#include <ipxe/vlan.h>
40 41
 #include <ipxe/dhcp.h>
41 42
 #include <ipxe/iscsi.h>
42 43
 #include <ipxe/ibft.h>
@@ -264,6 +265,8 @@ static int ibft_fill_nic ( struct ibft_nic *nic,
264 265
 	DBG ( "iBFT NIC subnet = /%d\n", nic->subnet_mask_prefix );
265 266
 
266 267
 	/* Extract values from net-device configuration */
268
+	nic->vlan = cpu_to_le16 ( vlan_tag ( netdev ) );
269
+	DBG ( "iBFT NIC VLAN = %02x\n", le16_to_cpu ( nic->vlan ) );
267 270
 	if ( ( rc = ll_protocol->eth_addr ( netdev->ll_addr,
268 271
 					    nic->mac_address ) ) != 0 ) {
269 272
 		DBG ( "Could not determine iBFT MAC: %s\n", strerror ( rc ) );

Laden…
Abbrechen
Speichern