Home | History | Annotate | Line # | Download | only in ata
wdvar.h revision 1.43.4.2
      1  1.43.4.2  jdolecek /*	$NetBSD: wdvar.h,v 1.43.4.2 2017/04/15 12:01:23 jdolecek 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  *
     15       1.6    bouyer  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     16       1.6    bouyer  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     17       1.6    bouyer  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     18      1.29     perry  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     19       1.6    bouyer  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     20       1.6    bouyer  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     21       1.6    bouyer  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     22       1.6    bouyer  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     23       1.6    bouyer  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     24       1.6    bouyer  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     25       1.8    bouyer  */
     26      1.13   thorpej 
     27      1.25   thorpej #ifndef _DEV_ATA_WDVAR_H_
     28      1.25   thorpej #define	_DEV_ATA_WDVAR_H_
     29      1.13   thorpej 
     30      1.27  drochner #ifdef _KERNEL_OPT
     31      1.27  drochner #include "opt_wd_softbadsect.h"
     32      1.27  drochner #endif
     33      1.27  drochner 
     34      1.42  riastrad #include <sys/rndsource.h>
     35      1.40       tls 
     36      1.13   thorpej struct wd_softc {
     37      1.13   thorpej 	/* General disk infos */
     38      1.36      cube 	device_t sc_dev;
     39      1.13   thorpej 	struct disk sc_dk;
     40      1.31      yamt 	struct bufq_state *sc_q;
     41      1.13   thorpej 	struct callout sc_restart_ch;
     42  1.43.4.1  jdolecek 	kmutex_t sc_lock;
     43      1.14   thorpej 	int sc_quirks;			/* any quirks drive might have */
     44  1.43.4.1  jdolecek 
     45      1.13   thorpej 	/* IDE disk soft states */
     46      1.13   thorpej 	struct ata_drive_datas *drvp; /* Our controller's infos */
     47      1.13   thorpej 	const struct ata_bustype *atabus;
     48      1.20       wiz 	struct ataparams sc_params;/* drive characteristics found */
     49      1.29     perry 	int sc_flags;
     50      1.13   thorpej #define	WDF_WLABEL	0x004 /* label is writable */
     51      1.13   thorpej #define	WDF_LABELLING	0x008 /* writing label */
     52      1.13   thorpej /*
     53      1.13   thorpej  * XXX Nothing resets this yet, but disk change sensing will when ATA-4 is
     54      1.13   thorpej  * more fully implemented.
     55      1.13   thorpej  */
     56      1.13   thorpej #define WDF_LOADED	0x010 /* parameters loaded */
     57      1.13   thorpej #define WDF_WAIT	0x020 /* waiting for resources */
     58      1.13   thorpej #define WDF_LBA		0x040 /* using LBA mode */
     59      1.13   thorpej #define WDF_KLABEL	0x080 /* retain label after 'full' close */
     60      1.13   thorpej #define WDF_LBA48	0x100 /* using 48-bit LBA mode */
     61      1.41      matt 	uint64_t sc_capacity; /* full capacity of the device */
     62      1.43  jakllsch 	uint64_t sc_capacity512; /* ... in DEV_BSIZE blocks */
     63      1.41      matt 	uint32_t sc_capacity28; /* capacity accessible with LBA28 commands */
     64      1.43  jakllsch 	uint32_t sc_blksize; /* logical block size, in bytes */
     65      1.30  drochner 
     66      1.27  drochner #ifdef WD_SOFTBADSECT
     67      1.16   darrenr 	SLIST_HEAD(, disk_badsectors)	sc_bslist;
     68      1.17   darrenr 	u_int sc_bscount;
     69      1.27  drochner #endif
     70      1.39       tls 	krndsource_t	rnd_source;
     71  1.43.4.1  jdolecek 
     72  1.43.4.1  jdolecek 	LIST_HEAD(, wd_ioctl) wi_head;
     73      1.13   thorpej 
     74  1.43.4.2  jdolecek 	STAILQ_HEAD(, ata_xfer) xfer_restart;
     75  1.43.4.2  jdolecek };
     76       1.2    bouyer 
     77      1.25   thorpej #endif /* _DEV_ATA_WDVAR_H_ */
     78