diff options
author | Giridhar Malavali <giridhar.malavali@qlogic.com> | 2012-02-09 14:15:36 -0500 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-02-19 09:14:08 -0500 |
commit | 9ba56b95a588906a65664a9299a9f8ac1a0f6a91 (patch) | |
tree | 93786c52320c2a7276c99cc4d9b3672ca6e0a50d /drivers/scsi/qla2xxx/qla_def.h | |
parent | 69e5f1ea61a3e84c03103c6a18ee9cacef4cbb9e (diff) |
[SCSI] qla2xxx: Consolidation of SRB processing.
Rework the structures related to SRB processing to minimize the memory
allocations per I/O and manage resources associated with and completions
from common routines.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_def.h')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_def.h | 44 |
1 files changed, 27 insertions, 17 deletions
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index 7b7d829bef8b..6704ef84c450 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h | |||
@@ -202,20 +202,12 @@ struct sd_dif_tuple { | |||
202 | /* | 202 | /* |
203 | * SCSI Request Block | 203 | * SCSI Request Block |
204 | */ | 204 | */ |
205 | typedef struct srb { | 205 | struct srb_cmd { |
206 | atomic_t ref_count; | ||
207 | struct fc_port *fcport; | ||
208 | uint32_t handle; | ||
209 | |||
210 | struct scsi_cmnd *cmd; /* Linux SCSI command pkt */ | 206 | struct scsi_cmnd *cmd; /* Linux SCSI command pkt */ |
211 | |||
212 | uint16_t flags; | ||
213 | |||
214 | uint32_t request_sense_length; | 207 | uint32_t request_sense_length; |
215 | uint8_t *request_sense_ptr; | 208 | uint8_t *request_sense_ptr; |
216 | |||
217 | void *ctx; | 209 | void *ctx; |
218 | } srb_t; | 210 | }; |
219 | 211 | ||
220 | /* | 212 | /* |
221 | * SRB flag definitions | 213 | * SRB flag definitions |
@@ -254,10 +246,7 @@ struct srb_iocb { | |||
254 | } u; | 246 | } u; |
255 | 247 | ||
256 | struct timer_list timer; | 248 | struct timer_list timer; |
257 | 249 | void (*timeout)(void *); | |
258 | void (*done)(srb_t *); | ||
259 | void (*free)(srb_t *); | ||
260 | void (*timeout)(srb_t *); | ||
261 | }; | 250 | }; |
262 | 251 | ||
263 | /* Values for srb_ctx type */ | 252 | /* Values for srb_ctx type */ |
@@ -268,16 +257,37 @@ struct srb_iocb { | |||
268 | #define SRB_CT_CMD 5 | 257 | #define SRB_CT_CMD 5 |
269 | #define SRB_ADISC_CMD 6 | 258 | #define SRB_ADISC_CMD 6 |
270 | #define SRB_TM_CMD 7 | 259 | #define SRB_TM_CMD 7 |
260 | #define SRB_SCSI_CMD 8 | ||
271 | 261 | ||
272 | struct srb_ctx { | 262 | typedef struct srb { |
263 | atomic_t ref_count; | ||
264 | struct fc_port *fcport; | ||
265 | uint32_t handle; | ||
266 | uint16_t flags; | ||
273 | uint16_t type; | 267 | uint16_t type; |
274 | char *name; | 268 | char *name; |
275 | int iocbs; | 269 | int iocbs; |
276 | union { | 270 | union { |
277 | struct srb_iocb *iocb_cmd; | 271 | struct srb_iocb iocb_cmd; |
278 | struct fc_bsg_job *bsg_job; | 272 | struct fc_bsg_job *bsg_job; |
273 | struct srb_cmd scmd; | ||
279 | } u; | 274 | } u; |
280 | }; | 275 | void (*done)(void *, void *, int); |
276 | void (*free)(void *, void *); | ||
277 | } srb_t; | ||
278 | |||
279 | #define GET_CMD_SP(sp) (sp->u.scmd.cmd) | ||
280 | #define SET_CMD_SP(sp, cmd) (sp->u.scmd.cmd = cmd) | ||
281 | #define GET_CMD_CTX_SP(sp) (sp->u.scmd.ctx) | ||
282 | |||
283 | #define GET_CMD_SENSE_LEN(sp) \ | ||
284 | (sp->u.scmd.request_sense_length) | ||
285 | #define SET_CMD_SENSE_LEN(sp, len) \ | ||
286 | (sp->u.scmd.request_sense_length = len) | ||
287 | #define GET_CMD_SENSE_PTR(sp) \ | ||
288 | (sp->u.scmd.request_sense_ptr) | ||
289 | #define SET_CMD_SENSE_PTR(sp, ptr) \ | ||
290 | (sp->u.scmd.request_sense_ptr = ptr) | ||
281 | 291 | ||
282 | struct msg_echo_lb { | 292 | struct msg_echo_lb { |
283 | dma_addr_t send_dma; | 293 | dma_addr_t send_dma; |