diff options
Diffstat (limited to 'sys/dev/ida/ida_disk.c')
-rw-r--r-- | sys/dev/ida/ida_disk.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/ida/ida_disk.c b/sys/dev/ida/ida_disk.c index 47e32a9..6172085 100644 --- a/sys/dev/ida/ida_disk.c +++ b/sys/dev/ida/ida_disk.c @@ -226,9 +226,11 @@ idad_attach(device_t dev) parent = device_get_parent(dev); drv->controller = (struct ida_softc *)device_get_softc(parent); drv->unit = device_get_unit(dev); + drv->drive = drv->controller->num_drives; + drv->controller->num_drives++; error = ida_command(drv->controller, CMD_GET_LOG_DRV_INFO, - &dinfo, sizeof(dinfo), drv->unit, DMA_DATA_IN); + &dinfo, sizeof(dinfo), drv->drive, DMA_DATA_IN); if (error) { device_printf(dev, "CMD_GET_LOG_DRV_INFO failed\n"); return (ENXIO); @@ -237,7 +239,7 @@ idad_attach(device_t dev) drv->cylinders = dinfo.ncylinders; drv->heads = dinfo.nheads; drv->sectors = dinfo.nsectors; - drv->secsize = dinfo.secsize; + drv->secsize = dinfo.secsize == 0 ? 512 : dinfo.secsize; drv->secperunit = dinfo.secperunit; /* XXX |