Lines Matching defs:drv

89 	struct idad_softc *drv;
91 drv = bp->bio_disk->d_drv1;
92 if (drv == NULL) {
100 if (drv->flags & DRV_WRITEPROT && (bp->bio_cmd == BIO_WRITE)) {
105 bp->bio_driver1 = drv;
106 ida_submit_buf(drv->controller, bp);
124 struct idad_softc *drv;
129 drv = dp->d_drv1;
130 if (drv == NULL)
133 drv->controller->flags &= ~IDA_INTERRUPTS;
136 error = ida_command(drv->controller, CMD_WRITE, virtual,
137 length, drv->drive, offset / DEV_BSIZE, DMA_DATA_OUT);
139 drv->controller->flags |= IDA_INTERRUPTS;
146 struct idad_softc *drv;
148 drv = bp->bio_disk->d_drv1;
170 struct idad_softc *drv;
174 drv = (struct idad_softc *)device_get_softc(dev);
176 drv->dev = dev;
177 drv->controller = (struct ida_softc *)device_get_softc(parent);
178 drv->unit = device_get_unit(dev);
179 drv->drive = (intptr_t)device_get_ivars(dev);
181 mtx_lock(&drv->controller->lock);
182 error = ida_command(drv->controller, CMD_GET_LOG_DRV_INFO,
183 &dinfo, sizeof(dinfo), drv->drive, 0, DMA_DATA_IN);
184 mtx_unlock(&drv->controller->lock);
190 drv->cylinders = dinfo.dp.ncylinders;
191 drv->heads = dinfo.dp.nheads;
192 drv->sectors = dinfo.dp.nsectors;
193 drv->secsize = dinfo.secsize == 0 ? 512 : dinfo.secsize;
194 drv->secperunit = dinfo.secperunit;
200 drv->secperunit / ((1024 * 1024) / drv->secsize),
201 drv->secperunit, drv->secsize);
203 drv->disk = disk_alloc();
204 drv->disk->d_strategy = idad_strategy;
205 drv->disk->d_name = "idad";
206 drv->disk->d_dump = idad_dump;
207 drv->disk->d_sectorsize = drv->secsize;
208 drv->disk->d_mediasize = (off_t)drv->secperunit * drv->secsize;
209 drv->disk->d_fwsectors = drv->sectors;
210 drv->disk->d_fwheads = drv->heads;
211 drv->disk->d_drv1 = drv;
212 drv->disk->d_maxsize = DFLTPHYS; /* XXX guess? */
213 drv->disk->d_unit = drv->unit;
214 disk_create(drv->disk, DISK_VERSION);
222 struct idad_softc *drv;
224 drv = (struct idad_softc *)device_get_softc(dev);
225 disk_destroy(drv->disk);