idareg.h revision 50477
1/*-
2 * Copyright (c) 1999 Jonathan Lemon
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 *    notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 *    notice, this list of conditions and the following disclaimer in the
12 *    documentation and/or other materials provided with the distribution.
13 *
14 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 * $FreeBSD: head/sys/dev/ida/idareg.h 50477 1999-08-28 01:08:13Z peter $
27 */
28
29/*
30 * #defines and software structures for the Compaq RAID card
31 */
32
33/*
34 * board register offsets
35 */
36#define R_CMD_FIFO	0x04
37#define R_DONE_FIFO	0x08
38#define R_INT_MASK	0x0C
39#define R_STATUS	0x10
40#define R_INT_PENDING	0x14
41
42/*
43 * interrupt mask values
44 */
45#define INT_DISABLE	0x00
46#define INT_ENABLE	0x01
47
48/*
49 * return status codes
50 */
51#define SOFT_ERROR	0x02
52#define HARD_ERROR	0x04
53#define CMD_REJECTED	0x14
54
55/*
56 * command types
57 */
58#define	CMD_GET_LOG_DRV_INFO	0x10
59#define	CMD_GET_CTRL_INFO	0x11
60#define	CMD_SENSE_DRV_STATUS	0x12
61#define	CMD_START_RECOVERY	0x13
62#define	CMD_GET_PHYS_DRV_INFO	0x15
63#define	CMD_BLINK_DRV_LEDS	0x16
64#define	CMD_SENSE_DRV_LEDS	0x17
65#define	CMD_GET_LOG_DRV_EXT	0x18
66#define	CMD_GET_CTRL_INFO	0x11
67#define CMD_READ		0x20
68#define CMD_WRITE		0x30
69#define CMD_WRITE_MEDIA		0x31
70#define CMD_GET_CONFIG		0x50
71#define CMD_SET_CONFIG		0x51
72#define CMD_FLUSH_CACHE		0xc2
73
74/*
75 * command structures
76 */
77struct ida_drive_info {
78	u_int16_t	secsize 	__attribute__ ((packed));
79	u_int32_t	secperunit 	__attribute__ ((packed));
80	u_int16_t	ncylinders 	__attribute__ ((packed));
81	u_int8_t	nheads	 	__attribute__ ((packed));
82	u_int8_t	signature 	__attribute__ ((packed));
83	u_int8_t	psectors 	__attribute__ ((packed));
84	u_int16_t	wprecomp 	__attribute__ ((packed));
85	u_int8_t	max_acc 	__attribute__ ((packed));
86	u_int8_t	control 	__attribute__ ((packed));
87	u_int16_t	pcylinders 	__attribute__ ((packed));
88	u_int8_t	ptracks 	__attribute__ ((packed));
89	u_int16_t	landing_zone 	__attribute__ ((packed));
90	u_int8_t	nsectors 	__attribute__ ((packed));
91	u_int8_t	checksum 	__attribute__ ((packed));
92	u_int8_t	mirror 		__attribute__ ((packed));
93};
94
95struct ida_controller_info {
96	u_int8_t	num_drvs 	__attribute__ ((packed));
97	u_int32_t	signature 	__attribute__ ((packed));
98	u_int8_t	firm_rev[4] 	__attribute__ ((packed));
99};
100