Home | History | Annotate | Line # | Download | only in ata
wdvar.h revision 1.27
      1  1.27  drochner /*	$NetBSD: wdvar.h,v 1.27 2004/08/30 09:34:42 drochner Exp $	*/
      2   1.2    bouyer 
      3   1.2    bouyer /*
      4  1.10    bouyer  * Copyright (c) 1998, 2001 Manuel Bouyer.
      5   1.2    bouyer  *
      6   1.2    bouyer  * Redistribution and use in source and binary forms, with or without
      7   1.2    bouyer  * modification, are permitted provided that the following conditions
      8   1.2    bouyer  * are met:
      9   1.2    bouyer  * 1. Redistributions of source code must retain the above copyright
     10   1.2    bouyer  *    notice, this list of conditions and the following disclaimer.
     11   1.2    bouyer  * 2. Redistributions in binary form must reproduce the above copyright
     12   1.2    bouyer  *    notice, this list of conditions and the following disclaimer in the
     13   1.2    bouyer  *    documentation and/or other materials provided with the distribution.
     14   1.2    bouyer  * 3. All advertising materials mentioning features or use of this software
     15   1.2    bouyer  *    must display the following acknowledgement:
     16  1.12    bouyer  *	This product includes software developed by Manuel Bouyer.
     17  1.18    bouyer  * 4. The name of the author may not be used to endorse or promote products
     18  1.18    bouyer  *    derived from this software without specific prior written permission.
     19   1.2    bouyer  *
     20   1.6    bouyer  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     21   1.6    bouyer  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     22   1.6    bouyer  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     23   1.6    bouyer  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     24   1.6    bouyer  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     25   1.6    bouyer  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     26   1.6    bouyer  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     27   1.6    bouyer  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     28   1.6    bouyer  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     29   1.6    bouyer  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     30   1.8    bouyer  */
     31  1.13   thorpej 
     32  1.25   thorpej #ifndef _DEV_ATA_WDVAR_H_
     33  1.25   thorpej #define	_DEV_ATA_WDVAR_H_
     34  1.13   thorpej 
     35  1.27  drochner #ifdef _KERNEL_OPT
     36  1.27  drochner #include "opt_wd_softbadsect.h"
     37  1.27  drochner #endif
     38  1.27  drochner 
     39  1.13   thorpej struct wd_softc {
     40  1.13   thorpej 	/* General disk infos */
     41  1.13   thorpej 	struct device sc_dev;
     42  1.13   thorpej 	struct disk sc_dk;
     43  1.21   mycroft 	struct lock sc_lock;
     44  1.13   thorpej 	struct bufq_state sc_q;
     45  1.13   thorpej 	struct callout sc_restart_ch;
     46  1.14   thorpej 	int sc_quirks;			/* any quirks drive might have */
     47  1.13   thorpej 	/* IDE disk soft states */
     48  1.13   thorpej 	struct ata_bio sc_wdc_bio; /* current transfer */
     49  1.13   thorpej 	struct buf *sc_bp; /* buf being transfered */
     50  1.13   thorpej 	struct ata_drive_datas *drvp; /* Our controller's infos */
     51  1.13   thorpej 	const struct ata_bustype *atabus;
     52  1.13   thorpej 	int openings;
     53  1.20       wiz 	struct ataparams sc_params;/* drive characteristics found */
     54  1.13   thorpej 	int sc_flags;
     55  1.13   thorpej #define	WDF_WLABEL	0x004 /* label is writable */
     56  1.13   thorpej #define	WDF_LABELLING	0x008 /* writing label */
     57  1.13   thorpej /*
     58  1.13   thorpej  * XXX Nothing resets this yet, but disk change sensing will when ATA-4 is
     59  1.13   thorpej  * more fully implemented.
     60  1.13   thorpej  */
     61  1.13   thorpej #define WDF_LOADED	0x010 /* parameters loaded */
     62  1.13   thorpej #define WDF_WAIT	0x020 /* waiting for resources */
     63  1.13   thorpej #define WDF_LBA		0x040 /* using LBA mode */
     64  1.13   thorpej #define WDF_KLABEL	0x080 /* retain label after 'full' close */
     65  1.13   thorpej #define WDF_LBA48	0x100 /* using 48-bit LBA mode */
     66  1.15      fvdl 	u_int64_t sc_capacity;
     67  1.13   thorpej 	int cyl; /* actual drive parameters */
     68  1.13   thorpej 	int heads;
     69  1.13   thorpej 	int sectors;
     70  1.13   thorpej 	int retries; /* number of xfer retry */
     71  1.13   thorpej 
     72  1.13   thorpej 	void *sc_sdhook;		/* our shutdown hook */
     73  1.16   darrenr 
     74  1.27  drochner #ifdef WD_SOFTBADSECT
     75  1.16   darrenr 	SLIST_HEAD(, disk_badsectors)	sc_bslist;
     76  1.17   darrenr 	u_int sc_bscount;
     77  1.27  drochner #endif
     78  1.13   thorpej #if NRND > 0
     79  1.13   thorpej 	rndsource_element_t	rnd_source;
     80  1.13   thorpej #endif
     81  1.13   thorpej };
     82  1.13   thorpej 
     83  1.13   thorpej #define sc_drive sc_wdc_bio.drive
     84  1.13   thorpej #define sc_mode sc_wdc_bio.mode
     85  1.13   thorpej #define sc_multi sc_wdc_bio.multi
     86  1.13   thorpej #define sc_badsect sc_wdc_bio.badsect
     87   1.2    bouyer 
     88  1.25   thorpej #endif /* _DEV_ATA_WDVAR_H_ */
     89