xref: /netbsd/sys/dev/mca/edvar.h (revision 71c9a541)
1*71c9a541Sriastradh /*	$NetBSD: edvar.h,v 1.18 2015/04/14 20:32:36 riastradh Exp $	*/
2fd1d702aSjdolecek 
3fd1d702aSjdolecek /*
4fd1d702aSjdolecek  * Copyright (c) 2001 The NetBSD Foundation, Inc.
5592397dbSmartin  * All rights reserved.
6fd1d702aSjdolecek  *
7fd1d702aSjdolecek  * This code is derived from software contributed to The NetBSD Foundation
8fd1d702aSjdolecek  * by Jaromir Dolecek.
9fd1d702aSjdolecek  *
10fd1d702aSjdolecek  * Redistribution and use in source and binary forms, with or without
11fd1d702aSjdolecek  * modification, are permitted provided that the following conditions
12fd1d702aSjdolecek  * are met:
13fd1d702aSjdolecek  * 1. Redistributions of source code must retain the above copyright
14fd1d702aSjdolecek  *    notice, this list of conditions and the following disclaimer.
15fd1d702aSjdolecek  * 2. Redistributions in binary form must reproduce the above copyright
16fd1d702aSjdolecek  *    notice, this list of conditions and the following disclaimer in the
17fd1d702aSjdolecek  *    documentation and/or other materials provided with the distribution.
18fd1d702aSjdolecek  *
19592397dbSmartin  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20592397dbSmartin  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21592397dbSmartin  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22592397dbSmartin  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23592397dbSmartin  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24592397dbSmartin  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25592397dbSmartin  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26592397dbSmartin  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27592397dbSmartin  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28592397dbSmartin  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29592397dbSmartin  * POSSIBILITY OF SUCH DAMAGE.
30fd1d702aSjdolecek  */
31fd1d702aSjdolecek 
3297615f89Sskrll #include <sys/mutex.h>
33*71c9a541Sriastradh #include <sys/rndsource.h>
340664a045Sad 
35dbf91c82Sjdolecek struct edc_mca_softc;
36fd1d702aSjdolecek 
37fd1d702aSjdolecek struct ed_softc {
385f819ca3Schs 	device_t sc_dev;
39fd1d702aSjdolecek 
40fd1d702aSjdolecek 	/* General disk infos */
41fd1d702aSjdolecek 	struct disk sc_dk;
42aec75b1cSyamt 	struct bufq_state *sc_q;
4397615f89Sskrll 	kmutex_t sc_q_lock;
44fd1d702aSjdolecek 
4567238c60Sjdolecek 	struct edc_mca_softc *edc_softc;   /* pointer to our controller */
46fd1d702aSjdolecek 
475b3932d1Sjdolecek 	int sc_flags;
488927d6f1Sjdolecek #define WDF_WLABEL	0x001 /* label is writable */
498927d6f1Sjdolecek #define WDF_LABELLING   0x002 /* writing label */
508927d6f1Sjdolecek #define WDF_LOADED	0x004 /* parameters loaded */
518927d6f1Sjdolecek #define WDF_KLABEL	0x008 /* retain label after 'full' close */
525b3932d1Sjdolecek #define EDF_INIT	0x100 /* disk initialized */
53fd1d702aSjdolecek 
54fd1d702aSjdolecek 	/* actual drive parameters */
5567238c60Sjdolecek 	int sc_capacity;
5667238c60Sjdolecek 	int sc_devno;
5767238c60Sjdolecek 	u_int16_t sense_data[4];	/* sensed drive parameters */
58fd1d702aSjdolecek 	u_int16_t cyl;
59fd1d702aSjdolecek 	u_int8_t heads;
60fd1d702aSjdolecek 	u_int8_t sectors;
61fd1d702aSjdolecek 	u_int8_t spares;	/* spares per cylinder */
6267238c60Sjdolecek 	u_int32_t rba;		/* # of RBAs */
63fd1d702aSjdolecek 
648e933452Stls 	krndsource_t	rnd_source;
65fd1d702aSjdolecek };
66