diff options
Diffstat (limited to 'drivers/scsi/fcoe/fcoe.c')
| -rw-r--r-- | drivers/scsi/fcoe/fcoe.c | 200 | 
1 files changed, 148 insertions, 52 deletions
diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c index 76e3d0b5bfa..fe30b1b65e1 100644 --- a/drivers/scsi/fcoe/fcoe.c +++ b/drivers/scsi/fcoe/fcoe.c @@ -41,6 +41,7 @@  #include <scsi/fc/fc_encaps.h>  #include <scsi/fc/fc_fip.h> +#include <scsi/fc/fc_fcoe.h>  #include <scsi/libfc.h>  #include <scsi/fc_frame.h> @@ -150,6 +151,21 @@ static int fcoe_vport_create(struct fc_vport *, bool disabled);  static int fcoe_vport_disable(struct fc_vport *, bool disable);  static void fcoe_set_vport_symbolic_name(struct fc_vport *);  static void fcoe_set_port_id(struct fc_lport *, u32, struct fc_frame *); +static void fcoe_ctlr_get_lesb(struct fcoe_ctlr_device *); +static void fcoe_fcf_get_vlan_id(struct fcoe_fcf_device *); + +static struct fcoe_sysfs_function_template fcoe_sysfs_templ = { +	.get_fcoe_ctlr_mode = fcoe_ctlr_get_fip_mode, +	.get_fcoe_ctlr_link_fail = fcoe_ctlr_get_lesb, +	.get_fcoe_ctlr_vlink_fail = fcoe_ctlr_get_lesb, +	.get_fcoe_ctlr_miss_fka = fcoe_ctlr_get_lesb, +	.get_fcoe_ctlr_symb_err = fcoe_ctlr_get_lesb, +	.get_fcoe_ctlr_err_block = fcoe_ctlr_get_lesb, +	.get_fcoe_ctlr_fcs_error = fcoe_ctlr_get_lesb, + +	.get_fcoe_fcf_selected = fcoe_fcf_get_selected, +	.get_fcoe_fcf_vlan_id = fcoe_fcf_get_vlan_id, +};  static struct libfc_function_template fcoe_libfc_fcn_templ = {  	.frame_send = fcoe_xmit, @@ -282,7 +298,7 @@ static struct scsi_host_template fcoe_shost_template = {  static int fcoe_interface_setup(struct fcoe_interface *fcoe,  				struct net_device *netdev)  { -	struct fcoe_ctlr *fip = &fcoe->ctlr; +	struct fcoe_ctlr *fip = fcoe_to_ctlr(fcoe);  	struct netdev_hw_addr *ha;  	struct net_device *real_dev;  	u8 flogi_maddr[ETH_ALEN]; @@ -366,7 +382,10 @@ static int fcoe_interface_setup(struct fcoe_interface *fcoe,  static struct fcoe_interface *fcoe_interface_create(struct net_device *netdev,  						    enum fip_state fip_mode)  { +	struct fcoe_ctlr_device *ctlr_dev; +	struct fcoe_ctlr *ctlr;  	struct fcoe_interface *fcoe; +	int size;  	int err;  	if (!try_module_get(THIS_MODULE)) { @@ -376,27 +395,32 @@ static struct fcoe_interface *fcoe_interface_create(struct net_device *netdev,  		goto out;  	} -	fcoe = kzalloc(sizeof(*fcoe), GFP_KERNEL); -	if (!fcoe) { -		FCOE_NETDEV_DBG(netdev, "Could not allocate fcoe structure\n"); +	size = sizeof(struct fcoe_ctlr) + sizeof(struct fcoe_interface); +	ctlr_dev = fcoe_ctlr_device_add(&netdev->dev, &fcoe_sysfs_templ, +					size); +	if (!ctlr_dev) { +		FCOE_DBG("Failed to add fcoe_ctlr_device\n");  		fcoe = ERR_PTR(-ENOMEM);  		goto out_putmod;  	} +	ctlr = fcoe_ctlr_device_priv(ctlr_dev); +	fcoe = fcoe_ctlr_priv(ctlr); +  	dev_hold(netdev);  	/*  	 * Initialize FIP.  	 */ -	fcoe_ctlr_init(&fcoe->ctlr, fip_mode); -	fcoe->ctlr.send = fcoe_fip_send; -	fcoe->ctlr.update_mac = fcoe_update_src_mac; -	fcoe->ctlr.get_src_addr = fcoe_get_src_mac; +	fcoe_ctlr_init(ctlr, fip_mode); +	ctlr->send = fcoe_fip_send; +	ctlr->update_mac = fcoe_update_src_mac; +	ctlr->get_src_addr = fcoe_get_src_mac;  	err = fcoe_interface_setup(fcoe, netdev);  	if (err) { -		fcoe_ctlr_destroy(&fcoe->ctlr); -		kfree(fcoe); +		fcoe_ctlr_destroy(ctlr); +		fcoe_ctlr_device_delete(ctlr_dev);  		dev_put(netdev);  		fcoe = ERR_PTR(err);  		goto out_putmod; @@ -419,7 +443,7 @@ out:  static void fcoe_interface_remove(struct fcoe_interface *fcoe)  {  	struct net_device *netdev = fcoe->netdev; -	struct fcoe_ctlr *fip = &fcoe->ctlr; +	struct fcoe_ctlr *fip = fcoe_to_ctlr(fcoe);  	u8 flogi_maddr[ETH_ALEN];  	const struct net_device_ops *ops; @@ -462,7 +486,8 @@ static void fcoe_interface_remove(struct fcoe_interface *fcoe)  static void fcoe_interface_cleanup(struct fcoe_interface *fcoe)  {  	struct net_device *netdev = fcoe->netdev; -	struct fcoe_ctlr *fip = &fcoe->ctlr; +	struct fcoe_ctlr *fip = fcoe_to_ctlr(fcoe); +	struct fcoe_ctlr_device *ctlr_dev = fcoe_ctlr_to_ctlr_dev(fip);  	rtnl_lock();  	if (!fcoe->removed) @@ -472,8 +497,8 @@ static void fcoe_interface_cleanup(struct fcoe_interface *fcoe)  	/* Release the self-reference taken during fcoe_interface_create() */  	/* tear-down the FCoE controller */  	fcoe_ctlr_destroy(fip); -	scsi_host_put(fcoe->ctlr.lp->host); -	kfree(fcoe); +	scsi_host_put(fip->lp->host); +	fcoe_ctlr_device_delete(ctlr_dev);  	dev_put(netdev);  	module_put(THIS_MODULE);  } @@ -493,9 +518,11 @@ static int fcoe_fip_recv(struct sk_buff *skb, struct net_device *netdev,  			 struct net_device *orig_dev)  {  	struct fcoe_interface *fcoe; +	struct fcoe_ctlr *ctlr;  	fcoe = container_of(ptype, struct fcoe_interface, fip_packet_type); -	fcoe_ctlr_recv(&fcoe->ctlr, skb); +	ctlr = fcoe_to_ctlr(fcoe); +	fcoe_ctlr_recv(ctlr, skb);  	return 0;  } @@ -645,11 +672,13 @@ static int fcoe_netdev_config(struct fc_lport *lport, struct net_device *netdev)  	u32 mfs;  	u64 wwnn, wwpn;  	struct fcoe_interface *fcoe; +	struct fcoe_ctlr *ctlr;  	struct fcoe_port *port;  	/* Setup lport private data to point to fcoe softc */  	port = lport_priv(lport);  	fcoe = port->priv; +	ctlr = fcoe_to_ctlr(fcoe);  	/*  	 * Determine max frame size based on underlying device and optional @@ -676,10 +705,10 @@ static int fcoe_netdev_config(struct fc_lport *lport, struct net_device *netdev)  	if (!lport->vport) {  		if (fcoe_get_wwn(netdev, &wwnn, NETDEV_FCOE_WWNN)) -			wwnn = fcoe_wwn_from_mac(fcoe->ctlr.ctl_src_addr, 1, 0); +			wwnn = fcoe_wwn_from_mac(ctlr->ctl_src_addr, 1, 0);  		fc_set_wwnn(lport, wwnn);  		if (fcoe_get_wwn(netdev, &wwpn, NETDEV_FCOE_WWPN)) -			wwpn = fcoe_wwn_from_mac(fcoe->ctlr.ctl_src_addr, +			wwpn = fcoe_wwn_from_mac(ctlr->ctl_src_addr,  						 2, 0);  		fc_set_wwpn(lport, wwpn);  	} @@ -1056,6 +1085,7 @@ static int fcoe_ddp_done(struct fc_lport *lport, u16 xid)  static struct fc_lport *fcoe_if_create(struct fcoe_interface *fcoe,  				       struct device *parent, int npiv)  { +	struct fcoe_ctlr *ctlr = fcoe_to_ctlr(fcoe);  	struct net_device *netdev = fcoe->netdev;  	struct fc_lport *lport, *n_port;  	struct fcoe_port *port; @@ -1119,7 +1149,7 @@ static struct fc_lport *fcoe_if_create(struct fcoe_interface *fcoe,  	}  	/* Initialize the library */ -	rc = fcoe_libfc_config(lport, &fcoe->ctlr, &fcoe_libfc_fcn_templ, 1); +	rc = fcoe_libfc_config(lport, ctlr, &fcoe_libfc_fcn_templ, 1);  	if (rc) {  		FCOE_NETDEV_DBG(netdev, "Could not configure libfc for the "  				"interface\n"); @@ -1386,6 +1416,7 @@ static int fcoe_rcv(struct sk_buff *skb, struct net_device *netdev,  {  	struct fc_lport *lport;  	struct fcoe_rcv_info *fr; +	struct fcoe_ctlr *ctlr;  	struct fcoe_interface *fcoe;  	struct fc_frame_header *fh;  	struct fcoe_percpu_s *fps; @@ -1393,7 +1424,8 @@ static int fcoe_rcv(struct sk_buff *skb, struct net_device *netdev,  	unsigned int cpu;  	fcoe = container_of(ptype, struct fcoe_interface, fcoe_packet_type); -	lport = fcoe->ctlr.lp; +	ctlr = fcoe_to_ctlr(fcoe); +	lport = ctlr->lp;  	if (unlikely(!lport)) {  		FCOE_NETDEV_DBG(netdev, "Cannot find hba structure");  		goto err2; @@ -1409,8 +1441,8 @@ static int fcoe_rcv(struct sk_buff *skb, struct net_device *netdev,  	eh = eth_hdr(skb); -	if (is_fip_mode(&fcoe->ctlr) && -	    compare_ether_addr(eh->h_source, fcoe->ctlr.dest_addr)) { +	if (is_fip_mode(ctlr) && +	    compare_ether_addr(eh->h_source, ctlr->dest_addr)) {  		FCOE_NETDEV_DBG(netdev, "wrong source mac address:%pM\n",  				eh->h_source);  		goto err; @@ -1544,6 +1576,7 @@ static int fcoe_xmit(struct fc_lport *lport, struct fc_frame *fp)  	unsigned int elen;		/* eth header, may include vlan */  	struct fcoe_port *port = lport_priv(lport);  	struct fcoe_interface *fcoe = port->priv; +	struct fcoe_ctlr *ctlr = fcoe_to_ctlr(fcoe);  	u8 sof, eof;  	struct fcoe_hdr *hp; @@ -1559,7 +1592,7 @@ static int fcoe_xmit(struct fc_lport *lport, struct fc_frame *fp)  	}  	if (unlikely(fh->fh_type == FC_TYPE_ELS) && -	    fcoe_ctlr_els_send(&fcoe->ctlr, lport, skb)) +	    fcoe_ctlr_els_send(ctlr, lport, skb))  		return 0;  	sof = fr_sof(fp); @@ -1623,12 +1656,12 @@ static int fcoe_xmit(struct fc_lport *lport, struct fc_frame *fp)  	/* fill up mac and fcoe headers */  	eh = eth_hdr(skb);  	eh->h_proto = htons(ETH_P_FCOE); -	memcpy(eh->h_dest, fcoe->ctlr.dest_addr, ETH_ALEN); -	if (fcoe->ctlr.map_dest) +	memcpy(eh->h_dest, ctlr->dest_addr, ETH_ALEN); +	if (ctlr->map_dest)  		memcpy(eh->h_dest + 3, fh->fh_d_id, 3); -	if (unlikely(fcoe->ctlr.flogi_oxid != FC_XID_UNKNOWN)) -		memcpy(eh->h_source, fcoe->ctlr.ctl_src_addr, ETH_ALEN); +	if (unlikely(ctlr->flogi_oxid != FC_XID_UNKNOWN)) +		memcpy(eh->h_source, ctlr->ctl_src_addr, ETH_ALEN);  	else  		memcpy(eh->h_source, port->data_src_addr, ETH_ALEN); @@ -1677,6 +1710,7 @@ static void fcoe_percpu_flush_done(struct sk_buff *skb)  static inline int fcoe_filter_frames(struct fc_lport *lport,  				     struct fc_frame *fp)  { +	struct fcoe_ctlr *ctlr;  	struct fcoe_interface *fcoe;  	struct fc_frame_header *fh;  	struct sk_buff *skb = (struct sk_buff *)fp; @@ -1698,7 +1732,8 @@ static inline int fcoe_filter_frames(struct fc_lport *lport,  		return 0;  	fcoe = ((struct fcoe_port *)lport_priv(lport))->priv; -	if (is_fip_mode(&fcoe->ctlr) && fc_frame_payload_op(fp) == ELS_LOGO && +	ctlr = fcoe_to_ctlr(fcoe); +	if (is_fip_mode(ctlr) && fc_frame_payload_op(fp) == ELS_LOGO &&  	    ntoh24(fh->fh_s_id) == FC_FID_FLOGI) {  		FCOE_DBG("fcoe: dropping FCoE lport LOGO in fip mode\n");  		return -EINVAL; @@ -1877,6 +1912,7 @@ static int fcoe_dcb_app_notification(struct notifier_block *notifier,  				     ulong event, void *ptr)  {  	struct dcb_app_type *entry = ptr; +	struct fcoe_ctlr *ctlr;  	struct fcoe_interface *fcoe;  	struct net_device *netdev;  	struct fcoe_port *port; @@ -1894,6 +1930,8 @@ static int fcoe_dcb_app_notification(struct notifier_block *notifier,  	if (!fcoe)  		return NOTIFY_OK; +	ctlr = fcoe_to_ctlr(fcoe); +  	if (entry->dcbx & DCB_CAP_DCBX_VER_CEE)  		prio = ffs(entry->app.priority) - 1;  	else @@ -1904,10 +1942,10 @@ static int fcoe_dcb_app_notification(struct notifier_block *notifier,  	if (entry->app.protocol == ETH_P_FIP ||  	    entry->app.protocol == ETH_P_FCOE) -		fcoe->ctlr.priority = prio; +		ctlr->priority = prio;  	if (entry->app.protocol == ETH_P_FCOE) { -		port = lport_priv(fcoe->ctlr.lp); +		port = lport_priv(ctlr->lp);  		port->priority = prio;  	} @@ -1929,6 +1967,7 @@ static int fcoe_device_notification(struct notifier_block *notifier,  {  	struct fc_lport *lport = NULL;  	struct net_device *netdev = ptr; +	struct fcoe_ctlr *ctlr;  	struct fcoe_interface *fcoe;  	struct fcoe_port *port;  	struct fcoe_dev_stats *stats; @@ -1938,7 +1977,8 @@ static int fcoe_device_notification(struct notifier_block *notifier,  	list_for_each_entry(fcoe, &fcoe_hostlist, list) {  		if (fcoe->netdev == netdev) { -			lport = fcoe->ctlr.lp; +			ctlr = fcoe_to_ctlr(fcoe); +			lport = ctlr->lp;  			break;  		}  	} @@ -1967,7 +2007,7 @@ static int fcoe_device_notification(struct notifier_block *notifier,  		break;  	case NETDEV_UNREGISTER:  		list_del(&fcoe->list); -		port = lport_priv(fcoe->ctlr.lp); +		port = lport_priv(ctlr->lp);  		queue_work(fcoe_wq, &port->destroy_work);  		goto out;  		break; @@ -1982,8 +2022,8 @@ static int fcoe_device_notification(struct notifier_block *notifier,  	fcoe_link_speed_update(lport);  	if (link_possible && !fcoe_link_ok(lport)) -		fcoe_ctlr_link_up(&fcoe->ctlr); -	else if (fcoe_ctlr_link_down(&fcoe->ctlr)) { +		fcoe_ctlr_link_up(ctlr); +	else if (fcoe_ctlr_link_down(ctlr)) {  		stats = per_cpu_ptr(lport->dev_stats, get_cpu());  		stats->LinkFailureCount++;  		put_cpu(); @@ -2003,6 +2043,7 @@ out:   */  static int fcoe_disable(struct net_device *netdev)  { +	struct fcoe_ctlr *ctlr;  	struct fcoe_interface *fcoe;  	int rc = 0; @@ -2013,8 +2054,9 @@ static int fcoe_disable(struct net_device *netdev)  	rtnl_unlock();  	if (fcoe) { -		fcoe_ctlr_link_down(&fcoe->ctlr); -		fcoe_clean_pending_queue(fcoe->ctlr.lp); +		ctlr = fcoe_to_ctlr(fcoe); +		fcoe_ctlr_link_down(ctlr); +		fcoe_clean_pending_queue(ctlr->lp);  	} else  		rc = -ENODEV; @@ -2032,6 +2074,7 @@ static int fcoe_disable(struct net_device *netdev)   */  static int fcoe_enable(struct net_device *netdev)  { +	struct fcoe_ctlr *ctlr;  	struct fcoe_interface *fcoe;  	int rc = 0; @@ -2040,11 +2083,17 @@ static int fcoe_enable(struct net_device *netdev)  	fcoe = fcoe_hostlist_lookup_port(netdev);  	rtnl_unlock(); -	if (!fcoe) +	if (!fcoe) {  		rc = -ENODEV; -	else if (!fcoe_link_ok(fcoe->ctlr.lp)) -		fcoe_ctlr_link_up(&fcoe->ctlr); +		goto out; +	} + +	ctlr = fcoe_to_ctlr(fcoe); +	if (!fcoe_link_ok(ctlr->lp)) +		fcoe_ctlr_link_up(ctlr); + +out:  	mutex_unlock(&fcoe_config_mutex);  	return rc;  } @@ -2059,6 +2108,7 @@ static int fcoe_enable(struct net_device *netdev)   */  static int fcoe_destroy(struct net_device *netdev)  { +	struct fcoe_ctlr *ctlr;  	struct fcoe_interface *fcoe;  	struct fc_lport *lport;  	struct fcoe_port *port; @@ -2071,7 +2121,8 @@ static int fcoe_destroy(struct net_device *netdev)  		rc = -ENODEV;  		goto out_nodev;  	} -	lport = fcoe->ctlr.lp; +	ctlr = fcoe_to_ctlr(fcoe); +	lport = ctlr->lp;  	port = lport_priv(lport);  	list_del(&fcoe->list);  	queue_work(fcoe_wq, &port->destroy_work); @@ -2126,7 +2177,8 @@ static void fcoe_dcb_create(struct fcoe_interface *fcoe)  	int dcbx;  	u8 fup, up;  	struct net_device *netdev = fcoe->realdev; -	struct fcoe_port *port = lport_priv(fcoe->ctlr.lp); +	struct fcoe_ctlr *ctlr = fcoe_to_ctlr(fcoe); +	struct fcoe_port *port = lport_priv(ctlr->lp);  	struct dcb_app app = {  				.priority = 0,  				.protocol = ETH_P_FCOE @@ -2149,7 +2201,7 @@ static void fcoe_dcb_create(struct fcoe_interface *fcoe)  		}  		port->priority = ffs(up) ? ffs(up) - 1 : 0; -		fcoe->ctlr.priority = ffs(fup) ? ffs(fup) - 1 : port->priority; +		ctlr->priority = ffs(fup) ? ffs(fup) - 1 : port->priority;  	}  #endif  } @@ -2166,6 +2218,8 @@ static void fcoe_dcb_create(struct fcoe_interface *fcoe)  static int fcoe_create(struct net_device *netdev, enum fip_state fip_mode)  {  	int rc = 0; +	struct fcoe_ctlr_device *ctlr_dev; +	struct fcoe_ctlr *ctlr;  	struct fcoe_interface *fcoe;  	struct fc_lport *lport; @@ -2184,7 +2238,9 @@ static int fcoe_create(struct net_device *netdev, enum fip_state fip_mode)  		goto out_nodev;  	} -	lport = fcoe_if_create(fcoe, &netdev->dev, 0); +	ctlr = fcoe_to_ctlr(fcoe); +	ctlr_dev = fcoe_ctlr_to_ctlr_dev(ctlr); +	lport = fcoe_if_create(fcoe, &ctlr_dev->dev, 0);  	if (IS_ERR(lport)) {  		printk(KERN_ERR "fcoe: Failed to create interface (%s)\n",  		       netdev->name); @@ -2195,7 +2251,7 @@ static int fcoe_create(struct net_device *netdev, enum fip_state fip_mode)  	}  	/* Make this the "master" N_Port */ -	fcoe->ctlr.lp = lport; +	ctlr->lp = lport;  	/* setup DCB priority attributes. */  	fcoe_dcb_create(fcoe); @@ -2208,7 +2264,7 @@ static int fcoe_create(struct net_device *netdev, enum fip_state fip_mode)  	fc_fabric_login(lport);  	if (!fcoe_link_ok(lport)) {  		rtnl_unlock(); -		fcoe_ctlr_link_up(&fcoe->ctlr); +		fcoe_ctlr_link_up(ctlr);  		mutex_unlock(&fcoe_config_mutex);  		return rc;  	} @@ -2320,11 +2376,12 @@ static int fcoe_reset(struct Scsi_Host *shost)  	struct fc_lport *lport = shost_priv(shost);  	struct fcoe_port *port = lport_priv(lport);  	struct fcoe_interface *fcoe = port->priv; +	struct fcoe_ctlr *ctlr = fcoe_to_ctlr(fcoe); -	fcoe_ctlr_link_down(&fcoe->ctlr); -	fcoe_clean_pending_queue(fcoe->ctlr.lp); -	if (!fcoe_link_ok(fcoe->ctlr.lp)) -		fcoe_ctlr_link_up(&fcoe->ctlr); +	fcoe_ctlr_link_down(ctlr); +	fcoe_clean_pending_queue(ctlr->lp); +	if (!fcoe_link_ok(ctlr->lp)) +		fcoe_ctlr_link_up(ctlr);  	return 0;  } @@ -2359,10 +2416,12 @@ fcoe_hostlist_lookup_port(const struct net_device *netdev)   */  static struct fc_lport *fcoe_hostlist_lookup(const struct net_device *netdev)  { +	struct fcoe_ctlr *ctlr;  	struct fcoe_interface *fcoe;  	fcoe = fcoe_hostlist_lookup_port(netdev); -	return (fcoe) ? fcoe->ctlr.lp : NULL; +	ctlr = fcoe_to_ctlr(fcoe); +	return (fcoe) ? ctlr->lp : NULL;  }  /** @@ -2466,6 +2525,7 @@ module_init(fcoe_init);  static void __exit fcoe_exit(void)  {  	struct fcoe_interface *fcoe, *tmp; +	struct fcoe_ctlr *ctlr;  	struct fcoe_port *port;  	unsigned int cpu; @@ -2477,7 +2537,8 @@ static void __exit fcoe_exit(void)  	rtnl_lock();  	list_for_each_entry_safe(fcoe, tmp, &fcoe_hostlist, list) {  		list_del(&fcoe->list); -		port = lport_priv(fcoe->ctlr.lp); +		ctlr = fcoe_to_ctlr(fcoe); +		port = lport_priv(ctlr->lp);  		queue_work(fcoe_wq, &port->destroy_work);  	}  	rtnl_unlock(); @@ -2573,7 +2634,7 @@ static struct fc_seq *fcoe_elsct_send(struct fc_lport *lport, u32 did,  {  	struct fcoe_port *port = lport_priv(lport);  	struct fcoe_interface *fcoe = port->priv; -	struct fcoe_ctlr *fip = &fcoe->ctlr; +	struct fcoe_ctlr *fip = fcoe_to_ctlr(fcoe);  	struct fc_frame_header *fh = fc_frame_header_get(fp);  	switch (op) { @@ -2730,6 +2791,40 @@ static void fcoe_get_lesb(struct fc_lport *lport,  	__fcoe_get_lesb(lport, fc_lesb, netdev);  } +static void fcoe_ctlr_get_lesb(struct fcoe_ctlr_device *ctlr_dev) +{ +	struct fcoe_ctlr *fip = fcoe_ctlr_device_priv(ctlr_dev); +	struct net_device *netdev = fcoe_netdev(fip->lp); +	struct fcoe_fc_els_lesb *fcoe_lesb; +	struct fc_els_lesb fc_lesb; + +	__fcoe_get_lesb(fip->lp, &fc_lesb, netdev); +	fcoe_lesb = (struct fcoe_fc_els_lesb *)(&fc_lesb); + +	ctlr_dev->lesb.lesb_link_fail = +		ntohl(fcoe_lesb->lesb_link_fail); +	ctlr_dev->lesb.lesb_vlink_fail = +		ntohl(fcoe_lesb->lesb_vlink_fail); +	ctlr_dev->lesb.lesb_miss_fka = +		ntohl(fcoe_lesb->lesb_miss_fka); +	ctlr_dev->lesb.lesb_symb_err = +		ntohl(fcoe_lesb->lesb_symb_err); +	ctlr_dev->lesb.lesb_err_block = +		ntohl(fcoe_lesb->lesb_err_block); +	ctlr_dev->lesb.lesb_fcs_error = +		ntohl(fcoe_lesb->lesb_fcs_error); +} + +static void fcoe_fcf_get_vlan_id(struct fcoe_fcf_device *fcf_dev) +{ +	struct fcoe_ctlr_device *ctlr_dev = +		fcoe_fcf_dev_to_ctlr_dev(fcf_dev); +	struct fcoe_ctlr *ctlr = fcoe_ctlr_device_priv(ctlr_dev); +	struct fcoe_interface *fcoe = fcoe_ctlr_priv(ctlr); + +	fcf_dev->vlan_id = vlan_dev_vlan_id(fcoe->netdev); +} +  /**   * fcoe_set_port_id() - Callback from libfc when Port_ID is set.   * @lport: the local port @@ -2747,7 +2842,8 @@ static void fcoe_set_port_id(struct fc_lport *lport,  {  	struct fcoe_port *port = lport_priv(lport);  	struct fcoe_interface *fcoe = port->priv; +	struct fcoe_ctlr *ctlr = fcoe_to_ctlr(fcoe);  	if (fp && fc_frame_payload_op(fp) == ELS_FLOGI) -		fcoe_ctlr_recv_flogi(&fcoe->ctlr, lport, fp); +		fcoe_ctlr_recv_flogi(ctlr, lport, fp);  }  |