1*1fbab01aSdholland /* $NetBSD: xio.h,v 1.6 2015/09/06 06:01:01 dholland Exp $ */ 2f00f5d94Spk 3f00f5d94Spk /* 4f00f5d94Spk * Copyright (c) 1995 Charles D. Cranor 5f00f5d94Spk * All rights reserved. 6f00f5d94Spk * 7f00f5d94Spk * Redistribution and use in source and binary forms, with or without 8f00f5d94Spk * modification, are permitted provided that the following conditions 9f00f5d94Spk * are met: 10f00f5d94Spk * 1. Redistributions of source code must retain the above copyright 11f00f5d94Spk * notice, this list of conditions and the following disclaimer. 12f00f5d94Spk * 2. Redistributions in binary form must reproduce the above copyright 13f00f5d94Spk * notice, this list of conditions and the following disclaimer in the 14f00f5d94Spk * documentation and/or other materials provided with the distribution. 15f00f5d94Spk * 16f00f5d94Spk * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17f00f5d94Spk * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18f00f5d94Spk * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19f00f5d94Spk * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20f00f5d94Spk * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21f00f5d94Spk * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22f00f5d94Spk * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23f00f5d94Spk * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24f00f5d94Spk * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25f00f5d94Spk * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26f00f5d94Spk */ 27f00f5d94Spk 28f00f5d94Spk /* 29f00f5d94Spk * x i o . h 30f00f5d94Spk * 31f00f5d94Spk * this file defines the software structure we use to ioctl the 32f00f5d94Spk * 753/7053. this interface isn't set in stone and may (or may not) 33f00f5d94Spk * need adjustment. 34f00f5d94Spk * 35e7c4ab00Schuck * author: Chuck Cranor <chuck@netbsd> 36f00f5d94Spk */ 37f00f5d94Spk 38f00f5d94Spk /* 39f00f5d94Spk * xylogic ioctl interface 40f00f5d94Spk */ 41f00f5d94Spk 42*1fbab01aSdholland #include <sys/ioccom.h> 43*1fbab01aSdholland 44*1fbab01aSdholland 45f00f5d94Spk struct xd_iocmd { 46f00f5d94Spk u_char cmd; /* in: command number */ 47f00f5d94Spk u_char subfn; /* in: subfunction number */ 4806869f0aSchristos u_char errnum; /* out: error number */ 49f00f5d94Spk u_char tries; /* out: number of tries */ 50f00f5d94Spk u_short sectcnt;/* in,out: sector count (hw_spt on read drive param) */ 51f00f5d94Spk u_short dlen; /* in: length of data buffer (good sanity check) */ 529d4112bfSmrg u_int block; /* in: block number */ 5353524e44Schristos void *dptr; /* in: data buffer to do I/O from */ 54f00f5d94Spk }; 55f00f5d94Spk 56f00f5d94Spk #ifndef DIOSXDCMD 57f00f5d94Spk #define DIOSXDCMD _IOWR('x', 101, struct xd_iocmd) /* do xd command */ 58f00f5d94Spk #endif 59f00f5d94Spk 60f00f5d94Spk #define XD_IOCMD_MAXS 16 /* max number of sectors you can do */ 61f00f5d94Spk #define XD_IOCMD_HSZ 4 /* size of one header */ 62f00f5d94Spk #define XD_IOCMD_DMSZ 24 /* defect map size */ 63