1 1.1 mycroft typedef u_long physaddr; 2 1.1 mycroft typedef u_long physlen; 3 1.1 mycroft 4 1.1 mycroft /* 5 1.1 mycroft * AHA1740 EISA board mode registers (Offset from slot base) 6 1.1 mycroft */ 7 1.1 mycroft #define PORTADDR 0xCC0 8 1.1 mycroft #define PORTADDR_ENHANCED 0x80 9 1.1 mycroft #define BIOSADDR 0xCC1 10 1.1 mycroft #define INTDEF 0xCC2 11 1.1 mycroft #define SCSIDEF 0xCC3 12 1.1 mycroft #define BUSDEF 0xCC4 13 1.1 mycroft #define RESV0 0xCC5 14 1.1 mycroft #define RESV1 0xCC6 15 1.1 mycroft #define RESV2 0xCC7 16 1.1 mycroft /**** bit definitions for INTDEF ****/ 17 1.1 mycroft #define INT9 0x00 18 1.1 mycroft #define INT10 0x01 19 1.1 mycroft #define INT11 0x02 20 1.1 mycroft #define INT12 0x03 21 1.1 mycroft #define INT14 0x05 22 1.1 mycroft #define INT15 0x06 23 1.1 mycroft #define INTHIGH 0x08 /* int high=ACTIVE (else edge) */ 24 1.1 mycroft #define INTEN 0x10 25 1.1 mycroft /**** bit definitions for SCSIDEF ****/ 26 1.1 mycroft #define HSCSIID 0x0F /* our SCSI ID */ 27 1.1 mycroft #define RSTPWR 0x10 /* reset scsi bus on power up or reset */ 28 1.1 mycroft /**** bit definitions for BUSDEF ****/ 29 1.1 mycroft #define B0uS 0x00 /* give up bus immediatly */ 30 1.1 mycroft #define B4uS 0x01 /* delay 4uSec. */ 31 1.1 mycroft #define B8uS 0x02 32 1.1 mycroft 33 1.1 mycroft /* 34 1.1 mycroft * AHA1740 ENHANCED mode mailbox control regs (Offset from slot base) 35 1.1 mycroft */ 36 1.1 mycroft #define MBOXOUT0 0xCD0 37 1.1 mycroft #define MBOXOUT1 0xCD1 38 1.1 mycroft #define MBOXOUT2 0xCD2 39 1.1 mycroft #define MBOXOUT3 0xCD3 40 1.1 mycroft 41 1.1 mycroft #define ATTN 0xCD4 42 1.1 mycroft #define G2CNTRL 0xCD5 43 1.1 mycroft #define G2INTST 0xCD6 44 1.1 mycroft #define G2STAT 0xCD7 45 1.1 mycroft 46 1.1 mycroft #define MBOXIN0 0xCD8 47 1.1 mycroft #define MBOXIN1 0xCD9 48 1.1 mycroft #define MBOXIN2 0xCDA 49 1.1 mycroft #define MBOXIN3 0xCDB 50 1.1 mycroft 51 1.1 mycroft #define G2STAT2 0xCDC 52 1.1 mycroft 53 1.1 mycroft /* 54 1.1 mycroft * Bit definitions for the 5 control/status registers 55 1.1 mycroft */ 56 1.1 mycroft #define ATTN_TARGET 0x0F 57 1.1 mycroft #define ATTN_OPCODE 0xF0 58 1.1 mycroft #define OP_IMMED 0x10 59 1.1 mycroft #define AHB_TARG_RESET 0x80 60 1.1 mycroft #define OP_START_ECB 0x40 61 1.1 mycroft #define OP_ABORT_ECB 0x50 62 1.1 mycroft 63 1.1 mycroft #define G2CNTRL_SET_HOST_READY 0x20 64 1.1 mycroft #define G2CNTRL_CLEAR_EISA_INT 0x40 65 1.1 mycroft #define G2CNTRL_HARD_RESET 0x80 66 1.1 mycroft 67 1.1 mycroft #define G2INTST_TARGET 0x0F 68 1.1 mycroft #define G2INTST_INT_STAT 0xF0 69 1.1 mycroft #define AHB_ECB_OK 0x10 70 1.1 mycroft #define AHB_ECB_RECOVERED 0x50 71 1.1 mycroft #define AHB_HW_ERR 0x70 72 1.1 mycroft #define AHB_IMMED_OK 0xA0 73 1.1 mycroft #define AHB_ECB_ERR 0xC0 74 1.1 mycroft #define AHB_ASN 0xD0 /* for target mode */ 75 1.1 mycroft #define AHB_IMMED_ERR 0xE0 76 1.1 mycroft 77 1.1 mycroft #define G2STAT_BUSY 0x01 78 1.1 mycroft #define G2STAT_INT_PEND 0x02 79 1.1 mycroft #define G2STAT_MBOX_EMPTY 0x04 80 1.1 mycroft 81 1.1 mycroft #define G2STAT2_HOST_READY 0x01 82 1.1 mycroft 83 1.1 mycroft #define AHB_NSEG 33 /* number of dma segments supported */ 84 1.1 mycroft 85 1.1 mycroft struct ahb_dma_seg { 86 1.1 mycroft physaddr seg_addr; 87 1.1 mycroft physlen seg_len; 88 1.1 mycroft }; 89 1.1 mycroft 90 1.1 mycroft struct ahb_ecb_status { 91 1.1 mycroft u_short status; 92 1.1 mycroft #define ST_DON 0x0001 93 1.1 mycroft #define ST_DU 0x0002 94 1.1 mycroft #define ST_QF 0x0008 95 1.1 mycroft #define ST_SC 0x0010 96 1.1 mycroft #define ST_DO 0x0020 97 1.1 mycroft #define ST_CH 0x0040 98 1.1 mycroft #define ST_INT 0x0080 99 1.1 mycroft #define ST_ASA 0x0100 100 1.1 mycroft #define ST_SNS 0x0200 101 1.1 mycroft #define ST_INI 0x0800 102 1.1 mycroft #define ST_ME 0x1000 103 1.1 mycroft #define ST_ECA 0x4000 104 1.1 mycroft u_char host_stat; 105 1.1 mycroft #define HS_OK 0x00 106 1.1 mycroft #define HS_CMD_ABORTED_HOST 0x04 107 1.1 mycroft #define HS_CMD_ABORTED_ADAPTER 0x05 108 1.1 mycroft #define HS_TIMED_OUT 0x11 109 1.1 mycroft #define HS_HARDWARE_ERR 0x20 110 1.1 mycroft #define HS_SCSI_RESET_ADAPTER 0x22 111 1.1 mycroft #define HS_SCSI_RESET_INCOMING 0x23 112 1.1 mycroft u_char target_stat; 113 1.1 mycroft u_long resid_count; 114 1.1 mycroft u_long resid_addr; 115 1.1 mycroft u_short addit_status; 116 1.1 mycroft u_char sense_len; 117 1.1 mycroft u_char unused[9]; 118 1.1 mycroft u_char cdb[6]; 119 1.1 mycroft }; 120 1.1 mycroft 121 1.1 mycroft struct ahb_ecb { 122 1.1 mycroft u_char opcode; 123 1.1 mycroft #define ECB_SCSI_OP 0x01 124 1.1 mycroft u_char:4; 125 1.1 mycroft u_char options:3; 126 1.1 mycroft u_char:1; 127 1.1 mycroft short opt1; 128 1.1 mycroft #define ECB_CNE 0x0001 129 1.1 mycroft #define ECB_DI 0x0080 130 1.1 mycroft #define ECB_SES 0x0400 131 1.1 mycroft #define ECB_S_G 0x1000 132 1.1 mycroft #define ECB_DSB 0x4000 133 1.1 mycroft #define ECB_ARS 0x8000 134 1.1 mycroft short opt2; 135 1.1 mycroft #define ECB_LUN 0x0007 136 1.1 mycroft #define ECB_TAG 0x0008 137 1.1 mycroft #define ECB_TT 0x0030 138 1.1 mycroft #define ECB_ND 0x0040 139 1.1 mycroft #define ECB_DAT 0x0100 140 1.1 mycroft #define ECB_DIR 0x0200 141 1.1 mycroft #define ECB_ST 0x0400 142 1.1 mycroft #define ECB_CHK 0x0800 143 1.1 mycroft #define ECB_REC 0x4000 144 1.1 mycroft #define ECB_NRB 0x8000 145 1.1 mycroft u_short unused1; 146 1.1 mycroft physaddr data_addr; 147 1.1 mycroft physlen data_length; 148 1.1 mycroft physaddr status; 149 1.1 mycroft physaddr link_addr; 150 1.1 mycroft short unused2; 151 1.1 mycroft short unused3; 152 1.1 mycroft physaddr sense_ptr; 153 1.1 mycroft u_char req_sense_length; 154 1.1 mycroft u_char scsi_cmd_length; 155 1.1 mycroft short cksum; 156 1.1 mycroft struct scsi_generic scsi_cmd; 157 1.1 mycroft 158 1.1 mycroft struct ahb_dma_seg ahb_dma[AHB_NSEG]; 159 1.1 mycroft struct ahb_ecb_status ecb_status; 160 1.1 mycroft struct scsi_sense_data ecb_sense; 161 1.1 mycroft /*-----------------end of hardware supported fields----------------*/ 162 1.1 mycroft TAILQ_ENTRY(ahb_ecb) chain; 163 1.1 mycroft struct ahb_ecb *nexthash; 164 1.1 mycroft long hashkey; 165 1.1 mycroft struct scsi_xfer *xs; /* the scsi_xfer for this cmd */ 166 1.1 mycroft int flags; 167 1.1 mycroft #define ECB_ALLOC 0x01 168 1.1 mycroft #define ECB_ABORT 0x02 169 1.1 mycroft #define ECB_IMMED 0x04 170 1.1 mycroft #define ECB_IMMED_FAIL 0x08 171 1.1 mycroft int timeout; 172 1.1 mycroft }; 173