Lines Matching refs:drive
37 static int ide_floppy_get_format_capacities(ide_drive_t *drive, in ide_floppy_get_format_capacities() argument
41 struct ide_disk_obj *floppy = drive->driver_data; in ide_floppy_get_format_capacities()
54 if (ide_queue_pc_tail(drive, floppy->disk, pc, pc_buf, pc->req_xfer)) { in ide_floppy_get_format_capacities()
120 static int ide_floppy_get_sfrp_bit(ide_drive_t *drive, struct ide_atapi_pc *pc) in ide_floppy_get_sfrp_bit() argument
122 struct ide_disk_obj *floppy = drive->driver_data; in ide_floppy_get_sfrp_bit()
125 drive->atapi_flags &= ~IDE_AFLAG_SRFP; in ide_floppy_get_sfrp_bit()
130 if (ide_queue_pc_tail(drive, floppy->disk, pc, buf, pc->req_xfer)) in ide_floppy_get_sfrp_bit()
134 drive->atapi_flags |= IDE_AFLAG_SRFP; in ide_floppy_get_sfrp_bit()
139 static int ide_floppy_format_unit(ide_drive_t *drive, struct ide_atapi_pc *pc, in ide_floppy_format_unit() argument
142 struct ide_disk_obj *floppy = drive->driver_data; in ide_floppy_format_unit()
148 drive->dev_flags &= ~IDE_DFLAG_FORMAT_IN_PROGRESS; in ide_floppy_format_unit()
152 drive->dev_flags |= IDE_DFLAG_FORMAT_IN_PROGRESS; in ide_floppy_format_unit()
176 ide_floppy_get_sfrp_bit(drive, pc); in ide_floppy_format_unit()
179 if (ide_queue_pc_tail(drive, floppy->disk, pc, buf, pc->req_xfer)) in ide_floppy_format_unit()
184 drive->dev_flags &= ~IDE_DFLAG_FORMAT_IN_PROGRESS; in ide_floppy_format_unit()
198 static int ide_floppy_get_format_progress(ide_drive_t *drive, in ide_floppy_get_format_progress() argument
202 struct ide_disk_obj *floppy = drive->driver_data; in ide_floppy_get_format_progress()
206 if (drive->atapi_flags & IDE_AFLAG_SRFP) { in ide_floppy_get_format_progress()
207 ide_create_request_sense_cmd(drive, pc); in ide_floppy_get_format_progress()
208 if (ide_queue_pc_tail(drive, floppy->disk, pc, sense_buf, in ide_floppy_get_format_progress()
219 ide_hwif_t *hwif = drive->hwif; in ide_floppy_get_format_progress()
236 static int ide_floppy_lockdoor(ide_drive_t *drive, struct ide_atapi_pc *pc, in ide_floppy_lockdoor() argument
239 struct ide_disk_obj *floppy = drive->driver_data; in ide_floppy_lockdoor()
246 ide_set_media_lock(drive, disk, prevent); in ide_floppy_lockdoor()
249 ide_do_start_stop(drive, disk, 2); in ide_floppy_lockdoor()
254 static int ide_floppy_format_ioctl(ide_drive_t *drive, struct ide_atapi_pc *pc, in ide_floppy_format_ioctl() argument
262 return ide_floppy_get_format_capacities(drive, pc, argp); in ide_floppy_format_ioctl()
266 return ide_floppy_format_unit(drive, pc, (int __user *)argp); in ide_floppy_format_ioctl()
268 return ide_floppy_get_format_progress(drive, pc, argp); in ide_floppy_format_ioctl()
274 int ide_floppy_ioctl(ide_drive_t *drive, struct block_device *bdev, in ide_floppy_ioctl() argument
283 err = ide_floppy_lockdoor(drive, &pc, arg, cmd); in ide_floppy_ioctl()
287 err = ide_floppy_format_ioctl(drive, &pc, mode, cmd, argp); in ide_floppy_ioctl()
299 err = generic_ide_ioctl(drive, bdev, cmd, arg); in ide_floppy_ioctl()