diff options
Diffstat (limited to 'include/scsi')
| -rw-r--r-- | include/scsi/fc/fc_fcp.h | 2 | ||||
| -rw-r--r-- | include/scsi/fc/fc_ns.h | 11 | ||||
| -rw-r--r-- | include/scsi/fc_encode.h | 26 | ||||
| -rw-r--r-- | include/scsi/iscsi_if.h | 2 | ||||
| -rw-r--r-- | include/scsi/libfc.h | 82 | ||||
| -rw-r--r-- | include/scsi/libfcoe.h | 105 | ||||
| -rw-r--r-- | include/scsi/libiscsi.h | 8 | ||||
| -rw-r--r-- | include/scsi/libiscsi_tcp.h | 3 | ||||
| -rw-r--r-- | include/scsi/osd_initiator.h | 2 | ||||
| -rw-r--r-- | include/scsi/sas_ata.h | 22 | ||||
| -rw-r--r-- | include/scsi/scsi.h | 6 | ||||
| -rw-r--r-- | include/scsi/scsi_device.h | 3 | ||||
| -rw-r--r-- | include/scsi/scsi_host.h | 2 | ||||
| -rw-r--r-- | include/scsi/scsi_transport_fc.h | 6 | ||||
| -rw-r--r-- | include/scsi/scsi_transport_iscsi.h | 6 |
15 files changed, 255 insertions, 31 deletions
diff --git a/include/scsi/fc/fc_fcp.h b/include/scsi/fc/fc_fcp.h index 8a143ca79878..652dec230514 100644 --- a/include/scsi/fc/fc_fcp.h +++ b/include/scsi/fc/fc_fcp.h | |||
| @@ -75,7 +75,7 @@ struct fcp_cmnd32 { | |||
| 75 | #define FCP_PTA_SIMPLE 0 /* simple task attribute */ | 75 | #define FCP_PTA_SIMPLE 0 /* simple task attribute */ |
| 76 | #define FCP_PTA_HEADQ 1 /* head of queue task attribute */ | 76 | #define FCP_PTA_HEADQ 1 /* head of queue task attribute */ |
| 77 | #define FCP_PTA_ORDERED 2 /* ordered task attribute */ | 77 | #define FCP_PTA_ORDERED 2 /* ordered task attribute */ |
| 78 | #define FCP_PTA_ACA 4 /* auto. contigent allegiance */ | 78 | #define FCP_PTA_ACA 4 /* auto. contingent allegiance */ |
| 79 | #define FCP_PTA_MASK 7 /* mask for task attribute field */ | 79 | #define FCP_PTA_MASK 7 /* mask for task attribute field */ |
| 80 | #define FCP_PRI_SHIFT 3 /* priority field starts in bit 3 */ | 80 | #define FCP_PRI_SHIFT 3 /* priority field starts in bit 3 */ |
| 81 | #define FCP_PRI_RESVD_MASK 0x80 /* reserved bits in priority field */ | 81 | #define FCP_PRI_RESVD_MASK 0x80 /* reserved bits in priority field */ |
diff --git a/include/scsi/fc/fc_ns.h b/include/scsi/fc/fc_ns.h index 185015dd1166..f7751d53f1d3 100644 --- a/include/scsi/fc/fc_ns.h +++ b/include/scsi/fc/fc_ns.h | |||
| @@ -41,6 +41,7 @@ enum fc_ns_req { | |||
| 41 | FC_NS_GI_A = 0x0101, /* get identifiers - scope */ | 41 | FC_NS_GI_A = 0x0101, /* get identifiers - scope */ |
| 42 | FC_NS_GPN_ID = 0x0112, /* get port name by ID */ | 42 | FC_NS_GPN_ID = 0x0112, /* get port name by ID */ |
| 43 | FC_NS_GNN_ID = 0x0113, /* get node name by ID */ | 43 | FC_NS_GNN_ID = 0x0113, /* get node name by ID */ |
| 44 | FC_NS_GSPN_ID = 0x0118, /* get symbolic port name */ | ||
| 44 | FC_NS_GID_PN = 0x0121, /* get ID for port name */ | 45 | FC_NS_GID_PN = 0x0121, /* get ID for port name */ |
| 45 | FC_NS_GID_NN = 0x0131, /* get IDs for node name */ | 46 | FC_NS_GID_NN = 0x0131, /* get IDs for node name */ |
| 46 | FC_NS_GID_FT = 0x0171, /* get IDs by FC4 type */ | 47 | FC_NS_GID_FT = 0x0171, /* get IDs by FC4 type */ |
| @@ -144,7 +145,7 @@ struct fc_ns_gid_pn { | |||
| 144 | }; | 145 | }; |
| 145 | 146 | ||
| 146 | /* | 147 | /* |
| 147 | * GID_PN response | 148 | * GID_PN response or GSPN_ID request |
| 148 | */ | 149 | */ |
| 149 | struct fc_gid_pn_resp { | 150 | struct fc_gid_pn_resp { |
| 150 | __u8 fp_resvd; | 151 | __u8 fp_resvd; |
| @@ -152,6 +153,14 @@ struct fc_gid_pn_resp { | |||
| 152 | }; | 153 | }; |
| 153 | 154 | ||
| 154 | /* | 155 | /* |
| 156 | * GSPN_ID response | ||
| 157 | */ | ||
| 158 | struct fc_gspn_resp { | ||
| 159 | __u8 fp_name_len; | ||
| 160 | char fp_name[]; | ||
| 161 | }; | ||
| 162 | |||
| 163 | /* | ||
| 155 | * RFT_ID request - register FC-4 types for ID. | 164 | * RFT_ID request - register FC-4 types for ID. |
| 156 | */ | 165 | */ |
| 157 | struct fc_ns_rft_id { | 166 | struct fc_ns_rft_id { |
diff --git a/include/scsi/fc_encode.h b/include/scsi/fc_encode.h index 6d293c846a46..be418d8448a5 100644 --- a/include/scsi/fc_encode.h +++ b/include/scsi/fc_encode.h | |||
| @@ -46,16 +46,11 @@ struct fc_ct_req { | |||
| 46 | } payload; | 46 | } payload; |
| 47 | }; | 47 | }; |
| 48 | 48 | ||
| 49 | /** | 49 | static inline void __fc_fill_fc_hdr(struct fc_frame_header *fh, |
| 50 | * fill FC header fields in specified fc_frame | 50 | enum fc_rctl r_ctl, |
| 51 | */ | 51 | u32 did, u32 sid, enum fc_fh_type type, |
| 52 | static inline void fc_fill_fc_hdr(struct fc_frame *fp, enum fc_rctl r_ctl, | 52 | u32 f_ctl, u32 parm_offset) |
| 53 | u32 did, u32 sid, enum fc_fh_type type, | ||
| 54 | u32 f_ctl, u32 parm_offset) | ||
| 55 | { | 53 | { |
| 56 | struct fc_frame_header *fh; | ||
| 57 | |||
| 58 | fh = fc_frame_header_get(fp); | ||
| 59 | WARN_ON(r_ctl == 0); | 54 | WARN_ON(r_ctl == 0); |
| 60 | fh->fh_r_ctl = r_ctl; | 55 | fh->fh_r_ctl = r_ctl; |
| 61 | hton24(fh->fh_d_id, did); | 56 | hton24(fh->fh_d_id, did); |
| @@ -68,6 +63,19 @@ static inline void fc_fill_fc_hdr(struct fc_frame *fp, enum fc_rctl r_ctl, | |||
| 68 | } | 63 | } |
| 69 | 64 | ||
| 70 | /** | 65 | /** |
| 66 | * fill FC header fields in specified fc_frame | ||
| 67 | */ | ||
| 68 | static inline void fc_fill_fc_hdr(struct fc_frame *fp, enum fc_rctl r_ctl, | ||
| 69 | u32 did, u32 sid, enum fc_fh_type type, | ||
| 70 | u32 f_ctl, u32 parm_offset) | ||
| 71 | { | ||
| 72 | struct fc_frame_header *fh; | ||
| 73 | |||
| 74 | fh = fc_frame_header_get(fp); | ||
| 75 | __fc_fill_fc_hdr(fh, r_ctl, did, sid, type, f_ctl, parm_offset); | ||
| 76 | } | ||
| 77 | |||
| 78 | /** | ||
| 71 | * fc_adisc_fill() - Fill in adisc request frame | 79 | * fc_adisc_fill() - Fill in adisc request frame |
| 72 | * @lport: local port. | 80 | * @lport: local port. |
| 73 | * @fp: fc frame where payload will be placed. | 81 | * @fp: fc frame where payload will be placed. |
diff --git a/include/scsi/iscsi_if.h b/include/scsi/iscsi_if.h index c3e1cbcc2ad2..ddb04568a509 100644 --- a/include/scsi/iscsi_if.h +++ b/include/scsi/iscsi_if.h | |||
| @@ -292,7 +292,7 @@ enum iscsi_param { | |||
| 292 | ISCSI_PARAM_PERSISTENT_PORT, | 292 | ISCSI_PARAM_PERSISTENT_PORT, |
| 293 | ISCSI_PARAM_SESS_RECOVERY_TMO, | 293 | ISCSI_PARAM_SESS_RECOVERY_TMO, |
| 294 | 294 | ||
| 295 | /* pased in through bind conn using transport_fd */ | 295 | /* passed in through bind conn using transport_fd */ |
| 296 | ISCSI_PARAM_CONN_PORT, | 296 | ISCSI_PARAM_CONN_PORT, |
| 297 | ISCSI_PARAM_CONN_ADDRESS, | 297 | ISCSI_PARAM_CONN_ADDRESS, |
| 298 | 298 | ||
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h index f53c8e31d5fb..a3cbda4ddb5c 100644 --- a/include/scsi/libfc.h +++ b/include/scsi/libfc.h | |||
| @@ -35,6 +35,8 @@ | |||
| 35 | 35 | ||
| 36 | #include <scsi/fc_frame.h> | 36 | #include <scsi/fc_frame.h> |
| 37 | 37 | ||
| 38 | #define FC_FC4_PROV_SIZE (FC_TYPE_FCP + 1) /* size of tables */ | ||
| 39 | |||
| 38 | /* | 40 | /* |
| 39 | * libfc error codes | 41 | * libfc error codes |
| 40 | */ | 42 | */ |
| @@ -156,6 +158,7 @@ struct fc_rport_libfc_priv { | |||
| 156 | #define FC_RP_FLAGS_REC_SUPPORTED (1 << 0) | 158 | #define FC_RP_FLAGS_REC_SUPPORTED (1 << 0) |
| 157 | #define FC_RP_FLAGS_RETRY (1 << 1) | 159 | #define FC_RP_FLAGS_RETRY (1 << 1) |
| 158 | #define FC_RP_STARTED (1 << 2) | 160 | #define FC_RP_STARTED (1 << 2) |
| 161 | #define FC_RP_FLAGS_CONF_REQ (1 << 3) | ||
| 159 | unsigned int e_d_tov; | 162 | unsigned int e_d_tov; |
| 160 | unsigned int r_a_tov; | 163 | unsigned int r_a_tov; |
| 161 | }; | 164 | }; |
| @@ -179,6 +182,7 @@ struct fc_rport_libfc_priv { | |||
| 179 | * @rp_mutex: The mutex that protects the remote port | 182 | * @rp_mutex: The mutex that protects the remote port |
| 180 | * @retry_work: Handle for retries | 183 | * @retry_work: Handle for retries |
| 181 | * @event_callback: Callback when READY, FAILED or LOGO states complete | 184 | * @event_callback: Callback when READY, FAILED or LOGO states complete |
| 185 | * @prli_count: Count of open PRLI sessions in providers | ||
| 182 | * @rcu: Structure used for freeing in an RCU-safe manner | 186 | * @rcu: Structure used for freeing in an RCU-safe manner |
| 183 | */ | 187 | */ |
| 184 | struct fc_rport_priv { | 188 | struct fc_rport_priv { |
| @@ -202,7 +206,13 @@ struct fc_rport_priv { | |||
| 202 | struct list_head peers; | 206 | struct list_head peers; |
| 203 | struct work_struct event_work; | 207 | struct work_struct event_work; |
| 204 | u32 supported_classes; | 208 | u32 supported_classes; |
| 209 | u16 prli_count; | ||
| 205 | struct rcu_head rcu; | 210 | struct rcu_head rcu; |
| 211 | u16 sp_features; | ||
| 212 | u8 spp_type; | ||
| 213 | void (*lld_event_callback)(struct fc_lport *, | ||
| 214 | struct fc_rport_priv *, | ||
| 215 | enum fc_rport_event); | ||
| 206 | }; | 216 | }; |
| 207 | 217 | ||
| 208 | /** | 218 | /** |
| @@ -250,7 +260,7 @@ struct fcoe_dev_stats { | |||
| 250 | /** | 260 | /** |
| 251 | * struct fc_seq_els_data - ELS data used for passing ELS specific responses | 261 | * struct fc_seq_els_data - ELS data used for passing ELS specific responses |
| 252 | * @reason: The reason for rejection | 262 | * @reason: The reason for rejection |
| 253 | * @explan: The explaination of the rejection | 263 | * @explan: The explanation of the rejection |
| 254 | * | 264 | * |
| 255 | * Mainly used by the exchange manager layer. | 265 | * Mainly used by the exchange manager layer. |
| 256 | */ | 266 | */ |
| @@ -515,7 +525,7 @@ struct libfc_function_template { | |||
| 515 | struct fc_frame *); | 525 | struct fc_frame *); |
| 516 | 526 | ||
| 517 | /* | 527 | /* |
| 518 | * Send an ELS response using infomation from the received frame. | 528 | * Send an ELS response using information from the received frame. |
| 519 | * | 529 | * |
| 520 | * STATUS: OPTIONAL | 530 | * STATUS: OPTIONAL |
| 521 | */ | 531 | */ |
| @@ -551,6 +561,16 @@ struct libfc_function_template { | |||
| 551 | struct fc_seq *(*seq_start_next)(struct fc_seq *); | 561 | struct fc_seq *(*seq_start_next)(struct fc_seq *); |
| 552 | 562 | ||
| 553 | /* | 563 | /* |
| 564 | * Set a response handler for the exchange of the sequence. | ||
| 565 | * | ||
| 566 | * STATUS: OPTIONAL | ||
| 567 | */ | ||
| 568 | void (*seq_set_resp)(struct fc_seq *sp, | ||
| 569 | void (*resp)(struct fc_seq *, struct fc_frame *, | ||
| 570 | void *), | ||
| 571 | void *arg); | ||
| 572 | |||
| 573 | /* | ||
| 554 | * Assign a sequence for an incoming request frame. | 574 | * Assign a sequence for an incoming request frame. |
| 555 | * | 575 | * |
| 556 | * STATUS: OPTIONAL | 576 | * STATUS: OPTIONAL |
| @@ -558,6 +578,13 @@ struct libfc_function_template { | |||
| 558 | struct fc_seq *(*seq_assign)(struct fc_lport *, struct fc_frame *); | 578 | struct fc_seq *(*seq_assign)(struct fc_lport *, struct fc_frame *); |
| 559 | 579 | ||
| 560 | /* | 580 | /* |
| 581 | * Release the reference on the sequence returned by seq_assign(). | ||
| 582 | * | ||
| 583 | * STATUS: OPTIONAL | ||
| 584 | */ | ||
| 585 | void (*seq_release)(struct fc_seq *); | ||
| 586 | |||
| 587 | /* | ||
| 561 | * Reset an exchange manager, completing all sequences and exchanges. | 588 | * Reset an exchange manager, completing all sequences and exchanges. |
| 562 | * If s_id is non-zero, reset only exchanges originating from that FID. | 589 | * If s_id is non-zero, reset only exchanges originating from that FID. |
| 563 | * If d_id is non-zero, reset only exchanges sending to that FID. | 590 | * If d_id is non-zero, reset only exchanges sending to that FID. |
| @@ -636,7 +663,7 @@ struct libfc_function_template { | |||
| 636 | int (*rport_logoff)(struct fc_rport_priv *); | 663 | int (*rport_logoff)(struct fc_rport_priv *); |
| 637 | 664 | ||
| 638 | /* | 665 | /* |
| 639 | * Recieve a request from a remote port. | 666 | * Receive a request from a remote port. |
| 640 | * | 667 | * |
| 641 | * STATUS: OPTIONAL | 668 | * STATUS: OPTIONAL |
| 642 | */ | 669 | */ |
| @@ -656,6 +683,15 @@ struct libfc_function_template { | |||
| 656 | void (*rport_destroy)(struct kref *); | 683 | void (*rport_destroy)(struct kref *); |
| 657 | 684 | ||
| 658 | /* | 685 | /* |
| 686 | * Callback routine after the remote port is logged in | ||
| 687 | * | ||
| 688 | * STATUS: OPTIONAL | ||
| 689 | */ | ||
| 690 | void (*rport_event_callback)(struct fc_lport *, | ||
| 691 | struct fc_rport_priv *, | ||
| 692 | enum fc_rport_event); | ||
| 693 | |||
| 694 | /* | ||
| 659 | * Send a fcp cmd from fsp pkt. | 695 | * Send a fcp cmd from fsp pkt. |
| 660 | * Called with the SCSI host lock unlocked and irqs disabled. | 696 | * Called with the SCSI host lock unlocked and irqs disabled. |
| 661 | * | 697 | * |
| @@ -668,7 +704,7 @@ struct libfc_function_template { | |||
| 668 | void *)); | 704 | void *)); |
| 669 | 705 | ||
| 670 | /* | 706 | /* |
| 671 | * Cleanup the FCP layer, used durring link down and reset | 707 | * Cleanup the FCP layer, used during link down and reset |
| 672 | * | 708 | * |
| 673 | * STATUS: OPTIONAL | 709 | * STATUS: OPTIONAL |
| 674 | */ | 710 | */ |
| @@ -749,6 +785,15 @@ struct fc_disc { | |||
| 749 | enum fc_disc_event); | 785 | enum fc_disc_event); |
| 750 | }; | 786 | }; |
| 751 | 787 | ||
| 788 | /* | ||
| 789 | * Local port notifier and events. | ||
| 790 | */ | ||
| 791 | extern struct blocking_notifier_head fc_lport_notifier_head; | ||
| 792 | enum fc_lport_event { | ||
| 793 | FC_LPORT_EV_ADD, | ||
| 794 | FC_LPORT_EV_DEL, | ||
| 795 | }; | ||
| 796 | |||
| 752 | /** | 797 | /** |
| 753 | * struct fc_lport - Local port | 798 | * struct fc_lport - Local port |
| 754 | * @host: The SCSI host associated with a local port | 799 | * @host: The SCSI host associated with a local port |
| @@ -789,8 +834,10 @@ struct fc_disc { | |||
| 789 | * @lso_max: The maximum large offload send size | 834 | * @lso_max: The maximum large offload send size |
| 790 | * @fcts: FC-4 type mask | 835 | * @fcts: FC-4 type mask |
| 791 | * @lp_mutex: Mutex to protect the local port | 836 | * @lp_mutex: Mutex to protect the local port |
| 792 | * @list: Handle for list of local ports | 837 | * @list: Linkage on list of vport peers |
| 793 | * @retry_work: Handle to local port for delayed retry context | 838 | * @retry_work: Handle to local port for delayed retry context |
| 839 | * @prov: Pointers available for use by passive FC-4 providers | ||
| 840 | * @lport_list: Linkage on module-wide list of local ports | ||
| 794 | */ | 841 | */ |
| 795 | struct fc_lport { | 842 | struct fc_lport { |
| 796 | /* Associations */ | 843 | /* Associations */ |
| @@ -846,8 +893,32 @@ struct fc_lport { | |||
| 846 | struct mutex lp_mutex; | 893 | struct mutex lp_mutex; |
| 847 | struct list_head list; | 894 | struct list_head list; |
| 848 | struct delayed_work retry_work; | 895 | struct delayed_work retry_work; |
| 896 | void *prov[FC_FC4_PROV_SIZE]; | ||
| 897 | struct list_head lport_list; | ||
| 849 | }; | 898 | }; |
| 850 | 899 | ||
| 900 | /** | ||
| 901 | * struct fc4_prov - FC-4 provider registration | ||
| 902 | * @prli: Handler for incoming PRLI | ||
| 903 | * @prlo: Handler for session reset | ||
| 904 | * @recv: Handler for incoming request | ||
| 905 | * @module: Pointer to module. May be NULL. | ||
| 906 | */ | ||
| 907 | struct fc4_prov { | ||
| 908 | int (*prli)(struct fc_rport_priv *, u32 spp_len, | ||
| 909 | const struct fc_els_spp *spp_in, | ||
| 910 | struct fc_els_spp *spp_out); | ||
| 911 | void (*prlo)(struct fc_rport_priv *); | ||
| 912 | void (*recv)(struct fc_lport *, struct fc_frame *); | ||
| 913 | struct module *module; | ||
| 914 | }; | ||
| 915 | |||
| 916 | /* | ||
| 917 | * Register FC-4 provider with libfc. | ||
| 918 | */ | ||
| 919 | int fc_fc4_register_provider(enum fc_fh_type type, struct fc4_prov *); | ||
| 920 | void fc_fc4_deregister_provider(enum fc_fh_type type, struct fc4_prov *); | ||
| 921 | |||
| 851 | /* | 922 | /* |
| 852 | * FC_LPORT HELPER FUNCTIONS | 923 | * FC_LPORT HELPER FUNCTIONS |
| 853 | *****************************/ | 924 | *****************************/ |
| @@ -978,6 +1049,7 @@ struct fc_lport *libfc_vport_create(struct fc_vport *, int privsize); | |||
| 978 | struct fc_lport *fc_vport_id_lookup(struct fc_lport *, u32 port_id); | 1049 | struct fc_lport *fc_vport_id_lookup(struct fc_lport *, u32 port_id); |
| 979 | int fc_lport_bsg_request(struct fc_bsg_job *); | 1050 | int fc_lport_bsg_request(struct fc_bsg_job *); |
| 980 | void fc_lport_set_local_id(struct fc_lport *, u32 port_id); | 1051 | void fc_lport_set_local_id(struct fc_lport *, u32 port_id); |
| 1052 | void fc_lport_iterate(void (*func)(struct fc_lport *, void *), void *); | ||
| 981 | 1053 | ||
| 982 | /* | 1054 | /* |
| 983 | * REMOTE PORT LAYER | 1055 | * REMOTE PORT LAYER |
diff --git a/include/scsi/libfcoe.h b/include/scsi/libfcoe.h index feb6a94c90ea..8c1638b8c28e 100644 --- a/include/scsi/libfcoe.h +++ b/include/scsi/libfcoe.h | |||
| @@ -33,6 +33,12 @@ | |||
| 33 | #define FCOE_MAX_CMD_LEN 16 /* Supported CDB length */ | 33 | #define FCOE_MAX_CMD_LEN 16 /* Supported CDB length */ |
| 34 | 34 | ||
| 35 | /* | 35 | /* |
| 36 | * Max MTU for FCoE: 14 (FCoE header) + 24 (FC header) + 2112 (max FC payload) | ||
| 37 | * + 4 (FC CRC) + 4 (FCoE trailer) = 2158 bytes | ||
| 38 | */ | ||
| 39 | #define FCOE_MTU 2158 | ||
| 40 | |||
| 41 | /* | ||
| 36 | * FIP tunable parameters. | 42 | * FIP tunable parameters. |
| 37 | */ | 43 | */ |
| 38 | #define FCOE_CTLR_START_DELAY 2000 /* mS after first adv. to choose FCF */ | 44 | #define FCOE_CTLR_START_DELAY 2000 /* mS after first adv. to choose FCF */ |
| @@ -221,6 +227,8 @@ int fcoe_ctlr_recv_flogi(struct fcoe_ctlr *, struct fc_lport *, | |||
| 221 | u64 fcoe_wwn_from_mac(unsigned char mac[], unsigned int, unsigned int); | 227 | u64 fcoe_wwn_from_mac(unsigned char mac[], unsigned int, unsigned int); |
| 222 | int fcoe_libfc_config(struct fc_lport *, struct fcoe_ctlr *, | 228 | int fcoe_libfc_config(struct fc_lport *, struct fcoe_ctlr *, |
| 223 | const struct libfc_function_template *, int init_fcp); | 229 | const struct libfc_function_template *, int init_fcp); |
| 230 | u32 fcoe_fc_crc(struct fc_frame *fp); | ||
| 231 | int fcoe_start_io(struct sk_buff *skb); | ||
| 224 | 232 | ||
| 225 | /** | 233 | /** |
| 226 | * is_fip_mode() - returns true if FIP mode selected. | 234 | * is_fip_mode() - returns true if FIP mode selected. |
| @@ -231,5 +239,102 @@ static inline bool is_fip_mode(struct fcoe_ctlr *fip) | |||
| 231 | return fip->state == FIP_ST_ENABLED; | 239 | return fip->state == FIP_ST_ENABLED; |
| 232 | } | 240 | } |
| 233 | 241 | ||
| 242 | /* helper for FCoE SW HBA drivers, can include subven and subdev if needed. The | ||
| 243 | * modpost would use pci_device_id table to auto-generate formatted module alias | ||
| 244 | * into the corresponding .mod.c file, but there may or may not be a pci device | ||
| 245 | * id table for FCoE drivers so we use the following helper for build the fcoe | ||
| 246 | * driver module alias. | ||
| 247 | */ | ||
| 248 | #define MODULE_ALIAS_FCOE_PCI(ven, dev) \ | ||
| 249 | MODULE_ALIAS("fcoe-pci:" \ | ||
| 250 | "v" __stringify(ven) \ | ||
| 251 | "d" __stringify(dev) "sv*sd*bc*sc*i*") | ||
| 252 | |||
| 253 | /* the name of the default FCoE transport driver fcoe.ko */ | ||
| 254 | #define FCOE_TRANSPORT_DEFAULT "fcoe" | ||
| 255 | |||
| 256 | /* struct fcoe_transport - The FCoE transport interface | ||
| 257 | * @name: a vendor specific name for their FCoE transport driver | ||
| 258 | * @attached: whether this transport is already attached | ||
| 259 | * @list: list linkage to all attached transports | ||
| 260 | * @match: handler to allow the transport driver to match up a given netdev | ||
| 261 | * @create: handler to sysfs entry of create for FCoE instances | ||
| 262 | * @destroy: handler to sysfs entry of destroy for FCoE instances | ||
| 263 | * @enable: handler to sysfs entry of enable for FCoE instances | ||
| 264 | * @disable: handler to sysfs entry of disable for FCoE instances | ||
| 265 | */ | ||
| 266 | struct fcoe_transport { | ||
| 267 | char name[IFNAMSIZ]; | ||
| 268 | bool attached; | ||
| 269 | struct list_head list; | ||
| 270 | bool (*match) (struct net_device *device); | ||
| 271 | int (*create) (struct net_device *device, enum fip_state fip_mode); | ||
| 272 | int (*destroy) (struct net_device *device); | ||
| 273 | int (*enable) (struct net_device *device); | ||
| 274 | int (*disable) (struct net_device *device); | ||
| 275 | }; | ||
| 276 | |||
| 277 | /** | ||
| 278 | * struct fcoe_percpu_s - The context for FCoE receive thread(s) | ||
| 279 | * @thread: The thread context | ||
| 280 | * @fcoe_rx_list: The queue of pending packets to process | ||
| 281 | * @page: The memory page for calculating frame trailer CRCs | ||
| 282 | * @crc_eof_offset: The offset into the CRC page pointing to available | ||
| 283 | * memory for a new trailer | ||
| 284 | */ | ||
| 285 | struct fcoe_percpu_s { | ||
| 286 | struct task_struct *thread; | ||
| 287 | struct sk_buff_head fcoe_rx_list; | ||
| 288 | struct page *crc_eof_page; | ||
| 289 | int crc_eof_offset; | ||
| 290 | }; | ||
| 291 | |||
| 292 | /** | ||
| 293 | * struct fcoe_port - The FCoE private structure | ||
| 294 | * @priv: The associated fcoe interface. The structure is | ||
| 295 | * defined by the low level driver | ||
| 296 | * @lport: The associated local port | ||
| 297 | * @fcoe_pending_queue: The pending Rx queue of skbs | ||
| 298 | * @fcoe_pending_queue_active: Indicates if the pending queue is active | ||
| 299 | * @max_queue_depth: Max queue depth of pending queue | ||
| 300 | * @min_queue_depth: Min queue depth of pending queue | ||
| 301 | * @timer: The queue timer | ||
| 302 | * @destroy_work: Handle for work context | ||
| 303 | * (to prevent RTNL deadlocks) | ||
| 304 | * @data_srt_addr: Source address for data | ||
| 305 | * | ||
| 306 | * An instance of this structure is to be allocated along with the | ||
| 307 | * Scsi_Host and libfc fc_lport structures. | ||
| 308 | */ | ||
| 309 | struct fcoe_port { | ||
| 310 | void *priv; | ||
| 311 | struct fc_lport *lport; | ||
| 312 | struct sk_buff_head fcoe_pending_queue; | ||
| 313 | u8 fcoe_pending_queue_active; | ||
| 314 | u32 max_queue_depth; | ||
| 315 | u32 min_queue_depth; | ||
| 316 | struct timer_list timer; | ||
| 317 | struct work_struct destroy_work; | ||
| 318 | u8 data_src_addr[ETH_ALEN]; | ||
| 319 | }; | ||
| 320 | void fcoe_clean_pending_queue(struct fc_lport *); | ||
| 321 | void fcoe_check_wait_queue(struct fc_lport *lport, struct sk_buff *skb); | ||
| 322 | void fcoe_queue_timer(ulong lport); | ||
| 323 | int fcoe_get_paged_crc_eof(struct sk_buff *skb, int tlen, | ||
| 324 | struct fcoe_percpu_s *fps); | ||
| 325 | |||
| 326 | /** | ||
| 327 | * struct netdev_list | ||
| 328 | * A mapping from netdevice to fcoe_transport | ||
| 329 | */ | ||
| 330 | struct fcoe_netdev_mapping { | ||
| 331 | struct list_head list; | ||
| 332 | struct net_device *netdev; | ||
| 333 | struct fcoe_transport *ft; | ||
| 334 | }; | ||
| 335 | |||
| 336 | /* fcoe transports registration and deregistration */ | ||
| 337 | int fcoe_transport_attach(struct fcoe_transport *ft); | ||
| 338 | int fcoe_transport_detach(struct fcoe_transport *ft); | ||
| 234 | 339 | ||
| 235 | #endif /* _LIBFCOE_H */ | 340 | #endif /* _LIBFCOE_H */ |
diff --git a/include/scsi/libiscsi.h b/include/scsi/libiscsi.h index 748382b32b52..0f4367751b71 100644 --- a/include/scsi/libiscsi.h +++ b/include/scsi/libiscsi.h | |||
| @@ -212,9 +212,6 @@ struct iscsi_conn { | |||
| 212 | /* values userspace uses to id a conn */ | 212 | /* values userspace uses to id a conn */ |
| 213 | int persistent_port; | 213 | int persistent_port; |
| 214 | char *persistent_address; | 214 | char *persistent_address; |
| 215 | /* remote portal currently connected to */ | ||
| 216 | int portal_port; | ||
| 217 | char portal_address[ISCSI_ADDRESS_BUF_LEN]; | ||
| 218 | 215 | ||
| 219 | /* MIB-statistics */ | 216 | /* MIB-statistics */ |
| 220 | uint64_t txdata_octets; | 217 | uint64_t txdata_octets; |
| @@ -319,9 +316,6 @@ struct iscsi_host { | |||
| 319 | /* hw address or netdev iscsi connection is bound to */ | 316 | /* hw address or netdev iscsi connection is bound to */ |
| 320 | char *hwaddress; | 317 | char *hwaddress; |
| 321 | char *netdev; | 318 | char *netdev; |
| 322 | /* local address */ | ||
| 323 | int local_port; | ||
| 324 | char local_address[ISCSI_ADDRESS_BUF_LEN]; | ||
| 325 | 319 | ||
| 326 | wait_queue_head_t session_removal_wq; | 320 | wait_queue_head_t session_removal_wq; |
| 327 | /* protects sessions and state */ | 321 | /* protects sessions and state */ |
| @@ -394,6 +388,8 @@ extern void iscsi_session_failure(struct iscsi_session *session, | |||
| 394 | enum iscsi_err err); | 388 | enum iscsi_err err); |
| 395 | extern int iscsi_conn_get_param(struct iscsi_cls_conn *cls_conn, | 389 | extern int iscsi_conn_get_param(struct iscsi_cls_conn *cls_conn, |
| 396 | enum iscsi_param param, char *buf); | 390 | enum iscsi_param param, char *buf); |
| 391 | extern int iscsi_conn_get_addr_param(struct sockaddr_storage *addr, | ||
| 392 | enum iscsi_param param, char *buf); | ||
| 397 | extern void iscsi_suspend_tx(struct iscsi_conn *conn); | 393 | extern void iscsi_suspend_tx(struct iscsi_conn *conn); |
| 398 | extern void iscsi_suspend_queue(struct iscsi_conn *conn); | 394 | extern void iscsi_suspend_queue(struct iscsi_conn *conn); |
| 399 | extern void iscsi_conn_queue_work(struct iscsi_conn *conn); | 395 | extern void iscsi_conn_queue_work(struct iscsi_conn *conn); |
diff --git a/include/scsi/libiscsi_tcp.h b/include/scsi/libiscsi_tcp.h index 741ae7ed4394..ac0cc1d925ef 100644 --- a/include/scsi/libiscsi_tcp.h +++ b/include/scsi/libiscsi_tcp.h | |||
| @@ -47,11 +47,12 @@ struct iscsi_segment { | |||
| 47 | struct scatterlist *sg; | 47 | struct scatterlist *sg; |
| 48 | void *sg_mapped; | 48 | void *sg_mapped; |
| 49 | unsigned int sg_offset; | 49 | unsigned int sg_offset; |
| 50 | bool atomic_mapped; | ||
| 50 | 51 | ||
| 51 | iscsi_segment_done_fn_t *done; | 52 | iscsi_segment_done_fn_t *done; |
| 52 | }; | 53 | }; |
| 53 | 54 | ||
| 54 | /* Socket connection recieve helper */ | 55 | /* Socket connection receive helper */ |
| 55 | struct iscsi_tcp_recv { | 56 | struct iscsi_tcp_recv { |
| 56 | struct iscsi_hdr *hdr; | 57 | struct iscsi_hdr *hdr; |
| 57 | struct iscsi_segment segment; | 58 | struct iscsi_segment segment; |
diff --git a/include/scsi/osd_initiator.h b/include/scsi/osd_initiator.h index 53a9e886612b..0a5079974fe9 100644 --- a/include/scsi/osd_initiator.h +++ b/include/scsi/osd_initiator.h | |||
| @@ -265,7 +265,7 @@ int osd_execute_request_async(struct osd_request *or, | |||
| 265 | * @osi - Recievs a more detailed error report information (optional). | 265 | * @osi - Recievs a more detailed error report information (optional). |
| 266 | * @silent - Do not print to dmsg (Even if enabled) | 266 | * @silent - Do not print to dmsg (Even if enabled) |
| 267 | * @bad_obj_list - Some commands act on multiple objects. Failed objects will | 267 | * @bad_obj_list - Some commands act on multiple objects. Failed objects will |
| 268 | * be recieved here (optional) | 268 | * be received here (optional) |
| 269 | * @max_obj - Size of @bad_obj_list. | 269 | * @max_obj - Size of @bad_obj_list. |
| 270 | * @bad_attr_list - List of failing attributes (optional) | 270 | * @bad_attr_list - List of failing attributes (optional) |
| 271 | * @max_attr - Size of @bad_attr_list. | 271 | * @max_attr - Size of @bad_attr_list. |
diff --git a/include/scsi/sas_ata.h b/include/scsi/sas_ata.h index c583193ae929..9c159f74c6d0 100644 --- a/include/scsi/sas_ata.h +++ b/include/scsi/sas_ata.h | |||
| @@ -39,6 +39,11 @@ int sas_ata_init_host_and_port(struct domain_device *found_dev, | |||
| 39 | struct scsi_target *starget); | 39 | struct scsi_target *starget); |
| 40 | 40 | ||
| 41 | void sas_ata_task_abort(struct sas_task *task); | 41 | void sas_ata_task_abort(struct sas_task *task); |
| 42 | void sas_ata_strategy_handler(struct Scsi_Host *shost); | ||
| 43 | int sas_ata_timed_out(struct scsi_cmnd *cmd, struct sas_task *task, | ||
| 44 | enum blk_eh_timer_return *rtn); | ||
| 45 | int sas_ata_eh(struct Scsi_Host *shost, struct list_head *work_q, | ||
| 46 | struct list_head *done_q); | ||
| 42 | 47 | ||
| 43 | #else | 48 | #else |
| 44 | 49 | ||
| @@ -55,6 +60,23 @@ static inline int sas_ata_init_host_and_port(struct domain_device *found_dev, | |||
| 55 | static inline void sas_ata_task_abort(struct sas_task *task) | 60 | static inline void sas_ata_task_abort(struct sas_task *task) |
| 56 | { | 61 | { |
| 57 | } | 62 | } |
| 63 | |||
| 64 | static inline void sas_ata_strategy_handler(struct Scsi_Host *shost) | ||
| 65 | { | ||
| 66 | } | ||
| 67 | |||
| 68 | static inline int sas_ata_timed_out(struct scsi_cmnd *cmd, | ||
| 69 | struct sas_task *task, | ||
| 70 | enum blk_eh_timer_return *rtn) | ||
| 71 | { | ||
| 72 | return 0; | ||
| 73 | } | ||
| 74 | static inline int sas_ata_eh(struct Scsi_Host *shost, struct list_head *work_q, | ||
| 75 | struct list_head *done_q) | ||
| 76 | { | ||
| 77 | return 0; | ||
| 78 | } | ||
| 79 | |||
| 58 | #endif | 80 | #endif |
| 59 | 81 | ||
| 60 | #endif /* _SAS_ATA_H_ */ | 82 | #endif /* _SAS_ATA_H_ */ |
diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h index 648d23358038..3668903e397b 100644 --- a/include/scsi/scsi.h +++ b/include/scsi/scsi.h | |||
| @@ -9,6 +9,7 @@ | |||
| 9 | #define _SCSI_SCSI_H | 9 | #define _SCSI_SCSI_H |
| 10 | 10 | ||
| 11 | #include <linux/types.h> | 11 | #include <linux/types.h> |
| 12 | #include <linux/scatterlist.h> | ||
| 12 | 13 | ||
| 13 | struct scsi_cmnd; | 14 | struct scsi_cmnd; |
| 14 | 15 | ||
| @@ -434,6 +435,10 @@ static inline int scsi_is_wlun(unsigned int lun) | |||
| 434 | * recover the link. Transport class will | 435 | * recover the link. Transport class will |
| 435 | * retry or fail IO */ | 436 | * retry or fail IO */ |
| 436 | #define DID_TRANSPORT_FAILFAST 0x0f /* Transport class fastfailed the io */ | 437 | #define DID_TRANSPORT_FAILFAST 0x0f /* Transport class fastfailed the io */ |
| 438 | #define DID_TARGET_FAILURE 0x10 /* Permanent target failure, do not retry on | ||
| 439 | * other paths */ | ||
| 440 | #define DID_NEXUS_FAILURE 0x11 /* Permanent nexus failure, retry on other | ||
| 441 | * paths might yield different results */ | ||
| 437 | #define DRIVER_OK 0x00 /* Driver status */ | 442 | #define DRIVER_OK 0x00 /* Driver status */ |
| 438 | 443 | ||
| 439 | /* | 444 | /* |
| @@ -463,6 +468,7 @@ static inline int scsi_is_wlun(unsigned int lun) | |||
| 463 | #define TIMEOUT_ERROR 0x2007 | 468 | #define TIMEOUT_ERROR 0x2007 |
| 464 | #define SCSI_RETURN_NOT_HANDLED 0x2008 | 469 | #define SCSI_RETURN_NOT_HANDLED 0x2008 |
| 465 | #define FAST_IO_FAIL 0x2009 | 470 | #define FAST_IO_FAIL 0x2009 |
| 471 | #define TARGET_ERROR 0x200A | ||
| 466 | 472 | ||
| 467 | /* | 473 | /* |
| 468 | * Midlevel queue return values. | 474 | * Midlevel queue return values. |
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index 85867dcde335..2d3ec5094685 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h | |||
| @@ -184,6 +184,7 @@ typedef void (*activate_complete)(void *, int); | |||
| 184 | struct scsi_device_handler { | 184 | struct scsi_device_handler { |
| 185 | /* Used by the infrastructure */ | 185 | /* Used by the infrastructure */ |
| 186 | struct list_head list; /* list of scsi_device_handlers */ | 186 | struct list_head list; /* list of scsi_device_handlers */ |
| 187 | int idx; | ||
| 187 | 188 | ||
| 188 | /* Filled by the hardware handler */ | 189 | /* Filled by the hardware handler */ |
| 189 | struct module *module; | 190 | struct module *module; |
| @@ -461,7 +462,7 @@ static inline int scsi_device_qas(struct scsi_device *sdev) | |||
| 461 | } | 462 | } |
| 462 | static inline int scsi_device_enclosure(struct scsi_device *sdev) | 463 | static inline int scsi_device_enclosure(struct scsi_device *sdev) |
| 463 | { | 464 | { |
| 464 | return sdev->inquiry[6] & (1<<6); | 465 | return sdev->inquiry ? (sdev->inquiry[6] & (1<<6)) : 1; |
| 465 | } | 466 | } |
| 466 | 467 | ||
| 467 | static inline int scsi_device_protection(struct scsi_device *sdev) | 468 | static inline int scsi_device_protection(struct scsi_device *sdev) |
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index e7e385842a38..f1f2644137b8 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h | |||
| @@ -46,7 +46,7 @@ struct blk_queue_tags; | |||
| 46 | enum { | 46 | enum { |
| 47 | SCSI_QDEPTH_DEFAULT, /* default requested change, e.g. from sysfs */ | 47 | SCSI_QDEPTH_DEFAULT, /* default requested change, e.g. from sysfs */ |
| 48 | SCSI_QDEPTH_QFULL, /* scsi-ml requested due to queue full */ | 48 | SCSI_QDEPTH_QFULL, /* scsi-ml requested due to queue full */ |
| 49 | SCSI_QDEPTH_RAMP_UP, /* scsi-ml requested due to threshhold event */ | 49 | SCSI_QDEPTH_RAMP_UP, /* scsi-ml requested due to threshold event */ |
| 50 | }; | 50 | }; |
| 51 | 51 | ||
| 52 | struct scsi_host_template { | 52 | struct scsi_host_template { |
diff --git a/include/scsi/scsi_transport_fc.h b/include/scsi/scsi_transport_fc.h index 59816fe31e68..2a65167a8f10 100644 --- a/include/scsi/scsi_transport_fc.h +++ b/include/scsi/scsi_transport_fc.h | |||
| @@ -192,9 +192,9 @@ struct fc_vport_identifiers { | |||
| 192 | * | 192 | * |
| 193 | * This structure exists for each FC port is a virtual FC port. Virtual | 193 | * This structure exists for each FC port is a virtual FC port. Virtual |
| 194 | * ports share the physical link with the Physical port. Each virtual | 194 | * ports share the physical link with the Physical port. Each virtual |
| 195 | * ports has a unique presense on the SAN, and may be instantiated via | 195 | * ports has a unique presence on the SAN, and may be instantiated via |
| 196 | * NPIV, Virtual Fabrics, or via additional ALPAs. As the vport is a | 196 | * NPIV, Virtual Fabrics, or via additional ALPAs. As the vport is a |
| 197 | * unique presense, each vport has it's own view of the fabric, | 197 | * unique presence, each vport has it's own view of the fabric, |
| 198 | * authentication privilege, and priorities. | 198 | * authentication privilege, and priorities. |
| 199 | * | 199 | * |
| 200 | * A virtual port may support 1 or more FC4 roles. Typically it is a | 200 | * A virtual port may support 1 or more FC4 roles. Typically it is a |
| @@ -370,7 +370,7 @@ struct fc_rport { /* aka fc_starget_attrs */ | |||
| 370 | /* | 370 | /* |
| 371 | * FC SCSI Target Attributes | 371 | * FC SCSI Target Attributes |
| 372 | * | 372 | * |
| 373 | * The SCSI Target is considered an extention of a remote port (as | 373 | * The SCSI Target is considered an extension of a remote port (as |
| 374 | * a remote port can be more than a SCSI Target). Within the scsi | 374 | * a remote port can be more than a SCSI Target). Within the scsi |
| 375 | * subsystem, we leave the Target as a separate entity. Doing so | 375 | * subsystem, we leave the Target as a separate entity. Doing so |
| 376 | * provides backward compatibility with prior FC transport api's, | 376 | * provides backward compatibility with prior FC transport api's, |
diff --git a/include/scsi/scsi_transport_iscsi.h b/include/scsi/scsi_transport_iscsi.h index 7fff94b3b2a8..bf8f52965675 100644 --- a/include/scsi/scsi_transport_iscsi.h +++ b/include/scsi/scsi_transport_iscsi.h | |||
| @@ -101,6 +101,8 @@ struct iscsi_transport { | |||
| 101 | void (*destroy_conn) (struct iscsi_cls_conn *conn); | 101 | void (*destroy_conn) (struct iscsi_cls_conn *conn); |
| 102 | int (*set_param) (struct iscsi_cls_conn *conn, enum iscsi_param param, | 102 | int (*set_param) (struct iscsi_cls_conn *conn, enum iscsi_param param, |
| 103 | char *buf, int buflen); | 103 | char *buf, int buflen); |
| 104 | int (*get_ep_param) (struct iscsi_endpoint *ep, enum iscsi_param param, | ||
| 105 | char *buf); | ||
| 104 | int (*get_conn_param) (struct iscsi_cls_conn *conn, | 106 | int (*get_conn_param) (struct iscsi_cls_conn *conn, |
| 105 | enum iscsi_param param, char *buf); | 107 | enum iscsi_param param, char *buf); |
| 106 | int (*get_session_param) (struct iscsi_cls_session *session, | 108 | int (*get_session_param) (struct iscsi_cls_session *session, |
| @@ -160,8 +162,9 @@ struct iscsi_cls_conn { | |||
| 160 | void *dd_data; /* LLD private data */ | 162 | void *dd_data; /* LLD private data */ |
| 161 | struct iscsi_transport *transport; | 163 | struct iscsi_transport *transport; |
| 162 | uint32_t cid; /* connection id */ | 164 | uint32_t cid; /* connection id */ |
| 165 | struct mutex ep_mutex; | ||
| 166 | struct iscsi_endpoint *ep; | ||
| 163 | 167 | ||
| 164 | int active; /* must be accessed with the connlock */ | ||
| 165 | struct device dev; /* sysfs transport/container device */ | 168 | struct device dev; /* sysfs transport/container device */ |
| 166 | }; | 169 | }; |
| 167 | 170 | ||
| @@ -222,6 +225,7 @@ struct iscsi_endpoint { | |||
| 222 | void *dd_data; /* LLD private data */ | 225 | void *dd_data; /* LLD private data */ |
| 223 | struct device dev; | 226 | struct device dev; |
| 224 | uint64_t id; | 227 | uint64_t id; |
| 228 | struct iscsi_cls_conn *conn; | ||
| 225 | }; | 229 | }; |
| 226 | 230 | ||
| 227 | /* | 231 | /* |
