Browse Source

[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 11 years ago
parent
commit
7d64abbc5d
1 changed files with 3 additions and 0 deletions
  1. 3
    0
      src/drivers/block/ibft.c

+ 3
- 0
src/drivers/block/ibft.c View File

37
 #include <ipxe/in.h>
37
 #include <ipxe/in.h>
38
 #include <ipxe/netdevice.h>
38
 #include <ipxe/netdevice.h>
39
 #include <ipxe/ethernet.h>
39
 #include <ipxe/ethernet.h>
40
+#include <ipxe/vlan.h>
40
 #include <ipxe/dhcp.h>
41
 #include <ipxe/dhcp.h>
41
 #include <ipxe/iscsi.h>
42
 #include <ipxe/iscsi.h>
42
 #include <ipxe/ibft.h>
43
 #include <ipxe/ibft.h>
264
 	DBG ( "iBFT NIC subnet = /%d\n", nic->subnet_mask_prefix );
265
 	DBG ( "iBFT NIC subnet = /%d\n", nic->subnet_mask_prefix );
265
 
266
 
266
 	/* Extract values from net-device configuration */
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
 	if ( ( rc = ll_protocol->eth_addr ( netdev->ll_addr,
270
 	if ( ( rc = ll_protocol->eth_addr ( netdev->ll_addr,
268
 					    nic->mac_address ) ) != 0 ) {
271
 					    nic->mac_address ) ) != 0 ) {
269
 		DBG ( "Could not determine iBFT MAC: %s\n", strerror ( rc ) );
272
 		DBG ( "Could not determine iBFT MAC: %s\n", strerror ( rc ) );

Loading…
Cancel
Save