1139825Simp/*- 24963Sphk * Copyright (c) 1988 University of Utah. 34963Sphk * Copyright (c) 1990, 1993 44963Sphk * The Regents of the University of California. All rights reserved. 54963Sphk * 64963Sphk * This code is derived from software contributed to Berkeley by 74963Sphk * the Systems Programming Group of the University of Utah Computer 84963Sphk * Science Department. 94963Sphk * 104963Sphk * Redistribution and use in source and binary forms, with or without 114963Sphk * modification, are permitted provided that the following conditions 124963Sphk * are met: 134963Sphk * 1. Redistributions of source code must retain the above copyright 144963Sphk * notice, this list of conditions and the following disclaimer. 154963Sphk * 2. Redistributions in binary form must reproduce the above copyright 164963Sphk * notice, this list of conditions and the following disclaimer in the 174963Sphk * documentation and/or other materials provided with the distribution. 184963Sphk * 4. Neither the name of the University nor the names of its contributors 194963Sphk * may be used to endorse or promote products derived from this software 204963Sphk * without specific prior written permission. 214963Sphk * 224963Sphk * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 234963Sphk * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 244963Sphk * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 254963Sphk * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 264963Sphk * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 274963Sphk * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 284963Sphk * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 294963Sphk * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 304963Sphk * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 314963Sphk * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 324963Sphk * SUCH DAMAGE. 334963Sphk * 344963Sphk * from: Utah $Hdr: fdioctl.h 1.1 90/07/09$ 354963Sphk * 364963Sphk * @(#)vnioctl.h 8.1 (Berkeley) 6/10/93 3751341Sdillon * 3870451Sphk * From: src/sys/sys/vnioctl.h,v 1.4 3970451Sphk * 4051341Sdillon * $FreeBSD$ 414963Sphk */ 424963Sphk 4370451Sphk#ifndef _SYS_MDIOCTL_H_ 4470451Sphk#define _SYS_MDIOCTL_H_ 4510358Sjulian 46289516Straszenum md_types {MD_MALLOC, MD_PRELOAD, MD_VNODE, MD_SWAP, MD_NULL}; 4770451Sphk 484963Sphk/* 4970451Sphk * Ioctl definitions for memory disk pseudo-device. 504963Sphk */ 514963Sphk 52113289Sphk#define MDNPAD 97 5370451Sphkstruct md_ioctl { 5470573Sphk unsigned md_version; /* Structure layout version */ 5570451Sphk unsigned md_unit; /* unit number */ 5670451Sphk enum md_types md_type ; /* type of disk */ 57139359Spjd char *md_file; /* pathname of file to mount */ 58135340Spjd off_t md_mediasize; /* size of disk in bytes */ 59135340Spjd unsigned md_sectorsize; /* sectorsize */ 6070451Sphk unsigned md_options; /* options */ 6170573Sphk u_int64_t md_base; /* base address */ 62113289Sphk int md_fwheads; /* firmware heads */ 63113289Sphk int md_fwsectors; /* firmware sectors */ 64109928Sphk int md_pad[MDNPAD]; /* padding for future ideas */ 654963Sphk}; 664963Sphk 6773026Sphk#define MD_NAME "md" 6873026Sphk#define MDCTL_NAME "mdctl" 69139359Spjd#define MDIOVERSION 0 7070573Sphk 714963Sphk/* 7270451Sphk * Before you can use a unit, it must be configured with MDIOCSET. 734963Sphk * The configuration persists across opens and closes of the device; 7470451Sphk * an MDIOCCLR must be used to reset a configuration. An attempt to 7570451Sphk * MDIOCSET an already active unit will return EBUSY. 764963Sphk */ 776998Sphk 7870451Sphk#define MDIOCATTACH _IOWR('m', 0, struct md_ioctl) /* attach disk */ 7970451Sphk#define MDIOCDETACH _IOWR('m', 1, struct md_ioctl) /* detach disk */ 8073026Sphk#define MDIOCQUERY _IOWR('m', 2, struct md_ioctl) /* query status */ 81109928Sphk#define MDIOCLIST _IOWR('m', 3, struct md_ioctl) /* query status */ 82238215Strasz#define MDIOCRESIZE _IOWR('m', 4, struct md_ioctl) /* resize disk */ 8310358Sjulian 8470451Sphk#define MD_CLUSTER 0x01 /* Don't cluster */ 8570451Sphk#define MD_RESERVE 0x02 /* Pre-reserve swap */ 8670451Sphk#define MD_AUTOUNIT 0x04 /* Assign next free unit */ 8770451Sphk#define MD_READONLY 0x08 /* Readonly mode */ 8870535Sphk#define MD_COMPRESS 0x10 /* Compression mode */ 8981257Sdd#define MD_FORCE 0x20 /* Don't try to prevent foot-shooting */ 90230536Strasz#define MD_ASYNC 0x40 /* Asynchronous mode */ 9170451Sphk 9270451Sphk#endif /* _SYS_MDIOCTL_H_*/ 93