diff options
author | Maggie Zhang <xmzhang@brocade.com> | 2010-12-09 22:11:39 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-12-21 13:32:47 -0500 |
commit | f314878ab95d4802ddde066096f7b30087cea7ba (patch) | |
tree | b5f45f7be429386ca5b209d9058680f448541a43 /drivers/scsi | |
parent | e3e7d3eebb08735c8a14cd27f76dac784e9a9b75 (diff) |
[SCSI] bfa: remove all SCSI IO callbacks
Remove SCSI IO callbacks, and as a result remove bfa_cb_ioim.h.
Signed-off-by: Maggie Zhang <xmzhang@brocade.com>
Signed-off-by: Jing Huang <huangj@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/bfa/bfa_cb_ioim.h | 169 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfa_defs.h | 4 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfa_fc.h | 5 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfa_fcpim.c | 53 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfa_fcpim.h | 8 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfad_im.c | 10 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfi.h | 2 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfi_ms.h | 2 |
8 files changed, 49 insertions, 204 deletions
diff --git a/drivers/scsi/bfa/bfa_cb_ioim.h b/drivers/scsi/bfa/bfa_cb_ioim.h deleted file mode 100644 index afb573878e20..000000000000 --- a/drivers/scsi/bfa/bfa_cb_ioim.h +++ /dev/null | |||
@@ -1,169 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2005-2010 Brocade Communications Systems, Inc. | ||
3 | * All rights reserved | ||
4 | * www.brocade.com | ||
5 | * | ||
6 | * Linux driver for Brocade Fibre Channel Host Bus Adapter. | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify it | ||
9 | * under the terms of the GNU General Public License (GPL) Version 2 as | ||
10 | * published by the Free Software Foundation | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, but | ||
13 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
15 | * General Public License for more details. | ||
16 | */ | ||
17 | |||
18 | #ifndef __BFA_HCB_IOIM_H__ | ||
19 | #define __BFA_HCB_IOIM_H__ | ||
20 | |||
21 | #include "bfa_os_inc.h" | ||
22 | /* | ||
23 | * task attribute values in FCP-2 FCP_CMND IU | ||
24 | */ | ||
25 | #define SIMPLE_Q 0 | ||
26 | #define HEAD_OF_Q 1 | ||
27 | #define ORDERED_Q 2 | ||
28 | #define ACA_Q 4 | ||
29 | #define UNTAGGED 5 | ||
30 | |||
31 | static inline lun_t | ||
32 | bfad_int_to_lun(u32 luno) | ||
33 | { | ||
34 | union { | ||
35 | __be16 scsi_lun[4]; | ||
36 | lun_t bfa_lun; | ||
37 | } lun; | ||
38 | |||
39 | lun.bfa_lun = 0; | ||
40 | lun.scsi_lun[0] = cpu_to_be16(luno); | ||
41 | |||
42 | return lun.bfa_lun; | ||
43 | } | ||
44 | |||
45 | /* | ||
46 | * Get LUN for the I/O request | ||
47 | */ | ||
48 | #define bfa_cb_ioim_get_lun(__dio) \ | ||
49 | bfad_int_to_lun(((struct scsi_cmnd *)__dio)->device->lun) | ||
50 | |||
51 | /* | ||
52 | * Get CDB for the I/O request | ||
53 | */ | ||
54 | static inline u8 * | ||
55 | bfa_cb_ioim_get_cdb(struct bfad_ioim_s *dio) | ||
56 | { | ||
57 | struct scsi_cmnd *cmnd = (struct scsi_cmnd *)dio; | ||
58 | |||
59 | return (u8 *) cmnd->cmnd; | ||
60 | } | ||
61 | |||
62 | /* | ||
63 | * Get I/O direction (read/write) for the I/O request | ||
64 | */ | ||
65 | static inline enum fcp_iodir | ||
66 | bfa_cb_ioim_get_iodir(struct bfad_ioim_s *dio) | ||
67 | { | ||
68 | struct scsi_cmnd *cmnd = (struct scsi_cmnd *)dio; | ||
69 | enum dma_data_direction dmadir; | ||
70 | |||
71 | dmadir = cmnd->sc_data_direction; | ||
72 | if (dmadir == DMA_TO_DEVICE) | ||
73 | return FCP_IODIR_WRITE; | ||
74 | else if (dmadir == DMA_FROM_DEVICE) | ||
75 | return FCP_IODIR_READ; | ||
76 | else | ||
77 | return FCP_IODIR_NONE; | ||
78 | } | ||
79 | |||
80 | /* | ||
81 | * Get IO size in bytes for the I/O request | ||
82 | */ | ||
83 | static inline u32 | ||
84 | bfa_cb_ioim_get_size(struct bfad_ioim_s *dio) | ||
85 | { | ||
86 | struct scsi_cmnd *cmnd = (struct scsi_cmnd *)dio; | ||
87 | |||
88 | return scsi_bufflen(cmnd); | ||
89 | } | ||
90 | |||
91 | /* | ||
92 | * Get timeout for the I/O request | ||
93 | */ | ||
94 | static inline u8 | ||
95 | bfa_cb_ioim_get_timeout(struct bfad_ioim_s *dio) | ||
96 | { | ||
97 | struct scsi_cmnd *cmnd = (struct scsi_cmnd *)dio; | ||
98 | /* | ||
99 | * TBD: need a timeout for scsi passthru | ||
100 | */ | ||
101 | if (cmnd->device->host == NULL) | ||
102 | return 4; | ||
103 | |||
104 | return 0; | ||
105 | } | ||
106 | |||
107 | /* | ||
108 | * Get Command Reference Number for the I/O request. 0 if none. | ||
109 | */ | ||
110 | static inline u8 | ||
111 | bfa_cb_ioim_get_crn(struct bfad_ioim_s *dio) | ||
112 | { | ||
113 | return 0; | ||
114 | } | ||
115 | |||
116 | /* | ||
117 | * Get SAM-3 priority for the I/O request. 0 is default. | ||
118 | */ | ||
119 | static inline u8 | ||
120 | bfa_cb_ioim_get_priority(struct bfad_ioim_s *dio) | ||
121 | { | ||
122 | return 0; | ||
123 | } | ||
124 | |||
125 | /* | ||
126 | * Get task attributes for the I/O request. Default is FCP_TASK_ATTR_SIMPLE(0). | ||
127 | */ | ||
128 | static inline u8 | ||
129 | bfa_cb_ioim_get_taskattr(struct bfad_ioim_s *dio) | ||
130 | { | ||
131 | struct scsi_cmnd *cmnd = (struct scsi_cmnd *)dio; | ||
132 | u8 task_attr = UNTAGGED; | ||
133 | |||
134 | if (cmnd->device->tagged_supported) { | ||
135 | switch (cmnd->tag) { | ||
136 | case HEAD_OF_QUEUE_TAG: | ||
137 | task_attr = HEAD_OF_Q; | ||
138 | break; | ||
139 | case ORDERED_QUEUE_TAG: | ||
140 | task_attr = ORDERED_Q; | ||
141 | break; | ||
142 | default: | ||
143 | task_attr = SIMPLE_Q; | ||
144 | break; | ||
145 | } | ||
146 | } | ||
147 | |||
148 | return task_attr; | ||
149 | } | ||
150 | |||
151 | /* | ||
152 | * Get CDB length in bytes for the I/O request. Default is FCP_CMND_CDB_LEN(16). | ||
153 | */ | ||
154 | static inline u8 | ||
155 | bfa_cb_ioim_get_cdblen(struct bfad_ioim_s *dio) | ||
156 | { | ||
157 | struct scsi_cmnd *cmnd = (struct scsi_cmnd *)dio; | ||
158 | |||
159 | return cmnd->cmd_len; | ||
160 | } | ||
161 | |||
162 | /* | ||
163 | * Assign queue to be used for the I/O request. This value depends on whether | ||
164 | * the driver wants to use the queues via any specific algorithm. Currently, | ||
165 | * this is not supported. | ||
166 | */ | ||
167 | #define bfa_cb_ioim_get_reqq(__dio) BFA_FALSE | ||
168 | |||
169 | #endif /* __BFA_HCB_IOIM_H__ */ | ||
diff --git a/drivers/scsi/bfa/bfa_defs.h b/drivers/scsi/bfa/bfa_defs.h index 4b5b9e35abb9..07b57c4208c1 100644 --- a/drivers/scsi/bfa/bfa_defs.h +++ b/drivers/scsi/bfa/bfa_defs.h | |||
@@ -446,8 +446,8 @@ enum bfa_boot_bootopt { | |||
446 | * Boot lun information. | 446 | * Boot lun information. |
447 | */ | 447 | */ |
448 | struct bfa_boot_bootlun_s { | 448 | struct bfa_boot_bootlun_s { |
449 | wwn_t pwwn; /* port wwn of target */ | 449 | wwn_t pwwn; /* port wwn of target */ |
450 | lun_t lun; /* 64-bit lun */ | 450 | struct scsi_lun lun; /* 64-bit lun */ |
451 | }; | 451 | }; |
452 | #pragma pack() | 452 | #pragma pack() |
453 | 453 | ||
diff --git a/drivers/scsi/bfa/bfa_fc.h b/drivers/scsi/bfa/bfa_fc.h index ce5274a017fa..104a17f70b55 100644 --- a/drivers/scsi/bfa/bfa_fc.h +++ b/drivers/scsi/bfa/bfa_fc.h | |||
@@ -21,7 +21,6 @@ | |||
21 | #include "bfa_os_inc.h" | 21 | #include "bfa_os_inc.h" |
22 | 22 | ||
23 | typedef u64 wwn_t; | 23 | typedef u64 wwn_t; |
24 | typedef u64 lun_t; | ||
25 | 24 | ||
26 | #define WWN_NULL (0) | 25 | #define WWN_NULL (0) |
27 | #define FC_SYMNAME_MAX 256 /* max name server symbolic name size */ | 26 | #define FC_SYMNAME_MAX 256 /* max name server symbolic name size */ |
@@ -1176,8 +1175,8 @@ struct fc_srr_s { | |||
1176 | #define FCP_CMND_LUN_LEN 8 | 1175 | #define FCP_CMND_LUN_LEN 8 |
1177 | 1176 | ||
1178 | struct fcp_cmnd_s { | 1177 | struct fcp_cmnd_s { |
1179 | lun_t lun; /* 64-bit LU number */ | 1178 | struct scsi_lun lun; /* 64-bit LU number */ |
1180 | u8 crn; /* command reference number */ | 1179 | u8 crn; /* command reference number */ |
1181 | #ifdef __BIGENDIAN | 1180 | #ifdef __BIGENDIAN |
1182 | u8 resvd:1, | 1181 | u8 resvd:1, |
1183 | priority:4, /* FCP-3: SAM-3 priority */ | 1182 | priority:4, /* FCP-3: SAM-3 priority */ |
diff --git a/drivers/scsi/bfa/bfa_fcpim.c b/drivers/scsi/bfa/bfa_fcpim.c index c07ee42345bc..455c4f4e1d3b 100644 --- a/drivers/scsi/bfa/bfa_fcpim.c +++ b/drivers/scsi/bfa/bfa_fcpim.c | |||
@@ -16,7 +16,7 @@ | |||
16 | */ | 16 | */ |
17 | 17 | ||
18 | #include "bfa_modules.h" | 18 | #include "bfa_modules.h" |
19 | #include "bfa_cb_ioim.h" | 19 | #include "bfa_os_inc.h" |
20 | 20 | ||
21 | BFA_TRC_FILE(HAL, FCPIM); | 21 | BFA_TRC_FILE(HAL, FCPIM); |
22 | BFA_MODULE(fcpim); | 22 | BFA_MODULE(fcpim); |
@@ -263,7 +263,7 @@ static void bfa_ioim_sm_cmnd_retry(struct bfa_ioim_s *ioim, | |||
263 | static void __bfa_cb_tskim_done(void *cbarg, bfa_boolean_t complete); | 263 | static void __bfa_cb_tskim_done(void *cbarg, bfa_boolean_t complete); |
264 | static void __bfa_cb_tskim_failed(void *cbarg, bfa_boolean_t complete); | 264 | static void __bfa_cb_tskim_failed(void *cbarg, bfa_boolean_t complete); |
265 | static bfa_boolean_t bfa_tskim_match_scope(struct bfa_tskim_s *tskim, | 265 | static bfa_boolean_t bfa_tskim_match_scope(struct bfa_tskim_s *tskim, |
266 | lun_t lun); | 266 | struct scsi_lun lun); |
267 | static void bfa_tskim_gather_ios(struct bfa_tskim_s *tskim); | 267 | static void bfa_tskim_gather_ios(struct bfa_tskim_s *tskim); |
268 | static void bfa_tskim_cleanp_comp(void *tskim_cbarg); | 268 | static void bfa_tskim_cleanp_comp(void *tskim_cbarg); |
269 | static void bfa_tskim_cleanup_ios(struct bfa_tskim_s *tskim); | 269 | static void bfa_tskim_cleanup_ios(struct bfa_tskim_s *tskim); |
@@ -2315,7 +2315,7 @@ bfa_ioim_send_ioreq(struct bfa_ioim_s *ioim) | |||
2315 | { | 2315 | { |
2316 | struct bfa_itnim_s *itnim = ioim->itnim; | 2316 | struct bfa_itnim_s *itnim = ioim->itnim; |
2317 | struct bfi_ioim_req_s *m; | 2317 | struct bfi_ioim_req_s *m; |
2318 | static struct fcp_cmnd_s cmnd_z0 = { 0 }; | 2318 | static struct fcp_cmnd_s cmnd_z0 = {{{0}}}; |
2319 | struct bfi_sge_s *sge, *sgpge; | 2319 | struct bfi_sge_s *sge, *sgpge; |
2320 | u32 pgdlen = 0; | 2320 | u32 pgdlen = 0; |
2321 | u32 fcp_dl; | 2321 | u32 fcp_dl; |
@@ -2324,6 +2324,7 @@ bfa_ioim_send_ioreq(struct bfa_ioim_s *ioim) | |||
2324 | struct bfa_sgpg_s *sgpg; | 2324 | struct bfa_sgpg_s *sgpg; |
2325 | struct scsi_cmnd *cmnd = (struct scsi_cmnd *) ioim->dio; | 2325 | struct scsi_cmnd *cmnd = (struct scsi_cmnd *) ioim->dio; |
2326 | u32 i, sge_id, pgcumsz; | 2326 | u32 i, sge_id, pgcumsz; |
2327 | enum dma_data_direction dmadir; | ||
2327 | 2328 | ||
2328 | /* | 2329 | /* |
2329 | * check for room in queue to send request now | 2330 | * check for room in queue to send request now |
@@ -2341,7 +2342,7 @@ bfa_ioim_send_ioreq(struct bfa_ioim_s *ioim) | |||
2341 | */ | 2342 | */ |
2342 | m->io_tag = cpu_to_be16(ioim->iotag); | 2343 | m->io_tag = cpu_to_be16(ioim->iotag); |
2343 | m->rport_hdl = ioim->itnim->rport->fw_handle; | 2344 | m->rport_hdl = ioim->itnim->rport->fw_handle; |
2344 | m->io_timeout = bfa_cb_ioim_get_timeout(ioim->dio); | 2345 | m->io_timeout = 0; |
2345 | 2346 | ||
2346 | sge = &m->sges[0]; | 2347 | sge = &m->sges[0]; |
2347 | sgpg = ioim->sgpg; | 2348 | sgpg = ioim->sgpg; |
@@ -2412,10 +2413,17 @@ bfa_ioim_send_ioreq(struct bfa_ioim_s *ioim) | |||
2412 | * set up I/O command parameters | 2413 | * set up I/O command parameters |
2413 | */ | 2414 | */ |
2414 | m->cmnd = cmnd_z0; | 2415 | m->cmnd = cmnd_z0; |
2415 | m->cmnd.lun = bfa_cb_ioim_get_lun(ioim->dio); | 2416 | int_to_scsilun(cmnd->device->lun, &m->cmnd.lun); |
2416 | m->cmnd.iodir = bfa_cb_ioim_get_iodir(ioim->dio); | 2417 | dmadir = cmnd->sc_data_direction; |
2417 | m->cmnd.cdb = *(scsi_cdb_t *)bfa_cb_ioim_get_cdb(ioim->dio); | 2418 | if (dmadir == DMA_TO_DEVICE) |
2418 | fcp_dl = bfa_cb_ioim_get_size(ioim->dio); | 2419 | m->cmnd.iodir = FCP_IODIR_WRITE; |
2420 | else if (dmadir == DMA_FROM_DEVICE) | ||
2421 | m->cmnd.iodir = FCP_IODIR_READ; | ||
2422 | else | ||
2423 | m->cmnd.iodir = FCP_IODIR_NONE; | ||
2424 | |||
2425 | m->cmnd.cdb = *(scsi_cdb_t *) cmnd->cmnd; | ||
2426 | fcp_dl = scsi_bufflen(cmnd); | ||
2419 | m->cmnd.fcp_dl = cpu_to_be32(fcp_dl); | 2427 | m->cmnd.fcp_dl = cpu_to_be32(fcp_dl); |
2420 | 2428 | ||
2421 | /* | 2429 | /* |
@@ -2439,7 +2447,7 @@ bfa_ioim_send_ioreq(struct bfa_ioim_s *ioim) | |||
2439 | bfi_h2i_set(m->mh, BFI_MC_IOIM_IO, 0, bfa_lpuid(ioim->bfa)); | 2447 | bfi_h2i_set(m->mh, BFI_MC_IOIM_IO, 0, bfa_lpuid(ioim->bfa)); |
2440 | } | 2448 | } |
2441 | if (itnim->seq_rec || | 2449 | if (itnim->seq_rec || |
2442 | (bfa_cb_ioim_get_size(ioim->dio) & (sizeof(u32) - 1))) | 2450 | (scsi_bufflen(cmnd) & (sizeof(u32) - 1))) |
2443 | bfi_h2i_set(m->mh, BFI_MC_IOIM_IO, 0, bfa_lpuid(ioim->bfa)); | 2451 | bfi_h2i_set(m->mh, BFI_MC_IOIM_IO, 0, bfa_lpuid(ioim->bfa)); |
2444 | 2452 | ||
2445 | /* | 2453 | /* |
@@ -2769,7 +2777,8 @@ bfa_ioim_profile_start(struct bfa_ioim_s *ioim) | |||
2769 | void | 2777 | void |
2770 | bfa_ioim_profile_comp(struct bfa_ioim_s *ioim) | 2778 | bfa_ioim_profile_comp(struct bfa_ioim_s *ioim) |
2771 | { | 2779 | { |
2772 | u32 fcp_dl = bfa_cb_ioim_get_size(ioim->dio); | 2780 | struct scsi_cmnd *cmnd = (struct scsi_cmnd *) ioim->dio; |
2781 | u32 fcp_dl = scsi_bufflen(cmnd); | ||
2773 | u32 index = bfa_ioim_get_index(fcp_dl); | 2782 | u32 index = bfa_ioim_get_index(fcp_dl); |
2774 | u64 end_time = jiffies; | 2783 | u64 end_time = jiffies; |
2775 | struct bfa_itnim_latency_s *io_lat = | 2784 | struct bfa_itnim_latency_s *io_lat = |
@@ -2895,8 +2904,7 @@ bfa_ioim_start(struct bfa_ioim_s *ioim) | |||
2895 | * Obtain the queue over which this request has to be issued | 2904 | * Obtain the queue over which this request has to be issued |
2896 | */ | 2905 | */ |
2897 | ioim->reqq = bfa_fcpim_ioredirect_enabled(ioim->bfa) ? | 2906 | ioim->reqq = bfa_fcpim_ioredirect_enabled(ioim->bfa) ? |
2898 | bfa_cb_ioim_get_reqq(ioim->dio) : | 2907 | BFA_FALSE : bfa_itnim_get_reqq(ioim); |
2899 | bfa_itnim_get_reqq(ioim); | ||
2900 | 2908 | ||
2901 | bfa_sm_send_event(ioim, BFA_IOIM_SM_START); | 2909 | bfa_sm_send_event(ioim, BFA_IOIM_SM_START); |
2902 | } | 2910 | } |
@@ -3186,7 +3194,7 @@ __bfa_cb_tskim_failed(void *cbarg, bfa_boolean_t complete) | |||
3186 | } | 3194 | } |
3187 | 3195 | ||
3188 | static bfa_boolean_t | 3196 | static bfa_boolean_t |
3189 | bfa_tskim_match_scope(struct bfa_tskim_s *tskim, lun_t lun) | 3197 | bfa_tskim_match_scope(struct bfa_tskim_s *tskim, struct scsi_lun lun) |
3190 | { | 3198 | { |
3191 | switch (tskim->tm_cmnd) { | 3199 | switch (tskim->tm_cmnd) { |
3192 | case FCP_TM_TARGET_RESET: | 3200 | case FCP_TM_TARGET_RESET: |
@@ -3196,7 +3204,7 @@ bfa_tskim_match_scope(struct bfa_tskim_s *tskim, lun_t lun) | |||
3196 | case FCP_TM_CLEAR_TASK_SET: | 3204 | case FCP_TM_CLEAR_TASK_SET: |
3197 | case FCP_TM_LUN_RESET: | 3205 | case FCP_TM_LUN_RESET: |
3198 | case FCP_TM_CLEAR_ACA: | 3206 | case FCP_TM_CLEAR_ACA: |
3199 | return (tskim->lun == lun); | 3207 | return (!memcmp(&tskim->lun, &lun, sizeof(lun))); |
3200 | 3208 | ||
3201 | default: | 3209 | default: |
3202 | bfa_assert(0); | 3210 | bfa_assert(0); |
@@ -3213,7 +3221,9 @@ bfa_tskim_gather_ios(struct bfa_tskim_s *tskim) | |||
3213 | { | 3221 | { |
3214 | struct bfa_itnim_s *itnim = tskim->itnim; | 3222 | struct bfa_itnim_s *itnim = tskim->itnim; |
3215 | struct bfa_ioim_s *ioim; | 3223 | struct bfa_ioim_s *ioim; |
3216 | struct list_head *qe, *qen; | 3224 | struct list_head *qe, *qen; |
3225 | struct scsi_cmnd *cmnd; | ||
3226 | struct scsi_lun scsilun; | ||
3217 | 3227 | ||
3218 | INIT_LIST_HEAD(&tskim->io_q); | 3228 | INIT_LIST_HEAD(&tskim->io_q); |
3219 | 3229 | ||
@@ -3222,8 +3232,9 @@ bfa_tskim_gather_ios(struct bfa_tskim_s *tskim) | |||
3222 | */ | 3232 | */ |
3223 | list_for_each_safe(qe, qen, &itnim->io_q) { | 3233 | list_for_each_safe(qe, qen, &itnim->io_q) { |
3224 | ioim = (struct bfa_ioim_s *) qe; | 3234 | ioim = (struct bfa_ioim_s *) qe; |
3225 | if (bfa_tskim_match_scope | 3235 | cmnd = (struct scsi_cmnd *) ioim->dio; |
3226 | (tskim, bfa_cb_ioim_get_lun(ioim->dio))) { | 3236 | int_to_scsilun(cmnd->device->lun, &scsilun); |
3237 | if (bfa_tskim_match_scope(tskim, scsilun)) { | ||
3227 | list_del(&ioim->qe); | 3238 | list_del(&ioim->qe); |
3228 | list_add_tail(&ioim->qe, &tskim->io_q); | 3239 | list_add_tail(&ioim->qe, &tskim->io_q); |
3229 | } | 3240 | } |
@@ -3234,8 +3245,9 @@ bfa_tskim_gather_ios(struct bfa_tskim_s *tskim) | |||
3234 | */ | 3245 | */ |
3235 | list_for_each_safe(qe, qen, &itnim->pending_q) { | 3246 | list_for_each_safe(qe, qen, &itnim->pending_q) { |
3236 | ioim = (struct bfa_ioim_s *) qe; | 3247 | ioim = (struct bfa_ioim_s *) qe; |
3237 | if (bfa_tskim_match_scope | 3248 | cmnd = (struct scsi_cmnd *) ioim->dio; |
3238 | (tskim, bfa_cb_ioim_get_lun(ioim->dio))) { | 3249 | int_to_scsilun(cmnd->device->lun, &scsilun); |
3250 | if (bfa_tskim_match_scope(tskim, scsilun)) { | ||
3239 | list_del(&ioim->qe); | 3251 | list_del(&ioim->qe); |
3240 | list_add_tail(&ioim->qe, &ioim->fcpim->ioim_comp_q); | 3252 | list_add_tail(&ioim->qe, &ioim->fcpim->ioim_comp_q); |
3241 | bfa_ioim_tov(ioim); | 3253 | bfa_ioim_tov(ioim); |
@@ -3494,7 +3506,8 @@ bfa_tskim_free(struct bfa_tskim_s *tskim) | |||
3494 | * @return None. | 3506 | * @return None. |
3495 | */ | 3507 | */ |
3496 | void | 3508 | void |
3497 | bfa_tskim_start(struct bfa_tskim_s *tskim, struct bfa_itnim_s *itnim, lun_t lun, | 3509 | bfa_tskim_start(struct bfa_tskim_s *tskim, struct bfa_itnim_s *itnim, |
3510 | struct scsi_lun lun, | ||
3498 | enum fcp_tm_cmnd tm_cmnd, u8 tsecs) | 3511 | enum fcp_tm_cmnd tm_cmnd, u8 tsecs) |
3499 | { | 3512 | { |
3500 | tskim->itnim = itnim; | 3513 | tskim->itnim = itnim; |
diff --git a/drivers/scsi/bfa/bfa_fcpim.h b/drivers/scsi/bfa/bfa_fcpim.h index 18bdc44432ac..7d0eababa5df 100644 --- a/drivers/scsi/bfa/bfa_fcpim.h +++ b/drivers/scsi/bfa/bfa_fcpim.h | |||
@@ -146,9 +146,9 @@ struct bfa_tskim_s { | |||
146 | struct bfa_s *bfa; /* BFA module */ | 146 | struct bfa_s *bfa; /* BFA module */ |
147 | struct bfa_fcpim_mod_s *fcpim; /* parent fcpim module */ | 147 | struct bfa_fcpim_mod_s *fcpim; /* parent fcpim module */ |
148 | struct bfa_itnim_s *itnim; /* i-t-n nexus for this IO */ | 148 | struct bfa_itnim_s *itnim; /* i-t-n nexus for this IO */ |
149 | struct bfad_tskim_s *dtsk; /* driver task mgmt cmnd */ | 149 | struct bfad_tskim_s *dtsk; /* driver task mgmt cmnd */ |
150 | bfa_boolean_t notify; /* notify itnim on TM comp */ | 150 | bfa_boolean_t notify; /* notify itnim on TM comp */ |
151 | lun_t lun; /* lun if applicable */ | 151 | struct scsi_lun lun; /* lun if applicable */ |
152 | enum fcp_tm_cmnd tm_cmnd; /* task management command */ | 152 | enum fcp_tm_cmnd tm_cmnd; /* task management command */ |
153 | u16 tsk_tag; /* FWI IO tag */ | 153 | u16 tsk_tag; /* FWI IO tag */ |
154 | u8 tsecs; /* timeout in seconds */ | 154 | u8 tsecs; /* timeout in seconds */ |
@@ -389,7 +389,7 @@ struct bfa_tskim_s *bfa_tskim_alloc(struct bfa_s *bfa, | |||
389 | struct bfad_tskim_s *dtsk); | 389 | struct bfad_tskim_s *dtsk); |
390 | void bfa_tskim_free(struct bfa_tskim_s *tskim); | 390 | void bfa_tskim_free(struct bfa_tskim_s *tskim); |
391 | void bfa_tskim_start(struct bfa_tskim_s *tskim, | 391 | void bfa_tskim_start(struct bfa_tskim_s *tskim, |
392 | struct bfa_itnim_s *itnim, lun_t lun, | 392 | struct bfa_itnim_s *itnim, struct scsi_lun lun, |
393 | enum fcp_tm_cmnd tm, u8 t_secs); | 393 | enum fcp_tm_cmnd tm, u8 t_secs); |
394 | void bfa_cb_tskim_done(void *bfad, struct bfad_tskim_s *dtsk, | 394 | void bfa_cb_tskim_done(void *bfad, struct bfad_tskim_s *dtsk, |
395 | enum bfi_tskim_status tsk_status); | 395 | enum bfi_tskim_status tsk_status); |
diff --git a/drivers/scsi/bfa/bfad_im.c b/drivers/scsi/bfa/bfad_im.c index bcab8912dd59..d10adcbf24b3 100644 --- a/drivers/scsi/bfa/bfad_im.c +++ b/drivers/scsi/bfa/bfad_im.c | |||
@@ -21,7 +21,6 @@ | |||
21 | 21 | ||
22 | #include "bfad_drv.h" | 22 | #include "bfad_drv.h" |
23 | #include "bfad_im.h" | 23 | #include "bfad_im.h" |
24 | #include "bfa_cb_ioim.h" | ||
25 | #include "bfa_fcs.h" | 24 | #include "bfa_fcs.h" |
26 | 25 | ||
27 | BFA_TRC_FILE(LDRV, IM); | 26 | BFA_TRC_FILE(LDRV, IM); |
@@ -258,6 +257,7 @@ bfad_im_target_reset_send(struct bfad_s *bfad, struct scsi_cmnd *cmnd, | |||
258 | struct bfa_tskim_s *tskim; | 257 | struct bfa_tskim_s *tskim; |
259 | struct bfa_itnim_s *bfa_itnim; | 258 | struct bfa_itnim_s *bfa_itnim; |
260 | bfa_status_t rc = BFA_STATUS_OK; | 259 | bfa_status_t rc = BFA_STATUS_OK; |
260 | struct scsi_lun scsilun; | ||
261 | 261 | ||
262 | tskim = bfa_tskim_alloc(&bfad->bfa, (struct bfad_tskim_s *) cmnd); | 262 | tskim = bfa_tskim_alloc(&bfad->bfa, (struct bfad_tskim_s *) cmnd); |
263 | if (!tskim) { | 263 | if (!tskim) { |
@@ -274,7 +274,8 @@ bfad_im_target_reset_send(struct bfad_s *bfad, struct scsi_cmnd *cmnd, | |||
274 | cmnd->host_scribble = NULL; | 274 | cmnd->host_scribble = NULL; |
275 | cmnd->SCp.Status = 0; | 275 | cmnd->SCp.Status = 0; |
276 | bfa_itnim = bfa_fcs_itnim_get_halitn(&itnim->fcs_itnim); | 276 | bfa_itnim = bfa_fcs_itnim_get_halitn(&itnim->fcs_itnim); |
277 | bfa_tskim_start(tskim, bfa_itnim, (lun_t)0, | 277 | memset(&scsilun, 0, sizeof(scsilun)); |
278 | bfa_tskim_start(tskim, bfa_itnim, scsilun, | ||
278 | FCP_TM_TARGET_RESET, BFAD_TARGET_RESET_TMO); | 279 | FCP_TM_TARGET_RESET, BFAD_TARGET_RESET_TMO); |
279 | out: | 280 | out: |
280 | return rc; | 281 | return rc; |
@@ -301,6 +302,7 @@ bfad_im_reset_lun_handler(struct scsi_cmnd *cmnd) | |||
301 | int rc = SUCCESS; | 302 | int rc = SUCCESS; |
302 | unsigned long flags; | 303 | unsigned long flags; |
303 | enum bfi_tskim_status task_status; | 304 | enum bfi_tskim_status task_status; |
305 | struct scsi_lun scsilun; | ||
304 | 306 | ||
305 | spin_lock_irqsave(&bfad->bfad_lock, flags); | 307 | spin_lock_irqsave(&bfad->bfad_lock, flags); |
306 | itnim = itnim_data->itnim; | 308 | itnim = itnim_data->itnim; |
@@ -327,8 +329,8 @@ bfad_im_reset_lun_handler(struct scsi_cmnd *cmnd) | |||
327 | cmnd->SCp.ptr = (char *)&wq; | 329 | cmnd->SCp.ptr = (char *)&wq; |
328 | cmnd->SCp.Status = 0; | 330 | cmnd->SCp.Status = 0; |
329 | bfa_itnim = bfa_fcs_itnim_get_halitn(&itnim->fcs_itnim); | 331 | bfa_itnim = bfa_fcs_itnim_get_halitn(&itnim->fcs_itnim); |
330 | bfa_tskim_start(tskim, bfa_itnim, | 332 | int_to_scsilun(cmnd->device->lun, &scsilun); |
331 | bfad_int_to_lun(cmnd->device->lun), | 333 | bfa_tskim_start(tskim, bfa_itnim, scsilun, |
332 | FCP_TM_LUN_RESET, BFAD_LUN_RESET_TMO); | 334 | FCP_TM_LUN_RESET, BFAD_LUN_RESET_TMO); |
333 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | 335 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); |
334 | 336 | ||
diff --git a/drivers/scsi/bfa/bfi.h b/drivers/scsi/bfa/bfi.h index 27b33c765ddc..e19448427042 100644 --- a/drivers/scsi/bfa/bfi.h +++ b/drivers/scsi/bfa/bfi.h | |||
@@ -399,7 +399,7 @@ union bfi_ioc_i2h_msg_u { | |||
399 | */ | 399 | */ |
400 | struct bfi_pbc_blun_s { | 400 | struct bfi_pbc_blun_s { |
401 | wwn_t tgt_pwwn; | 401 | wwn_t tgt_pwwn; |
402 | lun_t tgt_lun; | 402 | struct scsi_lun tgt_lun; |
403 | }; | 403 | }; |
404 | 404 | ||
405 | /* | 405 | /* |
diff --git a/drivers/scsi/bfa/bfi_ms.h b/drivers/scsi/bfa/bfi_ms.h index 10288764439d..e0e5318ce007 100644 --- a/drivers/scsi/bfa/bfi_ms.h +++ b/drivers/scsi/bfa/bfi_ms.h | |||
@@ -725,7 +725,7 @@ struct bfi_tskim_req_s { | |||
725 | struct bfi_mhdr_s mh; /* Common msg header */ | 725 | struct bfi_mhdr_s mh; /* Common msg header */ |
726 | __be16 tsk_tag; /* task management tag */ | 726 | __be16 tsk_tag; /* task management tag */ |
727 | u16 itn_fhdl; /* itn firmware handle */ | 727 | u16 itn_fhdl; /* itn firmware handle */ |
728 | lun_t lun; /* LU number */ | 728 | struct scsi_lun lun; /* LU number */ |
729 | u8 tm_flags; /* see enum fcp_tm_cmnd */ | 729 | u8 tm_flags; /* see enum fcp_tm_cmnd */ |
730 | u8 t_secs; /* Timeout value in seconds */ | 730 | u8 t_secs; /* Timeout value in seconds */ |
731 | u8 rsvd[2]; | 731 | u8 rsvd[2]; |