From d5bd3491c8c30b98f642cab4361ff1a43955ccd4 Mon Sep 17 00:00:00 2001 From: "Kashyap, Desai" Date: Tue, 4 Jan 2011 11:39:20 +0530 Subject: [SCSI] mpt2sas: Basic Code Cleanup in mpt2sas_base Basic Code Cleanup: (1) _base_get_cb_idx and mpt2sas_base_free_smid were reorganized in similar fashion so the order of obtaining the cbx and smid are scsiio, hi_priority, and internal. (2) The hi_priority and internal request queue struct was made smaller by removing the scmd and chain_tracker, thus saving memory allocation. (3) For scsiio request, a new structure was created having the same elements from the former request tracker struct. Signed-off-by: Kashyap Desai Signed-off-by: James Bottomley --- drivers/scsi/mpt2sas/mpt2sas_base.h | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'drivers/scsi/mpt2sas/mpt2sas_base.h') diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.h b/drivers/scsi/mpt2sas/mpt2sas_base.h index 82579fb..445f1cf 100644 --- a/drivers/scsi/mpt2sas/mpt2sas_base.h +++ b/drivers/scsi/mpt2sas/mpt2sas_base.h @@ -101,7 +101,8 @@ #define MPT_NAME_LENGTH 32 /* generic length of strings */ #define MPT_STRING_LENGTH 64 -#define MPT_MAX_CALLBACKS 16 +#define MPT_MAX_CALLBACKS 16 + #define CAN_SLEEP 1 #define NO_SLEEP 0 @@ -445,14 +446,14 @@ struct chain_tracker { }; /** - * struct request_tracker - firmware request tracker + * struct scsiio_tracker - scsi mf request tracker * @smid: system message id * @scmd: scsi request pointer * @cb_idx: callback index * @chain_list: list of chains associated to this IO * @tracker_list: list of free request (ioc->free_list) */ -struct request_tracker { +struct scsiio_tracker { u16 smid; struct scsi_cmnd *scmd; u8 cb_idx; @@ -461,6 +462,19 @@ struct request_tracker { }; /** + * struct request_tracker - misc mf request tracker + * @smid: system message id + * @scmd: scsi request pointer + * @cb_idx: callback index + * @tracker_list: list of free request (ioc->free_list) + */ +struct request_tracker { + u16 smid; + u8 cb_idx; + struct list_head tracker_list; +}; + +/** * struct _tr_list - target reset list * @handle: device handle * @state: state machine @@ -723,7 +737,7 @@ struct MPT2SAS_ADAPTER { u8 *request; dma_addr_t request_dma; u32 request_dma_sz; - struct request_tracker *scsi_lookup; + struct scsiio_tracker *scsi_lookup; ulong scsi_lookup_pages; spinlock_t scsi_lookup_lock; struct list_head free_list; -- cgit v1.1