Commit d35055a0 authored by Boaz Harrosh's avatar Boaz Harrosh Committed by James Bottomley

[SCSI] gdth: remove command accessors

These are no longer necessary.
Signed-off-by: default avatarBoaz Harrosh <bharrosh@panasas.com>
Tested-by: default avatarJoerg Dorchain: <joerg@dorchain.net>
Tested-by: default avatarStefan Priebe <s.priebe@allied-internet.ag>
Tested-by: default avatarJon Chelton <jchelton@ffpglobal.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
parent 68066c3e
...@@ -85,10 +85,10 @@ ...@@ -85,10 +85,10 @@
/* The meaning of the Scsi_Pointer members in this driver is as follows: /* The meaning of the Scsi_Pointer members in this driver is as follows:
* ptr: Chaining * ptr: Chaining
* this_residual: gdth_bufflen * this_residual: unused
* buffer: gdth_sglist * buffer: unused
* dma_handle: unused * dma_handle: unused
* buffers_residual: gdth_sg_count * buffers_residual: unused
* Status: unused * Status: unused
* Message: unused * Message: unused
* have_data_in: unused * have_data_in: unused
...@@ -372,47 +372,6 @@ static const struct file_operations gdth_fops = { ...@@ -372,47 +372,6 @@ static const struct file_operations gdth_fops = {
.release = gdth_close, .release = gdth_close,
}; };
/*
* gdth scsi_command access wrappers.
* below 6 functions are used throughout the driver to access scsi_command's
* io parameters. The reason we do not use the regular accessors from
* scsi_cmnd.h is because of gdth_execute(). Since it is unrecommended for
* llds to directly set scsi_cmnd's IO members. This driver will use SCp
* members for IO parameters, and will copy scsi_cmnd's members to Scp
* members in queuecommand. For internal commands through gdth_execute()
* SCp's members will be set directly.
*/
static inline unsigned gdth_bufflen(struct scsi_cmnd *cmd)
{
return (unsigned)cmd->SCp.this_residual;
}
static inline void gdth_set_bufflen(struct scsi_cmnd *cmd, unsigned bufflen)
{
cmd->SCp.this_residual = bufflen;
}
static inline unsigned gdth_sg_count(struct scsi_cmnd *cmd)
{
return (unsigned)cmd->SCp.buffers_residual;
}
static inline void gdth_set_sg_count(struct scsi_cmnd *cmd, unsigned sg_count)
{
cmd->SCp.buffers_residual = sg_count;
}
static inline struct scatterlist *gdth_sglist(struct scsi_cmnd *cmd)
{
return cmd->SCp.buffer;
}
static inline void gdth_set_sglist(struct scsi_cmnd *cmd,
struct scatterlist *sglist)
{
cmd->SCp.buffer = sglist;
}
#include "gdth_proc.h" #include "gdth_proc.h"
#include "gdth_proc.c" #include "gdth_proc.c"
...@@ -2337,12 +2296,12 @@ static void gdth_next(gdth_ha_str *ha) ...@@ -2337,12 +2296,12 @@ static void gdth_next(gdth_ha_str *ha)
static void gdth_copy_internal_data(gdth_ha_str *ha, Scsi_Cmnd *scp, static void gdth_copy_internal_data(gdth_ha_str *ha, Scsi_Cmnd *scp,
char *buffer, ushort count) char *buffer, ushort count)
{ {
ushort cpcount,i, max_sg = gdth_sg_count(scp); ushort cpcount,i, max_sg = scsi_sg_count(scp);
ushort cpsum,cpnow; ushort cpsum,cpnow;
struct scatterlist *sl; struct scatterlist *sl;
char *address; char *address;
cpcount = min_t(ushort, count, gdth_bufflen(scp)); cpcount = min_t(ushort, count, scsi_bufflen(scp));
if (cpcount) { if (cpcount) {
cpsum=0; cpsum=0;
...@@ -2350,7 +2309,7 @@ static void gdth_copy_internal_data(gdth_ha_str *ha, Scsi_Cmnd *scp, ...@@ -2350,7 +2309,7 @@ static void gdth_copy_internal_data(gdth_ha_str *ha, Scsi_Cmnd *scp,
unsigned long flags; unsigned long flags;
cpnow = (ushort)sl->length; cpnow = (ushort)sl->length;
TRACE(("copy_internal() now %d sum %d count %d %d\n", TRACE(("copy_internal() now %d sum %d count %d %d\n",
cpnow, cpsum, cpcount, gdth_bufflen(scp))); cpnow, cpsum, cpcount, scsi_bufflen(scp)));
if (cpsum+cpnow > cpcount) if (cpsum+cpnow > cpcount)
cpnow = cpcount - cpsum; cpnow = cpcount - cpsum;
cpsum += cpnow; cpsum += cpnow;
...@@ -2573,10 +2532,10 @@ static int gdth_fill_cache_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp, ushort hdrive) ...@@ -2573,10 +2532,10 @@ static int gdth_fill_cache_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp, ushort hdrive)
cmdp->u.cache.BlockCnt = blockcnt; cmdp->u.cache.BlockCnt = blockcnt;
} }
if (gdth_bufflen(scp)) { if (scsi_bufflen(scp)) {
cmndinfo->dma_dir = (read_write == 1 ? cmndinfo->dma_dir = (read_write == 1 ?
PCI_DMA_TODEVICE : PCI_DMA_FROMDEVICE); PCI_DMA_TODEVICE : PCI_DMA_FROMDEVICE);
sgcnt = pci_map_sg(ha->pdev, gdth_sglist(scp), gdth_sg_count(scp), sgcnt = pci_map_sg(ha->pdev, scsi_sglist(scp), scsi_sg_count(scp),
cmndinfo->dma_dir); cmndinfo->dma_dir);
if (mode64) { if (mode64) {
struct scatterlist *sl; struct scatterlist *sl;
...@@ -2723,7 +2682,7 @@ static int gdth_fill_raw_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp, unchar b) ...@@ -2723,7 +2682,7 @@ static int gdth_fill_raw_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp, unchar b)
cmdp->u.raw64.lun = l; cmdp->u.raw64.lun = l;
cmdp->u.raw64.bus = b; cmdp->u.raw64.bus = b;
cmdp->u.raw64.priority = 0; cmdp->u.raw64.priority = 0;
cmdp->u.raw64.sdlen = gdth_bufflen(scp); cmdp->u.raw64.sdlen = scsi_bufflen(scp);
cmdp->u.raw64.sense_len = 16; cmdp->u.raw64.sense_len = 16;
cmdp->u.raw64.sense_data = sense_paddr; cmdp->u.raw64.sense_data = sense_paddr;
cmdp->u.raw64.direction = cmdp->u.raw64.direction =
...@@ -2740,7 +2699,7 @@ static int gdth_fill_raw_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp, unchar b) ...@@ -2740,7 +2699,7 @@ static int gdth_fill_raw_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp, unchar b)
cmdp->u.raw.bus = b; cmdp->u.raw.bus = b;
cmdp->u.raw.priority = 0; cmdp->u.raw.priority = 0;
cmdp->u.raw.link_p = 0; cmdp->u.raw.link_p = 0;
cmdp->u.raw.sdlen = gdth_bufflen(scp); cmdp->u.raw.sdlen = scsi_bufflen(scp);
cmdp->u.raw.sense_len = 16; cmdp->u.raw.sense_len = 16;
cmdp->u.raw.sense_data = sense_paddr; cmdp->u.raw.sense_data = sense_paddr;
cmdp->u.raw.direction = cmdp->u.raw.direction =
...@@ -2749,9 +2708,9 @@ static int gdth_fill_raw_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp, unchar b) ...@@ -2749,9 +2708,9 @@ static int gdth_fill_raw_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp, unchar b)
cmdp->u.raw.sg_ranz = 0; cmdp->u.raw.sg_ranz = 0;
} }
if (gdth_bufflen(scp)) { if (scsi_bufflen(scp)) {
cmndinfo->dma_dir = PCI_DMA_BIDIRECTIONAL; cmndinfo->dma_dir = PCI_DMA_BIDIRECTIONAL;
sgcnt = pci_map_sg(ha->pdev, gdth_sglist(scp), gdth_sg_count(scp), sgcnt = pci_map_sg(ha->pdev, scsi_sglist(scp), scsi_sg_count(scp),
cmndinfo->dma_dir); cmndinfo->dma_dir);
if (mode64) { if (mode64) {
struct scatterlist *sl; struct scatterlist *sl;
...@@ -3372,8 +3331,8 @@ static int gdth_sync_event(gdth_ha_str *ha, int service, unchar index, ...@@ -3372,8 +3331,8 @@ static int gdth_sync_event(gdth_ha_str *ha, int service, unchar index,
/* retry */ /* retry */
return 2; return 2;
} }
if (gdth_bufflen(scp)) if (scsi_bufflen(scp))
pci_unmap_sg(ha->pdev, gdth_sglist(scp), gdth_sg_count(scp), pci_unmap_sg(ha->pdev, scsi_sglist(scp), scsi_sg_count(scp),
cmndinfo->dma_dir); cmndinfo->dma_dir);
if (cmndinfo->sense_paddr) if (cmndinfo->sense_paddr)
...@@ -4015,10 +3974,6 @@ static int gdth_queuecommand(struct scsi_cmnd *scp, ...@@ -4015,10 +3974,6 @@ static int gdth_queuecommand(struct scsi_cmnd *scp,
gdth_update_timeout(scp, scp->timeout_per_command * 6); gdth_update_timeout(scp, scp->timeout_per_command * 6);
cmndinfo->priority = DEFAULT_PRI; cmndinfo->priority = DEFAULT_PRI;
gdth_set_bufflen(scp, scsi_bufflen(scp));
gdth_set_sg_count(scp, scsi_sg_count(scp));
gdth_set_sglist(scp, scsi_sglist(scp));
return __gdth_queuecommand(ha, scp, cmndinfo); return __gdth_queuecommand(ha, scp, cmndinfo);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment