Deleted Added
full compact
ofw_disk.c (94749) ofw_disk.c (103714)
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 *
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 94749 2002-04-15 10:54:22Z benno $
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;
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 struct disklabel *label;
118
119 sc = (struct ofwd_softc *)dev->si_drv1;
120 if (sc == NULL)
121 return (ENXIO);
122
117
118 sc = (struct ofwd_softc *)dev->si_drv1;
119 if (sc == NULL)
120 return (ENXIO);
121
123 /*
124 * Build synthetic label.
125 */
126 label = &sc->ofwd_disk.d_label;
127 bzero(label, sizeof(*label));
128 label->d_type = DTYPE_ESDI;
129 label->d_secsize = OFWD_BLOCKSIZE;
130 label->d_nsectors = 33554432;
131 label->d_ntracks = 1;
132 label->d_ncylinders = 1024;
133 label->d_secpercyl = 32768;
134 label->d_secperunit = 33554432;
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
135
136 sc->ofwd_flags |= OFWD_OPEN;
137 return (0);
138}
139
140/*
141 * Handle last close of the disk device.
142 */

--- 119 unchanged lines hidden ---
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 ---