aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJames Bottomley <JBottomley@Parallels.com>2013-03-01 04:09:51 -0500
committerJames Bottomley <JBottomley@Parallels.com>2013-03-01 04:10:08 -0500
commit3e34c1fc2b51f117045e4a2472572f14ac91df6e (patch)
tree12c7c79931e657483f965bc944861bc8a6a9694d /include
parentc157750a901d767ecb95f1dbabd0972dee396b1e (diff)
parent1f953b0dbc2549318afcc0a70af5542dffbce34a (diff)
[SCSI] Merge tag 'fcoe-02-19-13' into for-linus
FCoE Updates for 3.9 Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'include')
-rw-r--r--include/scsi/fc/Kbuild4
-rw-r--r--include/scsi/fcoe_sysfs.h11
-rw-r--r--include/scsi/libfcoe.h32
-rw-r--r--include/uapi/scsi/fc/Kbuild4
-rw-r--r--include/uapi/scsi/fc/fc_els.h (renamed from include/scsi/fc/fc_els.h)0
-rw-r--r--include/uapi/scsi/fc/fc_fs.h (renamed from include/scsi/fc/fc_fs.h)0
-rw-r--r--include/uapi/scsi/fc/fc_gs.h (renamed from include/scsi/fc/fc_gs.h)0
-rw-r--r--include/uapi/scsi/fc/fc_ns.h (renamed from include/scsi/fc/fc_ns.h)0
8 files changed, 44 insertions, 7 deletions
diff --git a/include/scsi/fc/Kbuild b/include/scsi/fc/Kbuild
index 56603813c6cd..e69de29bb2d1 100644
--- a/include/scsi/fc/Kbuild
+++ b/include/scsi/fc/Kbuild
@@ -1,4 +0,0 @@
1header-y += fc_els.h
2header-y += fc_fs.h
3header-y += fc_gs.h
4header-y += fc_ns.h
diff --git a/include/scsi/fcoe_sysfs.h b/include/scsi/fcoe_sysfs.h
index 604cb9bb3e76..7e2314870341 100644
--- a/include/scsi/fcoe_sysfs.h
+++ b/include/scsi/fcoe_sysfs.h
@@ -34,7 +34,8 @@ struct fcoe_sysfs_function_template {
34 void (*get_fcoe_ctlr_symb_err)(struct fcoe_ctlr_device *); 34 void (*get_fcoe_ctlr_symb_err)(struct fcoe_ctlr_device *);
35 void (*get_fcoe_ctlr_err_block)(struct fcoe_ctlr_device *); 35 void (*get_fcoe_ctlr_err_block)(struct fcoe_ctlr_device *);
36 void (*get_fcoe_ctlr_fcs_error)(struct fcoe_ctlr_device *); 36 void (*get_fcoe_ctlr_fcs_error)(struct fcoe_ctlr_device *);
37 void (*get_fcoe_ctlr_mode)(struct fcoe_ctlr_device *); 37 void (*set_fcoe_ctlr_mode)(struct fcoe_ctlr_device *);
38 int (*set_fcoe_ctlr_enabled)(struct fcoe_ctlr_device *);
38 void (*get_fcoe_fcf_selected)(struct fcoe_fcf_device *); 39 void (*get_fcoe_fcf_selected)(struct fcoe_fcf_device *);
39 void (*get_fcoe_fcf_vlan_id)(struct fcoe_fcf_device *); 40 void (*get_fcoe_fcf_vlan_id)(struct fcoe_fcf_device *);
40}; 41};
@@ -48,6 +49,12 @@ enum fip_conn_type {
48 FIP_CONN_TYPE_VN2VN, 49 FIP_CONN_TYPE_VN2VN,
49}; 50};
50 51
52enum ctlr_enabled_state {
53 FCOE_CTLR_ENABLED,
54 FCOE_CTLR_DISABLED,
55 FCOE_CTLR_UNUSED,
56};
57
51struct fcoe_ctlr_device { 58struct fcoe_ctlr_device {
52 u32 id; 59 u32 id;
53 60
@@ -64,6 +71,8 @@ struct fcoe_ctlr_device {
64 int fcf_dev_loss_tmo; 71 int fcf_dev_loss_tmo;
65 enum fip_conn_type mode; 72 enum fip_conn_type mode;
66 73
74 enum ctlr_enabled_state enabled;
75
67 /* expected in host order for displaying */ 76 /* expected in host order for displaying */
68 struct fcoe_fc_els_lesb lesb; 77 struct fcoe_fc_els_lesb lesb;
69}; 78};
diff --git a/include/scsi/libfcoe.h b/include/scsi/libfcoe.h
index 8742d853a3b8..4427393115ea 100644
--- a/include/scsi/libfcoe.h
+++ b/include/scsi/libfcoe.h
@@ -260,6 +260,9 @@ void __fcoe_get_lesb(struct fc_lport *lport, struct fc_els_lesb *fc_lesb,
260 struct net_device *netdev); 260 struct net_device *netdev);
261void fcoe_wwn_to_str(u64 wwn, char *buf, int len); 261void fcoe_wwn_to_str(u64 wwn, char *buf, int len);
262int fcoe_validate_vport_create(struct fc_vport *vport); 262int fcoe_validate_vport_create(struct fc_vport *vport);
263int fcoe_link_speed_update(struct fc_lport *);
264void fcoe_get_lesb(struct fc_lport *, struct fc_els_lesb *);
265void fcoe_ctlr_get_lesb(struct fcoe_ctlr_device *ctlr_dev);
263 266
264/** 267/**
265 * is_fip_mode() - returns true if FIP mode selected. 268 * is_fip_mode() - returns true if FIP mode selected.
@@ -289,8 +292,11 @@ static inline bool is_fip_mode(struct fcoe_ctlr *fip)
289 * @attached: whether this transport is already attached 292 * @attached: whether this transport is already attached
290 * @list: list linkage to all attached transports 293 * @list: list linkage to all attached transports
291 * @match: handler to allow the transport driver to match up a given netdev 294 * @match: handler to allow the transport driver to match up a given netdev
295 * @alloc: handler to allocate per-instance FCoE structures
296 * (no discovery or login)
292 * @create: handler to sysfs entry of create for FCoE instances 297 * @create: handler to sysfs entry of create for FCoE instances
293 * @destroy: handler to sysfs entry of destroy for FCoE instances 298 * @destroy: handler to delete per-instance FCoE structures
299 * (frees all memory)
294 * @enable: handler to sysfs entry of enable for FCoE instances 300 * @enable: handler to sysfs entry of enable for FCoE instances
295 * @disable: handler to sysfs entry of disable for FCoE instances 301 * @disable: handler to sysfs entry of disable for FCoE instances
296 */ 302 */
@@ -299,6 +305,7 @@ struct fcoe_transport {
299 bool attached; 305 bool attached;
300 struct list_head list; 306 struct list_head list;
301 bool (*match) (struct net_device *device); 307 bool (*match) (struct net_device *device);
308 int (*alloc) (struct net_device *device);
302 int (*create) (struct net_device *device, enum fip_state fip_mode); 309 int (*create) (struct net_device *device, enum fip_state fip_mode);
303 int (*destroy) (struct net_device *device); 310 int (*destroy) (struct net_device *device);
304 int (*enable) (struct net_device *device); 311 int (*enable) (struct net_device *device);
@@ -347,7 +354,20 @@ struct fcoe_port {
347 struct timer_list timer; 354 struct timer_list timer;
348 struct work_struct destroy_work; 355 struct work_struct destroy_work;
349 u8 data_src_addr[ETH_ALEN]; 356 u8 data_src_addr[ETH_ALEN];
357 struct net_device * (*get_netdev)(const struct fc_lport *lport);
350}; 358};
359
360/**
361 * fcoe_get_netdev() - Return the net device associated with a local port
362 * @lport: The local port to get the net device from
363 */
364static inline struct net_device *fcoe_get_netdev(const struct fc_lport *lport)
365{
366 struct fcoe_port *port = ((struct fcoe_port *)lport_priv(lport));
367
368 return (port->get_netdev) ? port->get_netdev(lport) : NULL;
369}
370
351void fcoe_clean_pending_queue(struct fc_lport *); 371void fcoe_clean_pending_queue(struct fc_lport *);
352void fcoe_check_wait_queue(struct fc_lport *lport, struct sk_buff *skb); 372void fcoe_check_wait_queue(struct fc_lport *lport, struct sk_buff *skb);
353void fcoe_queue_timer(ulong lport); 373void fcoe_queue_timer(ulong lport);
@@ -356,7 +376,7 @@ int fcoe_get_paged_crc_eof(struct sk_buff *skb, int tlen,
356 376
357/* FCoE Sysfs helpers */ 377/* FCoE Sysfs helpers */
358void fcoe_fcf_get_selected(struct fcoe_fcf_device *); 378void fcoe_fcf_get_selected(struct fcoe_fcf_device *);
359void fcoe_ctlr_get_fip_mode(struct fcoe_ctlr_device *); 379void fcoe_ctlr_set_fip_mode(struct fcoe_ctlr_device *);
360 380
361/** 381/**
362 * struct netdev_list 382 * struct netdev_list
@@ -372,4 +392,12 @@ struct fcoe_netdev_mapping {
372int fcoe_transport_attach(struct fcoe_transport *ft); 392int fcoe_transport_attach(struct fcoe_transport *ft);
373int fcoe_transport_detach(struct fcoe_transport *ft); 393int fcoe_transport_detach(struct fcoe_transport *ft);
374 394
395/* sysfs store handler for ctrl_control interface */
396ssize_t fcoe_ctlr_create_store(struct bus_type *bus,
397 const char *buf, size_t count);
398ssize_t fcoe_ctlr_destroy_store(struct bus_type *bus,
399 const char *buf, size_t count);
400
375#endif /* _LIBFCOE_H */ 401#endif /* _LIBFCOE_H */
402
403
diff --git a/include/uapi/scsi/fc/Kbuild b/include/uapi/scsi/fc/Kbuild
index aafaa5aa54d4..5ead9fac265c 100644
--- a/include/uapi/scsi/fc/Kbuild
+++ b/include/uapi/scsi/fc/Kbuild
@@ -1 +1,5 @@
1# UAPI Header export list 1# UAPI Header export list
2header-y += fc_els.h
3header-y += fc_fs.h
4header-y += fc_gs.h
5header-y += fc_ns.h
diff --git a/include/scsi/fc/fc_els.h b/include/uapi/scsi/fc/fc_els.h
index 481abbd48e39..481abbd48e39 100644
--- a/include/scsi/fc/fc_els.h
+++ b/include/uapi/scsi/fc/fc_els.h
diff --git a/include/scsi/fc/fc_fs.h b/include/uapi/scsi/fc/fc_fs.h
index 50f28b143451..50f28b143451 100644
--- a/include/scsi/fc/fc_fs.h
+++ b/include/uapi/scsi/fc/fc_fs.h
diff --git a/include/scsi/fc/fc_gs.h b/include/uapi/scsi/fc/fc_gs.h
index a37346d47eb1..a37346d47eb1 100644
--- a/include/scsi/fc/fc_gs.h
+++ b/include/uapi/scsi/fc/fc_gs.h
diff --git a/include/scsi/fc/fc_ns.h b/include/uapi/scsi/fc/fc_ns.h
index f7751d53f1d3..f7751d53f1d3 100644
--- a/include/scsi/fc/fc_ns.h
+++ b/include/uapi/scsi/fc/fc_ns.h