Lines Matching full:drive
51 * ide_get_best_pio_mode - get PIO mode from drive
52 * @drive: drive to consider
56 * This routine returns the recommended PIO settings for a given drive,
57 * based on the drive->id information and the ide_pio_blacklist[].
59 * Drive PIO mode is auto-selected if 255 is passed as mode_wanted.
63 static u8 ide_get_best_pio_mode(ide_drive_t *drive, u8 mode_wanted, u8 max_mode) in ide_get_best_pio_mode() argument
65 u16 *id = drive->id; in ide_get_best_pio_mode()
71 if ((drive->hwif->host_flags & IDE_HFLAG_PIO_NO_BLACKLIST) == 0) in ide_get_best_pio_mode()
75 printk(KERN_INFO "%s: is on PIO blacklist\n", drive->name); in ide_get_best_pio_mode()
102 drive->name); in ide_get_best_pio_mode()
111 int ide_pio_need_iordy(ide_drive_t *drive, const u8 pio) in ide_pio_need_iordy() argument
117 if (pio == 0 && (drive->hwif->port_flags & IDE_PFLAG_PROBING)) in ide_pio_need_iordy()
119 return ata_id_pio_need_iordy(drive->id, pio); in ide_pio_need_iordy()
123 int ide_set_pio_mode(ide_drive_t *drive, const u8 mode) in ide_set_pio_mode() argument
125 ide_hwif_t *hwif = drive->hwif; in ide_set_pio_mode()
139 drive->pio_mode = mode; in ide_set_pio_mode()
140 port_ops->set_pio_mode(hwif, drive); in ide_set_pio_mode()
145 if (ide_config_drive_speed(drive, mode)) in ide_set_pio_mode()
147 drive->pio_mode = mode; in ide_set_pio_mode()
148 port_ops->set_pio_mode(hwif, drive); in ide_set_pio_mode()
151 drive->pio_mode = mode; in ide_set_pio_mode()
152 port_ops->set_pio_mode(hwif, drive); in ide_set_pio_mode()
153 return ide_config_drive_speed(drive, mode); in ide_set_pio_mode()
157 int ide_set_dma_mode(ide_drive_t *drive, const u8 mode) in ide_set_dma_mode() argument
159 ide_hwif_t *hwif = drive->hwif; in ide_set_dma_mode()
169 if (ide_config_drive_speed(drive, mode)) in ide_set_dma_mode()
171 drive->dma_mode = mode; in ide_set_dma_mode()
172 port_ops->set_dma_mode(hwif, drive); in ide_set_dma_mode()
175 drive->dma_mode = mode; in ide_set_dma_mode()
176 port_ops->set_dma_mode(hwif, drive); in ide_set_dma_mode()
177 return ide_config_drive_speed(drive, mode); in ide_set_dma_mode()
183 void ide_set_pio(ide_drive_t *drive, u8 req_pio) in ide_set_pio() argument
185 ide_hwif_t *hwif = drive->hwif; in ide_set_pio()
197 pio = ide_get_best_pio_mode(drive, req_pio, host_pio); in ide_set_pio()
205 drive->name, host_pio, req_pio, in ide_set_pio()
208 (void)ide_set_pio_mode(drive, XFER_PIO_0 + pio); in ide_set_pio()
214 * @drive: IDE device
223 static u8 ide_rate_filter(ide_drive_t *drive, u8 speed) in ide_rate_filter() argument
225 ide_hwif_t *hwif = drive->hwif; in ide_rate_filter()
226 u8 mode = ide_find_dma_mode(drive, speed); in ide_rate_filter()
242 * @drive: drive to set
250 int ide_set_xfer_rate(ide_drive_t *drive, u8 rate) in ide_set_xfer_rate() argument
252 ide_hwif_t *hwif = drive->hwif; in ide_set_xfer_rate()
259 rate = ide_rate_filter(drive, rate); in ide_set_xfer_rate()
264 return ide_set_pio_mode(drive, rate); in ide_set_xfer_rate()
266 return ide_set_dma_mode(drive, rate); in ide_set_xfer_rate()