diff options
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/fcoe/fcoe.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c index fba7ba00c71b..28029a342892 100644 --- a/drivers/scsi/fcoe/fcoe.c +++ b/drivers/scsi/fcoe/fcoe.c | |||
@@ -555,6 +555,7 @@ static int fcoe_netdev_config(struct fc_lport *lport, struct net_device *netdev) | |||
555 | u64 wwnn, wwpn; | 555 | u64 wwnn, wwpn; |
556 | struct fcoe_interface *fcoe; | 556 | struct fcoe_interface *fcoe; |
557 | struct fcoe_port *port; | 557 | struct fcoe_port *port; |
558 | int vid = 0; | ||
558 | 559 | ||
559 | /* Setup lport private data to point to fcoe softc */ | 560 | /* Setup lport private data to point to fcoe softc */ |
560 | port = lport_priv(lport); | 561 | port = lport_priv(lport); |
@@ -599,10 +600,16 @@ static int fcoe_netdev_config(struct fc_lport *lport, struct net_device *netdev) | |||
599 | setup_timer(&port->timer, fcoe_queue_timer, (unsigned long)lport); | 600 | setup_timer(&port->timer, fcoe_queue_timer, (unsigned long)lport); |
600 | 601 | ||
601 | if (!lport->vport) { | 602 | if (!lport->vport) { |
603 | /* | ||
604 | * Use NAA 1&2 (FC-FS Rev. 2.0, Sec. 15) to generate WWNN/WWPN: | ||
605 | * For WWNN, we use NAA 1 w/ bit 27-16 of word 0 as 0. | ||
606 | * For WWPN, we use NAA 2 w/ bit 27-16 of word 0 from VLAN ID | ||
607 | */ | ||
608 | if (netdev->priv_flags & IFF_802_1Q_VLAN) | ||
609 | vid = vlan_dev_vlan_id(netdev); | ||
602 | wwnn = fcoe_wwn_from_mac(fcoe->ctlr.ctl_src_addr, 1, 0); | 610 | wwnn = fcoe_wwn_from_mac(fcoe->ctlr.ctl_src_addr, 1, 0); |
603 | fc_set_wwnn(lport, wwnn); | 611 | fc_set_wwnn(lport, wwnn); |
604 | /* XXX - 3rd arg needs to be vlan id */ | 612 | wwpn = fcoe_wwn_from_mac(fcoe->ctlr.ctl_src_addr, 2, vid); |
605 | wwpn = fcoe_wwn_from_mac(fcoe->ctlr.ctl_src_addr, 2, 0); | ||
606 | fc_set_wwpn(lport, wwpn); | 613 | fc_set_wwpn(lport, wwpn); |
607 | } | 614 | } |
608 | 615 | ||