]> Pileus Git - ~andy/linux/blobdiff - include/scsi/libfcoe.h
Merge branch 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild
[~andy/linux] / include / scsi / libfcoe.h
index 4427393115ea22b2e06ba5bcb8c9a19384700bca..de7e3ee60f0cd845f518a331fbd5bdc35a776457 100644 (file)
@@ -90,6 +90,7 @@ enum fip_state {
  * @lp:                   &fc_lport: libfc local port.
  * @sel_fcf:      currently selected FCF, or NULL.
  * @fcfs:         list of discovered FCFs.
+ * @cdev:          (Optional) pointer to sysfs fcoe_ctlr_device.
  * @fcf_count:    number of discovered FCF entries.
  * @sol_time:     time when a multicast solicitation was last sent.
  * @sel_time:     time after which to select an FCF.
@@ -127,6 +128,7 @@ struct fcoe_ctlr {
        struct fc_lport *lp;
        struct fcoe_fcf *sel_fcf;
        struct list_head fcfs;
+       struct fcoe_ctlr_device *cdev;
        u16 fcf_count;
        unsigned long sol_time;
        unsigned long sel_time;
@@ -168,8 +170,11 @@ static inline void *fcoe_ctlr_priv(const struct fcoe_ctlr *ctlr)
        return (void *)(ctlr + 1);
 }
 
+/*
+ * This assumes that the fcoe_ctlr (x) is allocated with the fcoe_ctlr_device.
+ */
 #define fcoe_ctlr_to_ctlr_dev(x)                                       \
-       (struct fcoe_ctlr_device *)(((struct fcoe_ctlr_device *)(x)) - 1)
+       (x)->cdev
 
 /**
  * struct fcoe_fcf - Fibre-Channel Forwarder