dkio.h revision 5d54f3d8999eac1762fe0a8c7177d20f1f201fae
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _sun_dkio_h
#define _sun_dkio_h
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Structures and definitions for disk io control commands
*/
/*
* Structures used as data by ioctl calls.
*/
/*
* Used for controller info
*/
struct dk_info {
int dki_ctlr; /* controller address */
short dki_unit; /* unit (slave) address */
short dki_ctype; /* controller type */
short dki_flags; /* flags */
};
/* unit # & NULL (ie - "xyc1") */
/*
* Used for configuration info
*/
struct dk_conf {
short dkc_cnum; /* controller number */
int dkc_addr; /* controller address */
int dkc_prio; /* interrupt priority */
int dkc_vec; /* interrupt vector */
short dkc_unit; /* unit number */
short dkc_slave; /* slave number */
};
/*
* Controller types
*/
#define DKC_UNKNOWN 0
/* 1 used to be Interphase 2180 */
#define DKC_WDC2880 2
/* 3 used to be Interphase 2181 */
/* 4 used to be Xylogics 440 */
#define DKC_DSD5215 5
#define DKC_XY450 6
#define DKC_ACB4000 7
#define DKC_MD21 8
/* 9 used to be Xylogics 751 */
#define DKC_NCRFLOPPY 10
/* #define DKC_XB1401 10 does not match dkinfo.c*/
#define DKC_XD7053 11
#define DKC_SMSFLOPPY 12
#define DKC_SCSI_CCS 13
#define DKC_PANTHER 15
/*
* Flags
*/
/*
* Used for drive info
*/
struct dk_type {
};
/*
* Used for all partitions
*/
struct dk_allmap {
};
/*
* Used for bad sector map
*/
struct dk_badmap {
};
/*
* Definition of a disk's geometry
*/
struct dk_geom {
unsigned short dkg_ncyl; /* # of data cylinders */
unsigned short dkg_acyl; /* # of alternate cylinders */
unsigned short dkg_bcyl; /* cyl offset (for fixed head area) */
unsigned short dkg_nhead; /* # of heads */
unsigned short dkg_obs1; /* obsolete */
unsigned short dkg_nsect; /* # of data sectors per track */
unsigned short dkg_intrlv; /* interleave factor */
unsigned short dkg_obs2; /* obsolete */
unsigned short dkg_obs3; /* obsolete */
unsigned short dkg_apc; /* alternates per cyl (SCSI only) */
unsigned short dkg_rpm; /* revolutions per minute */
unsigned short dkg_pcyl; /* # of physical cylinders */
};
/*
* These defines are for historic compatibility with old drivers.
*/
/*
* Used for generic commands
*/
struct dk_cmd {
int dkc_flags; /* execution flags */
int dkc_secnt; /* sector count for command */
};
/*
* Execution flags.
*/
/*
* Used for disk diagnostics
*/
struct dk_diag {
};
/*
* Used for getting disk error log.
*/
struct dk_loghdr {
long dkl_entries; /* number of dk_log entries */
long dkl_max_size; /* max. size of dk_log table */
};
/*
* Disk error log table entry.
*/
struct dk_log {
short type; /* type of error (e.g. soft error) */
short err1; /* primary error code (e.g sense key) */
short err2; /* secondary error code */
};
/*
* Dk_log type flags.
*
* FIXME: Really should specify dkd_errno error codes.
* For some reason they're specified in the drivers
* instead of here?? Should also use those here for
* dk_log.type too.
*/
/*
* Used for floppies
*/
struct fdk_char{
int transfer_rate; /* transfer rate */
int ncyl; /* number of cylinders */
int nhead; /* number of heads */
int sec_size; /* sector size */
int secptrack; /* sectors per track */
int steps; /* number of steps per */
};
struct fdk_state {
int fkc_bsec; /* bytes per sector */
int fkc_strack; /* sectors per track */
int fkc_step; /* step rate */
int fkc_rate; /* data rate */
int fkc_error; /* error returned by controller */
};
struct fdk_cmd { /* used by generic command */
};
/*
* Floppy commands
*/
#define FKWRITE 1
#define FKREAD 2
#define FKSEEK 3
#define FKREZERO 4
#define FKFORMAT_UNIT 5
#define FKFORMAT_TRACK 6
/*
* Used by FDKGETCHANGE, return state of the sense disk change bit.
*/
/*
* Used by FDK{G, S}ETDRIVECHAR
*/
struct fdk_drive {
int fdd_ejectable; /* does the drive support eject? */
int fdd_maxsearch; /* size of per-unit search table */
int fdd_writeprecomp; /* cyl to start write prcompensation */
int fdd_writereduce; /* cyl to start recucing write current */
int fdd_stepwidth; /* width of step pulse in 1 us units */
int fdd_steprate; /* step rate in 100 us units */
int fdd_headsettle; /* delay, in 100 us units */
int fdd_headload; /* delay, in 100 us units */
int fdd_headunload; /* delay, in 100 us units */
int fdd_motoron; /* delay, in 100 ms units */
int fdd_motoroff; /* delay, in 100 ms units */
int fdd_precomplevel; /* bit shift, in nano-secs */
int fdd_pins; /* defines meaning of pin 1, 2, 4, and 34 */
int fdd_flags; /* TRUE READY, Starting Sector #, & Motor On */
};
/*
* Used by FDK{G, S}ETSEARCH
*/
struct fdk_search {
int fdk_numentries; /* number of elements in the table */
struct fdk_char *fdk_search;
};
/*
* Used by F_RAW
*/
struct fdraw {
short fr_cnum; /* number of command bytes */
};
/*
* Floppy raw commands
*/
#define FRAW_SPECIFY 0x03
#define FRAW_READID 0x0a
#define FRAW_SENSE_DRV 0x04
#define FRAW_REZERO 0x07
#define FRAW_SEEK 0x0f
#define FRAW_SENSE_INT 0x08
#define FRAW_FORMAT 0x0d
#define FRAW_READTRACK 0x02
#define FRAW_WRCMD 0x05
#define FRAW_RDCMD 0x06
#define FRAW_WRITEDEL 0x09
#define FRAW_READDEL 0x0c
/*
* Severity values
*/
#define DK_NOERROR 0
#define DK_CORRECTED 1
#define DK_RECOVERED 2
#define DK_FATAL 3
/*
* Error types
*/
#define DK_NONMEDIA 0 /* not caused by a media defect */
/*
* Disk io control commands
*/
#endif /* !_sun_dkio_h */