Home
last modified time | relevance | path

Searched refs:drive (Results 1 – 25 of 251) sorted by relevance

1234567891011

/linux-2.6.39/drivers/ide/
Dide-dma.c90 ide_startstop_t ide_dma_intr(ide_drive_t *drive) in ide_dma_intr() argument
92 ide_hwif_t *hwif = drive->hwif; in ide_dma_intr()
96 drive->waiting_for_dma = 0; in ide_dma_intr()
97 dma_stat = hwif->dma_ops->dma_end(drive); in ide_dma_intr()
98 ide_dma_unmap_sg(drive, cmd); in ide_dma_intr()
101 if (OK_STAT(stat, DRIVE_READY, drive->bad_wstat | ATA_DRQ)) { in ide_dma_intr()
104 ide_finish_cmd(drive, cmd, stat); in ide_dma_intr()
106 ide_complete_rq(drive, 0, in ide_dma_intr()
111 drive->name, __func__, dma_stat); in ide_dma_intr()
113 return ide_error(drive, "dma_intr", stat); in ide_dma_intr()
[all …]
Dide-disk.c55 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 …]
Dide-atapi.c26 static inline int dev_is_idecd(ide_drive_t *drive) in dev_is_idecd() argument
28 return drive->media == ide_cdrom || drive->media == ide_optical; in dev_is_idecd()
35 int ide_check_atapi_device(ide_drive_t *drive, const char *s) in ide_check_atapi_device() argument
37 u16 *id = drive->id; in ide_check_atapi_device()
50 if (drive->media == ide_floppy && device_type == 5 && in ide_check_atapi_device()
58 s, drive->name, protocol); in ide_check_atapi_device()
59 else if ((drive->media == ide_floppy && device_type != 0) || in ide_check_atapi_device()
60 (drive->media == ide_tape && device_type != 1)) in ide_check_atapi_device()
62 s, drive->name, device_type); in ide_check_atapi_device()
65 s, drive->name); in ide_check_atapi_device()
[all …]
Dide-gd.c40 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 …]
Dide-eh.c6 static ide_startstop_t ide_ata_error(ide_drive_t *drive, struct request *rq, in ide_ata_error() argument
9 ide_hwif_t *hwif = drive->hwif; in ide_ata_error()
12 ((stat & ATA_DF) && (drive->dev_flags & IDE_DFLAG_NOWERR) == 0)) { in ide_ata_error()
18 if ((drive->dev_flags & IDE_DFLAG_LBA) && in ide_ata_error()
24 drive->crc_count++; in ide_ata_error()
36 int nsect = drive->mult_count ? drive->mult_count : 1; in ide_ata_error()
38 ide_pad_transfer(drive, READ, nsect * SECTOR_SIZE); in ide_ata_error()
42 ide_kill_rq(drive, rq); in ide_ata_error()
51 return ide_do_reset(drive); in ide_ata_error()
55 drive->special_flags |= IDE_SFLAG_RECALIBRATE; in ide_ata_error()
[all …]
Dide-io.c57 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 …]
Dide-probe.c51 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 …]
Dide-floppy.c63 static int ide_floppy_callback(ide_drive_t *drive, int dsc) in ide_floppy_callback() argument
65 struct ide_disk_obj *floppy = drive->driver_data; in ide_floppy_callback()
66 struct ide_atapi_pc *pc = drive->pc; in ide_floppy_callback()
72 if (drive->failed_pc == pc) in ide_floppy_callback()
73 drive->failed_pc = NULL; in ide_floppy_callback()
89 if (drive->failed_pc) in ide_floppy_callback()
91 drive->failed_pc->c[0]); in ide_floppy_callback()
118 floppy->drive->name, pc->c[0], floppy->sense_key, in ide_floppy_report_error()
123 static ide_startstop_t ide_floppy_issue_pc(ide_drive_t *drive, in ide_floppy_issue_pc() argument
127 struct ide_disk_obj *floppy = drive->driver_data; in ide_floppy_issue_pc()
[all …]
Dide-tape.c142 ide_drive_t *drive; member
245 if (ide_device_get(tape->drive)) in ide_tape_get()
257 ide_drive_t *drive = tape->drive; in ide_tape_put() local
261 ide_device_put(drive); in ide_tape_put()
269 static void idetape_analyze_error(ide_drive_t *drive) in idetape_analyze_error() argument
271 idetape_tape_t *tape = drive->driver_data; in idetape_analyze_error()
272 struct ide_atapi_pc *pc = drive->failed_pc; in idetape_analyze_error()
273 struct request *rq = drive->hwif->rq; in idetape_analyze_error()
327 static int ide_tape_callback(ide_drive_t *drive, int dsc) in ide_tape_callback() argument
329 idetape_tape_t *tape = drive->driver_data; in ide_tape_callback()
[all …]
Dide-iops.c30 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 …]
Dide-pm.c7 ide_drive_t *drive = dev_get_drvdata(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_WAIT); 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()
43 ide_drive_t *drive = dev_get_drvdata(dev); in generic_ide_resume() local
44 ide_drive_t *pair = ide_get_pair_dev(drive); in generic_ide_resume()
45 ide_hwif_t *hwif = drive->hwif; in generic_ide_resume()
[all …]
Dide-xfer-mode.c61 static u8 ide_get_best_pio_mode(ide_drive_t *drive, u8 mode_wanted, u8 max_mode) in ide_get_best_pio_mode() argument
63 u16 *id = drive->id; in ide_get_best_pio_mode()
69 if ((drive->hwif->host_flags & IDE_HFLAG_PIO_NO_BLACKLIST) == 0) in ide_get_best_pio_mode()
73 printk(KERN_INFO "%s: is on PIO blacklist\n", drive->name); in ide_get_best_pio_mode()
100 drive->name); in ide_get_best_pio_mode()
109 int ide_pio_need_iordy(ide_drive_t *drive, const u8 pio) in ide_pio_need_iordy() argument
115 if (pio == 0 && (drive->hwif->port_flags & IDE_PFLAG_PROBING)) in ide_pio_need_iordy()
117 return ata_id_pio_need_iordy(drive->id, pio); in ide_pio_need_iordy()
121 int ide_set_pio_mode(ide_drive_t *drive, const u8 mode) in ide_set_pio_mode() argument
123 ide_hwif_t *hwif = drive->hwif; in ide_set_pio_mode()
[all …]
Dide-cd.c66 if (ide_device_get(cd->drive)) in ide_cd_get()
78 ide_drive_t *drive = cd->drive; in ide_cd_put() local
82 ide_device_put(drive); in ide_cd_put()
91 static void cdrom_saw_media_change(ide_drive_t *drive) in cdrom_saw_media_change() argument
93 drive->dev_flags |= IDE_DFLAG_MEDIA_CHANGED; in cdrom_saw_media_change()
94 drive->atapi_flags &= ~IDE_AFLAG_TOC_VALID; in cdrom_saw_media_change()
97 static int cdrom_log_sense(ide_drive_t *drive, struct request *rq) in cdrom_log_sense() argument
99 struct request_sense *sense = &drive->sense_data; in cdrom_log_sense()
135 cdrom_saw_media_change(drive); in cdrom_log_sense()
144 static void cdrom_analyze_sense_data(ide_drive_t *drive, in cdrom_analyze_sense_data() argument
[all …]
Dide-cd_ioctl.c30 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 …]
Dide.c71 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()
107 put_device(&drive->gendev); in ide_device_put()
118 ide_drive_t *drive = to_ide_device(dev); in ide_uevent() local
120 add_uevent_var(env, "MEDIA=%s", ide_media_string(drive)); in ide_uevent()
121 add_uevent_var(env, "DRIVENAME=%s", drive->name); in ide_uevent()
[all …]
Dide-taskfile.c26 void ide_tf_readback(ide_drive_t *drive, struct ide_cmd *cmd) in ide_tf_readback() argument
28 ide_hwif_t *hwif = drive->hwif; in ide_tf_readback()
34 tp_ops->tf_read(drive, &cmd->tf, cmd->valid.in.tf); in ide_tf_readback()
39 tp_ops->tf_read(drive, &cmd->hob, cmd->valid.in.hob); in ide_tf_readback()
56 int taskfile_lib_get_identify(ide_drive_t *drive, u8 *buf) in taskfile_lib_get_identify() argument
62 if (drive->media == ide_disk) in taskfile_lib_get_identify()
70 return ide_raw_taskfile(drive, &cmd, buf, 1); in taskfile_lib_get_identify()
77 ide_startstop_t do_rw_taskfile(ide_drive_t *drive, struct ide_cmd *orig_cmd) in do_rw_taskfile() argument
79 ide_hwif_t *hwif = drive->hwif; in do_rw_taskfile()
88 drive->mult_count == 0) { in do_rw_taskfile()
[all …]
Dide-devsets.c10 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 …]
Dht6560b.c47 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 …]
Dide-floppy_ioctl.c36 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 …]
Dqd65xx.c93 static void qd65xx_dev_select(ide_drive_t *drive) in qd65xx_dev_select() argument
95 u8 index = (( (QD_TIMREG(drive)) & 0x80 ) >> 7) | in qd65xx_dev_select()
96 (QD_TIMREG(drive) & 0x02); in qd65xx_dev_select()
98 if (timings[index] != QD_TIMING(drive)) in qd65xx_dev_select()
99 outb(timings[index] = QD_TIMING(drive), QD_TIMREG(drive)); in qd65xx_dev_select()
101 outb(drive->select | ATA_DEVICE_OBS, drive->hwif->io_ports.device_addr); in qd65xx_dev_select()
151 static int qd_find_disk_type (ide_drive_t *drive, in qd_find_disk_type() argument
155 char *m = (char *)&drive->id[ATA_ID_PROD]; in qd_find_disk_type()
166 printk(KERN_DEBUG "%s: listed !\n", drive->name); in qd_find_disk_type()
181 static void qd_set_timing (ide_drive_t *drive, u8 timing) in qd_set_timing() argument
[all …]
Dsl82c105.c42 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 …]
Dide-ioctls.c18 int ide_setting_ioctl(ide_drive_t *drive, struct block_device *bdev, in ide_setting_ioctl() argument
36 err = ds->get(drive); in ide_setting_ioctl()
48 err = ide_devset_execute(drive, ds, arg); in ide_setting_ioctl()
56 static int ide_get_identity_ioctl(ide_drive_t *drive, unsigned int cmd, in ide_get_identity_ioctl() argument
63 if ((drive->dev_flags & IDE_DFLAG_ID_READ) == 0) { in ide_get_identity_ioctl()
75 memcpy(id, drive->id, size); in ide_get_identity_ioctl()
86 static int ide_get_nice_ioctl(ide_drive_t *drive, unsigned long arg) in ide_get_nice_ioctl() argument
88 return put_user((!!(drive->dev_flags & IDE_DFLAG_DSC_OVERLAP) in ide_get_nice_ioctl()
90 (!!(drive->dev_flags & IDE_DFLAG_NICE1) in ide_get_nice_ioctl()
94 static int ide_set_nice_ioctl(ide_drive_t *drive, unsigned long arg) in ide_set_nice_ioctl() argument
[all …]
Dide-park.c9 static void issue_park_cmd(ide_drive_t *drive, unsigned long timeout) in issue_park_cmd() argument
11 ide_hwif_t *hwif = drive->hwif; in issue_park_cmd()
12 struct request_queue *q = drive->queue; in issue_park_cmd()
18 if (drive->dev_flags & IDE_DFLAG_PARKED) { in issue_park_cmd()
19 int reset_timer = time_before(timeout, drive->sleep); in issue_park_cmd()
22 drive->sleep = timeout; in issue_park_cmd()
61 ide_startstop_t ide_do_park_unpark(ide_drive_t *drive, struct request *rq) in ide_do_park_unpark() argument
68 drive->sleep = *(unsigned long *)rq->special; in ide_do_park_unpark()
69 drive->dev_flags |= IDE_DFLAG_SLEEPING; in ide_do_park_unpark()
85 return do_rw_taskfile(drive, &cmd); in ide_do_park_unpark()
[all …]
/linux-2.6.39/drivers/block/
Damiflop.c125 #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 …]
Dxd.c395 int drive = p->unit; in xd_readwrite() local
403 …er = 0x%X, block = %d, count = %d\n",operation == READ ? "read" : "write",drive,buffer,block,count… in xd_readwrite()
420 …printk("xd_readwrite: drive = %d, head = %d, cylinder = %d, sector = %d, count = %d\n",drive,head,… in xd_readwrite()
432 …xd_build(cmdblk,operation == READ ? CMD_READ : CMD_WRITE,drive,head,cylinder,sector,temp & 0xFF,co… in xd_readwrite()
436 …printk("xd%c: %s timeout, recalibrating drive\n",'a'+drive,(operation == READ ? "read" : "write")); in xd_readwrite()
437 xd_recalibrate(drive); in xd_readwrite()
442 printk("xd%c: %s - ",'a'+drive,(operation == READ ? "reading" : "writing")); in xd_readwrite()
473 static void xd_recalibrate (u_char drive) in xd_recalibrate() argument
477 xd_build(cmdblk,CMD_RECALIBRATE,drive,0,0,0,0,0); in xd_recalibrate()
479 printk("xd%c: warning! error recalibrating, controller may be unstable\n", 'a'+drive); in xd_recalibrate()
[all …]

1234567891011