diff options
author | James Bottomley <JBottomley@Parallels.com> | 2013-03-01 09:09:51 +0000 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2013-03-01 09:10:08 +0000 |
commit | 3e34c1fc2b51f117045e4a2472572f14ac91df6e (patch) | |
tree | 12c7c79931e657483f965bc944861bc8a6a9694d /include | |
parent | c157750a901d767ecb95f1dbabd0972dee396b1e (diff) | |
parent | 1f953b0dbc2549318afcc0a70af5542dffbce34a (diff) | |
download | linux-3.10-3e34c1fc2b51f117045e4a2472572f14ac91df6e.tar.gz linux-3.10-3e34c1fc2b51f117045e4a2472572f14ac91df6e.tar.bz2 linux-3.10-3e34c1fc2b51f117045e4a2472572f14ac91df6e.zip |
[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/Kbuild | 4 | ||||
-rw-r--r-- | include/scsi/fcoe_sysfs.h | 11 | ||||
-rw-r--r-- | include/scsi/libfcoe.h | 32 | ||||
-rw-r--r-- | include/uapi/scsi/fc/Kbuild | 4 | ||||
-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 56603813c6c..e69de29bb2d 100644 --- a/include/scsi/fc/Kbuild +++ b/include/scsi/fc/Kbuild @@ -1,4 +0,0 @@ -header-y += fc_els.h -header-y += fc_fs.h -header-y += fc_gs.h -header-y += fc_ns.h diff --git a/include/scsi/fcoe_sysfs.h b/include/scsi/fcoe_sysfs.h index 604cb9bb3e7..7e231487034 100644 --- a/include/scsi/fcoe_sysfs.h +++ b/include/scsi/fcoe_sysfs.h @@ -34,7 +34,8 @@ struct fcoe_sysfs_function_template { void (*get_fcoe_ctlr_symb_err)(struct fcoe_ctlr_device *); void (*get_fcoe_ctlr_err_block)(struct fcoe_ctlr_device *); void (*get_fcoe_ctlr_fcs_error)(struct fcoe_ctlr_device *); - void (*get_fcoe_ctlr_mode)(struct fcoe_ctlr_device *); + void (*set_fcoe_ctlr_mode)(struct fcoe_ctlr_device *); + int (*set_fcoe_ctlr_enabled)(struct fcoe_ctlr_device *); void (*get_fcoe_fcf_selected)(struct fcoe_fcf_device *); void (*get_fcoe_fcf_vlan_id)(struct fcoe_fcf_device *); }; @@ -48,6 +49,12 @@ enum fip_conn_type { FIP_CONN_TYPE_VN2VN, }; +enum ctlr_enabled_state { + FCOE_CTLR_ENABLED, + FCOE_CTLR_DISABLED, + FCOE_CTLR_UNUSED, +}; + struct fcoe_ctlr_device { u32 id; @@ -64,6 +71,8 @@ struct fcoe_ctlr_device { int fcf_dev_loss_tmo; enum fip_conn_type mode; + enum ctlr_enabled_state enabled; + /* expected in host order for displaying */ struct fcoe_fc_els_lesb lesb; }; diff --git a/include/scsi/libfcoe.h b/include/scsi/libfcoe.h index 8742d853a3b..4427393115e 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, struct net_device *netdev); void fcoe_wwn_to_str(u64 wwn, char *buf, int len); int fcoe_validate_vport_create(struct fc_vport *vport); +int fcoe_link_speed_update(struct fc_lport *); +void fcoe_get_lesb(struct fc_lport *, struct fc_els_lesb *); +void fcoe_ctlr_get_lesb(struct fcoe_ctlr_device *ctlr_dev); /** * is_fip_mode() - returns true if FIP mode selected. @@ -289,8 +292,11 @@ static inline bool is_fip_mode(struct fcoe_ctlr *fip) * @attached: whether this transport is already attached * @list: list linkage to all attached transports * @match: handler to allow the transport driver to match up a given netdev + * @alloc: handler to allocate per-instance FCoE structures + * (no discovery or login) * @create: handler to sysfs entry of create for FCoE instances - * @destroy: handler to sysfs entry of destroy for FCoE instances + * @destroy: handler to delete per-instance FCoE structures + * (frees all memory) * @enable: handler to sysfs entry of enable for FCoE instances * @disable: handler to sysfs entry of disable for FCoE instances */ @@ -299,6 +305,7 @@ struct fcoe_transport { bool attached; struct list_head list; bool (*match) (struct net_device *device); + int (*alloc) (struct net_device *device); int (*create) (struct net_device *device, enum fip_state fip_mode); int (*destroy) (struct net_device *device); int (*enable) (struct net_device *device); @@ -347,7 +354,20 @@ struct fcoe_port { struct timer_list timer; struct work_struct destroy_work; u8 data_src_addr[ETH_ALEN]; + struct net_device * (*get_netdev)(const struct fc_lport *lport); }; + +/** + * fcoe_get_netdev() - Return the net device associated with a local port + * @lport: The local port to get the net device from + */ +static inline struct net_device *fcoe_get_netdev(const struct fc_lport *lport) +{ + struct fcoe_port *port = ((struct fcoe_port *)lport_priv(lport)); + + return (port->get_netdev) ? port->get_netdev(lport) : NULL; +} + void fcoe_clean_pending_queue(struct fc_lport *); void fcoe_check_wait_queue(struct fc_lport *lport, struct sk_buff *skb); void fcoe_queue_timer(ulong lport); @@ -356,7 +376,7 @@ int fcoe_get_paged_crc_eof(struct sk_buff *skb, int tlen, /* FCoE Sysfs helpers */ void fcoe_fcf_get_selected(struct fcoe_fcf_device *); -void fcoe_ctlr_get_fip_mode(struct fcoe_ctlr_device *); +void fcoe_ctlr_set_fip_mode(struct fcoe_ctlr_device *); /** * struct netdev_list @@ -372,4 +392,12 @@ struct fcoe_netdev_mapping { int fcoe_transport_attach(struct fcoe_transport *ft); int fcoe_transport_detach(struct fcoe_transport *ft); +/* sysfs store handler for ctrl_control interface */ +ssize_t fcoe_ctlr_create_store(struct bus_type *bus, + const char *buf, size_t count); +ssize_t fcoe_ctlr_destroy_store(struct bus_type *bus, + const char *buf, size_t count); + #endif /* _LIBFCOE_H */ + + diff --git a/include/uapi/scsi/fc/Kbuild b/include/uapi/scsi/fc/Kbuild index aafaa5aa54d..5ead9fac265 100644 --- a/include/uapi/scsi/fc/Kbuild +++ b/include/uapi/scsi/fc/Kbuild @@ -1 +1,5 @@ # UAPI Header export list +header-y += fc_els.h +header-y += fc_fs.h +header-y += fc_gs.h +header-y += fc_ns.h diff --git a/include/scsi/fc/fc_els.h b/include/uapi/scsi/fc/fc_els.h index 481abbd48e3..481abbd48e3 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 50f28b14345..50f28b14345 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 a37346d47eb..a37346d47eb 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 f7751d53f1d..f7751d53f1d 100644 --- a/include/scsi/fc/fc_ns.h +++ b/include/uapi/scsi/fc/fc_ns.h |