diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/scsi/Kbuild | 3 | ||||
-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/scsi/scsi_host.h | 4 | ||||
-rw-r--r-- | include/uapi/scsi/Kbuild | 3 | ||||
-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 | ||||
-rw-r--r-- | include/uapi/scsi/scsi_bsg_fc.h (renamed from include/scsi/scsi_bsg_fc.h) | 0 | ||||
-rw-r--r-- | include/uapi/scsi/scsi_netlink.h (renamed from include/scsi/scsi_netlink.h) | 0 | ||||
-rw-r--r-- | include/uapi/scsi/scsi_netlink_fc.h (renamed from include/scsi/scsi_netlink_fc.h) | 0 |
14 files changed, 49 insertions, 12 deletions
diff --git a/include/scsi/Kbuild b/include/scsi/Kbuild index f2b94918994d..562ff9d591b8 100644 --- a/include/scsi/Kbuild +++ b/include/scsi/Kbuild | |||
@@ -1,4 +1 @@ | |||
1 | header-y += scsi_netlink.h | ||
2 | header-y += scsi_netlink_fc.h | ||
3 | header-y += scsi_bsg_fc.h | ||
4 | header-y += fc/ | header-y += fc/ | |
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 @@ | |||
1 | header-y += fc_els.h | ||
2 | header-y += fc_fs.h | ||
3 | header-y += fc_gs.h | ||
4 | header-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 | ||
52 | enum ctlr_enabled_state { | ||
53 | FCOE_CTLR_ENABLED, | ||
54 | FCOE_CTLR_DISABLED, | ||
55 | FCOE_CTLR_UNUSED, | ||
56 | }; | ||
57 | |||
51 | struct fcoe_ctlr_device { | 58 | struct 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); |
261 | void fcoe_wwn_to_str(u64 wwn, char *buf, int len); | 261 | void fcoe_wwn_to_str(u64 wwn, char *buf, int len); |
262 | int fcoe_validate_vport_create(struct fc_vport *vport); | 262 | int fcoe_validate_vport_create(struct fc_vport *vport); |
263 | int fcoe_link_speed_update(struct fc_lport *); | ||
264 | void fcoe_get_lesb(struct fc_lport *, struct fc_els_lesb *); | ||
265 | void 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 | */ | ||
364 | static 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 | |||
351 | void fcoe_clean_pending_queue(struct fc_lport *); | 371 | void fcoe_clean_pending_queue(struct fc_lport *); |
352 | void fcoe_check_wait_queue(struct fc_lport *lport, struct sk_buff *skb); | 372 | void fcoe_check_wait_queue(struct fc_lport *lport, struct sk_buff *skb); |
353 | void fcoe_queue_timer(ulong lport); | 373 | void 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 */ |
358 | void fcoe_fcf_get_selected(struct fcoe_fcf_device *); | 378 | void fcoe_fcf_get_selected(struct fcoe_fcf_device *); |
359 | void fcoe_ctlr_get_fip_mode(struct fcoe_ctlr_device *); | 379 | void 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 { | |||
372 | int fcoe_transport_attach(struct fcoe_transport *ft); | 392 | int fcoe_transport_attach(struct fcoe_transport *ft); |
373 | int fcoe_transport_detach(struct fcoe_transport *ft); | 393 | int fcoe_transport_detach(struct fcoe_transport *ft); |
374 | 394 | ||
395 | /* sysfs store handler for ctrl_control interface */ | ||
396 | ssize_t fcoe_ctlr_create_store(struct bus_type *bus, | ||
397 | const char *buf, size_t count); | ||
398 | ssize_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/scsi/scsi_host.h b/include/scsi/scsi_host.h index 49084807eb6b..2b6956e9853d 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h | |||
@@ -873,7 +873,7 @@ static inline unsigned int scsi_host_dif_capable(struct Scsi_Host *shost, unsign | |||
873 | SHOST_DIF_TYPE2_PROTECTION, | 873 | SHOST_DIF_TYPE2_PROTECTION, |
874 | SHOST_DIF_TYPE3_PROTECTION }; | 874 | SHOST_DIF_TYPE3_PROTECTION }; |
875 | 875 | ||
876 | if (target_type > SHOST_DIF_TYPE3_PROTECTION) | 876 | if (target_type >= ARRAY_SIZE(cap)) |
877 | return 0; | 877 | return 0; |
878 | 878 | ||
879 | return shost->prot_capabilities & cap[target_type] ? target_type : 0; | 879 | return shost->prot_capabilities & cap[target_type] ? target_type : 0; |
@@ -887,7 +887,7 @@ static inline unsigned int scsi_host_dix_capable(struct Scsi_Host *shost, unsign | |||
887 | SHOST_DIX_TYPE2_PROTECTION, | 887 | SHOST_DIX_TYPE2_PROTECTION, |
888 | SHOST_DIX_TYPE3_PROTECTION }; | 888 | SHOST_DIX_TYPE3_PROTECTION }; |
889 | 889 | ||
890 | if (target_type > SHOST_DIX_TYPE3_PROTECTION) | 890 | if (target_type >= ARRAY_SIZE(cap)) |
891 | return 0; | 891 | return 0; |
892 | 892 | ||
893 | return shost->prot_capabilities & cap[target_type]; | 893 | return shost->prot_capabilities & cap[target_type]; |
diff --git a/include/uapi/scsi/Kbuild b/include/uapi/scsi/Kbuild index 29a87dd26cfb..75746d52f208 100644 --- a/include/uapi/scsi/Kbuild +++ b/include/uapi/scsi/Kbuild | |||
@@ -1,2 +1,5 @@ | |||
1 | # UAPI Header export list | 1 | # UAPI Header export list |
2 | header-y += fc/ | 2 | header-y += fc/ |
3 | header-y += scsi_bsg_fc.h | ||
4 | header-y += scsi_netlink.h | ||
5 | header-y += scsi_netlink_fc.h | ||
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 |
2 | header-y += fc_els.h | ||
3 | header-y += fc_fs.h | ||
4 | header-y += fc_gs.h | ||
5 | header-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 | |||
diff --git a/include/scsi/scsi_bsg_fc.h b/include/uapi/scsi/scsi_bsg_fc.h index 3031b900b087..3031b900b087 100644 --- a/include/scsi/scsi_bsg_fc.h +++ b/include/uapi/scsi/scsi_bsg_fc.h | |||
diff --git a/include/scsi/scsi_netlink.h b/include/uapi/scsi/scsi_netlink.h index 62b4edab15d3..62b4edab15d3 100644 --- a/include/scsi/scsi_netlink.h +++ b/include/uapi/scsi/scsi_netlink.h | |||
diff --git a/include/scsi/scsi_netlink_fc.h b/include/uapi/scsi/scsi_netlink_fc.h index cbf76e479761..cbf76e479761 100644 --- a/include/scsi/scsi_netlink_fc.h +++ b/include/uapi/scsi/scsi_netlink_fc.h | |||