X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fscsi%2Fsym53c8xx_2%2Fsym_hipd.h;h=79ab6a177039956cf6da70a12c160982c0f61620;hb=43bc926fffd92024b46cafaf7350d669ba9ca884;hp=a95cbe4b8e39f988f21503654c85ab3ff74b4021;hpb=cee37fe97739d85991964371c1f3a745c00dd236;p=linux-2.6.git diff --git a/drivers/scsi/sym53c8xx_2/sym_hipd.h b/drivers/scsi/sym53c8xx_2/sym_hipd.h index a95cbe4b8..79ab6a177 100644 --- a/drivers/scsi/sym53c8xx_2/sym_hipd.h +++ b/drivers/scsi/sym53c8xx_2/sym_hipd.h @@ -37,6 +37,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #ifndef SYM_HIPD_H #define SYM_HIPD_H @@ -46,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. @@ -62,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 @@ -151,6 +146,16 @@ */ #define SYM_CONF_MIN_ASYNC (40) + +/* + * MEMORY ALLOCATOR. + */ + +#define SYM_MEM_WARN 1 /* Warn on failed operations */ + +#define SYM_MEM_PAGE_ORDER 0 /* 1 PAGE maximum */ +#define SYM_MEM_CLUSTER_SHIFT (PAGE_SHIFT+SYM_MEM_PAGE_ORDER) +#define SYM_MEM_FREE_UNUSED /* Free unused pages immediately */ /* * Shortest memory chunk is (1<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 +#define CCB_BA(cp,lbl) cpu_to_scr(cp->ccb_ba + offsetof(struct sym_ccb, lbl)) typedef struct device *m_pool_ident_t; @@ -1067,9 +1047,10 @@ char *sym_driver_name(void); void sym_print_xerr(struct scsi_cmnd *cmd, int x_status); int sym_reset_scsi_bus(struct sym_hcb *np, int enab_int); struct sym_chip *sym_lookup_chip_table(u_short device_id, u_char revision); -void sym_put_start_queue(struct sym_hcb *np, struct sym_ccb *cp); #ifdef SYM_OPT_HANDLE_DEVICE_QUEUEING void sym_start_next_ccbs(struct sym_hcb *np, struct sym_lcb *lp, int maxn); +#else +void sym_put_start_queue(struct sym_hcb *np, struct sym_ccb *cp); #endif void sym_start_up(struct sym_hcb *np, int reason); void sym_interrupt(struct sym_hcb *np); @@ -1125,81 +1106,10 @@ 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 = CAM_DIR_NONE; - - /* - * Set the data pointer. - */ - switch(dir) { -#ifdef SYM_OPT_HANDLE_DIR_UNKNOWN - case CAM_DIR_UNKNOWN: -#endif - case CAM_DIR_OUT: - 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 != CAM_DIR_UNKNOWN) - break; - cp->phys.head.wlastp = cpu_to_scr(lastp); - /* fall through */ -#else - break; -#endif - case CAM_DIR_IN: - cp->host_flags |= HF_DATA_IN; - goalp = SCRIPTA_BA(np, data_in2) + 8; - lastp = goalp - 8 - (cp->segments * (2*4)); - break; - case CAM_DIR_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 == CAM_DIR_UNKNOWN) - cp->phys.head.savep = cpu_to_scr(SCRIPTB_BA(np, data_io)); -#endif -} - /* * MEMORY ALLOCATOR. */ -#define SYM_MEM_PAGE_ORDER 0 /* 1 PAGE maximum */ -#define SYM_MEM_CLUSTER_SHIFT (PAGE_SHIFT+SYM_MEM_PAGE_ORDER) -#define SYM_MEM_FREE_UNUSED /* Free unused pages immediately */ - -#define SYM_MEM_WARN 1 /* Warn on failed operations */ - #define sym_get_mem_cluster() \ (void *) __get_free_pages(GFP_ATOMIC, SYM_MEM_PAGE_ORDER) #define sym_free_mem_cluster(p) \