• Home
  • Raw
  • Download

Lines Matching refs:drive

62 static int ide_floppy_callback(ide_drive_t *drive, int dsc)  in ide_floppy_callback()  argument
64 struct ide_disk_obj *floppy = drive->driver_data; in ide_floppy_callback()
65 struct ide_atapi_pc *pc = drive->pc; in ide_floppy_callback()
71 if (drive->failed_pc == pc) in ide_floppy_callback()
72 drive->failed_pc = NULL; in ide_floppy_callback()
88 if (drive->failed_pc) in ide_floppy_callback()
90 drive->failed_pc->c[0]); in ide_floppy_callback()
117 floppy->drive->name, pc->c[0], floppy->sense_key, in ide_floppy_report_error()
122 static ide_startstop_t ide_floppy_issue_pc(ide_drive_t *drive, in ide_floppy_issue_pc() argument
126 struct ide_disk_obj *floppy = drive->driver_data; in ide_floppy_issue_pc()
128 if (drive->failed_pc == NULL && in ide_floppy_issue_pc()
130 drive->failed_pc = pc; in ide_floppy_issue_pc()
133 drive->pc = pc; in ide_floppy_issue_pc()
136 unsigned int done = blk_rq_bytes(drive->hwif->rq); in ide_floppy_issue_pc()
144 drive->failed_pc = NULL; in ide_floppy_issue_pc()
145 drive->pc_callback(drive, 0); in ide_floppy_issue_pc()
146 ide_complete_rq(drive, -EIO, done); in ide_floppy_issue_pc()
154 return ide_issue_pc(drive, cmd); in ide_floppy_issue_pc()
190 static void idefloppy_create_rw_cmd(ide_drive_t *drive, in idefloppy_create_rw_cmd() argument
194 struct ide_disk_obj *floppy = drive->driver_data; in idefloppy_create_rw_cmd()
228 static ide_startstop_t ide_floppy_do_request(ide_drive_t *drive, in ide_floppy_do_request() argument
231 struct ide_disk_obj *floppy = drive->driver_data; in ide_floppy_do_request()
237 if (drive->debug_mask & IDE_DBG_RQ) in ide_floppy_do_request()
243 if (drive->failed_pc) { in ide_floppy_do_request()
244 ide_floppy_report_error(floppy, drive->failed_pc); in ide_floppy_do_request()
245 drive->failed_pc = NULL; in ide_floppy_do_request()
247 printk(KERN_ERR PFX "%s: I/O error\n", drive->name); in ide_floppy_do_request()
251 ide_complete_rq(drive, 0, blk_rq_bytes(rq)); in ide_floppy_do_request()
262 drive->name); in ide_floppy_do_request()
266 idefloppy_create_rw_cmd(drive, pc, rq, (unsigned long)block); in ide_floppy_do_request()
280 ide_prep_sense(drive, rq); in ide_floppy_do_request()
291 ide_map_sg(drive, &cmd); in ide_floppy_do_request()
296 return ide_floppy_issue_pc(drive, &cmd, pc); in ide_floppy_do_request()
298 drive->failed_pc = NULL; in ide_floppy_do_request()
301 ide_complete_rq(drive, -EIO, blk_rq_bytes(rq)); in ide_floppy_do_request()
309 static int ide_floppy_get_flexible_disk_page(ide_drive_t *drive, in ide_floppy_get_flexible_disk_page() argument
312 struct ide_disk_obj *floppy = drive->driver_data; in ide_floppy_get_flexible_disk_page()
321 if (ide_queue_pc_tail(drive, disk, pc, buf, pc->req_xfer)) { in ide_floppy_get_flexible_disk_page()
327 drive->dev_flags |= IDE_DFLAG_WP; in ide_floppy_get_flexible_disk_page()
329 drive->dev_flags &= ~IDE_DFLAG_WP; in ide_floppy_get_flexible_disk_page()
331 set_disk_ro(disk, !!(drive->dev_flags & IDE_DFLAG_WP)); in ide_floppy_get_flexible_disk_page()
347 drive->name, capacity / 1024, cyls, heads, in ide_floppy_get_flexible_disk_page()
351 drive->bios_cyl = cyls; in ide_floppy_get_flexible_disk_page()
352 drive->bios_head = heads; in ide_floppy_get_flexible_disk_page()
353 drive->bios_sect = sectors; in ide_floppy_get_flexible_disk_page()
359 drive->name, lba_capacity, capacity); in ide_floppy_get_flexible_disk_page()
362 drive->capacity64 = floppy->blocks * floppy->bs_factor; in ide_floppy_get_flexible_disk_page()
372 static int ide_floppy_get_capacity(ide_drive_t *drive) in ide_floppy_get_capacity() argument
374 struct ide_disk_obj *floppy = drive->driver_data; in ide_floppy_get_capacity()
383 drive->bios_cyl = 0; in ide_floppy_get_capacity()
384 drive->bios_head = drive->bios_sect = 0; in ide_floppy_get_capacity()
387 drive->capacity64 = 0; in ide_floppy_get_capacity()
390 if (ide_queue_pc_tail(drive, disk, &pc, pc_buf, pc.req_xfer)) { in ide_floppy_get_capacity()
418 if (!(drive->atapi_flags & IDE_AFLAG_CLIK_DRIVE)) in ide_floppy_get_capacity()
429 drive->name, blocks * length / 1024, in ide_floppy_get_capacity()
435 " not supported\n", drive->name, length); in ide_floppy_get_capacity()
444 drive->name); in ide_floppy_get_capacity()
445 drive->capacity64 = in ide_floppy_get_capacity()
456 drive->name); in ide_floppy_get_capacity()
460 "in drive\n", drive->name); in ide_floppy_get_capacity()
468 if (!(drive->atapi_flags & IDE_AFLAG_CLIK_DRIVE)) in ide_floppy_get_capacity()
469 (void) ide_floppy_get_flexible_disk_page(drive, &pc); in ide_floppy_get_capacity()
474 static void ide_floppy_setup(ide_drive_t *drive) in ide_floppy_setup() argument
476 struct ide_disk_obj *floppy = drive->driver_data; in ide_floppy_setup()
477 u16 *id = drive->id; in ide_floppy_setup()
479 drive->pc_callback = ide_floppy_callback; in ide_floppy_setup()
491 drive->atapi_flags |= IDE_AFLAG_ZIP_DRIVE; in ide_floppy_setup()
493 drive->pc_delay = IDEFLOPPY_PC_DELAY; in ide_floppy_setup()
494 blk_queue_max_hw_sectors(drive->queue, 64); in ide_floppy_setup()
502 blk_queue_max_hw_sectors(drive->queue, 64); in ide_floppy_setup()
503 drive->atapi_flags |= IDE_AFLAG_CLIK_DRIVE; in ide_floppy_setup()
505 drive->dev_flags &= ~IDE_DFLAG_DOORLOCKING; in ide_floppy_setup()
508 (void) ide_floppy_get_capacity(drive); in ide_floppy_setup()
510 ide_proc_register_driver(drive, floppy->driver); in ide_floppy_setup()
512 drive->dev_flags |= IDE_DFLAG_ATTACH; in ide_floppy_setup()
515 static void ide_floppy_flush(ide_drive_t *drive) in ide_floppy_flush() argument
519 static int ide_floppy_init_media(ide_drive_t *drive, struct gendisk *disk) in ide_floppy_init_media() argument
523 if (ide_do_test_unit_ready(drive, disk)) in ide_floppy_init_media()
524 ide_do_start_stop(drive, disk, 1); in ide_floppy_init_media()
526 ret = ide_floppy_get_capacity(drive); in ide_floppy_init_media()
528 set_capacity(disk, ide_gd_capacity(drive)); in ide_floppy_init_media()