17c478bd9Sstevel@tonic-gate /* 27c478bd9Sstevel@tonic-gate * CDDL HEADER START 37c478bd9Sstevel@tonic-gate * 47c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 57c478bd9Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 67c478bd9Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 77c478bd9Sstevel@tonic-gate * with the License. 87c478bd9Sstevel@tonic-gate * 97c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 107c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 117c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 127c478bd9Sstevel@tonic-gate * and limitations under the License. 137c478bd9Sstevel@tonic-gate * 147c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 157c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 167c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 177c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 187c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 197c478bd9Sstevel@tonic-gate * 207c478bd9Sstevel@tonic-gate * CDDL HEADER END 217c478bd9Sstevel@tonic-gate */ 227c478bd9Sstevel@tonic-gate /* 23*5d54f3d8Smuffin * Copyright 2005 Sun Microsystems, Inc. All rights reserved. 24*5d54f3d8Smuffin * Use is subject to license terms. 257c478bd9Sstevel@tonic-gate */ 267c478bd9Sstevel@tonic-gate 277c478bd9Sstevel@tonic-gate #ifndef _sun_dkio_h 287c478bd9Sstevel@tonic-gate #define _sun_dkio_h 297c478bd9Sstevel@tonic-gate 30*5d54f3d8Smuffin #pragma ident "%Z%%M% %I% %E% SMI" 31*5d54f3d8Smuffin 327c478bd9Sstevel@tonic-gate /* #include <sys/ioctl.h> not needed? */ 337c478bd9Sstevel@tonic-gate #include <sun/dklabel.h> 347c478bd9Sstevel@tonic-gate 357c478bd9Sstevel@tonic-gate /* 367c478bd9Sstevel@tonic-gate * Structures and definitions for disk io control commands 377c478bd9Sstevel@tonic-gate */ 387c478bd9Sstevel@tonic-gate 397c478bd9Sstevel@tonic-gate /* 407c478bd9Sstevel@tonic-gate * Structures used as data by ioctl calls. 417c478bd9Sstevel@tonic-gate */ 427c478bd9Sstevel@tonic-gate 437c478bd9Sstevel@tonic-gate /* 447c478bd9Sstevel@tonic-gate * Used for controller info 457c478bd9Sstevel@tonic-gate */ 467c478bd9Sstevel@tonic-gate struct dk_info { 477c478bd9Sstevel@tonic-gate int dki_ctlr; /* controller address */ 487c478bd9Sstevel@tonic-gate short dki_unit; /* unit (slave) address */ 497c478bd9Sstevel@tonic-gate short dki_ctype; /* controller type */ 507c478bd9Sstevel@tonic-gate short dki_flags; /* flags */ 517c478bd9Sstevel@tonic-gate }; 527c478bd9Sstevel@tonic-gate 537c478bd9Sstevel@tonic-gate #define DK_DEVLEN 16 /* device name max length, including */ 547c478bd9Sstevel@tonic-gate /* unit # & NULL (ie - "xyc1") */ 557c478bd9Sstevel@tonic-gate /* 567c478bd9Sstevel@tonic-gate * Used for configuration info 577c478bd9Sstevel@tonic-gate */ 587c478bd9Sstevel@tonic-gate struct dk_conf { 597c478bd9Sstevel@tonic-gate char dkc_cname[DK_DEVLEN]; /* controller name (no unit #) */ 607c478bd9Sstevel@tonic-gate u_short dkc_ctype; /* controller type */ 617c478bd9Sstevel@tonic-gate u_short dkc_flags; /* flags */ 627c478bd9Sstevel@tonic-gate short dkc_cnum; /* controller number */ 637c478bd9Sstevel@tonic-gate int dkc_addr; /* controller address */ 647c478bd9Sstevel@tonic-gate u_int dkc_space; /* controller bus type */ 657c478bd9Sstevel@tonic-gate int dkc_prio; /* interrupt priority */ 667c478bd9Sstevel@tonic-gate int dkc_vec; /* interrupt vector */ 677c478bd9Sstevel@tonic-gate char dkc_dname[DK_DEVLEN]; /* drive name (no unit #) */ 687c478bd9Sstevel@tonic-gate short dkc_unit; /* unit number */ 697c478bd9Sstevel@tonic-gate short dkc_slave; /* slave number */ 707c478bd9Sstevel@tonic-gate }; 717c478bd9Sstevel@tonic-gate 727c478bd9Sstevel@tonic-gate /* 737c478bd9Sstevel@tonic-gate * Controller types 747c478bd9Sstevel@tonic-gate */ 757c478bd9Sstevel@tonic-gate #define DKC_UNKNOWN 0 767c478bd9Sstevel@tonic-gate /* 1 used to be Interphase 2180 */ 777c478bd9Sstevel@tonic-gate #define DKC_WDC2880 2 787c478bd9Sstevel@tonic-gate /* 3 used to be Interphase 2181 */ 797c478bd9Sstevel@tonic-gate /* 4 used to be Xylogics 440 */ 807c478bd9Sstevel@tonic-gate #define DKC_DSD5215 5 817c478bd9Sstevel@tonic-gate #define DKC_XY450 6 827c478bd9Sstevel@tonic-gate #define DKC_ACB4000 7 837c478bd9Sstevel@tonic-gate #define DKC_MD21 8 847c478bd9Sstevel@tonic-gate /* 9 used to be Xylogics 751 */ 857c478bd9Sstevel@tonic-gate #define DKC_NCRFLOPPY 10 867c478bd9Sstevel@tonic-gate /* #define DKC_XB1401 10 does not match dkinfo.c*/ 877c478bd9Sstevel@tonic-gate #define DKC_XD7053 11 887c478bd9Sstevel@tonic-gate #define DKC_SMSFLOPPY 12 897c478bd9Sstevel@tonic-gate #define DKC_SCSI_CCS 13 907c478bd9Sstevel@tonic-gate #define DKC_INTEL82072 14 /* floppy ctlr on campus and hydra */ 917c478bd9Sstevel@tonic-gate #define DKC_PANTHER 15 927c478bd9Sstevel@tonic-gate #define DKC_SUN_IPI1 DKC_PANTHER /* Sun Panther VME/IPI controller */ 937c478bd9Sstevel@tonic-gate #define DKC_MD 16 /* meta-disk (virtual-disk) driver */ 947c478bd9Sstevel@tonic-gate #define DKC_CDC_9057 17 /* CDC 9057-321 (CM-3) IPI String Controller */ 957c478bd9Sstevel@tonic-gate #define DKC_FJ_M1060 18 /* Fujitsu/Intellistor M1060 IPI-3 SC */ 967c478bd9Sstevel@tonic-gate 977c478bd9Sstevel@tonic-gate /* 987c478bd9Sstevel@tonic-gate * Flags 997c478bd9Sstevel@tonic-gate */ 1007c478bd9Sstevel@tonic-gate #define DKI_BAD144 0x01 /* use DEC std 144 bad sector fwding */ 1017c478bd9Sstevel@tonic-gate #define DKI_MAPTRK 0x02 /* controller does track mapping */ 1027c478bd9Sstevel@tonic-gate #define DKI_FMTTRK 0x04 /* formats only full track at a time */ 1037c478bd9Sstevel@tonic-gate #define DKI_FMTVOL 0x08 /* formats only full volume at a time */ 1047c478bd9Sstevel@tonic-gate #define DKI_FMTCYL 0x10 /* formats only full cylinders at a time */ 1057c478bd9Sstevel@tonic-gate #define DKI_HEXUNIT 0x20 /* unit number is printed as 3 hex digits */ 1067c478bd9Sstevel@tonic-gate 1077c478bd9Sstevel@tonic-gate /* 1087c478bd9Sstevel@tonic-gate * Used for drive info 1097c478bd9Sstevel@tonic-gate */ 1107c478bd9Sstevel@tonic-gate struct dk_type { 1117c478bd9Sstevel@tonic-gate u_short dkt_hsect; /* hard sector count (read only) */ 1127c478bd9Sstevel@tonic-gate u_short dkt_promrev; /* prom revision (read only) */ 1137c478bd9Sstevel@tonic-gate u_char dkt_drtype; /* drive type (ctlr specific) */ 1147c478bd9Sstevel@tonic-gate u_char dkt_drstat; /* drive status (ctlr specific, ro) */ 1157c478bd9Sstevel@tonic-gate }; 1167c478bd9Sstevel@tonic-gate 1177c478bd9Sstevel@tonic-gate /* 1187c478bd9Sstevel@tonic-gate * Used for all partitions 1197c478bd9Sstevel@tonic-gate */ 1207c478bd9Sstevel@tonic-gate struct dk_allmap { 1217c478bd9Sstevel@tonic-gate struct dk_map dka_map[NDKMAP]; 1227c478bd9Sstevel@tonic-gate }; 1237c478bd9Sstevel@tonic-gate 1247c478bd9Sstevel@tonic-gate /* 1257c478bd9Sstevel@tonic-gate * Used for bad sector map 1267c478bd9Sstevel@tonic-gate */ 1277c478bd9Sstevel@tonic-gate struct dk_badmap { 1287c478bd9Sstevel@tonic-gate caddr_t dkb_bufaddr; /* address of user's map buffer */ 1297c478bd9Sstevel@tonic-gate }; 1307c478bd9Sstevel@tonic-gate 1317c478bd9Sstevel@tonic-gate /* 1327c478bd9Sstevel@tonic-gate * Definition of a disk's geometry 1337c478bd9Sstevel@tonic-gate */ 1347c478bd9Sstevel@tonic-gate struct dk_geom { 1357c478bd9Sstevel@tonic-gate unsigned short dkg_ncyl; /* # of data cylinders */ 1367c478bd9Sstevel@tonic-gate unsigned short dkg_acyl; /* # of alternate cylinders */ 1377c478bd9Sstevel@tonic-gate unsigned short dkg_bcyl; /* cyl offset (for fixed head area) */ 1387c478bd9Sstevel@tonic-gate unsigned short dkg_nhead; /* # of heads */ 1397c478bd9Sstevel@tonic-gate unsigned short dkg_obs1; /* obsolete */ 1407c478bd9Sstevel@tonic-gate unsigned short dkg_nsect; /* # of data sectors per track */ 1417c478bd9Sstevel@tonic-gate unsigned short dkg_intrlv; /* interleave factor */ 1427c478bd9Sstevel@tonic-gate unsigned short dkg_obs2; /* obsolete */ 1437c478bd9Sstevel@tonic-gate unsigned short dkg_obs3; /* obsolete */ 1447c478bd9Sstevel@tonic-gate unsigned short dkg_apc; /* alternates per cyl (SCSI only) */ 1457c478bd9Sstevel@tonic-gate unsigned short dkg_rpm; /* revolutions per minute */ 1467c478bd9Sstevel@tonic-gate unsigned short dkg_pcyl; /* # of physical cylinders */ 1477c478bd9Sstevel@tonic-gate unsigned short dkg_extra[7]; /* for compatible expansion */ 1487c478bd9Sstevel@tonic-gate }; 1497c478bd9Sstevel@tonic-gate /* 1507c478bd9Sstevel@tonic-gate * These defines are for historic compatibility with old drivers. 1517c478bd9Sstevel@tonic-gate */ 1527c478bd9Sstevel@tonic-gate #define dkg_bhead dkg_obs1 /* used to be head offset */ 1537c478bd9Sstevel@tonic-gate #define dkg_gap1 dkg_obs2 /* used to be gap1 */ 1547c478bd9Sstevel@tonic-gate #define dkg_gap2 dkg_obs3 /* used to be gap2 */ 1557c478bd9Sstevel@tonic-gate 1567c478bd9Sstevel@tonic-gate /* 1577c478bd9Sstevel@tonic-gate * Used for generic commands 1587c478bd9Sstevel@tonic-gate */ 1597c478bd9Sstevel@tonic-gate struct dk_cmd { 1607c478bd9Sstevel@tonic-gate u_short dkc_cmd; /* command to be executed */ 1617c478bd9Sstevel@tonic-gate int dkc_flags; /* execution flags */ 1627c478bd9Sstevel@tonic-gate daddr_t dkc_blkno; /* disk address for command */ 1637c478bd9Sstevel@tonic-gate int dkc_secnt; /* sector count for command */ 1647c478bd9Sstevel@tonic-gate caddr_t dkc_bufaddr; /* user's buffer address */ 1657c478bd9Sstevel@tonic-gate u_int dkc_buflen; /* size of user's buffer */ 1667c478bd9Sstevel@tonic-gate }; 1677c478bd9Sstevel@tonic-gate 1687c478bd9Sstevel@tonic-gate /* 1697c478bd9Sstevel@tonic-gate * Execution flags. 1707c478bd9Sstevel@tonic-gate */ 1717c478bd9Sstevel@tonic-gate #define DK_SILENT 0x01 /* no error messages */ 1727c478bd9Sstevel@tonic-gate #define DK_DIAGNOSE 0x02 /* fail if any error occurs */ 1737c478bd9Sstevel@tonic-gate #define DK_ISOLATE 0x04 /* isolate from normal commands */ 1747c478bd9Sstevel@tonic-gate #define DK_READ 0x08 /* read from device */ 1757c478bd9Sstevel@tonic-gate #define DK_WRITE 0x10 /* write to device */ 1767c478bd9Sstevel@tonic-gate 1777c478bd9Sstevel@tonic-gate /* 1787c478bd9Sstevel@tonic-gate * Used for disk diagnostics 1797c478bd9Sstevel@tonic-gate */ 1807c478bd9Sstevel@tonic-gate struct dk_diag { 1817c478bd9Sstevel@tonic-gate u_short dkd_errcmd; /* most recent command in error */ 1827c478bd9Sstevel@tonic-gate daddr_t dkd_errsect; /* most recent sector in error */ 1837c478bd9Sstevel@tonic-gate u_char dkd_errno; /* most recent error number */ 1847c478bd9Sstevel@tonic-gate u_char dkd_severe; /* severity of most recent error */ 1857c478bd9Sstevel@tonic-gate }; 1867c478bd9Sstevel@tonic-gate 1877c478bd9Sstevel@tonic-gate /* 1887c478bd9Sstevel@tonic-gate * Used for getting disk error log. 1897c478bd9Sstevel@tonic-gate */ 1907c478bd9Sstevel@tonic-gate struct dk_loghdr { 1917c478bd9Sstevel@tonic-gate long dkl_entries; /* number of dk_log entries */ 1927c478bd9Sstevel@tonic-gate long dkl_max_size; /* max. size of dk_log table */ 1937c478bd9Sstevel@tonic-gate caddr_t dkl_logbfr; /* pointer to dk_log table */ 1947c478bd9Sstevel@tonic-gate }; 1957c478bd9Sstevel@tonic-gate 1967c478bd9Sstevel@tonic-gate /* 1977c478bd9Sstevel@tonic-gate * Disk error log table entry. 1987c478bd9Sstevel@tonic-gate */ 1997c478bd9Sstevel@tonic-gate struct dk_log { 2007c478bd9Sstevel@tonic-gate daddr_t block; /* location of block in error */ 2017c478bd9Sstevel@tonic-gate u_long count; /* number of failures */ 2027c478bd9Sstevel@tonic-gate short type; /* type of error (e.g. soft error) */ 2037c478bd9Sstevel@tonic-gate short err1; /* primary error code (e.g sense key) */ 2047c478bd9Sstevel@tonic-gate short err2; /* secondary error code */ 2057c478bd9Sstevel@tonic-gate }; 2067c478bd9Sstevel@tonic-gate 2077c478bd9Sstevel@tonic-gate /* 2087c478bd9Sstevel@tonic-gate * Dk_log type flags. 2097c478bd9Sstevel@tonic-gate * 2107c478bd9Sstevel@tonic-gate * FIXME: Really should specify dkd_errno error codes. 2117c478bd9Sstevel@tonic-gate * For some reason they're specified in the drivers 2127c478bd9Sstevel@tonic-gate * instead of here?? Should also use those here for 2137c478bd9Sstevel@tonic-gate * dk_log.type too. 2147c478bd9Sstevel@tonic-gate */ 2157c478bd9Sstevel@tonic-gate #define DKL_SOFT 0x01 /* recoverable erro */ 2167c478bd9Sstevel@tonic-gate #define DKL_HARD 0x02 /* unrecoverable error */ 2177c478bd9Sstevel@tonic-gate 2187c478bd9Sstevel@tonic-gate /* 2197c478bd9Sstevel@tonic-gate * Used for floppies 2207c478bd9Sstevel@tonic-gate */ 2217c478bd9Sstevel@tonic-gate struct fdk_char{ 2227c478bd9Sstevel@tonic-gate u_char medium; /* medium type. Unused, why have it? history! */ 2237c478bd9Sstevel@tonic-gate int transfer_rate; /* transfer rate */ 2247c478bd9Sstevel@tonic-gate int ncyl; /* number of cylinders */ 2257c478bd9Sstevel@tonic-gate int nhead; /* number of heads */ 2267c478bd9Sstevel@tonic-gate int sec_size; /* sector size */ 2277c478bd9Sstevel@tonic-gate int secptrack; /* sectors per track */ 2287c478bd9Sstevel@tonic-gate int steps; /* number of steps per */ 2297c478bd9Sstevel@tonic-gate }; 2307c478bd9Sstevel@tonic-gate 2317c478bd9Sstevel@tonic-gate struct fdk_state { 2327c478bd9Sstevel@tonic-gate int fkc_bsec; /* bytes per sector */ 2337c478bd9Sstevel@tonic-gate int fkc_strack; /* sectors per track */ 2347c478bd9Sstevel@tonic-gate int fkc_step; /* step rate */ 2357c478bd9Sstevel@tonic-gate int fkc_rate; /* data rate */ 2367c478bd9Sstevel@tonic-gate int fkc_error; /* error returned by controller */ 2377c478bd9Sstevel@tonic-gate }; 2387c478bd9Sstevel@tonic-gate 2397c478bd9Sstevel@tonic-gate struct fdk_cmd { /* used by generic command */ 2407c478bd9Sstevel@tonic-gate struct dk_cmd dcmd; /* disk command info */ 2417c478bd9Sstevel@tonic-gate struct fdk_state fstate; /* floppy state info */ 2427c478bd9Sstevel@tonic-gate }; 2437c478bd9Sstevel@tonic-gate 2447c478bd9Sstevel@tonic-gate /* 2457c478bd9Sstevel@tonic-gate * Floppy commands 2467c478bd9Sstevel@tonic-gate */ 2477c478bd9Sstevel@tonic-gate #define FKWRITE 1 2487c478bd9Sstevel@tonic-gate #define FKREAD 2 2497c478bd9Sstevel@tonic-gate #define FKSEEK 3 2507c478bd9Sstevel@tonic-gate #define FKREZERO 4 2517c478bd9Sstevel@tonic-gate #define FKFORMAT_UNIT 5 2527c478bd9Sstevel@tonic-gate #define FKFORMAT_TRACK 6 2537c478bd9Sstevel@tonic-gate 2547c478bd9Sstevel@tonic-gate /* 2557c478bd9Sstevel@tonic-gate * Used by FDKGETCHANGE, return state of the sense disk change bit. 2567c478bd9Sstevel@tonic-gate */ 2577c478bd9Sstevel@tonic-gate #define FDKGC_HISTORY 0x01 /* disk has changed since last call */ 2587c478bd9Sstevel@tonic-gate #define FDKGC_CURRENT 0x02 /* current state of disk change */ 2597c478bd9Sstevel@tonic-gate 2607c478bd9Sstevel@tonic-gate /* 2617c478bd9Sstevel@tonic-gate * Used by FDK{G, S}ETDRIVECHAR 2627c478bd9Sstevel@tonic-gate */ 2637c478bd9Sstevel@tonic-gate struct fdk_drive { 2647c478bd9Sstevel@tonic-gate int fdd_ejectable; /* does the drive support eject? */ 2657c478bd9Sstevel@tonic-gate int fdd_maxsearch; /* size of per-unit search table */ 2667c478bd9Sstevel@tonic-gate 2677c478bd9Sstevel@tonic-gate int fdd_writeprecomp; /* cyl to start write prcompensation */ 2687c478bd9Sstevel@tonic-gate int fdd_writereduce; /* cyl to start recucing write current */ 2697c478bd9Sstevel@tonic-gate int fdd_stepwidth; /* width of step pulse in 1 us units */ 2707c478bd9Sstevel@tonic-gate int fdd_steprate; /* step rate in 100 us units */ 2717c478bd9Sstevel@tonic-gate int fdd_headsettle; /* delay, in 100 us units */ 2727c478bd9Sstevel@tonic-gate int fdd_headload; /* delay, in 100 us units */ 2737c478bd9Sstevel@tonic-gate int fdd_headunload; /* delay, in 100 us units */ 2747c478bd9Sstevel@tonic-gate int fdd_motoron; /* delay, in 100 ms units */ 2757c478bd9Sstevel@tonic-gate int fdd_motoroff; /* delay, in 100 ms units */ 2767c478bd9Sstevel@tonic-gate int fdd_precomplevel; /* bit shift, in nano-secs */ 2777c478bd9Sstevel@tonic-gate int fdd_pins; /* defines meaning of pin 1, 2, 4, and 34 */ 2787c478bd9Sstevel@tonic-gate int fdd_flags; /* TRUE READY, Starting Sector #, & Motor On */ 2797c478bd9Sstevel@tonic-gate }; 2807c478bd9Sstevel@tonic-gate 2817c478bd9Sstevel@tonic-gate /* 2827c478bd9Sstevel@tonic-gate * Used by FDK{G, S}ETSEARCH 2837c478bd9Sstevel@tonic-gate */ 2847c478bd9Sstevel@tonic-gate struct fdk_search { 2857c478bd9Sstevel@tonic-gate int fdk_numentries; /* number of elements in the table */ 2867c478bd9Sstevel@tonic-gate struct fdk_char *fdk_search; 2877c478bd9Sstevel@tonic-gate }; 2887c478bd9Sstevel@tonic-gate 2897c478bd9Sstevel@tonic-gate /* 2907c478bd9Sstevel@tonic-gate * Used by F_RAW 2917c478bd9Sstevel@tonic-gate */ 2927c478bd9Sstevel@tonic-gate struct fdraw { 2937c478bd9Sstevel@tonic-gate char fr_cmd[10]; /* user-supplied command bytes */ 2947c478bd9Sstevel@tonic-gate short fr_cnum; /* number of command bytes */ 2957c478bd9Sstevel@tonic-gate char fr_result[10]; /* controller-supplied result bytes */ 2967c478bd9Sstevel@tonic-gate short fr_nbytes; /* number to transfer if read/write command */ 2977c478bd9Sstevel@tonic-gate char *fr_addr; /* where to transfer if read/write command */ 2987c478bd9Sstevel@tonic-gate }; 2997c478bd9Sstevel@tonic-gate 3007c478bd9Sstevel@tonic-gate /* 3017c478bd9Sstevel@tonic-gate * Floppy raw commands 3027c478bd9Sstevel@tonic-gate */ 3037c478bd9Sstevel@tonic-gate #define FRAW_SPECIFY 0x03 3047c478bd9Sstevel@tonic-gate #define FRAW_READID 0x0a 3057c478bd9Sstevel@tonic-gate #define FRAW_SENSE_DRV 0x04 3067c478bd9Sstevel@tonic-gate #define FRAW_REZERO 0x07 3077c478bd9Sstevel@tonic-gate #define FRAW_SEEK 0x0f 3087c478bd9Sstevel@tonic-gate #define FRAW_SENSE_INT 0x08 3097c478bd9Sstevel@tonic-gate #define FRAW_FORMAT 0x0d 3107c478bd9Sstevel@tonic-gate #define FRAW_READTRACK 0x02 3117c478bd9Sstevel@tonic-gate #define FRAW_WRCMD 0x05 3127c478bd9Sstevel@tonic-gate #define FRAW_RDCMD 0x06 3137c478bd9Sstevel@tonic-gate #define FRAW_WRITEDEL 0x09 3147c478bd9Sstevel@tonic-gate #define FRAW_READDEL 0x0c 3157c478bd9Sstevel@tonic-gate 3167c478bd9Sstevel@tonic-gate /* 3177c478bd9Sstevel@tonic-gate * Severity values 3187c478bd9Sstevel@tonic-gate */ 3197c478bd9Sstevel@tonic-gate #define DK_NOERROR 0 3207c478bd9Sstevel@tonic-gate #define DK_CORRECTED 1 3217c478bd9Sstevel@tonic-gate #define DK_RECOVERED 2 3227c478bd9Sstevel@tonic-gate #define DK_FATAL 3 3237c478bd9Sstevel@tonic-gate 3247c478bd9Sstevel@tonic-gate /* 3257c478bd9Sstevel@tonic-gate * Error types 3267c478bd9Sstevel@tonic-gate */ 3277c478bd9Sstevel@tonic-gate #define DK_NONMEDIA 0 /* not caused by a media defect */ 3287c478bd9Sstevel@tonic-gate #define DK_ISMEDIA 1 /* caused by a media defect */ 3297c478bd9Sstevel@tonic-gate 3307c478bd9Sstevel@tonic-gate 3317c478bd9Sstevel@tonic-gate /* 3327c478bd9Sstevel@tonic-gate * Disk io control commands 3337c478bd9Sstevel@tonic-gate */ 334*5d54f3d8Smuffin #define DKIOCGGEOM _IOR('d', 2, struct dk_geom) /* Get geometry */ 335*5d54f3d8Smuffin #define DKIOCSGEOM _IOW('d', 3, struct dk_geom) /* Set geometry */ 336*5d54f3d8Smuffin #define DKIOCGPART _IOR('d', 4, struct dk_map) /* Get partition info */ 337*5d54f3d8Smuffin #define DKIOCSPART _IOW('d', 5, struct dk_map) /* Set partition info */ 338*5d54f3d8Smuffin #define DKIOCINFO _IOR('d', 8, struct dk_info) /* Get info */ 339*5d54f3d8Smuffin #define DKIOCGCONF _IOR('d', 126, struct dk_conf) /* Get conf info */ 340*5d54f3d8Smuffin #define DKIOCSTYPE _IOW('d', 125, struct dk_type) /* Set drive info */ 341*5d54f3d8Smuffin #define DKIOCGTYPE _IOR('d', 124, struct dk_type) /* Get drive info */ 342*5d54f3d8Smuffin #define DKIOCSAPART _IOW('d', 123, struct dk_allmap) /* Set all partitions */ 343*5d54f3d8Smuffin #define DKIOCGAPART _IOR('d', 122, struct dk_allmap) /* Get all partitions */ 344*5d54f3d8Smuffin #define DKIOCSBAD _IOW('d', 121, struct dk_badmap) /* Set bad sector map */ 345*5d54f3d8Smuffin #define DKIOCGBAD _IOW('d', 120, struct dk_badmap) /* Get bad sector map */ 346*5d54f3d8Smuffin #define DKIOCSCMD _IOW('d', 119, struct dk_cmd) /* Set generic cmd */ 347*5d54f3d8Smuffin #define DKIOCGLOG _IOR('d', 118, struct dk_loghdr) /* Get error log */ 348*5d54f3d8Smuffin #define DKIOCGDIAG _IOR('d', 116, struct dk_diag) /* Get diagnostics */ 349*5d54f3d8Smuffin #define DKIOCWCHK _IOWR('d', 115, int) /* Toggle write check */ 350*5d54f3d8Smuffin #define FDKIOGCHAR _IOR('d', 114, struct fdk_char) /* GetCharacteristics */ 351*5d54f3d8Smuffin #define FDKIOSCHAR _IOW('d', 113, struct fdk_char) /* SetCharacteristics */ 352*5d54f3d8Smuffin #define FDKEJECT _IO('d', 112) /* Eject floppy disk */ 353*5d54f3d8Smuffin #define FDKGETCHANGE _IOR('d', 111, int) /* Get diskchng stat */ 354*5d54f3d8Smuffin #define FDKGETDRIVECHAR _IOR('d', 110, struct fdk_drive) /* Get drivechar */ 355*5d54f3d8Smuffin #define FDKSETDRIVECHAR _IOW('d', 109, struct fdk_drive) /* Set drivechar */ 356*5d54f3d8Smuffin #define FDKGETSEARCH _IOR('d', 108, struct fdk_search) /* Get search tbl */ 357*5d54f3d8Smuffin #define FDKSETSEARCH _IOW('d', 107, struct fdk_search) /* Set search tbl */ 358*5d54f3d8Smuffin #define FDKIOCSCMD _IOWR('d', 106, struct fdk_cmd) /* Floppy command */ 359*5d54f3d8Smuffin #define F_RAW _IOWR('d', 105, struct fdraw) /* ECDstyle genericcmd*/ 3607c478bd9Sstevel@tonic-gate 3617c478bd9Sstevel@tonic-gate #endif /* !_sun_dkio_h */ 362