1/* 2 * Copyright (C) 2002 Benno Rice <benno@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 8 unchanged lines hidden (view full) --- 17 * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 18 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 20 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 21 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 22 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 23 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 * |
25 * $FreeBSD: head/sys/dev/ofw/ofw_disk.c 103714 2002-09-20 19:36:05Z phk $ |
26 * 27 */ 28 29#include <sys/param.h> 30#include <sys/systm.h> 31#include <sys/bio.h> 32#include <sys/bus.h> 33#include <sys/conf.h> --- 75 unchanged lines hidden (view full) --- 109 * 110 * This is typically only called by the diskslice code and not for opens on 111 * subdevices. 112 */ 113static int 114ofwd_open(dev_t dev, int flags, int fmt, struct thread *td) 115{ 116 struct ofwd_softc *sc; |
117 118 sc = (struct ofwd_softc *)dev->si_drv1; 119 if (sc == NULL) 120 return (ENXIO); 121 |
122 sc->ofwd_disk.d_sectorsize = OFWD_BLOCKSIZE; 123 sc->ofwd_disk.d_mediasize = (off_t)33554432 * OFWD_BLOCKSIZE; 124 /* XXX: probably don't need the next two */ 125 sc->ofwd_disk.d_fwsectors = 33554432; 126 sc->ofwd_disk.d_fwheads = 1 |
127 128 sc->ofwd_flags |= OFWD_OPEN; 129 return (0); 130} 131 132/* 133 * Handle last close of the disk device. 134 */ --- 119 unchanged lines hidden --- |