diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/enclosure.h | 5 | ||||
| -rw-r--r-- | include/scsi/fc/fc_gs.h | 1 | ||||
| -rw-r--r-- | include/scsi/fc_encode.h | 60 | ||||
| -rw-r--r-- | include/scsi/fc_frame.h | 7 | ||||
| -rw-r--r-- | include/scsi/iscsi_if.h | 1 | ||||
| -rw-r--r-- | include/scsi/libfc.h | 244 | ||||
| -rw-r--r-- | include/scsi/libiscsi.h | 3 | ||||
| -rw-r--r-- | include/scsi/scsi_device.h | 3 | ||||
| -rw-r--r-- | include/scsi/scsi_dh.h | 5 |
9 files changed, 184 insertions, 145 deletions
diff --git a/include/linux/enclosure.h b/include/linux/enclosure.h index 4332442b1b57..90d1c2184112 100644 --- a/include/linux/enclosure.h +++ b/include/linux/enclosure.h | |||
| @@ -122,8 +122,9 @@ enclosure_component_register(struct enclosure_device *, unsigned int, | |||
| 122 | enum enclosure_component_type, const char *); | 122 | enum enclosure_component_type, const char *); |
| 123 | int enclosure_add_device(struct enclosure_device *enclosure, int component, | 123 | int enclosure_add_device(struct enclosure_device *enclosure, int component, |
| 124 | struct device *dev); | 124 | struct device *dev); |
| 125 | int enclosure_remove_device(struct enclosure_device *enclosure, int component); | 125 | int enclosure_remove_device(struct enclosure_device *, struct device *); |
| 126 | struct enclosure_device *enclosure_find(struct device *dev); | 126 | struct enclosure_device *enclosure_find(struct device *dev, |
| 127 | struct enclosure_device *start); | ||
| 127 | int enclosure_for_each_device(int (*fn)(struct enclosure_device *, void *), | 128 | int enclosure_for_each_device(int (*fn)(struct enclosure_device *, void *), |
| 128 | void *data); | 129 | void *data); |
| 129 | 130 | ||
diff --git a/include/scsi/fc/fc_gs.h b/include/scsi/fc/fc_gs.h index ffab0272c65a..324dd0e3c622 100644 --- a/include/scsi/fc/fc_gs.h +++ b/include/scsi/fc/fc_gs.h | |||
| @@ -87,6 +87,7 @@ enum fc_ct_explan { | |||
| 87 | FC_FS_EXP_PNAM = 0x02, /* port name not registered */ | 87 | FC_FS_EXP_PNAM = 0x02, /* port name not registered */ |
| 88 | FC_FS_EXP_NNAM = 0x03, /* node name not registered */ | 88 | FC_FS_EXP_NNAM = 0x03, /* node name not registered */ |
| 89 | FC_FS_EXP_COS = 0x04, /* class of service not registered */ | 89 | FC_FS_EXP_COS = 0x04, /* class of service not registered */ |
| 90 | FC_FS_EXP_FTNR = 0x07, /* FC-4 types not registered */ | ||
| 90 | /* definitions not complete */ | 91 | /* definitions not complete */ |
| 91 | }; | 92 | }; |
| 92 | 93 | ||
diff --git a/include/scsi/fc_encode.h b/include/scsi/fc_encode.h index a0ff61c3e935..27dad703824f 100644 --- a/include/scsi/fc_encode.h +++ b/include/scsi/fc_encode.h | |||
| @@ -32,6 +32,7 @@ struct fc_ct_req { | |||
| 32 | struct fc_ns_gid_ft gid; | 32 | struct fc_ns_gid_ft gid; |
| 33 | struct fc_ns_rn_id rn; | 33 | struct fc_ns_rn_id rn; |
| 34 | struct fc_ns_rft rft; | 34 | struct fc_ns_rft rft; |
| 35 | struct fc_ns_fid fid; | ||
| 35 | } payload; | 36 | } payload; |
| 36 | }; | 37 | }; |
| 37 | 38 | ||
| @@ -57,6 +58,23 @@ static inline void fc_fill_fc_hdr(struct fc_frame *fp, enum fc_rctl r_ctl, | |||
| 57 | } | 58 | } |
| 58 | 59 | ||
| 59 | /** | 60 | /** |
| 61 | * fc_adisc_fill() - Fill in adisc request frame | ||
| 62 | * @lport: local port. | ||
| 63 | * @fp: fc frame where payload will be placed. | ||
| 64 | */ | ||
| 65 | static inline void fc_adisc_fill(struct fc_lport *lport, struct fc_frame *fp) | ||
| 66 | { | ||
| 67 | struct fc_els_adisc *adisc; | ||
| 68 | |||
| 69 | adisc = fc_frame_payload_get(fp, sizeof(*adisc)); | ||
| 70 | memset(adisc, 0, sizeof(*adisc)); | ||
| 71 | adisc->adisc_cmd = ELS_ADISC; | ||
| 72 | put_unaligned_be64(lport->wwpn, &adisc->adisc_wwpn); | ||
| 73 | put_unaligned_be64(lport->wwnn, &adisc->adisc_wwnn); | ||
| 74 | hton24(adisc->adisc_port_id, fc_host_port_id(lport->host)); | ||
| 75 | } | ||
| 76 | |||
| 77 | /** | ||
| 60 | * fc_ct_hdr_fill- fills ct header and reset ct payload | 78 | * fc_ct_hdr_fill- fills ct header and reset ct payload |
| 61 | * returns pointer to ct request. | 79 | * returns pointer to ct request. |
| 62 | */ | 80 | */ |
| @@ -77,10 +95,17 @@ static inline struct fc_ct_req *fc_ct_hdr_fill(const struct fc_frame *fp, | |||
| 77 | } | 95 | } |
| 78 | 96 | ||
| 79 | /** | 97 | /** |
| 80 | * fc_ct_fill - Fill in a name service request frame | 98 | * fc_ct_fill() - Fill in a name service request frame |
| 99 | * @lport: local port. | ||
| 100 | * @fc_id: FC_ID of non-destination rport for GPN_ID and similar inquiries. | ||
| 101 | * @fp: frame to contain payload. | ||
| 102 | * @op: CT opcode. | ||
| 103 | * @r_ctl: pointer to FC header R_CTL. | ||
| 104 | * @fh_type: pointer to FC-4 type. | ||
| 81 | */ | 105 | */ |
| 82 | static inline int fc_ct_fill(struct fc_lport *lport, struct fc_frame *fp, | 106 | static inline int fc_ct_fill(struct fc_lport *lport, |
| 83 | unsigned int op, enum fc_rctl *r_ctl, u32 *did, | 107 | u32 fc_id, struct fc_frame *fp, |
| 108 | unsigned int op, enum fc_rctl *r_ctl, | ||
| 84 | enum fc_fh_type *fh_type) | 109 | enum fc_fh_type *fh_type) |
| 85 | { | 110 | { |
| 86 | struct fc_ct_req *ct; | 111 | struct fc_ct_req *ct; |
| @@ -91,6 +116,11 @@ static inline int fc_ct_fill(struct fc_lport *lport, struct fc_frame *fp, | |||
| 91 | ct->payload.gid.fn_fc4_type = FC_TYPE_FCP; | 116 | ct->payload.gid.fn_fc4_type = FC_TYPE_FCP; |
| 92 | break; | 117 | break; |
| 93 | 118 | ||
| 119 | case FC_NS_GPN_ID: | ||
| 120 | ct = fc_ct_hdr_fill(fp, op, sizeof(struct fc_ns_fid)); | ||
| 121 | hton24(ct->payload.fid.fp_fid, fc_id); | ||
| 122 | break; | ||
| 123 | |||
| 94 | case FC_NS_RFT_ID: | 124 | case FC_NS_RFT_ID: |
| 95 | ct = fc_ct_hdr_fill(fp, op, sizeof(struct fc_ns_rft)); | 125 | ct = fc_ct_hdr_fill(fp, op, sizeof(struct fc_ns_rft)); |
| 96 | hton24(ct->payload.rft.fid.fp_fid, | 126 | hton24(ct->payload.rft.fid.fp_fid, |
| @@ -110,7 +140,6 @@ static inline int fc_ct_fill(struct fc_lport *lport, struct fc_frame *fp, | |||
| 110 | return -EINVAL; | 140 | return -EINVAL; |
| 111 | } | 141 | } |
| 112 | *r_ctl = FC_RCTL_DD_UNSOL_CTL; | 142 | *r_ctl = FC_RCTL_DD_UNSOL_CTL; |
| 113 | *did = FC_FID_DIR_SERV; | ||
| 114 | *fh_type = FC_TYPE_CT; | 143 | *fh_type = FC_TYPE_CT; |
| 115 | return 0; | 144 | return 0; |
| 116 | } | 145 | } |
| @@ -249,51 +278,42 @@ static inline void fc_scr_fill(struct fc_lport *lport, struct fc_frame *fp) | |||
| 249 | /** | 278 | /** |
| 250 | * fc_els_fill - Fill in an ELS request frame | 279 | * fc_els_fill - Fill in an ELS request frame |
| 251 | */ | 280 | */ |
| 252 | static inline int fc_els_fill(struct fc_lport *lport, struct fc_rport *rport, | 281 | static inline int fc_els_fill(struct fc_lport *lport, |
| 282 | u32 did, | ||
| 253 | struct fc_frame *fp, unsigned int op, | 283 | struct fc_frame *fp, unsigned int op, |
| 254 | enum fc_rctl *r_ctl, u32 *did, enum fc_fh_type *fh_type) | 284 | enum fc_rctl *r_ctl, enum fc_fh_type *fh_type) |
| 255 | { | 285 | { |
| 256 | switch (op) { | 286 | switch (op) { |
| 287 | case ELS_ADISC: | ||
| 288 | fc_adisc_fill(lport, fp); | ||
| 289 | break; | ||
| 290 | |||
| 257 | case ELS_PLOGI: | 291 | case ELS_PLOGI: |
| 258 | fc_plogi_fill(lport, fp, ELS_PLOGI); | 292 | fc_plogi_fill(lport, fp, ELS_PLOGI); |
| 259 | *did = rport->port_id; | ||
| 260 | break; | 293 | break; |
| 261 | 294 | ||
| 262 | case ELS_FLOGI: | 295 | case ELS_FLOGI: |
| 263 | fc_flogi_fill(lport, fp); | 296 | fc_flogi_fill(lport, fp); |
| 264 | *did = FC_FID_FLOGI; | ||
| 265 | break; | 297 | break; |
| 266 | 298 | ||
| 267 | case ELS_LOGO: | 299 | case ELS_LOGO: |
| 268 | fc_logo_fill(lport, fp); | 300 | fc_logo_fill(lport, fp); |
| 269 | *did = FC_FID_FLOGI; | ||
| 270 | /* | ||
| 271 | * if rport is valid then it | ||
| 272 | * is port logo, therefore | ||
| 273 | * set did to rport id. | ||
| 274 | */ | ||
| 275 | if (rport) | ||
| 276 | *did = rport->port_id; | ||
| 277 | break; | 301 | break; |
| 278 | 302 | ||
| 279 | case ELS_RTV: | 303 | case ELS_RTV: |
| 280 | fc_rtv_fill(lport, fp); | 304 | fc_rtv_fill(lport, fp); |
| 281 | *did = rport->port_id; | ||
| 282 | break; | 305 | break; |
| 283 | 306 | ||
| 284 | case ELS_REC: | 307 | case ELS_REC: |
| 285 | fc_rec_fill(lport, fp); | 308 | fc_rec_fill(lport, fp); |
| 286 | *did = rport->port_id; | ||
| 287 | break; | 309 | break; |
| 288 | 310 | ||
| 289 | case ELS_PRLI: | 311 | case ELS_PRLI: |
| 290 | fc_prli_fill(lport, fp); | 312 | fc_prli_fill(lport, fp); |
| 291 | *did = rport->port_id; | ||
| 292 | break; | 313 | break; |
| 293 | 314 | ||
| 294 | case ELS_SCR: | 315 | case ELS_SCR: |
| 295 | fc_scr_fill(lport, fp); | 316 | fc_scr_fill(lport, fp); |
| 296 | *did = FC_FID_FCTRL; | ||
| 297 | break; | 317 | break; |
| 298 | 318 | ||
| 299 | default: | 319 | default: |
diff --git a/include/scsi/fc_frame.h b/include/scsi/fc_frame.h index 59511057cee0..c35d2383cc26 100644 --- a/include/scsi/fc_frame.h +++ b/include/scsi/fc_frame.h | |||
| @@ -37,13 +37,6 @@ | |||
| 37 | #define FC_FRAME_HEADROOM 32 /* headroom for VLAN + FCoE headers */ | 37 | #define FC_FRAME_HEADROOM 32 /* headroom for VLAN + FCoE headers */ |
| 38 | #define FC_FRAME_TAILROOM 8 /* trailer space for FCoE */ | 38 | #define FC_FRAME_TAILROOM 8 /* trailer space for FCoE */ |
| 39 | 39 | ||
| 40 | /* | ||
| 41 | * Information about an individual fibre channel frame received or to be sent. | ||
| 42 | * The buffer may be in up to 4 additional non-contiguous sections, | ||
| 43 | * but the linear section must hold the frame header. | ||
| 44 | */ | ||
| 45 | #define FC_FRAME_SG_LEN 4 /* scatter/gather list maximum length */ | ||
| 46 | |||
| 47 | #define fp_skb(fp) (&((fp)->skb)) | 40 | #define fp_skb(fp) (&((fp)->skb)) |
| 48 | #define fr_hdr(fp) ((fp)->skb.data) | 41 | #define fr_hdr(fp) ((fp)->skb.data) |
| 49 | #define fr_len(fp) ((fp)->skb.len) | 42 | #define fr_len(fp) ((fp)->skb.len) |
diff --git a/include/scsi/iscsi_if.h b/include/scsi/iscsi_if.h index 4426f00da5ff..d67dda2b6aa0 100644 --- a/include/scsi/iscsi_if.h +++ b/include/scsi/iscsi_if.h | |||
| @@ -262,6 +262,7 @@ enum iscsi_err { | |||
| 262 | ISCSI_ERR_NO_SCSI_CMD = ISCSI_ERR_BASE + 17, | 262 | ISCSI_ERR_NO_SCSI_CMD = ISCSI_ERR_BASE + 17, |
| 263 | ISCSI_ERR_INVALID_HOST = ISCSI_ERR_BASE + 18, | 263 | ISCSI_ERR_INVALID_HOST = ISCSI_ERR_BASE + 18, |
| 264 | ISCSI_ERR_XMIT_FAILED = ISCSI_ERR_BASE + 19, | 264 | ISCSI_ERR_XMIT_FAILED = ISCSI_ERR_BASE + 19, |
| 265 | ISCSI_ERR_TCP_CONN_CLOSE = ISCSI_ERR_BASE + 20, | ||
| 265 | }; | 266 | }; |
| 266 | 267 | ||
| 267 | /* | 268 | /* |
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h index b92584a8843a..65dc9aacbf70 100644 --- a/include/scsi/libfc.h +++ b/include/scsi/libfc.h | |||
| @@ -51,55 +51,49 @@ do { \ | |||
| 51 | do { \ | 51 | do { \ |
| 52 | CMD; \ | 52 | CMD; \ |
| 53 | } while (0); \ | 53 | } while (0); \ |
| 54 | } while (0); | 54 | } while (0) |
| 55 | 55 | ||
| 56 | #define FC_LIBFC_DBG(fmt, args...) \ | 56 | #define FC_LIBFC_DBG(fmt, args...) \ |
| 57 | FC_CHECK_LOGGING(FC_LIBFC_LOGGING, \ | 57 | FC_CHECK_LOGGING(FC_LIBFC_LOGGING, \ |
| 58 | printk(KERN_INFO "libfc: " fmt, ##args);) | 58 | printk(KERN_INFO "libfc: " fmt, ##args)) |
| 59 | 59 | ||
| 60 | #define FC_LPORT_DBG(lport, fmt, args...) \ | 60 | #define FC_LPORT_DBG(lport, fmt, args...) \ |
| 61 | FC_CHECK_LOGGING(FC_LPORT_LOGGING, \ | 61 | FC_CHECK_LOGGING(FC_LPORT_LOGGING, \ |
| 62 | printk(KERN_INFO "lport: %6x: " fmt, \ | 62 | printk(KERN_INFO "host%u: lport %6x: " fmt, \ |
| 63 | fc_host_port_id(lport->host), ##args);) | 63 | (lport)->host->host_no, \ |
| 64 | fc_host_port_id((lport)->host), ##args)) | ||
| 64 | 65 | ||
| 65 | #define FC_DISC_DBG(disc, fmt, args...) \ | 66 | #define FC_DISC_DBG(disc, fmt, args...) \ |
| 66 | FC_CHECK_LOGGING(FC_DISC_LOGGING, \ | 67 | FC_CHECK_LOGGING(FC_DISC_LOGGING, \ |
| 67 | printk(KERN_INFO "disc: %6x: " fmt, \ | 68 | printk(KERN_INFO "host%u: disc: " fmt, \ |
| 68 | fc_host_port_id(disc->lport->host), \ | 69 | (disc)->lport->host->host_no, \ |
| 69 | ##args);) | 70 | ##args)) |
| 70 | 71 | ||
| 71 | #define FC_RPORT_DBG(rport, fmt, args...) \ | 72 | #define FC_RPORT_ID_DBG(lport, port_id, fmt, args...) \ |
| 72 | do { \ | ||
| 73 | struct fc_rport_libfc_priv *rdata = rport->dd_data; \ | ||
| 74 | struct fc_lport *lport = rdata->local_port; \ | ||
| 75 | FC_CHECK_LOGGING(FC_RPORT_LOGGING, \ | 73 | FC_CHECK_LOGGING(FC_RPORT_LOGGING, \ |
| 76 | printk(KERN_INFO "rport: %6x: %6x: " fmt, \ | 74 | printk(KERN_INFO "host%u: rport %6x: " fmt, \ |
| 77 | fc_host_port_id(lport->host), \ | 75 | (lport)->host->host_no, \ |
| 78 | rport->port_id, ##args);) \ | 76 | (port_id), ##args)) |
| 79 | } while (0); | 77 | |
| 78 | #define FC_RPORT_DBG(rdata, fmt, args...) \ | ||
| 79 | FC_RPORT_ID_DBG((rdata)->local_port, (rdata)->ids.port_id, fmt, ##args) | ||
| 80 | 80 | ||
| 81 | #define FC_FCP_DBG(pkt, fmt, args...) \ | 81 | #define FC_FCP_DBG(pkt, fmt, args...) \ |
| 82 | FC_CHECK_LOGGING(FC_FCP_LOGGING, \ | 82 | FC_CHECK_LOGGING(FC_FCP_LOGGING, \ |
| 83 | printk(KERN_INFO "fcp: %6x: %6x: " fmt, \ | 83 | printk(KERN_INFO "host%u: fcp: %6x: " fmt, \ |
| 84 | fc_host_port_id(pkt->lp->host), \ | 84 | (pkt)->lp->host->host_no, \ |
| 85 | pkt->rport->port_id, ##args);) | 85 | pkt->rport->port_id, ##args)) |
| 86 | |||
| 87 | #define FC_EM_DBG(em, fmt, args...) \ | ||
| 88 | FC_CHECK_LOGGING(FC_EM_LOGGING, \ | ||
| 89 | printk(KERN_INFO "em: %6x: " fmt, \ | ||
| 90 | fc_host_port_id(em->lp->host), \ | ||
| 91 | ##args);) | ||
| 92 | 86 | ||
| 93 | #define FC_EXCH_DBG(exch, fmt, args...) \ | 87 | #define FC_EXCH_DBG(exch, fmt, args...) \ |
| 94 | FC_CHECK_LOGGING(FC_EXCH_LOGGING, \ | 88 | FC_CHECK_LOGGING(FC_EXCH_LOGGING, \ |
| 95 | printk(KERN_INFO "exch: %6x: %4x: " fmt, \ | 89 | printk(KERN_INFO "host%u: xid %4x: " fmt, \ |
| 96 | fc_host_port_id(exch->lp->host), \ | 90 | (exch)->lp->host->host_no, \ |
| 97 | exch->xid, ##args);) | 91 | exch->xid, ##args)) |
| 98 | 92 | ||
| 99 | #define FC_SCSI_DBG(lport, fmt, args...) \ | 93 | #define FC_SCSI_DBG(lport, fmt, args...) \ |
| 100 | FC_CHECK_LOGGING(FC_SCSI_LOGGING, \ | 94 | FC_CHECK_LOGGING(FC_SCSI_LOGGING, \ |
| 101 | printk(KERN_INFO "scsi: %6x: " fmt, \ | 95 | printk(KERN_INFO "host%u: scsi: " fmt, \ |
| 102 | fc_host_port_id(lport->host), ##args);) | 96 | (lport)->host->host_no, ##args)) |
| 103 | 97 | ||
| 104 | /* | 98 | /* |
| 105 | * libfc error codes | 99 | * libfc error codes |
| @@ -125,7 +119,7 @@ do { \ | |||
| 125 | * FC HBA status | 119 | * FC HBA status |
| 126 | */ | 120 | */ |
| 127 | enum fc_lport_state { | 121 | enum fc_lport_state { |
| 128 | LPORT_ST_NONE = 0, | 122 | LPORT_ST_DISABLED = 0, |
| 129 | LPORT_ST_FLOGI, | 123 | LPORT_ST_FLOGI, |
| 130 | LPORT_ST_DNS, | 124 | LPORT_ST_DNS, |
| 131 | LPORT_ST_RPN_ID, | 125 | LPORT_ST_RPN_ID, |
| @@ -143,53 +137,74 @@ enum fc_disc_event { | |||
| 143 | }; | 137 | }; |
| 144 | 138 | ||
| 145 | enum fc_rport_state { | 139 | enum fc_rport_state { |
| 146 | RPORT_ST_NONE = 0, | ||
| 147 | RPORT_ST_INIT, /* initialized */ | 140 | RPORT_ST_INIT, /* initialized */ |
| 148 | RPORT_ST_PLOGI, /* waiting for PLOGI completion */ | 141 | RPORT_ST_PLOGI, /* waiting for PLOGI completion */ |
| 149 | RPORT_ST_PRLI, /* waiting for PRLI completion */ | 142 | RPORT_ST_PRLI, /* waiting for PRLI completion */ |
| 150 | RPORT_ST_RTV, /* waiting for RTV completion */ | 143 | RPORT_ST_RTV, /* waiting for RTV completion */ |
| 151 | RPORT_ST_READY, /* ready for use */ | 144 | RPORT_ST_READY, /* ready for use */ |
| 152 | RPORT_ST_LOGO, /* port logout sent */ | 145 | RPORT_ST_LOGO, /* port logout sent */ |
| 153 | }; | 146 | RPORT_ST_ADISC, /* Discover Address sent */ |
| 154 | 147 | RPORT_ST_DELETE, /* port being deleted */ | |
| 155 | enum fc_rport_trans_state { | ||
| 156 | FC_PORTSTATE_ROGUE, | ||
| 157 | FC_PORTSTATE_REAL, | ||
| 158 | }; | 148 | }; |
| 159 | 149 | ||
| 160 | /** | 150 | /** |
| 161 | * struct fc_disc_port - temporary discovery port to hold rport identifiers | 151 | * struct fc_disc_port - temporary discovery port to hold rport identifiers |
| 162 | * @lp: Fibre Channel host port instance | 152 | * @lp: Fibre Channel host port instance |
| 163 | * @peers: node for list management during discovery and RSCN processing | 153 | * @peers: Node for list management during discovery and RSCN processing |
| 164 | * @ids: identifiers structure to pass to fc_remote_port_add() | 154 | * @rport_work: Work struct for starting the rport state machine |
| 165 | * @rport_work: work struct for starting the rport state machine | 155 | * @port_id: Port ID of the discovered port |
| 166 | */ | 156 | */ |
| 167 | struct fc_disc_port { | 157 | struct fc_disc_port { |
| 168 | struct fc_lport *lp; | 158 | struct fc_lport *lp; |
| 169 | struct list_head peers; | 159 | struct list_head peers; |
| 170 | struct fc_rport_identifiers ids; | ||
| 171 | struct work_struct rport_work; | 160 | struct work_struct rport_work; |
| 161 | u32 port_id; | ||
| 172 | }; | 162 | }; |
| 173 | 163 | ||
| 174 | enum fc_rport_event { | 164 | enum fc_rport_event { |
| 175 | RPORT_EV_NONE = 0, | 165 | RPORT_EV_NONE = 0, |
| 176 | RPORT_EV_CREATED, | 166 | RPORT_EV_READY, |
| 177 | RPORT_EV_FAILED, | 167 | RPORT_EV_FAILED, |
| 178 | RPORT_EV_STOP, | 168 | RPORT_EV_STOP, |
| 179 | RPORT_EV_LOGO | 169 | RPORT_EV_LOGO |
| 180 | }; | 170 | }; |
| 181 | 171 | ||
| 172 | struct fc_rport_priv; | ||
| 173 | |||
| 182 | struct fc_rport_operations { | 174 | struct fc_rport_operations { |
| 183 | void (*event_callback)(struct fc_lport *, struct fc_rport *, | 175 | void (*event_callback)(struct fc_lport *, struct fc_rport_priv *, |
| 184 | enum fc_rport_event); | 176 | enum fc_rport_event); |
| 185 | }; | 177 | }; |
| 186 | 178 | ||
| 187 | /** | 179 | /** |
| 188 | * struct fc_rport_libfc_priv - libfc internal information about a remote port | 180 | * struct fc_rport_libfc_priv - libfc internal information about a remote port |
| 189 | * @local_port: Fibre Channel host port instance | 181 | * @local_port: Fibre Channel host port instance |
| 182 | * @rp_state: indicates READY for I/O or DELETE when blocked. | ||
| 183 | * @flags: REC and RETRY supported flags | ||
| 184 | * @e_d_tov: error detect timeout value (in msec) | ||
| 185 | * @r_a_tov: resource allocation timeout value (in msec) | ||
| 186 | */ | ||
| 187 | struct fc_rport_libfc_priv { | ||
| 188 | struct fc_lport *local_port; | ||
| 189 | enum fc_rport_state rp_state; | ||
| 190 | u16 flags; | ||
| 191 | #define FC_RP_FLAGS_REC_SUPPORTED (1 << 0) | ||
| 192 | #define FC_RP_FLAGS_RETRY (1 << 1) | ||
| 193 | unsigned int e_d_tov; | ||
| 194 | unsigned int r_a_tov; | ||
| 195 | }; | ||
| 196 | |||
| 197 | /** | ||
| 198 | * struct fc_rport_priv - libfc rport and discovery info about a remote port | ||
| 199 | * @local_port: Fibre Channel host port instance | ||
| 200 | * @rport: transport remote port | ||
| 201 | * @kref: reference counter | ||
| 190 | * @rp_state: state tracks progress of PLOGI, PRLI, and RTV exchanges | 202 | * @rp_state: state tracks progress of PLOGI, PRLI, and RTV exchanges |
| 203 | * @ids: remote port identifiers and roles | ||
| 191 | * @flags: REC and RETRY supported flags | 204 | * @flags: REC and RETRY supported flags |
| 192 | * @max_seq: maximum number of concurrent sequences | 205 | * @max_seq: maximum number of concurrent sequences |
| 206 | * @disc_id: discovery identifier | ||
| 207 | * @maxframe_size: maximum frame size | ||
| 193 | * @retries: retry count in current state | 208 | * @retries: retry count in current state |
| 194 | * @e_d_tov: error detect timeout value (in msec) | 209 | * @e_d_tov: error detect timeout value (in msec) |
| 195 | * @r_a_tov: resource allocation timeout value (in msec) | 210 | * @r_a_tov: resource allocation timeout value (in msec) |
| @@ -197,38 +212,28 @@ struct fc_rport_operations { | |||
| 197 | * @retry_work: | 212 | * @retry_work: |
| 198 | * @event_callback: Callback for rport READY, FAILED or LOGO | 213 | * @event_callback: Callback for rport READY, FAILED or LOGO |
| 199 | */ | 214 | */ |
| 200 | struct fc_rport_libfc_priv { | 215 | struct fc_rport_priv { |
| 201 | struct fc_lport *local_port; | 216 | struct fc_lport *local_port; |
| 217 | struct fc_rport *rport; | ||
| 218 | struct kref kref; | ||
| 202 | enum fc_rport_state rp_state; | 219 | enum fc_rport_state rp_state; |
| 220 | struct fc_rport_identifiers ids; | ||
| 203 | u16 flags; | 221 | u16 flags; |
| 204 | #define FC_RP_FLAGS_REC_SUPPORTED (1 << 0) | ||
| 205 | #define FC_RP_FLAGS_RETRY (1 << 1) | ||
| 206 | u16 max_seq; | 222 | u16 max_seq; |
| 223 | u16 disc_id; | ||
| 224 | u16 maxframe_size; | ||
| 207 | unsigned int retries; | 225 | unsigned int retries; |
| 208 | unsigned int e_d_tov; | 226 | unsigned int e_d_tov; |
| 209 | unsigned int r_a_tov; | 227 | unsigned int r_a_tov; |
| 210 | enum fc_rport_trans_state trans_state; | ||
| 211 | struct mutex rp_mutex; | 228 | struct mutex rp_mutex; |
| 212 | struct delayed_work retry_work; | 229 | struct delayed_work retry_work; |
| 213 | enum fc_rport_event event; | 230 | enum fc_rport_event event; |
| 214 | struct fc_rport_operations *ops; | 231 | struct fc_rport_operations *ops; |
| 215 | struct list_head peers; | 232 | struct list_head peers; |
| 216 | struct work_struct event_work; | 233 | struct work_struct event_work; |
| 234 | u32 supported_classes; | ||
| 217 | }; | 235 | }; |
| 218 | 236 | ||
| 219 | #define PRIV_TO_RPORT(x) \ | ||
| 220 | (struct fc_rport *)((void *)x - sizeof(struct fc_rport)); | ||
| 221 | #define RPORT_TO_PRIV(x) \ | ||
| 222 | (struct fc_rport_libfc_priv *)((void *)x + sizeof(struct fc_rport)); | ||
| 223 | |||
| 224 | struct fc_rport *fc_rport_rogue_create(struct fc_disc_port *); | ||
| 225 | |||
| 226 | static inline void fc_rport_set_name(struct fc_rport *rport, u64 wwpn, u64 wwnn) | ||
| 227 | { | ||
| 228 | rport->node_name = wwnn; | ||
| 229 | rport->port_name = wwpn; | ||
| 230 | } | ||
| 231 | |||
| 232 | /* | 237 | /* |
| 233 | * fcoe stats structure | 238 | * fcoe stats structure |
| 234 | */ | 239 | */ |
| @@ -344,6 +349,8 @@ static inline bool fc_fcp_is_read(const struct fc_fcp_pkt *fsp) | |||
| 344 | */ | 349 | */ |
| 345 | 350 | ||
| 346 | struct fc_exch_mgr; | 351 | struct fc_exch_mgr; |
| 352 | struct fc_exch_mgr_anchor; | ||
| 353 | extern u16 fc_cpu_mask; /* cpu mask for possible cpus */ | ||
| 347 | 354 | ||
| 348 | /* | 355 | /* |
| 349 | * Sequence. | 356 | * Sequence. |
| @@ -368,6 +375,7 @@ struct fc_seq { | |||
| 368 | */ | 375 | */ |
| 369 | struct fc_exch { | 376 | struct fc_exch { |
| 370 | struct fc_exch_mgr *em; /* exchange manager */ | 377 | struct fc_exch_mgr *em; /* exchange manager */ |
| 378 | struct fc_exch_pool *pool; /* per cpu exches pool */ | ||
| 371 | u32 state; /* internal driver state */ | 379 | u32 state; /* internal driver state */ |
| 372 | u16 xid; /* our exchange ID */ | 380 | u16 xid; /* our exchange ID */ |
| 373 | struct list_head ex_list; /* free or busy list linkage */ | 381 | struct list_head ex_list; /* free or busy list linkage */ |
| @@ -415,7 +423,7 @@ struct libfc_function_template { | |||
| 415 | * STATUS: OPTIONAL | 423 | * STATUS: OPTIONAL |
| 416 | */ | 424 | */ |
| 417 | struct fc_seq *(*elsct_send)(struct fc_lport *lport, | 425 | struct fc_seq *(*elsct_send)(struct fc_lport *lport, |
| 418 | struct fc_rport *rport, | 426 | u32 did, |
| 419 | struct fc_frame *fp, | 427 | struct fc_frame *fp, |
| 420 | unsigned int op, | 428 | unsigned int op, |
| 421 | void (*resp)(struct fc_seq *, | 429 | void (*resp)(struct fc_seq *, |
| @@ -519,25 +527,6 @@ struct libfc_function_template { | |||
| 519 | void (*exch_done)(struct fc_seq *sp); | 527 | void (*exch_done)(struct fc_seq *sp); |
| 520 | 528 | ||
| 521 | /* | 529 | /* |
| 522 | * Assigns a EM and a free XID for an new exchange and then | ||
| 523 | * allocates a new exchange and sequence pair. | ||
| 524 | * The fp can be used to determine free XID. | ||
| 525 | * | ||
| 526 | * STATUS: OPTIONAL | ||
| 527 | */ | ||
| 528 | struct fc_exch *(*exch_get)(struct fc_lport *lp, struct fc_frame *fp); | ||
| 529 | |||
| 530 | /* | ||
| 531 | * Release previously assigned XID by exch_get API. | ||
| 532 | * The LLD may implement this if XID is assigned by LLD | ||
| 533 | * in exch_get(). | ||
| 534 | * | ||
| 535 | * STATUS: OPTIONAL | ||
| 536 | */ | ||
| 537 | void (*exch_put)(struct fc_lport *lp, struct fc_exch_mgr *mp, | ||
| 538 | u16 ex_id); | ||
| 539 | |||
| 540 | /* | ||
| 541 | * Start a new sequence on the same exchange/sequence tuple. | 530 | * Start a new sequence on the same exchange/sequence tuple. |
| 542 | * | 531 | * |
| 543 | * STATUS: OPTIONAL | 532 | * STATUS: OPTIONAL |
| @@ -577,9 +566,11 @@ struct libfc_function_template { | |||
| 577 | int (*lport_reset)(struct fc_lport *); | 566 | int (*lport_reset)(struct fc_lport *); |
| 578 | 567 | ||
| 579 | /* | 568 | /* |
| 580 | * Create a remote port | 569 | * Create a remote port with a given port ID |
| 570 | * | ||
| 571 | * STATUS: OPTIONAL | ||
| 581 | */ | 572 | */ |
| 582 | struct fc_rport *(*rport_create)(struct fc_disc_port *); | 573 | struct fc_rport_priv *(*rport_create)(struct fc_lport *, u32); |
| 583 | 574 | ||
| 584 | /* | 575 | /* |
| 585 | * Initiates the RP state machine. It is called from the LP module. | 576 | * Initiates the RP state machine. It is called from the LP module. |
| @@ -592,7 +583,7 @@ struct libfc_function_template { | |||
| 592 | * | 583 | * |
| 593 | * STATUS: OPTIONAL | 584 | * STATUS: OPTIONAL |
| 594 | */ | 585 | */ |
| 595 | int (*rport_login)(struct fc_rport *rport); | 586 | int (*rport_login)(struct fc_rport_priv *); |
| 596 | 587 | ||
| 597 | /* | 588 | /* |
| 598 | * Logoff, and remove the rport from the transport if | 589 | * Logoff, and remove the rport from the transport if |
| @@ -600,7 +591,7 @@ struct libfc_function_template { | |||
| 600 | * | 591 | * |
| 601 | * STATUS: OPTIONAL | 592 | * STATUS: OPTIONAL |
| 602 | */ | 593 | */ |
| 603 | int (*rport_logoff)(struct fc_rport *rport); | 594 | int (*rport_logoff)(struct fc_rport_priv *); |
| 604 | 595 | ||
| 605 | /* | 596 | /* |
| 606 | * Recieve a request from a remote port. | 597 | * Recieve a request from a remote port. |
| @@ -608,14 +599,20 @@ struct libfc_function_template { | |||
| 608 | * STATUS: OPTIONAL | 599 | * STATUS: OPTIONAL |
| 609 | */ | 600 | */ |
| 610 | void (*rport_recv_req)(struct fc_seq *, struct fc_frame *, | 601 | void (*rport_recv_req)(struct fc_seq *, struct fc_frame *, |
| 611 | struct fc_rport *); | 602 | struct fc_lport *); |
| 612 | 603 | ||
| 613 | /* | 604 | /* |
| 614 | * lookup an rport by it's port ID. | 605 | * lookup an rport by it's port ID. |
| 615 | * | 606 | * |
| 616 | * STATUS: OPTIONAL | 607 | * STATUS: OPTIONAL |
| 617 | */ | 608 | */ |
| 618 | struct fc_rport *(*rport_lookup)(const struct fc_lport *, u32); | 609 | struct fc_rport_priv *(*rport_lookup)(const struct fc_lport *, u32); |
| 610 | |||
| 611 | /* | ||
| 612 | * Destroy an rport after final kref_put(). | ||
| 613 | * The argument is a pointer to the kref inside the fc_rport_priv. | ||
| 614 | */ | ||
| 615 | void (*rport_destroy)(struct kref *); | ||
| 619 | 616 | ||
| 620 | /* | 617 | /* |
| 621 | * Send a fcp cmd from fsp pkt. | 618 | * Send a fcp cmd from fsp pkt. |
| @@ -681,18 +678,16 @@ struct libfc_function_template { | |||
| 681 | /* information used by the discovery layer */ | 678 | /* information used by the discovery layer */ |
| 682 | struct fc_disc { | 679 | struct fc_disc { |
| 683 | unsigned char retry_count; | 680 | unsigned char retry_count; |
| 684 | unsigned char delay; | ||
| 685 | unsigned char pending; | 681 | unsigned char pending; |
| 686 | unsigned char requested; | 682 | unsigned char requested; |
| 687 | unsigned short seq_count; | 683 | unsigned short seq_count; |
| 688 | unsigned char buf_len; | 684 | unsigned char buf_len; |
| 689 | enum fc_disc_event event; | 685 | u16 disc_id; |
| 690 | 686 | ||
| 691 | void (*disc_callback)(struct fc_lport *, | 687 | void (*disc_callback)(struct fc_lport *, |
| 692 | enum fc_disc_event); | 688 | enum fc_disc_event); |
| 693 | 689 | ||
| 694 | struct list_head rports; | 690 | struct list_head rports; |
| 695 | struct list_head rogue_rports; | ||
| 696 | struct fc_lport *lport; | 691 | struct fc_lport *lport; |
| 697 | struct mutex disc_mutex; | 692 | struct mutex disc_mutex; |
| 698 | struct fc_gpn_ft_resp partial_buf; /* partial name buffer */ | 693 | struct fc_gpn_ft_resp partial_buf; /* partial name buffer */ |
| @@ -704,9 +699,9 @@ struct fc_lport { | |||
| 704 | 699 | ||
| 705 | /* Associations */ | 700 | /* Associations */ |
| 706 | struct Scsi_Host *host; | 701 | struct Scsi_Host *host; |
| 707 | struct fc_exch_mgr *emp; | 702 | struct list_head ema_list; |
| 708 | struct fc_rport *dns_rp; | 703 | struct fc_rport_priv *dns_rp; |
| 709 | struct fc_rport *ptp_rp; | 704 | struct fc_rport_priv *ptp_rp; |
| 710 | void *scsi_priv; | 705 | void *scsi_priv; |
| 711 | struct fc_disc disc; | 706 | struct fc_disc disc; |
| 712 | 707 | ||
| @@ -960,6 +955,28 @@ int fc_elsct_init(struct fc_lport *lp); | |||
| 960 | int fc_exch_init(struct fc_lport *lp); | 955 | int fc_exch_init(struct fc_lport *lp); |
| 961 | 956 | ||
| 962 | /* | 957 | /* |
| 958 | * Adds Exchange Manager (EM) mp to lport. | ||
| 959 | * | ||
| 960 | * Adds specified mp to lport using struct fc_exch_mgr_anchor, | ||
| 961 | * the struct fc_exch_mgr_anchor allows same EM sharing by | ||
| 962 | * more than one lport with their specified match function, | ||
| 963 | * the match function is used in allocating exchange from | ||
| 964 | * added mp. | ||
| 965 | */ | ||
| 966 | struct fc_exch_mgr_anchor *fc_exch_mgr_add(struct fc_lport *lport, | ||
| 967 | struct fc_exch_mgr *mp, | ||
| 968 | bool (*match)(struct fc_frame *)); | ||
| 969 | |||
| 970 | /* | ||
| 971 | * Deletes Exchange Manager (EM) from lport by removing | ||
| 972 | * its anchor ema from lport. | ||
| 973 | * | ||
| 974 | * If removed anchor ema was the last user of its associated EM | ||
| 975 | * then also destroys associated EM. | ||
| 976 | */ | ||
| 977 | void fc_exch_mgr_del(struct fc_exch_mgr_anchor *ema); | ||
| 978 | |||
| 979 | /* | ||
| 963 | * Allocates an Exchange Manager (EM). | 980 | * Allocates an Exchange Manager (EM). |
| 964 | * | 981 | * |
| 965 | * The EM manages exchanges for their allocation and | 982 | * The EM manages exchanges for their allocation and |
| @@ -974,27 +991,25 @@ int fc_exch_init(struct fc_lport *lp); | |||
| 974 | * a new exchange. | 991 | * a new exchange. |
| 975 | * The LLD may choose to have multiple EMs, | 992 | * The LLD may choose to have multiple EMs, |
| 976 | * e.g. one EM instance per CPU receive thread in LLD. | 993 | * e.g. one EM instance per CPU receive thread in LLD. |
| 977 | * The LLD can use exch_get() of struct libfc_function_template | ||
| 978 | * to specify XID for a new exchange within | ||
| 979 | * a specified EM instance. | ||
| 980 | * | 994 | * |
| 981 | * The em_idx to uniquely identify an EM instance. | 995 | * Specified match function is used in allocating exchanges |
| 996 | * from newly allocated EM. | ||
| 982 | */ | 997 | */ |
| 983 | struct fc_exch_mgr *fc_exch_mgr_alloc(struct fc_lport *lp, | 998 | struct fc_exch_mgr *fc_exch_mgr_alloc(struct fc_lport *lp, |
| 984 | enum fc_class class, | 999 | enum fc_class class, |
| 985 | u16 min_xid, | 1000 | u16 min_xid, |
| 986 | u16 max_xid); | 1001 | u16 max_xid, |
| 1002 | bool (*match)(struct fc_frame *)); | ||
| 987 | 1003 | ||
| 988 | /* | 1004 | /* |
| 989 | * Free an exchange manager. | 1005 | * Free all exchange managers of a lport. |
| 990 | */ | 1006 | */ |
| 991 | void fc_exch_mgr_free(struct fc_exch_mgr *mp); | 1007 | void fc_exch_mgr_free(struct fc_lport *lport); |
| 992 | 1008 | ||
| 993 | /* | 1009 | /* |
| 994 | * Receive a frame on specified local port and exchange manager. | 1010 | * Receive a frame on specified local port and exchange manager. |
| 995 | */ | 1011 | */ |
| 996 | void fc_exch_recv(struct fc_lport *lp, struct fc_exch_mgr *mp, | 1012 | void fc_exch_recv(struct fc_lport *lp, struct fc_frame *fp); |
| 997 | struct fc_frame *fp); | ||
| 998 | 1013 | ||
| 999 | /* | 1014 | /* |
| 1000 | * This function is for exch_seq_send function pointer in | 1015 | * This function is for exch_seq_send function pointer in |
| @@ -1036,28 +1051,20 @@ int fc_seq_exch_abort(const struct fc_seq *req_sp, unsigned int timer_msec); | |||
| 1036 | void fc_exch_done(struct fc_seq *sp); | 1051 | void fc_exch_done(struct fc_seq *sp); |
| 1037 | 1052 | ||
| 1038 | /* | 1053 | /* |
| 1039 | * Assigns a EM and XID for a frame and then allocates | ||
| 1040 | * a new exchange and sequence pair. | ||
| 1041 | * The fp can be used to determine free XID. | ||
| 1042 | */ | ||
| 1043 | struct fc_exch *fc_exch_get(struct fc_lport *lp, struct fc_frame *fp); | ||
| 1044 | |||
| 1045 | /* | ||
| 1046 | * Allocate a new exchange and sequence pair. | 1054 | * Allocate a new exchange and sequence pair. |
| 1047 | * if ex_id is zero then next free exchange id | ||
| 1048 | * from specified exchange manger mp will be assigned. | ||
| 1049 | */ | 1055 | */ |
| 1050 | struct fc_exch *fc_exch_alloc(struct fc_exch_mgr *mp, | 1056 | struct fc_exch *fc_exch_alloc(struct fc_lport *lport, struct fc_frame *fp); |
| 1051 | struct fc_frame *fp, u16 ex_id); | ||
| 1052 | /* | 1057 | /* |
| 1053 | * Start a new sequence on the same exchange as the supplied sequence. | 1058 | * Start a new sequence on the same exchange as the supplied sequence. |
| 1054 | */ | 1059 | */ |
| 1055 | struct fc_seq *fc_seq_start_next(struct fc_seq *sp); | 1060 | struct fc_seq *fc_seq_start_next(struct fc_seq *sp); |
| 1056 | 1061 | ||
| 1062 | |||
| 1057 | /* | 1063 | /* |
| 1058 | * Reset an exchange manager, completing all sequences and exchanges. | 1064 | * Reset all EMs of a lport, releasing its all sequences and |
| 1059 | * If s_id is non-zero, reset only exchanges originating from that FID. | 1065 | * exchanges. If sid is non-zero, then reset only exchanges |
| 1060 | * If d_id is non-zero, reset only exchanges sending to that FID. | 1066 | * we sourced from that FID. If did is non-zero, reset only |
| 1067 | * exchanges destined to that FID. | ||
| 1061 | */ | 1068 | */ |
| 1062 | void fc_exch_mgr_reset(struct fc_lport *, u32 s_id, u32 d_id); | 1069 | void fc_exch_mgr_reset(struct fc_lport *, u32 s_id, u32 d_id); |
| 1063 | 1070 | ||
| @@ -1078,4 +1085,9 @@ void fc_destroy_exch_mgr(void); | |||
| 1078 | int fc_setup_rport(void); | 1085 | int fc_setup_rport(void); |
| 1079 | void fc_destroy_rport(void); | 1086 | void fc_destroy_rport(void); |
| 1080 | 1087 | ||
| 1088 | /* | ||
| 1089 | * Internal libfc functions. | ||
| 1090 | */ | ||
| 1091 | const char *fc_els_resp_type(struct fc_frame *); | ||
| 1092 | |||
| 1081 | #endif /* _LIBFC_H_ */ | 1093 | #endif /* _LIBFC_H_ */ |
diff --git a/include/scsi/libiscsi.h b/include/scsi/libiscsi.h index 61afeb59a836..887e57e3e223 100644 --- a/include/scsi/libiscsi.h +++ b/include/scsi/libiscsi.h | |||
| @@ -390,6 +390,7 @@ extern void iscsi_session_failure(struct iscsi_session *session, | |||
| 390 | extern int iscsi_conn_get_param(struct iscsi_cls_conn *cls_conn, | 390 | extern int iscsi_conn_get_param(struct iscsi_cls_conn *cls_conn, |
| 391 | enum iscsi_param param, char *buf); | 391 | enum iscsi_param param, char *buf); |
| 392 | extern void iscsi_suspend_tx(struct iscsi_conn *conn); | 392 | extern void iscsi_suspend_tx(struct iscsi_conn *conn); |
| 393 | extern void iscsi_suspend_queue(struct iscsi_conn *conn); | ||
| 393 | extern void iscsi_conn_queue_work(struct iscsi_conn *conn); | 394 | extern void iscsi_conn_queue_work(struct iscsi_conn *conn); |
| 394 | 395 | ||
| 395 | #define iscsi_conn_printk(prefix, _c, fmt, a...) \ | 396 | #define iscsi_conn_printk(prefix, _c, fmt, a...) \ |
| @@ -415,6 +416,8 @@ extern struct iscsi_task *iscsi_itt_to_task(struct iscsi_conn *, itt_t); | |||
| 415 | extern void iscsi_requeue_task(struct iscsi_task *task); | 416 | extern void iscsi_requeue_task(struct iscsi_task *task); |
| 416 | extern void iscsi_put_task(struct iscsi_task *task); | 417 | extern void iscsi_put_task(struct iscsi_task *task); |
| 417 | extern void __iscsi_get_task(struct iscsi_task *task); | 418 | extern void __iscsi_get_task(struct iscsi_task *task); |
| 419 | extern void iscsi_complete_scsi_task(struct iscsi_task *task, | ||
| 420 | uint32_t exp_cmdsn, uint32_t max_cmdsn); | ||
| 418 | 421 | ||
| 419 | /* | 422 | /* |
| 420 | * generic helpers | 423 | * generic helpers |
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index 3f566af3f101..9af48cbf0036 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h | |||
| @@ -187,10 +187,13 @@ struct scsi_device_handler { | |||
| 187 | void (*detach)(struct scsi_device *); | 187 | void (*detach)(struct scsi_device *); |
| 188 | int (*activate)(struct scsi_device *); | 188 | int (*activate)(struct scsi_device *); |
| 189 | int (*prep_fn)(struct scsi_device *, struct request *); | 189 | int (*prep_fn)(struct scsi_device *, struct request *); |
| 190 | int (*set_params)(struct scsi_device *, const char *); | ||
| 190 | }; | 191 | }; |
| 191 | 192 | ||
| 192 | struct scsi_dh_data { | 193 | struct scsi_dh_data { |
| 193 | struct scsi_device_handler *scsi_dh; | 194 | struct scsi_device_handler *scsi_dh; |
| 195 | struct scsi_device *sdev; | ||
| 196 | struct kref kref; | ||
| 194 | char buf[0]; | 197 | char buf[0]; |
| 195 | }; | 198 | }; |
| 196 | 199 | ||
diff --git a/include/scsi/scsi_dh.h b/include/scsi/scsi_dh.h index 33efce20c26c..ff2407405b42 100644 --- a/include/scsi/scsi_dh.h +++ b/include/scsi/scsi_dh.h | |||
| @@ -60,6 +60,7 @@ extern int scsi_dh_activate(struct request_queue *); | |||
| 60 | extern int scsi_dh_handler_exist(const char *); | 60 | extern int scsi_dh_handler_exist(const char *); |
| 61 | extern int scsi_dh_attach(struct request_queue *, const char *); | 61 | extern int scsi_dh_attach(struct request_queue *, const char *); |
| 62 | extern void scsi_dh_detach(struct request_queue *); | 62 | extern void scsi_dh_detach(struct request_queue *); |
| 63 | extern int scsi_dh_set_params(struct request_queue *, const char *); | ||
| 63 | #else | 64 | #else |
| 64 | static inline int scsi_dh_activate(struct request_queue *req) | 65 | static inline int scsi_dh_activate(struct request_queue *req) |
| 65 | { | 66 | { |
| @@ -77,4 +78,8 @@ static inline void scsi_dh_detach(struct request_queue *q) | |||
| 77 | { | 78 | { |
| 78 | return; | 79 | return; |
| 79 | } | 80 | } |
| 81 | static inline int scsi_dh_set_params(struct request_queue *req, const char *params) | ||
| 82 | { | ||
| 83 | return -SCSI_DH_NOSYS; | ||
| 84 | } | ||
| 80 | #endif | 85 | #endif |
