From 3058d5de47ce09ac0e531290566937c7d94d0653 Mon Sep 17 00:00:00 2001 From: Boaz Harrosh Date: Tue, 2 Oct 2007 23:14:39 +0200 Subject: [SCSI] gdth: Setup proper per-command private data - scsi_cmnd and specifically ->SCp of, where heavily abused with internal meaning members and flags. So introduce a new struct gdth_cmndinfo, put it on ->host_scribble and define a gdth_cmnd_priv() accessor to retrieve it from a scsi_cmnd. - The structure now holds two members: internal_command - replaces the IS_GDTH_INTERNAL_CMD() croft. sense_paddr - which was a 64-bit spanning on 2 32-bit members of SCp. More overloaded members from SCp and scsi_cmnd will be moved in a later patch (For easy review). - Split up gdth_queuecommand to an additional internal_function. The later is the one called by gdth_execute(). This will be more evident later in the scsi accessors patch, but it also facilitates in the differentiation between internal_command and external. And the setup of gdth_cmndinfo of each command. Signed-off-by Boaz Harrosh Signed-off-by: James Bottomley --- drivers/scsi/gdth.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'drivers/scsi/gdth.h') diff --git a/drivers/scsi/gdth.h b/drivers/scsi/gdth.h index e6178c42185..be4ae5abd5c 100644 --- a/drivers/scsi/gdth.h +++ b/drivers/scsi/gdth.h @@ -919,6 +919,11 @@ typedef struct { Scsi_Cmnd *cmnd; /* pending request */ ushort service; /* service */ } cmd_tab[GDTH_MAXCMDS]; /* table of pend. requests */ + struct gdth_cmndinfo { /* per-command private info */ + int index; + int internal_command; /* don't call scsi_done */ + dma_addr_t sense_paddr; /* sense dma-addr */ + } cmndinfo[GDTH_MAXCMDS]; /* index==0 is free */ unchar bus_cnt; /* SCSI bus count */ unchar tid_cnt; /* Target ID count */ unchar bus_id[MAXBUS]; /* IOP IDs */ @@ -941,6 +946,11 @@ typedef struct { struct scsi_device *sdev; } gdth_ha_str; +static inline struct gdth_cmndinfo *gdth_cmnd_priv(struct scsi_cmnd* cmd) +{ + return (struct gdth_cmndinfo *)cmd->host_scribble; +} + /* INQUIRY data format */ typedef struct { unchar type_qual; -- cgit v1.2.3