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 1990 Sun Microsystems, Inc. All rights reserved. 24*5d54f3d8Smuffin * Use is subject to license terms. 257c478bd9Sstevel@tonic-gate */ 267c478bd9Sstevel@tonic-gate 277c478bd9Sstevel@tonic-gate #ifndef _SYS5_DKIO_H 287c478bd9Sstevel@tonic-gate #define _SYS5_DKIO_H 297c478bd9Sstevel@tonic-gate 30*5d54f3d8Smuffin #pragma ident "%Z%%M% %I% %E% SMI" 317c478bd9Sstevel@tonic-gate 327c478bd9Sstevel@tonic-gate #ifdef __cplusplus 337c478bd9Sstevel@tonic-gate extern "C" { 347c478bd9Sstevel@tonic-gate #endif 357c478bd9Sstevel@tonic-gate 367c478bd9Sstevel@tonic-gate /* 377c478bd9Sstevel@tonic-gate * Structures and definitions for disk io control commands 387c478bd9Sstevel@tonic-gate */ 397c478bd9Sstevel@tonic-gate 407c478bd9Sstevel@tonic-gate /* 417c478bd9Sstevel@tonic-gate * Structures used as data by ioctl calls. 427c478bd9Sstevel@tonic-gate */ 437c478bd9Sstevel@tonic-gate 447c478bd9Sstevel@tonic-gate /* 457c478bd9Sstevel@tonic-gate * Used for controller info 467c478bd9Sstevel@tonic-gate */ 477c478bd9Sstevel@tonic-gate struct s5_dk_cinfo { 487c478bd9Sstevel@tonic-gate char dki_cname[DK_DEVLEN]; /* controller name (no unit #) */ 497c478bd9Sstevel@tonic-gate short dki_ctype; /* controller type */ 507c478bd9Sstevel@tonic-gate short dki_flags; /* flags */ 517c478bd9Sstevel@tonic-gate short dki_cnum; /* controller number */ 527c478bd9Sstevel@tonic-gate int dki_addr; /* controller address */ 537c478bd9Sstevel@tonic-gate int dki_space; /* controller bus type */ 547c478bd9Sstevel@tonic-gate int dki_prio; /* interrupt priority */ 557c478bd9Sstevel@tonic-gate int dki_vec; /* interrupt vector */ 567c478bd9Sstevel@tonic-gate char dki_dname[DK_DEVLEN]; /* drive name (no unit #) */ 577c478bd9Sstevel@tonic-gate int dki_unit; /* unit number */ 587c478bd9Sstevel@tonic-gate int dki_slave; /* slave number */ 597c478bd9Sstevel@tonic-gate short dki_partition; /* partition number */ 607c478bd9Sstevel@tonic-gate short dki_maxtransfer; /* max. transfer size in DEV_BSIZE */ 617c478bd9Sstevel@tonic-gate }; 627c478bd9Sstevel@tonic-gate 637c478bd9Sstevel@tonic-gate 647c478bd9Sstevel@tonic-gate /* 657c478bd9Sstevel@tonic-gate * Disk io control commands 667c478bd9Sstevel@tonic-gate * Warning: some other ioctls with the DIOC prefix exist elsewhere. 677c478bd9Sstevel@tonic-gate */ 687c478bd9Sstevel@tonic-gate #define S5DKIOC (0x04 << 8) 697c478bd9Sstevel@tonic-gate #define S5DKIOCGGEOM (S5DKIOC|1) /* Get geometry */ 707c478bd9Sstevel@tonic-gate #define S5DKIOCSGEOM (S5DKIOC|2) /* Set geometry */ 717c478bd9Sstevel@tonic-gate #define S5DKIOCINFO (S5DKIOC|3) /* Get info */ 727c478bd9Sstevel@tonic-gate #define S5DKIOCSAPART (S5DKIOC|4) /* Set all partitions */ 737c478bd9Sstevel@tonic-gate #define S5DKIOCGAPART (S5DKIOC|5) /* Get all partitions */ 747c478bd9Sstevel@tonic-gate 757c478bd9Sstevel@tonic-gate /* 767c478bd9Sstevel@tonic-gate * These from hdio.h 777c478bd9Sstevel@tonic-gate */ 787c478bd9Sstevel@tonic-gate #define S5HDKIOC (0x04 << 8) 797c478bd9Sstevel@tonic-gate #define S5HDKIOCSTYPE (S5HDKIOC|101) /* Set drive info */ 807c478bd9Sstevel@tonic-gate #define S5HDKIOCGTYPE (S5HDKIOC|102) /* Get drive info */ 817c478bd9Sstevel@tonic-gate #define S5HDKIOCSBAD (S5HDKIOC|103) /* Set bad sector map */ 827c478bd9Sstevel@tonic-gate #define S5HDKIOCGBAD (S5HDKIOC|104) /* Get bad sector map */ 837c478bd9Sstevel@tonic-gate #define S5HDKIOCSCMD (S5HDKIOC|105) /* Set generic cmd */ 847c478bd9Sstevel@tonic-gate #define S5HDKIOCGDIAG (S5HDKIOC|106) /* Get diagnostics */ 857c478bd9Sstevel@tonic-gate 867c478bd9Sstevel@tonic-gate /* 877c478bd9Sstevel@tonic-gate * These are from cdio.h 887c478bd9Sstevel@tonic-gate * CDROM io control commands 897c478bd9Sstevel@tonic-gate */ 907c478bd9Sstevel@tonic-gate #define S5CDIOC (0x04 << 8) 917c478bd9Sstevel@tonic-gate #define S5CDROMPAUSE (S5CDIOC|151) /* Pause Audio Operation */ 927c478bd9Sstevel@tonic-gate #define S5CDROMRESUME (S5CDIOC|152) /* Resume paused Audio Operation */ 937c478bd9Sstevel@tonic-gate #define S5CDROMPLAYMSF (S5CDIOC|153) /* Play Audio MSF */ 947c478bd9Sstevel@tonic-gate #define S5CDROMPLAYTRKIND (S5CDIOC|154) /* Play Audio Track/index */ 957c478bd9Sstevel@tonic-gate #define S5CDROMREADTOCHDR (S5CDIOC|155) /* Read TOC header */ 967c478bd9Sstevel@tonic-gate #define S5CDROMREADTOCENTRY (S5CDIOC|156) /* Read a TOC entry */ 977c478bd9Sstevel@tonic-gate #define S5CDROMSTOP (S5CDIOC|157) /* Stop the CDrom drive */ 987c478bd9Sstevel@tonic-gate #define S5CDROMSTART (S5CDIOC|158) /* Start the CDrom drive */ 997c478bd9Sstevel@tonic-gate #define S5CDROMEJECT (S5CDIOC|159) /* Ejects the CDrom caddy */ 1007c478bd9Sstevel@tonic-gate #define S5CDROMVOLCTRL (S5CDIOC|160) /* control output volume */ 1017c478bd9Sstevel@tonic-gate #define S5CDROMSUBCHNL (S5CDIOC|161) /* read the subchannel data */ 1027c478bd9Sstevel@tonic-gate #define S5CDROMREADMODE2 (S5CDIOC|162) /* read CDROM mode 2 data */ 1037c478bd9Sstevel@tonic-gate #define S5CDROMREADMODE1 (S5CDIOC|163) /* read CDROM mode 1 data */ 1047c478bd9Sstevel@tonic-gate 1057c478bd9Sstevel@tonic-gate /* 1067c478bd9Sstevel@tonic-gate * From sys/scsi/impl/uscsi.h 107*5d54f3d8Smuffin */ 1087c478bd9Sstevel@tonic-gate /* 1097c478bd9Sstevel@tonic-gate * definition for user-scsi command structure 1107c478bd9Sstevel@tonic-gate */ 1117c478bd9Sstevel@tonic-gate struct s5_uscsi_cmd { 1127c478bd9Sstevel@tonic-gate int uscsi_flags; /* read, write, etc. see below */ 1137c478bd9Sstevel@tonic-gate short uscsi_status; /* resulting status */ 1147c478bd9Sstevel@tonic-gate short uscsi_timeout; /* Command Timeout */ 1157c478bd9Sstevel@tonic-gate caddr_t uscsi_cdb; /* cdb to send to target */ 1167c478bd9Sstevel@tonic-gate caddr_t uscsi_bufaddr; /* i/o source/destination */ 1177c478bd9Sstevel@tonic-gate u_int uscsi_buflen; /* size of i/o to take place */ 1187c478bd9Sstevel@tonic-gate u_int uscsi_resid; /* resid from i/o operation */ 1197c478bd9Sstevel@tonic-gate u_char uscsi_cdblen; /* # of valid cdb bytes */ 1207c478bd9Sstevel@tonic-gate u_char uscsi_reserved_1; /* Reserved for Future Use */ 1217c478bd9Sstevel@tonic-gate u_char uscsi_reserved_2; /* Reserved for Future Use */ 1227c478bd9Sstevel@tonic-gate u_char uscsi_reserved_3; /* Reserved for Future Use */ 1237c478bd9Sstevel@tonic-gate caddr_t uscsi_reserved_4; /* Reserved for Future Use */ 1247c478bd9Sstevel@tonic-gate void *uscsi_reserved_5; /* Reserved for Future Use */ 1257c478bd9Sstevel@tonic-gate }; 1267c478bd9Sstevel@tonic-gate 1277c478bd9Sstevel@tonic-gate /* 1287c478bd9Sstevel@tonic-gate * User SCSI io control command 1297c478bd9Sstevel@tonic-gate */ 1307c478bd9Sstevel@tonic-gate #define S5USCSIIOC (0x04 << 8) 1317c478bd9Sstevel@tonic-gate #define S5USCSICMD (S5USCSIIOC|201) /* user scsi command */ 1327c478bd9Sstevel@tonic-gate 1337c478bd9Sstevel@tonic-gate #ifdef __cplusplus 1347c478bd9Sstevel@tonic-gate } 1357c478bd9Sstevel@tonic-gate #endif 1367c478bd9Sstevel@tonic-gate 1377c478bd9Sstevel@tonic-gate #endif /* _SYS5_DKIO_H */ 138