10Sstevel@tonic-gate /* 20Sstevel@tonic-gate * CDDL HEADER START 30Sstevel@tonic-gate * 40Sstevel@tonic-gate * The contents of this file are subject to the terms of the 50Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 60Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 70Sstevel@tonic-gate * with the License. 80Sstevel@tonic-gate * 90Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 100Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 110Sstevel@tonic-gate * See the License for the specific language governing permissions 120Sstevel@tonic-gate * and limitations under the License. 130Sstevel@tonic-gate * 140Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 150Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 160Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 170Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 180Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 190Sstevel@tonic-gate * 200Sstevel@tonic-gate * CDDL HEADER END 210Sstevel@tonic-gate */ 220Sstevel@tonic-gate /* 23*722Smuffin * Copyright 1990 Sun Microsystems, Inc. All rights reserved. 24*722Smuffin * Use is subject to license terms. 250Sstevel@tonic-gate */ 260Sstevel@tonic-gate 270Sstevel@tonic-gate #ifndef _SYS5_DKIO_H 280Sstevel@tonic-gate #define _SYS5_DKIO_H 290Sstevel@tonic-gate 30*722Smuffin #pragma ident "%Z%%M% %I% %E% SMI" 310Sstevel@tonic-gate 320Sstevel@tonic-gate #ifdef __cplusplus 330Sstevel@tonic-gate extern "C" { 340Sstevel@tonic-gate #endif 350Sstevel@tonic-gate 360Sstevel@tonic-gate /* 370Sstevel@tonic-gate * Structures and definitions for disk io control commands 380Sstevel@tonic-gate */ 390Sstevel@tonic-gate 400Sstevel@tonic-gate /* 410Sstevel@tonic-gate * Structures used as data by ioctl calls. 420Sstevel@tonic-gate */ 430Sstevel@tonic-gate 440Sstevel@tonic-gate /* 450Sstevel@tonic-gate * Used for controller info 460Sstevel@tonic-gate */ 470Sstevel@tonic-gate struct s5_dk_cinfo { 480Sstevel@tonic-gate char dki_cname[DK_DEVLEN]; /* controller name (no unit #) */ 490Sstevel@tonic-gate short dki_ctype; /* controller type */ 500Sstevel@tonic-gate short dki_flags; /* flags */ 510Sstevel@tonic-gate short dki_cnum; /* controller number */ 520Sstevel@tonic-gate int dki_addr; /* controller address */ 530Sstevel@tonic-gate int dki_space; /* controller bus type */ 540Sstevel@tonic-gate int dki_prio; /* interrupt priority */ 550Sstevel@tonic-gate int dki_vec; /* interrupt vector */ 560Sstevel@tonic-gate char dki_dname[DK_DEVLEN]; /* drive name (no unit #) */ 570Sstevel@tonic-gate int dki_unit; /* unit number */ 580Sstevel@tonic-gate int dki_slave; /* slave number */ 590Sstevel@tonic-gate short dki_partition; /* partition number */ 600Sstevel@tonic-gate short dki_maxtransfer; /* max. transfer size in DEV_BSIZE */ 610Sstevel@tonic-gate }; 620Sstevel@tonic-gate 630Sstevel@tonic-gate 640Sstevel@tonic-gate /* 650Sstevel@tonic-gate * Disk io control commands 660Sstevel@tonic-gate * Warning: some other ioctls with the DIOC prefix exist elsewhere. 670Sstevel@tonic-gate */ 680Sstevel@tonic-gate #define S5DKIOC (0x04 << 8) 690Sstevel@tonic-gate #define S5DKIOCGGEOM (S5DKIOC|1) /* Get geometry */ 700Sstevel@tonic-gate #define S5DKIOCSGEOM (S5DKIOC|2) /* Set geometry */ 710Sstevel@tonic-gate #define S5DKIOCINFO (S5DKIOC|3) /* Get info */ 720Sstevel@tonic-gate #define S5DKIOCSAPART (S5DKIOC|4) /* Set all partitions */ 730Sstevel@tonic-gate #define S5DKIOCGAPART (S5DKIOC|5) /* Get all partitions */ 740Sstevel@tonic-gate 750Sstevel@tonic-gate /* 760Sstevel@tonic-gate * These from hdio.h 770Sstevel@tonic-gate */ 780Sstevel@tonic-gate #define S5HDKIOC (0x04 << 8) 790Sstevel@tonic-gate #define S5HDKIOCSTYPE (S5HDKIOC|101) /* Set drive info */ 800Sstevel@tonic-gate #define S5HDKIOCGTYPE (S5HDKIOC|102) /* Get drive info */ 810Sstevel@tonic-gate #define S5HDKIOCSBAD (S5HDKIOC|103) /* Set bad sector map */ 820Sstevel@tonic-gate #define S5HDKIOCGBAD (S5HDKIOC|104) /* Get bad sector map */ 830Sstevel@tonic-gate #define S5HDKIOCSCMD (S5HDKIOC|105) /* Set generic cmd */ 840Sstevel@tonic-gate #define S5HDKIOCGDIAG (S5HDKIOC|106) /* Get diagnostics */ 850Sstevel@tonic-gate 860Sstevel@tonic-gate /* 870Sstevel@tonic-gate * These are from cdio.h 880Sstevel@tonic-gate * CDROM io control commands 890Sstevel@tonic-gate */ 900Sstevel@tonic-gate #define S5CDIOC (0x04 << 8) 910Sstevel@tonic-gate #define S5CDROMPAUSE (S5CDIOC|151) /* Pause Audio Operation */ 920Sstevel@tonic-gate #define S5CDROMRESUME (S5CDIOC|152) /* Resume paused Audio Operation */ 930Sstevel@tonic-gate #define S5CDROMPLAYMSF (S5CDIOC|153) /* Play Audio MSF */ 940Sstevel@tonic-gate #define S5CDROMPLAYTRKIND (S5CDIOC|154) /* Play Audio Track/index */ 950Sstevel@tonic-gate #define S5CDROMREADTOCHDR (S5CDIOC|155) /* Read TOC header */ 960Sstevel@tonic-gate #define S5CDROMREADTOCENTRY (S5CDIOC|156) /* Read a TOC entry */ 970Sstevel@tonic-gate #define S5CDROMSTOP (S5CDIOC|157) /* Stop the CDrom drive */ 980Sstevel@tonic-gate #define S5CDROMSTART (S5CDIOC|158) /* Start the CDrom drive */ 990Sstevel@tonic-gate #define S5CDROMEJECT (S5CDIOC|159) /* Ejects the CDrom caddy */ 1000Sstevel@tonic-gate #define S5CDROMVOLCTRL (S5CDIOC|160) /* control output volume */ 1010Sstevel@tonic-gate #define S5CDROMSUBCHNL (S5CDIOC|161) /* read the subchannel data */ 1020Sstevel@tonic-gate #define S5CDROMREADMODE2 (S5CDIOC|162) /* read CDROM mode 2 data */ 1030Sstevel@tonic-gate #define S5CDROMREADMODE1 (S5CDIOC|163) /* read CDROM mode 1 data */ 1040Sstevel@tonic-gate 1050Sstevel@tonic-gate /* 1060Sstevel@tonic-gate * From sys/scsi/impl/uscsi.h 107*722Smuffin */ 1080Sstevel@tonic-gate /* 1090Sstevel@tonic-gate * definition for user-scsi command structure 1100Sstevel@tonic-gate */ 1110Sstevel@tonic-gate struct s5_uscsi_cmd { 1120Sstevel@tonic-gate int uscsi_flags; /* read, write, etc. see below */ 1130Sstevel@tonic-gate short uscsi_status; /* resulting status */ 1140Sstevel@tonic-gate short uscsi_timeout; /* Command Timeout */ 1150Sstevel@tonic-gate caddr_t uscsi_cdb; /* cdb to send to target */ 1160Sstevel@tonic-gate caddr_t uscsi_bufaddr; /* i/o source/destination */ 1170Sstevel@tonic-gate u_int uscsi_buflen; /* size of i/o to take place */ 1180Sstevel@tonic-gate u_int uscsi_resid; /* resid from i/o operation */ 1190Sstevel@tonic-gate u_char uscsi_cdblen; /* # of valid cdb bytes */ 1200Sstevel@tonic-gate u_char uscsi_reserved_1; /* Reserved for Future Use */ 1210Sstevel@tonic-gate u_char uscsi_reserved_2; /* Reserved for Future Use */ 1220Sstevel@tonic-gate u_char uscsi_reserved_3; /* Reserved for Future Use */ 1230Sstevel@tonic-gate caddr_t uscsi_reserved_4; /* Reserved for Future Use */ 1240Sstevel@tonic-gate void *uscsi_reserved_5; /* Reserved for Future Use */ 1250Sstevel@tonic-gate }; 1260Sstevel@tonic-gate 1270Sstevel@tonic-gate /* 1280Sstevel@tonic-gate * User SCSI io control command 1290Sstevel@tonic-gate */ 1300Sstevel@tonic-gate #define S5USCSIIOC (0x04 << 8) 1310Sstevel@tonic-gate #define S5USCSICMD (S5USCSIIOC|201) /* user scsi command */ 1320Sstevel@tonic-gate 1330Sstevel@tonic-gate #ifdef __cplusplus 1340Sstevel@tonic-gate } 1350Sstevel@tonic-gate #endif 1360Sstevel@tonic-gate 1370Sstevel@tonic-gate #endif /* _SYS5_DKIO_H */ 138