1*0Sstevel@tonic-gate /* 2*0Sstevel@tonic-gate * CDDL HEADER START 3*0Sstevel@tonic-gate * 4*0Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*0Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 6*0Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 7*0Sstevel@tonic-gate * with the License. 8*0Sstevel@tonic-gate * 9*0Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10*0Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 11*0Sstevel@tonic-gate * See the License for the specific language governing permissions 12*0Sstevel@tonic-gate * and limitations under the License. 13*0Sstevel@tonic-gate * 14*0Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 15*0Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16*0Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 17*0Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 18*0Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 19*0Sstevel@tonic-gate * 20*0Sstevel@tonic-gate * CDDL HEADER END 21*0Sstevel@tonic-gate */ 22*0Sstevel@tonic-gate /* 23*0Sstevel@tonic-gate * Copyright (c) 1990 by Sun Microsystems, Inc. 24*0Sstevel@tonic-gate */ 25*0Sstevel@tonic-gate 26*0Sstevel@tonic-gate #ifndef _SYS5_DKIO_H 27*0Sstevel@tonic-gate #define _SYS5_DKIO_H 28*0Sstevel@tonic-gate 29*0Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" /* SunOS-4.0 5.19 */ 30*0Sstevel@tonic-gate 31*0Sstevel@tonic-gate #ifdef __cplusplus 32*0Sstevel@tonic-gate extern "C" { 33*0Sstevel@tonic-gate #endif 34*0Sstevel@tonic-gate 35*0Sstevel@tonic-gate /* 36*0Sstevel@tonic-gate * Structures and definitions for disk io control commands 37*0Sstevel@tonic-gate */ 38*0Sstevel@tonic-gate 39*0Sstevel@tonic-gate /* 40*0Sstevel@tonic-gate * Structures used as data by ioctl calls. 41*0Sstevel@tonic-gate */ 42*0Sstevel@tonic-gate 43*0Sstevel@tonic-gate /* 44*0Sstevel@tonic-gate * Used for controller info 45*0Sstevel@tonic-gate */ 46*0Sstevel@tonic-gate struct s5_dk_cinfo { 47*0Sstevel@tonic-gate char dki_cname[DK_DEVLEN]; /* controller name (no unit #) */ 48*0Sstevel@tonic-gate short dki_ctype; /* controller type */ 49*0Sstevel@tonic-gate short dki_flags; /* flags */ 50*0Sstevel@tonic-gate short dki_cnum; /* controller number */ 51*0Sstevel@tonic-gate int dki_addr; /* controller address */ 52*0Sstevel@tonic-gate int dki_space; /* controller bus type */ 53*0Sstevel@tonic-gate int dki_prio; /* interrupt priority */ 54*0Sstevel@tonic-gate int dki_vec; /* interrupt vector */ 55*0Sstevel@tonic-gate char dki_dname[DK_DEVLEN]; /* drive name (no unit #) */ 56*0Sstevel@tonic-gate int dki_unit; /* unit number */ 57*0Sstevel@tonic-gate int dki_slave; /* slave number */ 58*0Sstevel@tonic-gate short dki_partition; /* partition number */ 59*0Sstevel@tonic-gate short dki_maxtransfer; /* max. transfer size in DEV_BSIZE */ 60*0Sstevel@tonic-gate }; 61*0Sstevel@tonic-gate 62*0Sstevel@tonic-gate 63*0Sstevel@tonic-gate /* 64*0Sstevel@tonic-gate * Disk io control commands 65*0Sstevel@tonic-gate * Warning: some other ioctls with the DIOC prefix exist elsewhere. 66*0Sstevel@tonic-gate */ 67*0Sstevel@tonic-gate #define S5DKIOC (0x04 << 8) 68*0Sstevel@tonic-gate #define S5DKIOCGGEOM (S5DKIOC|1) /* Get geometry */ 69*0Sstevel@tonic-gate #define S5DKIOCSGEOM (S5DKIOC|2) /* Set geometry */ 70*0Sstevel@tonic-gate #define S5DKIOCINFO (S5DKIOC|3) /* Get info */ 71*0Sstevel@tonic-gate #define S5DKIOCSAPART (S5DKIOC|4) /* Set all partitions */ 72*0Sstevel@tonic-gate #define S5DKIOCGAPART (S5DKIOC|5) /* Get all partitions */ 73*0Sstevel@tonic-gate 74*0Sstevel@tonic-gate /* 75*0Sstevel@tonic-gate * These from hdio.h 76*0Sstevel@tonic-gate */ 77*0Sstevel@tonic-gate #define S5HDKIOC (0x04 << 8) 78*0Sstevel@tonic-gate #define S5HDKIOCSTYPE (S5HDKIOC|101) /* Set drive info */ 79*0Sstevel@tonic-gate #define S5HDKIOCGTYPE (S5HDKIOC|102) /* Get drive info */ 80*0Sstevel@tonic-gate #define S5HDKIOCSBAD (S5HDKIOC|103) /* Set bad sector map */ 81*0Sstevel@tonic-gate #define S5HDKIOCGBAD (S5HDKIOC|104) /* Get bad sector map */ 82*0Sstevel@tonic-gate #define S5HDKIOCSCMD (S5HDKIOC|105) /* Set generic cmd */ 83*0Sstevel@tonic-gate #define S5HDKIOCGDIAG (S5HDKIOC|106) /* Get diagnostics */ 84*0Sstevel@tonic-gate 85*0Sstevel@tonic-gate /* 86*0Sstevel@tonic-gate * These are from cdio.h 87*0Sstevel@tonic-gate * CDROM io control commands 88*0Sstevel@tonic-gate */ 89*0Sstevel@tonic-gate #define S5CDIOC (0x04 << 8) 90*0Sstevel@tonic-gate #define S5CDROMPAUSE (S5CDIOC|151) /* Pause Audio Operation */ 91*0Sstevel@tonic-gate #define S5CDROMRESUME (S5CDIOC|152) /* Resume paused Audio Operation */ 92*0Sstevel@tonic-gate #define S5CDROMPLAYMSF (S5CDIOC|153) /* Play Audio MSF */ 93*0Sstevel@tonic-gate #define S5CDROMPLAYTRKIND (S5CDIOC|154) /* Play Audio Track/index */ 94*0Sstevel@tonic-gate #define S5CDROMREADTOCHDR (S5CDIOC|155) /* Read TOC header */ 95*0Sstevel@tonic-gate #define S5CDROMREADTOCENTRY (S5CDIOC|156) /* Read a TOC entry */ 96*0Sstevel@tonic-gate #define S5CDROMSTOP (S5CDIOC|157) /* Stop the CDrom drive */ 97*0Sstevel@tonic-gate #define S5CDROMSTART (S5CDIOC|158) /* Start the CDrom drive */ 98*0Sstevel@tonic-gate #define S5CDROMEJECT (S5CDIOC|159) /* Ejects the CDrom caddy */ 99*0Sstevel@tonic-gate #define S5CDROMVOLCTRL (S5CDIOC|160) /* control output volume */ 100*0Sstevel@tonic-gate #define S5CDROMSUBCHNL (S5CDIOC|161) /* read the subchannel data */ 101*0Sstevel@tonic-gate #define S5CDROMREADMODE2 (S5CDIOC|162) /* read CDROM mode 2 data */ 102*0Sstevel@tonic-gate #define S5CDROMREADMODE1 (S5CDIOC|163) /* read CDROM mode 1 data */ 103*0Sstevel@tonic-gate 104*0Sstevel@tonic-gate /* 105*0Sstevel@tonic-gate * From sys/scsi/impl/uscsi.h 106*0Sstevel@tonic-gate /* 107*0Sstevel@tonic-gate * definition for user-scsi command structure 108*0Sstevel@tonic-gate */ 109*0Sstevel@tonic-gate struct s5_uscsi_cmd { 110*0Sstevel@tonic-gate int uscsi_flags; /* read, write, etc. see below */ 111*0Sstevel@tonic-gate short uscsi_status; /* resulting status */ 112*0Sstevel@tonic-gate short uscsi_timeout; /* Command Timeout */ 113*0Sstevel@tonic-gate caddr_t uscsi_cdb; /* cdb to send to target */ 114*0Sstevel@tonic-gate caddr_t uscsi_bufaddr; /* i/o source/destination */ 115*0Sstevel@tonic-gate u_int uscsi_buflen; /* size of i/o to take place */ 116*0Sstevel@tonic-gate u_int uscsi_resid; /* resid from i/o operation */ 117*0Sstevel@tonic-gate u_char uscsi_cdblen; /* # of valid cdb bytes */ 118*0Sstevel@tonic-gate u_char uscsi_reserved_1; /* Reserved for Future Use */ 119*0Sstevel@tonic-gate u_char uscsi_reserved_2; /* Reserved for Future Use */ 120*0Sstevel@tonic-gate u_char uscsi_reserved_3; /* Reserved for Future Use */ 121*0Sstevel@tonic-gate caddr_t uscsi_reserved_4; /* Reserved for Future Use */ 122*0Sstevel@tonic-gate void *uscsi_reserved_5; /* Reserved for Future Use */ 123*0Sstevel@tonic-gate }; 124*0Sstevel@tonic-gate 125*0Sstevel@tonic-gate /* 126*0Sstevel@tonic-gate * User SCSI io control command 127*0Sstevel@tonic-gate */ 128*0Sstevel@tonic-gate #define S5USCSIIOC (0x04 << 8) 129*0Sstevel@tonic-gate #define S5USCSICMD (S5USCSIIOC|201) /* user scsi command */ 130*0Sstevel@tonic-gate 131*0Sstevel@tonic-gate #ifdef __cplusplus 132*0Sstevel@tonic-gate } 133*0Sstevel@tonic-gate #endif 134*0Sstevel@tonic-gate 135*0Sstevel@tonic-gate #endif /* _SYS5_DKIO_H */ 136