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