aboutsummaryrefslogtreecommitdiffstats
path: root/include/scsi
diff options
context:
space:
mode:
authorRobert Love <robert.w.love@intel.com>2012-05-22 22:06:26 -0400
committerJames Bottomley <JBottomley@Parallels.com>2012-05-23 04:43:13 -0400
commit8d55e507d24c6db7eb012c379c62912e642eb75e (patch)
tree5118b221cf9eab4ad040c9e1bcabb794e57dc906 /include/scsi
parent9a74e884ee71dbf3d0967b0321d7b4529a04826c (diff)
[SCSI] fcoe, bnx2fc, libfcoe: SW FCoE and bnx2fc use FCoE Syfs
This patch has the SW FCoE driver and the bnx2fc driver make use of the new fcoe_sysfs API added earlier in this patch series. After this patch a fcoe_ctlr_device is allocated with private data in this order. +------------------+ +------------------+ | fcoe_ctlr_device | | fcoe_ctlr_device | +------------------+ +------------------+ | fcoe_ctlr | | fcoe_ctlr | +------------------+ +------------------+ | fcoe_interface | | bnx2fc_interface | +------------------+ +------------------+ libfcoe also takes part in this new model since it discovers and manages fcoe_fcf instances. The memory allocation is different for FCFs. I didn't want to impact libfcoe's fcoe_fcf processing, so this patch creates fcoe_fcf_device instances for each discovered fcoe_fcf. The two are paired using a (void * priv) member of the fcoe_ctlr_device. This allows libfcoe to continue maintaining its list of fcoe_fcf instances and simply attaches and detaches them from existing or new fcoe_fcf_device instances. Signed-off-by: Robert Love <robert.w.love@intel.com> Tested-by: Ross Brattain <ross.b.brattain@intel.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'include/scsi')
-rw-r--r--include/scsi/libfcoe.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/scsi/libfcoe.h b/include/scsi/libfcoe.h
index 7b93f211b935..22b07cc99808 100644
--- a/include/scsi/libfcoe.h
+++ b/include/scsi/libfcoe.h
@@ -168,9 +168,16 @@ static inline void *fcoe_ctlr_priv(const struct fcoe_ctlr *ctlr)
168 return (void *)(ctlr + 1); 168 return (void *)(ctlr + 1);
169} 169}
170 170
171#define fcoe_ctlr_to_ctlr_dev(x) \
172 (struct fcoe_ctlr_device *)(((struct fcoe_ctlr_device *)(x)) - 1)
173
171/** 174/**
172 * struct fcoe_fcf - Fibre-Channel Forwarder 175 * struct fcoe_fcf - Fibre-Channel Forwarder
173 * @list: list linkage 176 * @list: list linkage
177 * @event_work: Work for FC Transport actions queue
178 * @event: The event to be processed
179 * @fip: The controller that the FCF was discovered on
180 * @fcf_dev: The associated fcoe_fcf_device instance
174 * @time: system time (jiffies) when an advertisement was last received 181 * @time: system time (jiffies) when an advertisement was last received
175 * @switch_name: WWN of switch from advertisement 182 * @switch_name: WWN of switch from advertisement
176 * @fabric_name: WWN of fabric from advertisement 183 * @fabric_name: WWN of fabric from advertisement
@@ -192,6 +199,9 @@ static inline void *fcoe_ctlr_priv(const struct fcoe_ctlr *ctlr)
192 */ 199 */
193struct fcoe_fcf { 200struct fcoe_fcf {
194 struct list_head list; 201 struct list_head list;
202 struct work_struct event_work;
203 struct fcoe_ctlr *fip;
204 struct fcoe_fcf_device *fcf_dev;
195 unsigned long time; 205 unsigned long time;
196 206
197 u64 switch_name; 207 u64 switch_name;
@@ -208,6 +218,9 @@ struct fcoe_fcf {
208 u8 fd_flags:1; 218 u8 fd_flags:1;
209}; 219};
210 220
221#define fcoe_fcf_to_fcf_dev(x) \
222 ((x)->fcf_dev)
223
211/** 224/**
212 * struct fcoe_rport - VN2VN remote port 225 * struct fcoe_rport - VN2VN remote port
213 * @time: time of create or last beacon packet received from node 226 * @time: time of create or last beacon packet received from node
@@ -343,6 +356,10 @@ void fcoe_queue_timer(ulong lport);
343int fcoe_get_paged_crc_eof(struct sk_buff *skb, int tlen, 356int fcoe_get_paged_crc_eof(struct sk_buff *skb, int tlen,
344 struct fcoe_percpu_s *fps); 357 struct fcoe_percpu_s *fps);
345 358
359/* FCoE Sysfs helpers */
360void fcoe_fcf_get_selected(struct fcoe_fcf_device *);
361void fcoe_ctlr_get_fip_mode(struct fcoe_ctlr_device *);
362
346/** 363/**
347 * struct netdev_list 364 * struct netdev_list
348 * A mapping from netdevice to fcoe_transport 365 * A mapping from netdevice to fcoe_transport