root/kernel/blk_drv/scsi/ultrastor.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


   1 /*
   2  *      ultrastor.c     (C) 1991 David B. Gentzel
   3  *      Low-level scsi driver for UltraStor 14F
   4  *      by David B. Gentzel, Whitfield Software Services, Carnegie, PA
   5  *          (gentzel@nova.enet.dec.com)
   6  *      Thanks to UltraStor for providing the necessary documentation
   7  */
   8 
   9 #ifndef _ULTRASTOR_H
  10 #define _ULTRASTOR_H
  11 
  12 /* ??? These don't really belong here */
  13 #ifndef TRUE
  14 # define TRUE 1
  15 #endif
  16 #ifndef FALSE
  17 # define FALSE 0
  18 #endif
  19 
  20 /* ??? This should go eventually, once I'm convinced the queueing stuff is
  21    stable enough... */
  22 /* #define NO_QUEUEING */
  23 
  24 int ultrastor_14f_detect(int);
  25 const char *ultrastor_14f_info(void);
  26 int ultrastor_14f_queuecommand(unsigned char target, const void *cmnd,
  27                                void *buff, int bufflen,
  28                                void (*done)(int, int));
  29 #ifdef NO_QUEUEING
  30 int ultrastor_14f_command(unsigned char target, const void *cmnd,
  31                           void *buff, int bufflen);
  32 #endif
  33 int ultrastor_14f_abort(int);
  34 int ultrastor_14f_reset(void);
  35 
  36 #ifndef NO_QUEUEING
  37 #define ULTRASTOR_14F \
  38     { "UltraStor 14F", ultrastor_14f_detect, ultrastor_14f_info, 0, \
  39       ultrastor_14f_queuecommand, ultrastor_14f_abort, ultrastor_14f_reset, \
  40       1, 0, 0 }
  41     /* ??? What should can_queue be set to?  Currently 1... */
  42 #else
  43 #define ULTRASTOR_14F \
  44     { "UltraStor 14F", ultrastor_14f_detect, ultrastor_14f_info, \
  45       ultrastor_14f_command, 0, ultrastor_14f_abort, ultrastor_14f_reset, \
  46       0, 0, 0 }
  47 #endif
  48 
  49 #define UD_ABORT 0x0001
  50 #define UD_COMMAND 0x0002
  51 #define UD_DETECT 0x0004
  52 #define UD_INTERRUPT 0x0008
  53 #define UD_RESET 0x0010
  54 
  55 #ifdef ULTRASTOR_PRIVATE
  56 
  57 /* #define PORT_OVERRIDE 0x330 */
  58 
  59 /* Port addresses (relative to the base address) */
  60 #define LCL_DOORBELL_MASK(port) ((port) + 0x0)
  61 #define LCL_DOORBELL_INTR(port) ((port) + 0x1)
  62 #define SYS_DOORBELL_MASK(port) ((port) + 0x2)
  63 #define SYS_DOORBELL_INTR(port) ((port) + 0x3)
  64 #define PRODUCT_ID(port) ((port) + 0x4)
  65 #define CONFIG(port) ((port) + 0x6)
  66 #define OGM_DATA_PTR(port) ((port) + 0x8)
  67 #define ICM_DATA_PTR(port) ((port) + 0xC)
  68 
  69 /* Values for the PRODUCT_ID ports for the 14F */
  70 #define US14F_PRODUCT_ID_0 0x56
  71 #define US14F_PRODUCT_ID_1 0x40         /* NOTE: Only upper nibble is used */
  72 
  73 /* MSCP field values */
  74 
  75 /* Opcode */
  76 #define OP_HOST_ADAPTER 0x1
  77 #define OP_SCSI 0x2
  78 #define OP_RESET 0x4
  79 
  80 /* Date Transfer Direction */
  81 #define DTD_SCSI 0x0
  82 #define DTD_IN 0x1
  83 #define DTD_OUT 0x2
  84 #define DTD_NONE 0x3
  85 
  86 /* Host Adapter command subcodes */
  87 #define HA_CMD_INQUIRY 0x1
  88 #define HA_CMD_SELF_DIAG 0x2
  89 #define HA_CMD_READ_BUFF 0x3
  90 #define HA_CMD_WRITE_BUFF 0x4
  91 
  92 #endif
  93 
  94 #endif

/* [previous][next][first][last][top][bottom][index][help] */