xio.h revision 1.2
11.2Schristos/* $NetBSD: xio.h,v 1.2 2007/03/04 06:00:54 christos Exp $ */ 21.1Sgwr 31.1Sgwr/* 41.1Sgwr * 51.1Sgwr * Copyright (c) 1995 Charles D. Cranor 61.1Sgwr * All rights reserved. 71.1Sgwr * 81.1Sgwr * Redistribution and use in source and binary forms, with or without 91.1Sgwr * modification, are permitted provided that the following conditions 101.1Sgwr * are met: 111.1Sgwr * 1. Redistributions of source code must retain the above copyright 121.1Sgwr * notice, this list of conditions and the following disclaimer. 131.1Sgwr * 2. Redistributions in binary form must reproduce the above copyright 141.1Sgwr * notice, this list of conditions and the following disclaimer in the 151.1Sgwr * documentation and/or other materials provided with the distribution. 161.1Sgwr * 3. All advertising materials mentioning features or use of this software 171.1Sgwr * must display the following acknowledgement: 181.1Sgwr * This product includes software developed by Charles D. Cranor. 191.1Sgwr * 4. The name of the author may not be used to endorse or promote products 201.1Sgwr * derived from this software without specific prior written permission. 211.1Sgwr * 221.1Sgwr * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 231.1Sgwr * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 241.1Sgwr * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 251.1Sgwr * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 261.1Sgwr * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 271.1Sgwr * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 281.1Sgwr * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 291.1Sgwr * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 301.1Sgwr * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 311.1Sgwr * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 321.1Sgwr */ 331.1Sgwr 341.1Sgwr/* 351.1Sgwr * x i o . h 361.1Sgwr * 371.1Sgwr * this file defines the software structure we use to ioctl the 381.1Sgwr * 753/7053. this interface isn't set in stone and may (or may not) 391.1Sgwr * need adjustment. 401.1Sgwr * 411.1Sgwr * author: Chuck Cranor <chuck@ccrc.wustl.edu> 421.1Sgwr */ 431.1Sgwr 441.1Sgwr/* 451.1Sgwr * xylogic ioctl interface 461.1Sgwr */ 471.1Sgwr 481.1Sgwrstruct xd_iocmd { 491.1Sgwr u_char cmd; /* in: command number */ 501.1Sgwr u_char subfn; /* in: subfunction number */ 511.1Sgwr u_char errno; /* out: error number */ 521.1Sgwr u_char tries; /* out: number of tries */ 531.1Sgwr u_short sectcnt; /* in,out: sector count (hw_spt on read drive param) */ 541.1Sgwr u_short dlen; /* in: length of data buffer (good sanity check) */ 551.1Sgwr u_long block; /* in: block number */ 561.2Schristos void *dptr; /* in: data buffer to do I/O from */ 571.1Sgwr}; 581.1Sgwr 591.1Sgwr#ifndef DIOSXDCMD 601.1Sgwr#define DIOSXDCMD _IOWR('x', 101, struct xd_iocmd) /* do xd command */ 611.1Sgwr#endif 621.1Sgwr 631.1Sgwr#define XD_IOCMD_MAXS 16 /* max number of sectors you can do */ 641.1Sgwr#define XD_IOCMD_HSZ 4 /* size of one header */ 651.1Sgwr#define XD_IOCMD_DMSZ 24 /* defect map size */ 66