From 44f30b0f59d628eb6f57cfa9d8ab06da670e5306 Mon Sep 17 00:00:00 2001 From: Matthew Wilcox Date: Tue, 29 Nov 2005 23:08:33 -0500 Subject: [SCSI] sym2: Remove code to handle DMA_BIDIRECTION requests The upper layer doesn't send these down since 2.4.x (or 2.6 in practice), so no need to handle it. Inline sym_setup_data_pointers into its only caller so we can fail gracefully in the case we'd get one neverless. Signed-off-by: Christoph Hellwig Signed-off-by: Matthew Wilcox Signed-off-by: James Bottomley --- drivers/scsi/sym53c8xx_2/sym_hipd.h | 84 ------------------------------------- 1 file changed, 84 deletions(-) (limited to 'drivers/scsi/sym53c8xx_2/sym_hipd.h') diff --git a/drivers/scsi/sym53c8xx_2/sym_hipd.h b/drivers/scsi/sym53c8xx_2/sym_hipd.h index 756008812aa..17181101f6c 100644 --- a/drivers/scsi/sym53c8xx_2/sym_hipd.h +++ b/drivers/scsi/sym53c8xx_2/sym_hipd.h @@ -48,12 +48,6 @@ * They may be defined in platform specific headers, if they * are useful. * - * SYM_OPT_HANDLE_DIR_UNKNOWN - * When this option is set, the SCRIPTS used by the driver - * are able to handle SCSI transfers with direction not - * supplied by user. - * (set for Linux-2.0.X) - * * SYM_OPT_HANDLE_DEVICE_QUEUEING * When this option is set, the driver will use a queue per * device and handle QUEUE FULL status requeuing internally. @@ -64,7 +58,6 @@ * (set for Linux) */ #if 0 -#define SYM_OPT_HANDLE_DIR_UNKNOWN #define SYM_OPT_HANDLE_DEVICE_QUEUEING #define SYM_OPT_LIMIT_COMMAND_REORDERING #endif @@ -659,9 +652,6 @@ struct sym_ccbh { */ u32 savep; /* Jump address to saved data pointer */ u32 lastp; /* SCRIPTS address at end of data */ -#ifdef SYM_OPT_HANDLE_DIR_UNKNOWN - u32 wlastp; -#endif /* * Status fields. @@ -791,9 +781,6 @@ struct sym_ccb { SYM_QUEHEAD link_ccbq; /* Link to free/busy CCB queue */ u32 startp; /* Initial data pointer */ u32 goalp; /* Expected last data pointer */ -#ifdef SYM_OPT_HANDLE_DIR_UNKNOWN - u32 wgoalp; -#endif int ext_sg; /* Extreme data pointer, used */ int ext_ofs; /* to calculate the residual. */ #ifdef SYM_OPT_HANDLE_DEVICE_QUEUEING @@ -808,12 +795,6 @@ struct sym_ccb { #define CCB_BA(cp,lbl) cpu_to_scr(cp->ccb_ba + offsetof(struct sym_ccb, lbl)) -#ifdef SYM_OPT_HANDLE_DIR_UNKNOWN -#define sym_goalp(cp) ((cp->host_flags & HF_DATA_IN) ? cp->goalp : cp->wgoalp) -#else -#define sym_goalp(cp) (cp->goalp) -#endif - typedef struct device *m_pool_ident_t; /* @@ -1121,71 +1102,6 @@ bad: #error "Unsupported DMA addressing mode" #endif -/* - * Set up data pointers used by SCRIPTS. - * Called from O/S specific code. - */ -static inline void sym_setup_data_pointers(struct sym_hcb *np, - struct sym_ccb *cp, int dir) -{ - u32 lastp, goalp; - - /* - * No segments means no data. - */ - if (!cp->segments) - dir = DMA_NONE; - - /* - * Set the data pointer. - */ - switch(dir) { -#ifdef SYM_OPT_HANDLE_DIR_UNKNOWN - case DMA_BIDIRECTIONAL: -#endif - case DMA_TO_DEVICE: - goalp = SCRIPTA_BA(np, data_out2) + 8; - lastp = goalp - 8 - (cp->segments * (2*4)); -#ifdef SYM_OPT_HANDLE_DIR_UNKNOWN - cp->wgoalp = cpu_to_scr(goalp); - if (dir != DMA_BIDIRECTIONAL) - break; - cp->phys.head.wlastp = cpu_to_scr(lastp); - /* fall through */ -#else - break; -#endif - case DMA_FROM_DEVICE: - cp->host_flags |= HF_DATA_IN; - goalp = SCRIPTA_BA(np, data_in2) + 8; - lastp = goalp - 8 - (cp->segments * (2*4)); - break; - case DMA_NONE: - default: -#ifdef SYM_OPT_HANDLE_DIR_UNKNOWN - cp->host_flags |= HF_DATA_IN; -#endif - lastp = goalp = SCRIPTB_BA(np, no_data); - break; - } - - /* - * Set all pointers values needed by SCRIPTS. - */ - cp->phys.head.lastp = cpu_to_scr(lastp); - cp->phys.head.savep = cpu_to_scr(lastp); - cp->startp = cp->phys.head.savep; - cp->goalp = cpu_to_scr(goalp); - -#ifdef SYM_OPT_HANDLE_DIR_UNKNOWN - /* - * If direction is unknown, start at data_io. - */ - if (dir == DMA_BIDIRECTIONAL) - cp->phys.head.savep = cpu_to_scr(SCRIPTB_BA(np, data_io)); -#endif -} - /* * MEMORY ALLOCATOR. */ -- cgit v1.2.3