Lines Matching refs:drive
40 if (ide_device_get(idkp->drive)) in ide_disk_get()
51 ide_drive_t *drive = idkp->drive; in ide_disk_put() local
55 ide_device_put(drive); in ide_disk_put()
59 sector_t ide_gd_capacity(ide_drive_t *drive) in ide_gd_capacity() argument
61 return drive->capacity64; in ide_gd_capacity()
66 static void ide_gd_remove(ide_drive_t *drive) in ide_gd_remove() argument
68 struct ide_disk_obj *idkp = drive->driver_data; in ide_gd_remove()
71 ide_proc_unregister_driver(drive, idkp->driver); in ide_gd_remove()
74 drive->disk_ops->flush(drive); in ide_gd_remove()
84 ide_drive_t *drive = idkp->drive; in ide_disk_release() local
87 drive->disk_ops = NULL; in ide_disk_release()
88 drive->driver_data = NULL; in ide_disk_release()
99 static void ide_gd_resume(ide_drive_t *drive) in ide_gd_resume() argument
101 if (ata_id_hpa_enabled(drive->id)) in ide_gd_resume()
102 (void)drive->disk_ops->get_capacity(drive); in ide_gd_resume()
118 static void ide_gd_shutdown(ide_drive_t *drive) argument
137 drive->disk_ops->flush(drive);
141 printk(KERN_INFO "Shutdown: %s\n", drive->name);
143 drive->gendev.bus->suspend(&drive->gendev, PMSG_SUSPEND);
147 static ide_proc_entry_t *ide_disk_proc_entries(ide_drive_t *drive) argument
149 return (drive->media == ide_disk) ? ide_disk_proc : ide_floppy_proc;
152 static const struct ide_proc_devset *ide_disk_proc_devsets(ide_drive_t *drive) argument
154 return (drive->media == ide_disk) ? ide_disk_settings
159 static ide_startstop_t ide_gd_do_request(ide_drive_t *drive, argument
162 return drive->disk_ops->do_request(drive, rq, sector);
187 ide_drive_t *drive; local
194 drive = idkp->drive;
200 if ((drive->dev_flags & IDE_DFLAG_REMOVABLE) && idkp->openers == 1) {
201 drive->dev_flags &= ~IDE_DFLAG_FORMAT_IN_PROGRESS;
204 ret = drive->disk_ops->init_media(drive, disk);
216 if ((drive->dev_flags & IDE_DFLAG_WP) && (mode & FMODE_WRITE)) {
226 drive->disk_ops->set_doorlock(drive, disk, 1);
227 drive->dev_flags |= IDE_DFLAG_MEDIA_CHANGED;
229 } else if (drive->dev_flags & IDE_DFLAG_FORMAT_IN_PROGRESS) {
256 ide_drive_t *drive = idkp->drive; local
262 drive->disk_ops->flush(drive);
264 if ((drive->dev_flags & IDE_DFLAG_REMOVABLE) && idkp->openers == 1) {
265 drive->disk_ops->set_doorlock(drive, disk, 0);
266 drive->dev_flags &= ~IDE_DFLAG_FORMAT_IN_PROGRESS;
278 ide_drive_t *drive = idkp->drive; local
280 geo->heads = drive->bios_head;
281 geo->sectors = drive->bios_sect;
282 geo->cylinders = (u16)drive->bios_cyl; /* truncate */
290 ide_drive_t *drive = idkp->drive; local
294 if (drive->dev_flags & IDE_DFLAG_ATTACH) {
295 drive->dev_flags &= ~IDE_DFLAG_ATTACH;
305 ret = drive->dev_flags & IDE_DFLAG_MEDIA_CHANGED;
306 drive->dev_flags &= ~IDE_DFLAG_MEDIA_CHANGED;
314 ide_drive_t *drive = idkp->drive; local
315 const struct ide_disk_ops *disk_ops = drive->disk_ops;
318 disk_ops->unlock_native_capacity(drive);
324 ide_drive_t *drive = idkp->drive; local
327 drive->disk_ops->get_capacity(drive);
329 set_capacity(disk, ide_gd_capacity(drive));
337 ide_drive_t *drive = idkp->drive; local
339 return drive->disk_ops->ioctl(drive, bdev, mode, cmd, arg);
353 static int ide_gd_probe(ide_drive_t *drive) argument
360 if (!strstr("ide-gd", drive->driver_req))
364 if (drive->media == ide_disk)
368 if (drive->media == ide_floppy)
374 if (disk_ops->check(drive, DRV_NAME) == 0) {
376 drive->name);
383 drive->name);
387 g = alloc_disk_node(IDE_DISK_MINORS, hwif_to_node(drive->hwif));
391 ide_init_disk(g, drive);
393 idkp->dev.parent = &drive->gendev;
395 dev_set_name(&idkp->dev, "%s", dev_name(&drive->gendev));
400 idkp->drive = drive;
406 drive->driver_data = idkp;
407 drive->debug_mask = debug_mask;
408 drive->disk_ops = disk_ops;
410 disk_ops->setup(drive);
412 set_capacity(g, ide_gd_capacity(drive));
416 if (drive->dev_flags & IDE_DFLAG_REMOVABLE)
419 device_add_disk(&drive->gendev, g);