|
|
1.1 root 1: #ifndef _AHA1542_H
2:
3: /* $Id: aha1542.h,v 1.1 1992/04/24 18:01:50 root Exp root $
4: *
5: * Header file for the adaptec 1542 driver for Linux
6: *
7: * $Log: aha1542.h,v $
8: * Revision 1.1 1992/04/24 18:01:50 root
9: * Initial revision
10: *
11: * Revision 1.1 1992/04/02 03:23:13 drew
12: * Initial revision
13: *
14: * Revision 1.3 1992/01/27 14:46:29 tthorn
15: * *** empty log message ***
16: *
17: */
18:
19: /* I/O Port interface 4.2 */
20: /* READ */
21: #define STATUS base
22: #define STST 0x80 /* Self Test in Progress */
23: #define DIAGF 0x40 /* Internal Diagonostic Failure */
24: #define INIT 0x20 /* Mailbox Initialization Required */
25: #define IDLE 0x10 /* SCSI Host Adapter Idle */
26: #define CDF 0x08 /* Command/Data Out Port Full */
27: #define DF 0x04 /* Data In Port Full */
28: #define INVDCMD 0x01 /* Invalid H A Command */
29: #define STATMASK 0xfd /* 0x02 is reserved */
30:
31: #define INTRFLAGS STATUS+2
32: #define ANYINTR 0x80 /* Any Interrupt */
33: #define SCRD 0x08 /* SCSI Reset Detected */
34: #define HACC 0x04 /* HA Command Complete */
35: #define MBOA 0x02 /* MBO Empty */
36: #define MBIF 0x01 /* MBI Full */
37: #define INTRMASK 0x8f
38:
39: /* WRITE */
40: #define CONTROL STATUS
41: #define HRST 0x80 /* Hard Reset */
42: #define SRST 0x40 /* Soft Reset */
43: #define IRST 0x20 /* Interrupt Reset */
44: #define SCRST 0x10 /* SCSI Bus Reset */
45:
46: /* READ/WRITE */
47: #define DATA STATUS+1
48: #define CMD_NOP 0x00 /* No Operation */
49: #define CMD_MBINIT 0x01 /* Mailbox Initialization */
50: #define CMD_START_SCSI 0x02 /* Start SCSI Command */
51: #define CMD_INQUIRY 0x04 /* Adapter Inquiry */
52: #define CMD_EMBOI 0x05 /* Enable MailBox Out Interrupt */
53: #define CMD_BUSON_TIME 0x07 /* Set Bus-On Time */
54: #define CMD_BUSOFF_TIME 0x08 /* Set Bus-Off Time */
55: #define CMD_RETDEVS 0x0a /* Return Installed Devices */
56: #define CMD_RETCONF 0x0b /* Return Configuration Data */
57: #define CMD_RETSETUP 0x0d /* Return Setup Data */
58: #define CMD_ECHO 0x1f /* ECHO Command Data */
59:
60: /* Mailbox Definition 5.2.1 and 5.2.2 */
61: struct mailbox {
62: unchar status; /* Command/Status */
63: unchar ccbptr[3]; /* msb, .., lsb */
64: };
65:
66: /* These belong in scsi.h also */
67: #define any2scsi(up, p) \
68: (up)[0] = (((long)(p)) >> 16) & 0xff; \
69: (up)[1] = ((long)(p)) >> 8; \
70: (up)[2] = ((long)(p));
71:
72: #define scsi2int(up) ( (((long)*(up)) << 16) + (((long)(up)[1]) << 8) + ((long)(up)[2]) )
73:
74: #define xany2scsi(up, p) \
75: (up)[0] = ((long)(p)) >> 24; \
76: (up)[1] = ((long)(p)) >> 16; \
77: (up)[2] = ((long)(p)) >> 8; \
78: (up)[3] = ((long)(p));
79:
80: #define xscsi2int(up) ( (((long)(up)[0]) << 24) + (((long)(up)[1]) << 16) \
81: + (((long)(up)[2]) << 8) + ((long)(up)[3]) )
82:
83: #define MAX_CDB 12
84: #define MAX_SENSE 14
85:
86: struct ccb { /* Command Control Block 5.3 */
87: unchar op; /* Command Control Block Operation Code */
88: unchar idlun; /* op=0,2:Target Id, op=1:Initiator Id */
89: /* Outbound data transfer, length is checked*/
90: /* Inbound data transfer, length is checked */
91: /* Logical Unit Number */
92: unchar cdblen; /* SCSI Command Length */
93: unchar rsalen; /* Request Sense Allocation Length/Disable */
94: unchar datalen[3]; /* Data Length (msb, .., lsb) */
95: unchar dataptr[3]; /* Data Pointer */
96: unchar linkptr[3]; /* Link Pointer */
97: unchar commlinkid; /* Command Linking Identifier */
98: unchar hastat; /* Host Adapter Status (HASTAT) */
99: unchar tarstat; /* Target Device Status */
100: unchar reserved[2];
101: unchar cdb[MAX_CDB+MAX_SENSE];/* SCSI Command Descriptor Block */
102: /* REQUEST SENSE */
103: };
104:
105: int aha1542_detect(int);
106: int aha1542_command(unsigned char target, const void *cmnd, void *buff, int bufflen);
107: /*int aha1542_queuecommand(unchar target, const void *cmnd, void *buff, int bufflen, void (*done)(int));*/
108: int aha1542_abort(int);
109: char *aha1542_info(void);
110: int aha1542_reset(void);
111:
112: #ifndef NULL
113: #define NULL 0
114: #endif
115:
116: #define AHA1542 {"Adaptec 1542", aha1542_detect, \
117: aha1542_info, aha1542_command, \
118: /*aha1542_queuecommand*/ NULL, \
119: aha1542_abort, \
120: aha1542_reset, \
121: 0, 7, 0}
122: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.