Commit 014f5c3f authored by Chris Leech's avatar Chris Leech Committed by James Bottomley

[SCSI] fcoe: Introduce and allocate fcoe_interface structure, 1:1 with net_device

In preparation for NPIV support, I'm splitting the fcoe instance structure
into two to remove the assumptions about it being 1:1 with the net_device.
There will now be two structures, one which is 1:1 with the underlying
net_device and one which is allocated per virtual SCSI/FC host.

fcoe_softc is renamed to fcoe_port for the per Scsi_Host FCoE private data.

Later patches with start moving shared stuff from fcoe_port to fcoe_interface
Signed-off-by: default avatarChris Leech <christopher.leech@intel.com>
Signed-off-by: default avatarRobert Love <robert.w.love@intel.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
parent af7f85d9
This diff is collapsed.
......@@ -75,10 +75,21 @@ struct fcoe_percpu_s {
};
/*
* the fcoe sw transport private data
* an FCoE interface, 1:1 with netdev
*/
struct fcoe_softc {
struct fcoe_interface {
struct list_head list;
/* This will be removed once all the shared values are
* moved out of fcoe_port */
struct fcoe_port *priv;
};
/*
* the FCoE private structure that's allocated along with the
* Scsi_Host and libfc fc_lport structures
*/
struct fcoe_port {
struct fcoe_interface *fcoe;
struct net_device *netdev;
struct fc_exch_mgr *oem; /* offload exchange manger */
struct packet_type fcoe_packet_type;
......@@ -89,12 +100,12 @@ struct fcoe_softc {
struct fcoe_ctlr ctlr;
};
#define fcoe_from_ctlr(fc) container_of(fc, struct fcoe_softc, ctlr)
#define fcoe_from_ctlr(port) container_of(port, struct fcoe_port, ctlr)
static inline struct net_device *fcoe_netdev(
const struct fc_lport *lp)
{
return ((struct fcoe_softc *)lport_priv(lp))->netdev;
return ((struct fcoe_port *)lport_priv(lp))->netdev;
}
#endif /* _FCOE_H_ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment