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