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