ida_disk.c (03016f421b93072568df5ea924df8d3bb503566a) ida_disk.c (49ff4debd3d4c155448b2b4e3b95b17d9eb575ed)
1/*-
2 * Copyright (c) 1999 Jonathan Lemon
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

--- 9 unchanged lines hidden (view full) ---

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
1/*-
2 * Copyright (c) 1999 Jonathan Lemon
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

--- 9 unchanged lines hidden (view full) ---

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 * $Id: ida_disk.c,v 1.1 1999/06/24 03:31:57 jlemon Exp $
26 * $Id: ida_disk.c,v 1.2 1999/07/04 14:58:16 phk Exp $
27 */
28
29/*
30 * Disk driver for Compaq SMART RAID adapters.
31 */
32
33#include <sys/param.h>
34#include <sys/systm.h>

--- 104 unchanged lines hidden (view full) ---

139 label.d_secsize = drv->secsize;
140 label.d_nsectors = drv->sectors;
141 label.d_ntracks = drv->heads;
142 label.d_ncylinders = drv->cylinders;
143 label.d_secpercyl = drv->sectors * drv->heads;
144 label.d_secperunit = drv->secperunit;
145
146 /* Initialize slice tables. */
27 */
28
29/*
30 * Disk driver for Compaq SMART RAID adapters.
31 */
32
33#include <sys/param.h>
34#include <sys/systm.h>

--- 104 unchanged lines hidden (view full) ---

139 label.d_secsize = drv->secsize;
140 label.d_nsectors = drv->sectors;
141 label.d_ntracks = drv->heads;
142 label.d_ncylinders = drv->cylinders;
143 label.d_secpercyl = drv->sectors * drv->heads;
144 label.d_secperunit = drv->secperunit;
145
146 /* Initialize slice tables. */
147 error = dsopen("id", dev, fmt, 0, &drv->slices, &label,
148 idstrategy, (ds_setgeom_t *)NULL, &id_cdevsw);
147 error = dsopen("id", dev, fmt, 0, &drv->slices, &label);
149
150 return (error);
151}
152
153static int
154idclose(dev_t dev, int flags, int fmt, struct proc *p)
155{
156 struct id_softc *drv;

--- 10 unchanged lines hidden (view full) ---

167{
168 struct id_softc *drv;
169 int error;
170
171 drv = idgetsoftc(dev);
172 if (drv == NULL)
173 return (ENXIO);
174
148
149 return (error);
150}
151
152static int
153idclose(dev_t dev, int flags, int fmt, struct proc *p)
154{
155 struct id_softc *drv;

--- 10 unchanged lines hidden (view full) ---

166{
167 struct id_softc *drv;
168 int error;
169
170 drv = idgetsoftc(dev);
171 if (drv == NULL)
172 return (ENXIO);
173
175 error = dsioctl("id", dev, cmd, addr, flag, &drv->slices,
176 idstrategy, (ds_setgeom_t *)NULL);
174 error = dsioctl("id", dev, cmd, addr, flag, &drv->slices);
177
178 if (error == ENOIOCTL)
179 return (ENOTTY);
180
181 return (error);
182}
183
184static int
185idsize(dev_t dev)
186{
187 struct id_softc *drv;
188
189 drv = idgetsoftc(dev);
190 if (drv == NULL)
191 return (ENXIO);
175
176 if (error == ENOIOCTL)
177 return (ENOTTY);
178
179 return (error);
180}
181
182static int
183idsize(dev_t dev)
184{
185 struct id_softc *drv;
186
187 drv = idgetsoftc(dev);
188 if (drv == NULL)
189 return (ENXIO);
192 return (dssize(dev, &drv->slices, idopen, idclose));
190 return (dssize(dev, &drv->slices));
193}
194
195/*
196 * Read/write routine for a buffer. Finds the proper unit, range checks
197 * arguments, and schedules the transfer. Does not wait for the transfer
198 * to complete. Multi-page transfers are supported. All I/O requests must
199 * be a multiple of a sector in length.
200 */

--- 130 unchanged lines hidden ---
191}
192
193/*
194 * Read/write routine for a buffer. Finds the proper unit, range checks
195 * arguments, and schedules the transfer. Does not wait for the transfer
196 * to complete. Multi-page transfers are supported. All I/O requests must
197 * be a multiple of a sector in length.
198 */

--- 130 unchanged lines hidden ---