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