2005-07-25 16:52:44 +04:00
|
|
|
/* $NetBSD: wdvar.h,v 1.30 2005/07/25 12:52:44 drochner Exp $ */
|
1998-10-12 20:09:10 +04:00
|
|
|
|
|
|
|
/*
|
2001-12-03 03:20:22 +03:00
|
|
|
* Copyright (c) 1998, 2001 Manuel Bouyer.
|
1998-10-12 20:09:10 +04:00
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
* 3. All advertising materials mentioning features or use of this software
|
|
|
|
* must display the following acknowledgement:
|
2002-04-24 00:41:13 +04:00
|
|
|
* This product includes software developed by Manuel Bouyer.
|
2003-10-05 21:48:49 +04:00
|
|
|
* 4. The name of the author may not be used to endorse or promote products
|
|
|
|
* derived from this software without specific prior written permission.
|
1998-10-12 20:09:10 +04:00
|
|
|
*
|
2000-05-15 12:32:07 +04:00
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
|
|
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
|
|
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
2005-02-27 03:26:58 +03:00
|
|
|
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
2000-05-15 12:32:07 +04:00
|
|
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
|
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
|
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
2001-12-03 01:44:32 +03:00
|
|
|
*/
|
|
|
|
|
2003-12-14 08:37:25 +03:00
|
|
|
#ifndef _DEV_ATA_WDVAR_H_
|
|
|
|
#define _DEV_ATA_WDVAR_H_
|
2003-01-27 21:21:23 +03:00
|
|
|
|
2004-08-30 13:34:41 +04:00
|
|
|
#ifdef _KERNEL_OPT
|
|
|
|
#include "opt_wd_softbadsect.h"
|
|
|
|
#endif
|
|
|
|
|
2003-01-27 21:21:23 +03:00
|
|
|
struct wd_softc {
|
|
|
|
/* General disk infos */
|
|
|
|
struct device sc_dev;
|
|
|
|
struct disk sc_dk;
|
|
|
|
struct bufq_state sc_q;
|
|
|
|
struct callout sc_restart_ch;
|
2003-03-22 01:40:56 +03:00
|
|
|
int sc_quirks; /* any quirks drive might have */
|
2003-01-27 21:21:23 +03:00
|
|
|
/* IDE disk soft states */
|
|
|
|
struct ata_bio sc_wdc_bio; /* current transfer */
|
|
|
|
struct buf *sc_bp; /* buf being transfered */
|
|
|
|
struct ata_drive_datas *drvp; /* Our controller's infos */
|
|
|
|
const struct ata_bustype *atabus;
|
|
|
|
int openings;
|
2003-11-02 12:52:33 +03:00
|
|
|
struct ataparams sc_params;/* drive characteristics found */
|
2005-02-27 03:26:58 +03:00
|
|
|
int sc_flags;
|
2003-01-27 21:21:23 +03:00
|
|
|
#define WDF_WLABEL 0x004 /* label is writable */
|
|
|
|
#define WDF_LABELLING 0x008 /* writing label */
|
|
|
|
/*
|
|
|
|
* XXX Nothing resets this yet, but disk change sensing will when ATA-4 is
|
|
|
|
* more fully implemented.
|
|
|
|
*/
|
|
|
|
#define WDF_LOADED 0x010 /* parameters loaded */
|
|
|
|
#define WDF_WAIT 0x020 /* waiting for resources */
|
|
|
|
#define WDF_LBA 0x040 /* using LBA mode */
|
|
|
|
#define WDF_KLABEL 0x080 /* retain label after 'full' close */
|
|
|
|
#define WDF_LBA48 0x100 /* using 48-bit LBA mode */
|
2003-04-04 02:18:23 +04:00
|
|
|
u_int64_t sc_capacity;
|
2005-07-25 16:52:44 +04:00
|
|
|
|
2003-01-27 21:21:23 +03:00
|
|
|
int retries; /* number of xfer retry */
|
|
|
|
|
|
|
|
void *sc_sdhook; /* our shutdown hook */
|
|
|
|
|
2004-08-30 13:34:41 +04:00
|
|
|
#ifdef WD_SOFTBADSECT
|
2003-04-15 18:11:00 +04:00
|
|
|
SLIST_HEAD(, disk_badsectors) sc_bslist;
|
2003-04-15 22:27:26 +04:00
|
|
|
u_int sc_bscount;
|
2004-08-30 13:34:41 +04:00
|
|
|
#endif
|
2003-01-27 21:21:23 +03:00
|
|
|
#if NRND > 0
|
|
|
|
rndsource_element_t rnd_source;
|
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
|
|
|
#define sc_drive sc_wdc_bio.drive
|
|
|
|
#define sc_mode sc_wdc_bio.mode
|
|
|
|
#define sc_multi sc_wdc_bio.multi
|
|
|
|
#define sc_badsect sc_wdc_bio.badsect
|
|
|
|
|
2003-12-14 08:37:25 +03:00
|
|
|
#endif /* _DEV_ATA_WDVAR_H_ */
|