/drivers/ide/ |
D | ide-disk.c | 55 static void ide_tf_set_cmd(ide_drive_t *drive, struct ide_cmd *cmd, u8 dma) in ide_tf_set_cmd() argument 67 if (drive->mult_count) { in ide_tf_set_cmd() 81 static ide_startstop_t __ide_do_rw_disk(ide_drive_t *drive, struct request *rq, in __ide_do_rw_disk() argument 84 ide_hwif_t *hwif = drive->hwif; in __ide_do_rw_disk() 86 u8 lba48 = !!(drive->dev_flags & IDE_DFLAG_LBA48); in __ide_do_rw_disk() 87 u8 dma = !!(drive->dev_flags & IDE_DFLAG_USING_DMA); in __ide_do_rw_disk() 103 if (drive->dev_flags & IDE_DFLAG_LBA) { in __ide_do_rw_disk() 105 pr_debug("%s: LBA=0x%012llx\n", drive->name, in __ide_do_rw_disk() 135 track = (int)block / drive->sect; in __ide_do_rw_disk() 136 sect = (int)block % drive->sect + 1; in __ide_do_rw_disk() [all …]
|
D | ide-dma.c | 91 ide_startstop_t ide_dma_intr(ide_drive_t *drive) in ide_dma_intr() argument 93 ide_hwif_t *hwif = drive->hwif; in ide_dma_intr() 97 drive->waiting_for_dma = 0; in ide_dma_intr() 98 dma_stat = hwif->dma_ops->dma_end(drive); in ide_dma_intr() 99 ide_dma_unmap_sg(drive, cmd); in ide_dma_intr() 102 if (OK_STAT(stat, DRIVE_READY, drive->bad_wstat | ATA_DRQ)) { in ide_dma_intr() 105 ide_finish_cmd(drive, cmd, stat); in ide_dma_intr() 107 ide_complete_rq(drive, 0, in ide_dma_intr() 112 drive->name, __func__, dma_stat); in ide_dma_intr() 114 return ide_error(drive, "dma_intr", stat); in ide_dma_intr() [all …]
|
D | ide-atapi.c | 27 static inline int dev_is_idecd(ide_drive_t *drive) in dev_is_idecd() argument 29 return drive->media == ide_cdrom || drive->media == ide_optical; in dev_is_idecd() 36 int ide_check_atapi_device(ide_drive_t *drive, const char *s) in ide_check_atapi_device() argument 38 u16 *id = drive->id; in ide_check_atapi_device() 51 if (drive->media == ide_floppy && device_type == 5 && in ide_check_atapi_device() 59 s, drive->name, protocol); in ide_check_atapi_device() 60 else if ((drive->media == ide_floppy && device_type != 0) || in ide_check_atapi_device() 61 (drive->media == ide_tape && device_type != 1)) in ide_check_atapi_device() 63 s, drive->name, device_type); in ide_check_atapi_device() 66 s, drive->name); in ide_check_atapi_device() [all …]
|
D | ide-gd.c | 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 [all …]
|
D | ide-eh.c | 7 static ide_startstop_t ide_ata_error(ide_drive_t *drive, struct request *rq, in ide_ata_error() argument 10 ide_hwif_t *hwif = drive->hwif; in ide_ata_error() 13 ((stat & ATA_DF) && (drive->dev_flags & IDE_DFLAG_NOWERR) == 0)) { in ide_ata_error() 19 if ((drive->dev_flags & IDE_DFLAG_LBA) && in ide_ata_error() 25 drive->crc_count++; in ide_ata_error() 37 int nsect = drive->mult_count ? drive->mult_count : 1; in ide_ata_error() 39 ide_pad_transfer(drive, READ, nsect * SECTOR_SIZE); in ide_ata_error() 43 ide_kill_rq(drive, rq); in ide_ata_error() 52 return ide_do_reset(drive); in ide_ata_error() 56 drive->special_flags |= IDE_SFLAG_RECALIBRATE; in ide_ata_error() [all …]
|
D | ide-probe.c | 51 static void generic_id(ide_drive_t *drive) in generic_id() argument 53 u16 *id = drive->id; in generic_id() 55 id[ATA_ID_CUR_CYLS] = id[ATA_ID_CYLS] = drive->cyl; in generic_id() 56 id[ATA_ID_CUR_HEADS] = id[ATA_ID_HEADS] = drive->head; in generic_id() 57 id[ATA_ID_CUR_SECTORS] = id[ATA_ID_SECTORS] = drive->sect; in generic_id() 60 static void ide_disk_init_chs(ide_drive_t *drive) in ide_disk_init_chs() argument 62 u16 *id = drive->id; in ide_disk_init_chs() 65 if (!drive->cyl || !drive->head || !drive->sect) { in ide_disk_init_chs() 66 drive->cyl = drive->bios_cyl = id[ATA_ID_CYLS]; in ide_disk_init_chs() 67 drive->head = drive->bios_head = id[ATA_ID_HEADS]; in ide_disk_init_chs() [all …]
|
D | ide-io.c | 57 int ide_end_rq(ide_drive_t *drive, struct request *rq, int error, in ide_end_rq() argument 64 if ((drive->dev_flags & IDE_DFLAG_DMA_PIO_RETRY) && in ide_end_rq() 65 drive->retry_pio <= 3) { in ide_end_rq() 66 drive->dev_flags &= ~IDE_DFLAG_DMA_PIO_RETRY; in ide_end_rq() 67 ide_dma_on(drive); in ide_end_rq() 74 void ide_complete_cmd(ide_drive_t *drive, struct ide_cmd *cmd, u8 stat, u8 err) in ide_complete_cmd() argument 76 const struct ide_tp_ops *tp_ops = drive->hwif->tp_ops; in ide_complete_cmd() 87 tp_ops->input_data(drive, cmd, data, 2); in ide_complete_cmd() 93 ide_tf_readback(drive, cmd); in ide_complete_cmd() 99 drive->name); in ide_complete_cmd() [all …]
|
D | ide-tape.c | 141 ide_drive_t *drive; member 244 if (ide_device_get(tape->drive)) in ide_tape_get() 256 ide_drive_t *drive = tape->drive; in ide_tape_put() local 260 ide_device_put(drive); in ide_tape_put() 268 static void idetape_analyze_error(ide_drive_t *drive) in idetape_analyze_error() argument 270 idetape_tape_t *tape = drive->driver_data; in idetape_analyze_error() 271 struct ide_atapi_pc *pc = drive->failed_pc; in idetape_analyze_error() 272 struct request *rq = drive->hwif->rq; in idetape_analyze_error() 326 static int ide_tape_callback(ide_drive_t *drive, int dsc) in ide_tape_callback() argument 328 idetape_tape_t *tape = drive->driver_data; in ide_tape_callback() [all …]
|
D | ide-floppy.c | 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() [all …]
|
D | ide-iops.c | 30 void SELECT_MASK(ide_drive_t *drive, int mask) in SELECT_MASK() argument 32 const struct ide_port_ops *port_ops = drive->hwif->port_ops; in SELECT_MASK() 35 port_ops->maskproc(drive, mask); in SELECT_MASK() 38 u8 ide_read_error(ide_drive_t *drive) in ide_read_error() argument 42 drive->hwif->tp_ops->tf_read(drive, &tf, IDE_VALID_ERROR); in ide_read_error() 105 int __ide_wait_stat(ide_drive_t *drive, u8 good, u8 bad, in __ide_wait_stat() argument 108 ide_hwif_t *hwif = drive->hwif; in __ide_wait_stat() 164 int ide_wait_stat(ide_startstop_t *startstop, ide_drive_t *drive, u8 good, in ide_wait_stat() argument 171 if (drive->max_failures && (drive->failures > drive->max_failures)) { in ide_wait_stat() 176 err = __ide_wait_stat(drive, good, bad, timeout, &stat); in ide_wait_stat() [all …]
|
D | ide-cd.c | 65 if (ide_device_get(cd->drive)) in ide_cd_get() 77 ide_drive_t *drive = cd->drive; in ide_cd_put() local 81 ide_device_put(drive); in ide_cd_put() 90 static void cdrom_saw_media_change(ide_drive_t *drive) in cdrom_saw_media_change() argument 92 drive->dev_flags |= IDE_DFLAG_MEDIA_CHANGED; in cdrom_saw_media_change() 93 drive->atapi_flags &= ~IDE_AFLAG_TOC_VALID; in cdrom_saw_media_change() 96 static int cdrom_log_sense(ide_drive_t *drive, struct request *rq) in cdrom_log_sense() argument 98 struct request_sense *sense = &drive->sense_data; in cdrom_log_sense() 134 cdrom_saw_media_change(drive); in cdrom_log_sense() 143 static void cdrom_analyze_sense_data(ide_drive_t *drive, in cdrom_analyze_sense_data() argument [all …]
|
D | ide-cd_ioctl.c | 30 ide_drive_t *drive = cdi->handle; in ide_cdrom_release_real() local 33 drive->atapi_flags &= ~IDE_AFLAG_TOC_VALID; in ide_cdrom_release_real() 43 ide_drive_t *drive = cdi->handle; in ide_cdrom_drive_status() local 51 stat = cdrom_check_status(drive, &sense); in ide_cdrom_drive_status() 91 ide_drive_t *drive = cdi->handle; in ide_cdrom_check_events_real() local 95 (void) cdrom_check_status(drive, NULL); in ide_cdrom_check_events_real() 96 retval = (drive->dev_flags & IDE_DFLAG_MEDIA_CHANGED) ? 1 : 0; in ide_cdrom_check_events_real() 97 drive->dev_flags &= ~IDE_DFLAG_MEDIA_CHANGED; in ide_cdrom_check_events_real() 107 int cdrom_eject(ide_drive_t *drive, int ejectflag, in cdrom_eject() argument 110 struct cdrom_info *cd = drive->driver_data; in cdrom_eject() [all …]
|
D | ide-taskfile.c | 27 void ide_tf_readback(ide_drive_t *drive, struct ide_cmd *cmd) in ide_tf_readback() argument 29 ide_hwif_t *hwif = drive->hwif; in ide_tf_readback() 35 tp_ops->tf_read(drive, &cmd->tf, cmd->valid.in.tf); in ide_tf_readback() 40 tp_ops->tf_read(drive, &cmd->hob, cmd->valid.in.hob); in ide_tf_readback() 57 int taskfile_lib_get_identify(ide_drive_t *drive, u8 *buf) in taskfile_lib_get_identify() argument 63 if (drive->media == ide_disk) in taskfile_lib_get_identify() 71 return ide_raw_taskfile(drive, &cmd, buf, 1); in taskfile_lib_get_identify() 78 ide_startstop_t do_rw_taskfile(ide_drive_t *drive, struct ide_cmd *orig_cmd) in do_rw_taskfile() argument 80 ide_hwif_t *hwif = drive->hwif; in do_rw_taskfile() 89 drive->mult_count == 0) { in do_rw_taskfile() [all …]
|
D | ide-xfer-mode.c | 62 static u8 ide_get_best_pio_mode(ide_drive_t *drive, u8 mode_wanted, u8 max_mode) in ide_get_best_pio_mode() argument 64 u16 *id = drive->id; in ide_get_best_pio_mode() 70 if ((drive->hwif->host_flags & IDE_HFLAG_PIO_NO_BLACKLIST) == 0) in ide_get_best_pio_mode() 74 printk(KERN_INFO "%s: is on PIO blacklist\n", drive->name); in ide_get_best_pio_mode() 101 drive->name); in ide_get_best_pio_mode() 110 int ide_pio_need_iordy(ide_drive_t *drive, const u8 pio) in ide_pio_need_iordy() argument 116 if (pio == 0 && (drive->hwif->port_flags & IDE_PFLAG_PROBING)) in ide_pio_need_iordy() 118 return ata_id_pio_need_iordy(drive->id, pio); in ide_pio_need_iordy() 122 int ide_set_pio_mode(ide_drive_t *drive, const u8 mode) in ide_set_pio_mode() argument 124 ide_hwif_t *hwif = drive->hwif; in ide_set_pio_mode() [all …]
|
D | ide.c | 71 int ide_device_get(ide_drive_t *drive) in ide_device_get() argument 76 if (!get_device(&drive->gendev)) in ide_device_get() 79 host_dev = drive->hwif->host->dev[0]; in ide_device_get() 83 put_device(&drive->gendev); in ide_device_get() 98 void ide_device_put(ide_drive_t *drive) in ide_device_put() argument 101 struct device *host_dev = drive->hwif->host->dev[0]; in ide_device_put() 106 put_device(&drive->gendev); in ide_device_put() 117 ide_drive_t *drive = to_ide_device(dev); in ide_uevent() local 119 add_uevent_var(env, "MEDIA=%s", ide_media_string(drive)); in ide_uevent() 120 add_uevent_var(env, "DRIVENAME=%s", drive->name); in ide_uevent() [all …]
|
D | ide-pm.c | 7 ide_drive_t *drive = to_ide_device(dev); in generic_ide_suspend() local 8 ide_drive_t *pair = ide_get_pair_dev(drive); in generic_ide_suspend() 9 ide_hwif_t *hwif = drive->hwif; in generic_ide_suspend() 16 if ((drive->dn & 1) == 0 || pair == NULL) in generic_ide_suspend() 21 rq = blk_get_request(drive->queue, READ, __GFP_RECLAIM); in generic_ide_suspend() 29 ret = blk_execute_rq(drive->queue, NULL, rq, 0); in generic_ide_suspend() 34 if ((drive->dn & 1) || pair == NULL) in generic_ide_suspend() 73 ide_drive_t *drive = to_ide_device(dev); in generic_ide_resume() local 74 ide_drive_t *pair = ide_get_pair_dev(drive); in generic_ide_resume() 75 ide_hwif_t *hwif = drive->hwif; in generic_ide_resume() [all …]
|
D | ide-devsets.c | 10 static int set_io_32bit(ide_drive_t *drive, int arg) in set_io_32bit() argument 12 if (drive->dev_flags & IDE_DFLAG_NO_IO_32BIT) in set_io_32bit() 18 drive->io_32bit = arg; in set_io_32bit() 25 static int set_ksettings(ide_drive_t *drive, int arg) in set_ksettings() argument 31 drive->dev_flags |= IDE_DFLAG_KEEP_SETTINGS; in set_ksettings() 33 drive->dev_flags &= ~IDE_DFLAG_KEEP_SETTINGS; in set_ksettings() 40 static int set_using_dma(ide_drive_t *drive, int arg) in set_using_dma() argument 48 if (ata_id_has_dma(drive->id) == 0) in set_using_dma() 51 if (drive->hwif->dma_ops == NULL) in set_using_dma() 57 if (ide_set_dma(drive)) in set_using_dma() [all …]
|
D | ht6560b.c | 47 static inline u8 HT_CONFIG(ide_drive_t *drive) in HT_CONFIG() argument 49 return ((unsigned long)ide_get_drivedata(drive) & 0xff00) >> 8; in HT_CONFIG() 97 static inline u8 HT_TIMING(ide_drive_t *drive) in HT_TIMING() argument 99 return (unsigned long)ide_get_drivedata(drive) & 0x00ff; in HT_TIMING() 114 static void ht6560b_dev_select(ide_drive_t *drive) in ht6560b_dev_select() argument 116 ide_hwif_t *hwif = drive->hwif; in ht6560b_dev_select() 124 select = HT_CONFIG(drive); in ht6560b_dev_select() 125 timing = HT_TIMING(drive); in ht6560b_dev_select() 131 if (drive->media != ide_disk || in ht6560b_dev_select() 132 (drive->dev_flags & IDE_DFLAG_PRESENT) == 0) in ht6560b_dev_select() [all …]
|
D | qd65xx.c | 92 static void qd65xx_dev_select(ide_drive_t *drive) in qd65xx_dev_select() argument 94 u8 index = (( (QD_TIMREG(drive)) & 0x80 ) >> 7) | in qd65xx_dev_select() 95 (QD_TIMREG(drive) & 0x02); in qd65xx_dev_select() 97 if (timings[index] != QD_TIMING(drive)) in qd65xx_dev_select() 98 outb(timings[index] = QD_TIMING(drive), QD_TIMREG(drive)); in qd65xx_dev_select() 100 outb(drive->select | ATA_DEVICE_OBS, drive->hwif->io_ports.device_addr); in qd65xx_dev_select() 150 static int qd_find_disk_type (ide_drive_t *drive, in qd_find_disk_type() argument 154 char *m = (char *)&drive->id[ATA_ID_PROD]; in qd_find_disk_type() 165 printk(KERN_DEBUG "%s: listed !\n", drive->name); in qd_find_disk_type() 180 static void qd_set_timing (ide_drive_t *drive, u8 timing) in qd_set_timing() argument [all …]
|
D | ide-floppy_ioctl.c | 36 static int ide_floppy_get_format_capacities(ide_drive_t *drive, in ide_floppy_get_format_capacities() argument 40 struct ide_disk_obj *floppy = drive->driver_data; in ide_floppy_get_format_capacities() 53 if (ide_queue_pc_tail(drive, floppy->disk, pc, pc_buf, pc->req_xfer)) { in ide_floppy_get_format_capacities() 119 static int ide_floppy_get_sfrp_bit(ide_drive_t *drive, struct ide_atapi_pc *pc) in ide_floppy_get_sfrp_bit() argument 121 struct ide_disk_obj *floppy = drive->driver_data; in ide_floppy_get_sfrp_bit() 124 drive->atapi_flags &= ~IDE_AFLAG_SRFP; in ide_floppy_get_sfrp_bit() 129 if (ide_queue_pc_tail(drive, floppy->disk, pc, buf, pc->req_xfer)) in ide_floppy_get_sfrp_bit() 133 drive->atapi_flags |= IDE_AFLAG_SRFP; in ide_floppy_get_sfrp_bit() 138 static int ide_floppy_format_unit(ide_drive_t *drive, struct ide_atapi_pc *pc, in ide_floppy_format_unit() argument 141 struct ide_disk_obj *floppy = drive->driver_data; in ide_floppy_format_unit() [all …]
|
D | ide-proc.c | 119 ide_drive_t *drive = (ide_drive_t *)m->private; in ide_identify_proc_show() local 122 if (!drive) { in ide_identify_proc_show() 130 if (taskfile_lib_get_identify(drive, buf) == 0) { in ide_identify_proc_show() 192 static int ide_read_setting(ide_drive_t *drive, in ide_read_setting() argument 199 val = ds->get(drive); in ide_read_setting() 222 static int ide_write_setting(ide_drive_t *drive, in ide_write_setting() argument 234 return ide_devset_execute(drive, ds, val); in ide_write_setting() 239 static int set_xfer_rate (ide_drive_t *drive, int arg) in set_xfer_rate() argument 254 return ide_no_data_taskfile(drive, &cmd); in set_xfer_rate() 285 ide_drive_t *drive = (ide_drive_t *) m->private; in ide_settings_proc_show() local [all …]
|
D | sl82c105.c | 42 static unsigned int get_pio_timings(ide_drive_t *drive, u8 pio) in get_pio_timings() argument 49 cmd_off = (ide_pio_cycle_time(drive, pio) - 30 * cmd_on + 29) / 30; in get_pio_timings() 57 if (ide_pio_need_iordy(drive, pio)) in get_pio_timings() 66 static void sl82c105_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive) in sl82c105_set_pio_mode() argument 69 unsigned long timings = (unsigned long)ide_get_drivedata(drive); in sl82c105_set_pio_mode() 70 int reg = 0x44 + drive->dn * 4; in sl82c105_set_pio_mode() 72 const u8 pio = drive->pio_mode - XFER_PIO_0; in sl82c105_set_pio_mode() 74 drv_ctrl = get_pio_timings(drive, pio); in sl82c105_set_pio_mode() 82 ide_set_drivedata(drive, (void *)timings); in sl82c105_set_pio_mode() 87 printk(KERN_DEBUG "%s: selected %s (%dns) (%04X)\n", drive->name, in sl82c105_set_pio_mode() [all …]
|
D | ide-ioctls.c | 19 int ide_setting_ioctl(ide_drive_t *drive, struct block_device *bdev, in ide_setting_ioctl() argument 37 err = ds->get(drive); in ide_setting_ioctl() 49 err = ide_devset_execute(drive, ds, arg); in ide_setting_ioctl() 57 static int ide_get_identity_ioctl(ide_drive_t *drive, unsigned int cmd, in ide_get_identity_ioctl() argument 64 if ((drive->dev_flags & IDE_DFLAG_ID_READ) == 0) { in ide_get_identity_ioctl() 76 memcpy(id, drive->id, size); in ide_get_identity_ioctl() 87 static int ide_get_nice_ioctl(ide_drive_t *drive, unsigned long arg) in ide_get_nice_ioctl() argument 89 return put_user((!!(drive->dev_flags & IDE_DFLAG_DSC_OVERLAP) in ide_get_nice_ioctl() 91 (!!(drive->dev_flags & IDE_DFLAG_NICE1) in ide_get_nice_ioctl() 95 static int ide_set_nice_ioctl(ide_drive_t *drive, unsigned long arg) in ide_set_nice_ioctl() argument [all …]
|
D | it821x.c | 112 static void it821x_program(ide_drive_t *drive, u16 timing) in it821x_program() argument 114 ide_hwif_t *hwif = drive->hwif; in it821x_program() 138 static void it821x_program_udma(ide_drive_t *drive, u16 timing) in it821x_program_udma() argument 140 ide_hwif_t *hwif = drive->hwif; in it821x_program_udma() 144 u8 unit = drive->dn & 1, conf; in it821x_program_udma() 168 static void it821x_clock_strategy(ide_drive_t *drive) in it821x_clock_strategy() argument 170 ide_hwif_t *hwif = drive->hwif; in it821x_clock_strategy() 173 ide_drive_t *pair = ide_get_pair_dev(drive); in it821x_clock_strategy() 175 u8 unit = drive->dn & 1, v; in it821x_clock_strategy() 225 it821x_program_udma(drive, itdev->udma[unit]); in it821x_clock_strategy() [all …]
|
/drivers/block/ |
D | amiflop.c | 125 #define SELMASK(drive) (1 << (3 + (drive & 3))) argument 239 static inline int try_fdc(int drive) in try_fdc() argument 241 drive &= 3; in try_fdc() 242 return ((fdc_busy < 0) || (fdc_busy == drive)); in try_fdc() 245 static void get_fdc(int drive) in get_fdc() argument 249 drive &= 3; in get_fdc() 251 printk("get_fdc: drive %d fdc_busy %d fdc_nested %d\n",drive,fdc_busy,fdc_nested); in get_fdc() 254 wait_event(fdc_wait, try_fdc(drive)); in get_fdc() 255 fdc_busy = drive; in get_fdc() 274 static void fd_select (int drive) in fd_select() argument [all …]
|