Deleted Added
full compact
ida_disk.c (60041) ida_disk.c (63934)
1/*-
2 * Copyright (c) 1999,2000 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,2000 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 * $FreeBSD: head/sys/dev/ida/ida_disk.c 60041 2000-05-05 09:59:14Z phk $
26 * $FreeBSD: head/sys/dev/ida/ida_disk.c 63934 2000-07-27 22:24:44Z jlemon $
27 */
28
29/*
30 * Disk driver for Compaq SMART RAID adapters.
31 */
32
33#include <sys/param.h>
34#include <sys/systm.h>

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

221 device_t parent;
222 dev_t dsk;
223 int error;
224
225 drv = (struct idad_softc *)device_get_softc(dev);
226 parent = device_get_parent(dev);
227 drv->controller = (struct ida_softc *)device_get_softc(parent);
228 drv->unit = device_get_unit(dev);
27 */
28
29/*
30 * Disk driver for Compaq SMART RAID adapters.
31 */
32
33#include <sys/param.h>
34#include <sys/systm.h>

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

221 device_t parent;
222 dev_t dsk;
223 int error;
224
225 drv = (struct idad_softc *)device_get_softc(dev);
226 parent = device_get_parent(dev);
227 drv->controller = (struct ida_softc *)device_get_softc(parent);
228 drv->unit = device_get_unit(dev);
229 drv->drive = drv->controller->num_drives;
230 drv->controller->num_drives++;
229
230 error = ida_command(drv->controller, CMD_GET_LOG_DRV_INFO,
231
232 error = ida_command(drv->controller, CMD_GET_LOG_DRV_INFO,
231 &dinfo, sizeof(dinfo), drv->unit, DMA_DATA_IN);
233 &dinfo, sizeof(dinfo), drv->drive, DMA_DATA_IN);
232 if (error) {
233 device_printf(dev, "CMD_GET_LOG_DRV_INFO failed\n");
234 return (ENXIO);
235 }
236
237 drv->cylinders = dinfo.ncylinders;
238 drv->heads = dinfo.nheads;
239 drv->sectors = dinfo.nsectors;
234 if (error) {
235 device_printf(dev, "CMD_GET_LOG_DRV_INFO failed\n");
236 return (ENXIO);
237 }
238
239 drv->cylinders = dinfo.ncylinders;
240 drv->heads = dinfo.nheads;
241 drv->sectors = dinfo.nsectors;
240 drv->secsize = dinfo.secsize;
242 drv->secsize = dinfo.secsize == 0 ? 512 : dinfo.secsize;
241 drv->secperunit = dinfo.secperunit;
242
243 /* XXX
244 * other initialization
245 */
246 device_printf(dev, "%uMB (%u sectors), blocksize=%d\n",
247 drv->secperunit / ((1024 * 1024) / drv->secsize),
248 drv->secperunit, drv->secsize);

--- 28 unchanged lines hidden ---
243 drv->secperunit = dinfo.secperunit;
244
245 /* XXX
246 * other initialization
247 */
248 device_printf(dev, "%uMB (%u sectors), blocksize=%d\n",
249 drv->secperunit / ((1024 * 1024) / drv->secsize),
250 drv->secperunit, drv->secsize);

--- 28 unchanged lines hidden ---