Lines Matching full:drive
38 static int ide_floppy_get_format_capacities(ide_drive_t *drive, in ide_floppy_get_format_capacities() argument
42 struct ide_disk_obj *floppy = drive->driver_data; in ide_floppy_get_format_capacities()
55 if (ide_queue_pc_tail(drive, floppy->disk, pc, pc_buf, pc->req_xfer)) { in ide_floppy_get_format_capacities()
121 static int ide_floppy_get_sfrp_bit(ide_drive_t *drive, struct ide_atapi_pc *pc) in ide_floppy_get_sfrp_bit() argument
123 struct ide_disk_obj *floppy = drive->driver_data; in ide_floppy_get_sfrp_bit()
126 drive->atapi_flags &= ~IDE_AFLAG_SRFP; in ide_floppy_get_sfrp_bit()
131 if (ide_queue_pc_tail(drive, floppy->disk, pc, buf, pc->req_xfer)) in ide_floppy_get_sfrp_bit()
135 drive->atapi_flags |= IDE_AFLAG_SRFP; in ide_floppy_get_sfrp_bit()
140 static int ide_floppy_format_unit(ide_drive_t *drive, struct ide_atapi_pc *pc, in ide_floppy_format_unit() argument
143 struct ide_disk_obj *floppy = drive->driver_data; in ide_floppy_format_unit()
149 drive->dev_flags &= ~IDE_DFLAG_FORMAT_IN_PROGRESS; in ide_floppy_format_unit()
153 drive->dev_flags |= IDE_DFLAG_FORMAT_IN_PROGRESS; in ide_floppy_format_unit()
156 * Send ATAPI_FORMAT_UNIT to the drive. in ide_floppy_format_unit()
177 ide_floppy_get_sfrp_bit(drive, pc); in ide_floppy_format_unit()
180 if (ide_queue_pc_tail(drive, floppy->disk, pc, buf, pc->req_xfer)) in ide_floppy_format_unit()
185 drive->dev_flags &= ~IDE_DFLAG_FORMAT_IN_PROGRESS; in ide_floppy_format_unit()
195 * If the drive does not support format progress indication, we just check
199 static int ide_floppy_get_format_progress(ide_drive_t *drive, in ide_floppy_get_format_progress() argument
203 struct ide_disk_obj *floppy = drive->driver_data; in ide_floppy_get_format_progress()
207 if (drive->atapi_flags & IDE_AFLAG_SRFP) { in ide_floppy_get_format_progress()
208 ide_create_request_sense_cmd(drive, pc); in ide_floppy_get_format_progress()
209 if (ide_queue_pc_tail(drive, floppy->disk, pc, sense_buf, in ide_floppy_get_format_progress()
220 ide_hwif_t *hwif = drive->hwif; in ide_floppy_get_format_progress()
237 static int ide_floppy_lockdoor(ide_drive_t *drive, struct ide_atapi_pc *pc, in ide_floppy_lockdoor() argument
240 struct ide_disk_obj *floppy = drive->driver_data; in ide_floppy_lockdoor()
247 ide_set_media_lock(drive, disk, prevent); in ide_floppy_lockdoor()
250 ide_do_start_stop(drive, disk, 2); in ide_floppy_lockdoor()
255 static int ide_floppy_format_ioctl(ide_drive_t *drive, struct ide_atapi_pc *pc, in ide_floppy_format_ioctl() argument
263 return ide_floppy_get_format_capacities(drive, pc, argp); in ide_floppy_format_ioctl()
267 return ide_floppy_format_unit(drive, pc, (int __user *)argp); in ide_floppy_format_ioctl()
269 return ide_floppy_get_format_progress(drive, pc, argp); in ide_floppy_format_ioctl()
275 int ide_floppy_ioctl(ide_drive_t *drive, struct block_device *bdev, in ide_floppy_ioctl() argument
284 err = ide_floppy_lockdoor(drive, &pc, arg, cmd); in ide_floppy_ioctl()
288 err = ide_floppy_format_ioctl(drive, &pc, mode, cmd, argp); in ide_floppy_ioctl()
300 err = generic_ide_ioctl(drive, bdev, cmd, arg); in ide_floppy_ioctl()
308 int ide_floppy_compat_ioctl(ide_drive_t *drive, struct block_device *bdev, in ide_floppy_compat_ioctl() argument
317 err = ide_floppy_lockdoor(drive, &pc, arg, cmd); in ide_floppy_compat_ioctl()
321 err = ide_floppy_format_ioctl(drive, &pc, mode, cmd, argp); in ide_floppy_compat_ioctl()
333 err = generic_ide_ioctl(drive, bdev, cmd, arg); in ide_floppy_compat_ioctl()