drive             261 arch/m68k/include/asm/sun3xflop.h #define fd_eject(drive) sun3x_eject()
drive              55 arch/mips/include/asm/mach-au1x00/au1xxx_ide.h 	ide_drive_t		*drive;
drive             378 arch/sparc/include/asm/floppy_32.h #define fd_eject(drive) sparc_eject()
drive              78 arch/sparc/include/asm/floppy_64.h #define fd_eject(drive)           sun_fdops.fd_eject(drive)
drive             274 arch/sparc/include/asm/floppy_64.h static int sun_fd_eject(int drive)
drive             427 arch/sparc/include/asm/floppy_64.h static int sun_pci_fd_eject(int drive)
drive             498 arch/sparc/include/asm/floppy_64.h static int sun_pci_fd_test_drive(unsigned long port, int drive)
drive             506 arch/sparc/include/asm/floppy_64.h 	data = (0x10 << drive) | 0x0c | drive;
drive             510 arch/sparc/include/asm/floppy_64.h 	sun_pci_fd_out_byte(port, drive & 0x03, FIFO);
drive             505 drivers/ata/libata-acpi.c 	mode = ata_timing_cycle2mode(ATA_SHIFT_PIO, gtm->drive[unit].pio);
drive             517 drivers/ata/libata-acpi.c 	mode = ata_timing_cycle2mode(type, gtm->drive[unit].dma);
drive             123 drivers/ata/pata_acpi.c 	acpi->gtm.drive[unit].pio = t->cycle;
drive             147 drivers/ata/pata_acpi.c 		acpi->gtm.drive[unit].dma = t->udma;
drive             150 drivers/ata/pata_acpi.c 		acpi->gtm.drive[unit].dma = t->cycle;
drive             297 drivers/ata/pata_amd.c 			 gtm->drive[0].dma, gtm->drive[1].dma, gtm->flags);
drive             244 drivers/block/amiflop.c #define SELMASK(drive)  (1 << (3 + (drive & 3)))
drive             358 drivers/block/amiflop.c static inline int try_fdc(int drive)
drive             360 drivers/block/amiflop.c 	drive &= 3;
drive             361 drivers/block/amiflop.c 	return ((fdc_busy < 0) || (fdc_busy == drive));
drive             364 drivers/block/amiflop.c static void get_fdc(int drive)
drive             368 drivers/block/amiflop.c 	drive &= 3;
drive             370 drivers/block/amiflop.c 	printk("get_fdc: drive %d  fdc_busy %d  fdc_nested %d\n",drive,fdc_busy,fdc_nested);
drive             373 drivers/block/amiflop.c 	wait_event(fdc_wait, try_fdc(drive));
drive             374 drivers/block/amiflop.c 	fdc_busy = drive;
drive             393 drivers/block/amiflop.c static void fd_select (int drive)
drive             397 drivers/block/amiflop.c 	drive&=3;
drive             399 drivers/block/amiflop.c 	printk("selecting %d\n",drive);
drive             401 drivers/block/amiflop.c 	if (drive == selected)
drive             403 drivers/block/amiflop.c 	get_fdc(drive);
drive             404 drivers/block/amiflop.c 	selected = drive;
drive             406 drivers/block/amiflop.c 	if (unit[drive].track % 2 != 0)
drive             408 drivers/block/amiflop.c 	if (unit[drive].motor == 1)
drive             412 drivers/block/amiflop.c 	prb &= ~SELMASK(drive);
drive             417 drivers/block/amiflop.c static void fd_deselect (int drive)
drive             422 drivers/block/amiflop.c 	drive&=3;
drive             424 drivers/block/amiflop.c 	printk("deselecting %d\n",drive);
drive             426 drivers/block/amiflop.c 	if (drive != selected) {
drive             427 drivers/block/amiflop.c 		printk(KERN_WARNING "Deselecting drive %d while %d was selected!\n",drive,selected);
drive             431 drivers/block/amiflop.c 	get_fdc(drive);
drive             489 drivers/block/amiflop.c 	unsigned long drive = ((unsigned long)timer -
drive             493 drivers/block/amiflop.c 	drive&=3;
drive             494 drivers/block/amiflop.c 	if (!try_fdc(drive)) {
drive             500 drivers/block/amiflop.c 	unit[drive].motor = 0;
drive             501 drivers/block/amiflop.c 	fd_select(drive);
drive             503 drivers/block/amiflop.c 	fd_deselect(drive);
drive             508 drivers/block/amiflop.c 	int drive;
drive             510 drivers/block/amiflop.c 	drive = nr & 3;
drive             511 drivers/block/amiflop.c 	mod_timer(motor_off_timer + drive, jiffies + 3*HZ);
drive             514 drivers/block/amiflop.c static int fd_calibrate(int drive)
drive             519 drivers/block/amiflop.c 	drive &= 3;
drive             520 drivers/block/amiflop.c 	get_fdc(drive);
drive             521 drivers/block/amiflop.c 	if (!fd_motor_on (drive))
drive             523 drivers/block/amiflop.c 	fd_select (drive);
drive             528 drivers/block/amiflop.c 	for (n = unit[drive].type->tracks/2; n != 0; --n) {
drive             536 drivers/block/amiflop.c 		ms_delay(unit[drive].type->step_delay);
drive             538 drivers/block/amiflop.c 	ms_delay (unit[drive].type->settle_time);
drive             540 drivers/block/amiflop.c 	n = unit[drive].type->tracks + 20;
drive             547 drivers/block/amiflop.c 		ms_delay(unit[drive].type->step_delay + 1);
drive             551 drivers/block/amiflop.c 			printk (KERN_ERR "fd%d: calibrate failed, turning motor off\n", drive);
drive             552 drivers/block/amiflop.c 			fd_motor_off (motor_off_timer + drive);
drive             553 drivers/block/amiflop.c 			unit[drive].track = -1;
drive             558 drivers/block/amiflop.c 	unit[drive].track = 0;
drive             559 drivers/block/amiflop.c 	ms_delay(unit[drive].type->settle_time);
drive             562 drivers/block/amiflop.c 	fd_deselect(drive);
drive             566 drivers/block/amiflop.c static int fd_seek(int drive, int track)
drive             572 drivers/block/amiflop.c 	printk("seeking drive %d to track %d\n",drive,track);
drive             574 drivers/block/amiflop.c 	drive &= 3;
drive             575 drivers/block/amiflop.c 	get_fdc(drive);
drive             576 drivers/block/amiflop.c 	if (unit[drive].track == track) {
drive             580 drivers/block/amiflop.c 	if (!fd_motor_on(drive)) {
drive             584 drivers/block/amiflop.c 	if (unit[drive].track < 0 && !fd_calibrate(drive)) {
drive             589 drivers/block/amiflop.c 	fd_select (drive);
drive             590 drivers/block/amiflop.c 	cnt = unit[drive].track/2 - track/2;
drive             600 drivers/block/amiflop.c 	if (track % 2 != unit[drive].track % 2)
drive             601 drivers/block/amiflop.c 		ms_delay (unit[drive].type->side_time);
drive             602 drivers/block/amiflop.c 	unit[drive].track = track;
drive             605 drivers/block/amiflop.c 		fd_deselect(drive);
drive             614 drivers/block/amiflop.c 		ms_delay (unit[drive].type->step_delay);
drive             616 drivers/block/amiflop.c 	ms_delay (unit[drive].type->settle_time);
drive             619 drivers/block/amiflop.c 	fd_deselect(drive);
drive             623 drivers/block/amiflop.c static unsigned long fd_get_drive_id(int drive)
drive             628 drivers/block/amiflop.c   	drive&=3;
drive             629 drivers/block/amiflop.c   	get_fdc(drive);
drive             633 drivers/block/amiflop.c 	SELECT(SELMASK(drive));
drive             635 drivers/block/amiflop.c 	DESELECT(SELMASK(drive));
drive             639 drivers/block/amiflop.c 	SELECT(SELMASK(drive));
drive             641 drivers/block/amiflop.c 	DESELECT(SELMASK(drive));
drive             646 drivers/block/amiflop.c 		SELECT(SELMASK(drive));
drive             653 drivers/block/amiflop.c 		DESELECT(SELMASK(drive));
drive             664 drivers/block/amiflop.c         if(drive == 0 && id == FD_NODRIVE)
drive             691 drivers/block/amiflop.c static void raw_read(int drive)
drive             693 drivers/block/amiflop.c 	drive&=3;
drive             694 drivers/block/amiflop.c 	get_fdc(drive);
drive             696 drivers/block/amiflop.c 	fd_select(drive);
drive             705 drivers/block/amiflop.c 	custom.dsklen = unit[drive].type->read_size/sizeof(short) | DSKLEN_DMAEN;
drive             706 drivers/block/amiflop.c 	custom.dsklen = unit[drive].type->read_size/sizeof(short) | DSKLEN_DMAEN;
drive             713 drivers/block/amiflop.c 	fd_deselect(drive);
drive             717 drivers/block/amiflop.c static int raw_write(int drive)
drive             721 drivers/block/amiflop.c 	drive&=3;
drive             722 drivers/block/amiflop.c 	get_fdc(drive); /* corresponds to rel_fdc() in post_write() */
drive             728 drivers/block/amiflop.c 	fd_select(drive);
drive             733 drivers/block/amiflop.c 	if ((ulong)unit[drive].track >= unit[drive].type->precomp2)
drive             735 drivers/block/amiflop.c 	else if ((ulong)unit[drive].track >= unit[drive].type->precomp1)
drive             741 drivers/block/amiflop.c 	custom.dsklen = unit[drive].type->write_size/sizeof(short) | DSKLEN_DMAEN|DSKLEN_WRITE;
drive             742 drivers/block/amiflop.c 	custom.dsklen = unit[drive].type->write_size/sizeof(short) | DSKLEN_DMAEN|DSKLEN_WRITE;
drive             752 drivers/block/amiflop.c static void post_write (unsigned long drive)
drive             755 drivers/block/amiflop.c 	printk("post_write for drive %ld\n",drive);
drive             757 drivers/block/amiflop.c 	drive &= 3;
drive             762 drivers/block/amiflop.c 	unit[drive].dirty = 0;
drive             764 drivers/block/amiflop.c 	fd_deselect(drive);
drive             835 drivers/block/amiflop.c static int amiga_read(int drive)
drive             843 drivers/block/amiflop.c 	drive&=3;
drive             845 drivers/block/amiflop.c 	end = raw + unit[drive].type->read_size;
drive             847 drivers/block/amiflop.c 	for (scnt = 0;scnt < unit[drive].dtype->sects * unit[drive].type->sect_mult; scnt++) {
drive             874 drivers/block/amiflop.c 		if (hdr.track != unit[drive].track) {
drive             875 drivers/block/amiflop.c 			printk(KERN_INFO "MFM_TRACK: %d, %d\n", hdr.track, unit[drive].track);
drive             879 drivers/block/amiflop.c 		raw = decode ((ulong *)(unit[drive].trackbuf + hdr.sect*512),
drive             881 drivers/block/amiflop.c 		csum = checksum((ulong *)(unit[drive].trackbuf + hdr.sect*512), 512);
drive             888 drivers/block/amiflop.c 				((ulong *)(unit[drive].trackbuf+hdr.sect*512))[0],
drive             889 drivers/block/amiflop.c 				((ulong *)(unit[drive].trackbuf+hdr.sect*512))[1],
drive             890 drivers/block/amiflop.c 				((ulong *)(unit[drive].trackbuf+hdr.sect*512))[2],
drive             891 drivers/block/amiflop.c 				((ulong *)(unit[drive].trackbuf+hdr.sect*512))[3]);
drive            1150 drivers/block/amiflop.c static int dos_read(int drive)
drive            1158 drivers/block/amiflop.c 	drive&=3;
drive            1160 drivers/block/amiflop.c 	end = raw + unit[drive].type->read_size;
drive            1162 drivers/block/amiflop.c 	for (scnt=0; scnt < unit[drive].dtype->sects * unit[drive].type->sect_mult; scnt++) {
drive            1167 drivers/block/amiflop.c 				       unit[drive].track,drive,scnt);
drive            1188 drivers/block/amiflop.c 		if (hdr.track != unit[drive].track/unit[drive].type->heads) {
drive            1191 drivers/block/amiflop.c 			       unit[drive].track/unit[drive].type->heads);
drive            1195 drivers/block/amiflop.c 		if (hdr.side != unit[drive].track%unit[drive].type->heads) {
drive            1198 drivers/block/amiflop.c 			       unit[drive].track%unit[drive].type->heads);
drive            1213 drivers/block/amiflop.c 			       unit[drive].track, drive, scnt, hdr.sec);
drive            1228 drivers/block/amiflop.c 		raw = dos_decode((unsigned char *)(unit[drive].trackbuf + (hdr.sec - 1) * 512), (ushort *) raw, 512);
drive            1230 drivers/block/amiflop.c 		crc = dos_data_crc(unit[drive].trackbuf + (hdr.sec - 1) * 512);
drive            1237 drivers/block/amiflop.c 			       ((ulong *)(unit[drive].trackbuf+(hdr.sec-1)*512))[0],
drive            1238 drivers/block/amiflop.c 			       ((ulong *)(unit[drive].trackbuf+(hdr.sec-1)*512))[1],
drive            1239 drivers/block/amiflop.c 			       ((ulong *)(unit[drive].trackbuf+(hdr.sec-1)*512))[2],
drive            1240 drivers/block/amiflop.c 			       ((ulong *)(unit[drive].trackbuf+(hdr.sec-1)*512))[3]);
drive            1271 drivers/block/amiflop.c static unsigned long *ms_putsec(int drive, unsigned long *raw, int cnt)
drive            1278 drivers/block/amiflop.c 	drive&=3;
drive            1288 drivers/block/amiflop.c 	hdr.track=unit[drive].track/unit[drive].type->heads;
drive            1289 drivers/block/amiflop.c 	hdr.side=unit[drive].track%unit[drive].type->heads;
drive            1307 drivers/block/amiflop.c 			 (unsigned char *)unit[drive].trackbuf+cnt*512,512);
drive            1311 drivers/block/amiflop.c 	crc[0]=dos_data_crc(unit[drive].trackbuf+cnt*512);
drive            1423 drivers/block/amiflop.c static int get_track(int drive, int track)
drive            1427 drivers/block/amiflop.c 	drive&=3;
drive            1428 drivers/block/amiflop.c 	if (unit[drive].track == track)
drive            1430 drivers/block/amiflop.c 	get_fdc(drive);
drive            1431 drivers/block/amiflop.c 	if (!fd_motor_on(drive)) {
drive            1436 drivers/block/amiflop.c 	if (unit[drive].dirty == 1) {
drive            1437 drivers/block/amiflop.c 		del_timer (flush_track_timer + drive);
drive            1438 drivers/block/amiflop.c 		non_int_flush_track (drive);
drive            1442 drivers/block/amiflop.c 		if (!fd_seek(drive, track))
drive            1444 drivers/block/amiflop.c 		raw_read(drive);
drive            1445 drivers/block/amiflop.c 		error = (*unit[drive].dtype->read_fkt)(drive);
drive            1451 drivers/block/amiflop.c 		unit[drive].track = -1;
drive            1461 drivers/block/amiflop.c 	int drive = floppy - unit;
drive            1480 drivers/block/amiflop.c 		if (get_track(drive, track) == -1)
drive            1489 drivers/block/amiflop.c 			if (!fd_motor_on(drive))
drive            1497 drivers/block/amiflop.c 			mod_timer (flush_track_timer + drive, jiffies + 1);
drive            1527 drivers/block/amiflop.c 	int drive = MINOR(bdev->bd_dev) & 3;
drive            1529 drivers/block/amiflop.c 	geo->heads = unit[drive].type->heads;
drive            1530 drivers/block/amiflop.c 	geo->sectors = unit[drive].dtype->sects * unit[drive].type->sect_mult;
drive            1531 drivers/block/amiflop.c 	geo->cylinders = unit[drive].type->tracks;
drive            1539 drivers/block/amiflop.c 	int drive = p - unit;
drive            1545 drivers/block/amiflop.c 		get_fdc(drive);
drive            1546 drivers/block/amiflop.c 		if (fd_ref[drive] > 1) {
drive            1551 drivers/block/amiflop.c 		if (fd_motor_on(drive) == 0) {
drive            1555 drivers/block/amiflop.c 		if (fd_calibrate(drive) == 0) {
drive            1559 drivers/block/amiflop.c 		floppy_off(drive);
drive            1565 drivers/block/amiflop.c 			get_fdc(drive);
drive            1566 drivers/block/amiflop.c 			if (fd_seek(drive,param) != 0){
drive            1569 drivers/block/amiflop.c 				non_int_flush_track(drive);
drive            1571 drivers/block/amiflop.c 			floppy_off(drive);
drive            1578 drivers/block/amiflop.c 		floppy_off(drive);
drive            1594 drivers/block/amiflop.c 		del_timer (flush_track_timer + drive);
drive            1595 drivers/block/amiflop.c 		non_int_flush_track(drive);
drive            1626 drivers/block/amiflop.c 	int drive;
drive            1628 drivers/block/amiflop.c 	drive = dev & 3;
drive            1629 drivers/block/amiflop.c 	code = fd_get_drive_id(drive);
drive            1639 drivers/block/amiflop.c 		unit[drive].type = &drive_types[num_dr_types-1]; /* FD_NODRIVE */
drive            1643 drivers/block/amiflop.c 	unit[drive].type = drive_types + type;
drive            1644 drivers/block/amiflop.c 	unit[drive].track = -1;
drive            1646 drivers/block/amiflop.c 	unit[drive].disk = -1;
drive            1647 drivers/block/amiflop.c 	unit[drive].motor = 0;
drive            1648 drivers/block/amiflop.c 	unit[drive].busy = 0;
drive            1649 drivers/block/amiflop.c 	unit[drive].status = -1;
drive            1659 drivers/block/amiflop.c 	int drive = MINOR(bdev->bd_dev) & 3;
drive            1665 drivers/block/amiflop.c 	old_dev = fd_device[drive];
drive            1667 drivers/block/amiflop.c 	if (fd_ref[drive] && old_dev != system) {
drive            1677 drivers/block/amiflop.c 			get_fdc(drive);
drive            1678 drivers/block/amiflop.c 			fd_select (drive);
drive            1680 drivers/block/amiflop.c 			fd_deselect (drive);
drive            1691 drivers/block/amiflop.c 	fd_ref[drive]++;
drive            1692 drivers/block/amiflop.c 	fd_device[drive] = system;
drive            1695 drivers/block/amiflop.c 	unit[drive].dtype=&data_types[system];
drive            1696 drivers/block/amiflop.c 	unit[drive].blocks=unit[drive].type->heads*unit[drive].type->tracks*
drive            1697 drivers/block/amiflop.c 		data_types[system].sects*unit[drive].type->sect_mult;
drive            1698 drivers/block/amiflop.c 	set_capacity(unit[drive].gendisk, unit[drive].blocks);
drive            1700 drivers/block/amiflop.c 	printk(KERN_INFO "fd%d: accessing %s-disk with %s-layout\n",drive,
drive            1701 drivers/block/amiflop.c 	       unit[drive].type->name, data_types[system].name);
drive            1710 drivers/block/amiflop.c 	int drive = p - unit;
drive            1713 drivers/block/amiflop.c 	if (unit[drive].dirty == 1) {
drive            1714 drivers/block/amiflop.c 		del_timer (flush_track_timer + drive);
drive            1715 drivers/block/amiflop.c 		non_int_flush_track (drive);
drive            1718 drivers/block/amiflop.c 	if (!fd_ref[drive]--) {
drive            1720 drivers/block/amiflop.c 		fd_ref[drive] = 0;
drive            1723 drivers/block/amiflop.c 	floppy_off (drive);
drive            1737 drivers/block/amiflop.c 	int drive = p - unit;
drive            1744 drivers/block/amiflop.c 		get_fdc(drive);
drive            1745 drivers/block/amiflop.c 		fd_select (drive);
drive            1747 drivers/block/amiflop.c 		fd_deselect (drive);
drive            1752 drivers/block/amiflop.c 		fd_probe(drive);
drive            1775 drivers/block/amiflop.c static struct gendisk *fd_alloc_disk(int drive)
drive            1783 drivers/block/amiflop.c 	disk->queue = blk_mq_init_sq_queue(&unit[drive].tag_set, &amiflop_mq_ops,
drive            1790 drivers/block/amiflop.c 	unit[drive].trackbuf = kmalloc(FLOPPY_MAX_SECTORS * 512, GFP_KERNEL);
drive            1791 drivers/block/amiflop.c 	if (!unit[drive].trackbuf)
drive            1799 drivers/block/amiflop.c 	blk_mq_free_tag_set(&unit[drive].tag_set);
drive            1803 drivers/block/amiflop.c 	unit[drive].type->code = FD_NODRIVE;
drive            1809 drivers/block/amiflop.c 	int drive,drives,nomem;
drive            1814 drivers/block/amiflop.c 	for(drive=0;drive<FD_MAX_UNITS;drive++) {
drive            1816 drivers/block/amiflop.c 		fd_probe(drive);
drive            1817 drivers/block/amiflop.c 		if (unit[drive].type->code == FD_NODRIVE)
drive            1820 drivers/block/amiflop.c 		disk = fd_alloc_disk(drive);
drive            1822 drivers/block/amiflop.c 			pr_cont(" no mem for fd%d", drive);
drive            1826 drivers/block/amiflop.c 		unit[drive].gendisk = disk;
drive            1829 drivers/block/amiflop.c 		pr_cont(" fd%d",drive);
drive            1831 drivers/block/amiflop.c 		disk->first_minor = drive;
drive            1834 drivers/block/amiflop.c 		sprintf(disk->disk_name, "fd%d", drive);
drive            1835 drivers/block/amiflop.c 		disk->private_data = &unit[drive];
drive            1851 drivers/block/amiflop.c 	int drive = *part & 3;
drive            1852 drivers/block/amiflop.c 	if (unit[drive].type->code == FD_NODRIVE)
drive            1855 drivers/block/amiflop.c 	return get_disk_and_module(unit[drive].gendisk);
drive             306 drivers/block/ataflop.c #define	UD	unit[drive]
drive             307 drivers/block/ataflop.c #define	UDT	unit[drive].disktype
drive             364 drivers/block/ataflop.c #define	IS_BUFFERED(drive,side,track) \
drive             365 drivers/block/ataflop.c     (BufferDrive == (drive) && BufferSide == (side) && BufferTrack == (track))
drive             420 drivers/block/ataflop.c static void fd_select_drive( int drive );
drive             426 drivers/block/ataflop.c static int do_format(int drive, int type, struct atari_format_descr *desc);
drive             427 drivers/block/ataflop.c static void do_fd_action( int drive );
drive             441 drivers/block/ataflop.c static void setup_req_params( int drive );
drive             444 drivers/block/ataflop.c static void fd_probe( int drive );
drive             445 drivers/block/ataflop.c static int fd_test_drive_present( int drive );
drive             508 drivers/block/ataflop.c static void fd_select_drive( int drive )
drive             513 drivers/block/ataflop.c 	if (drive == SelectedDrive)
drive             520 drivers/block/ataflop.c 	sound_ym.wd_data = (tmp | DSKDRVNONE) & ~(drive == 0 ? DSKDRV0 : DSKDRV1);
drive             533 drivers/block/ataflop.c 	SelectedDrive = drive;
drive             599 drivers/block/ataflop.c 	static int    drive = 0;
drive             605 drivers/block/ataflop.c 	if (++drive > 1 || !UD.connected)
drive             606 drivers/block/ataflop.c 		drive = 0;
drive             615 drivers/block/ataflop.c 			               ~(drive == 0 ? DSKDRV0 : DSKDRV1);
drive             620 drivers/block/ataflop.c 			DPRINT(( "wpstat[%d] = %d\n", drive, stat ));
drive             622 drivers/block/ataflop.c 			set_bit (drive, &changed_floppies);
drive             724 drivers/block/ataflop.c static int do_format(int drive, int type, struct atari_format_descr *desc)
drive             726 drivers/block/ataflop.c 	struct request_queue *q = unit[drive].disk->queue;
drive             787 drivers/block/ataflop.c 	do_fd_action( drive );
drive             808 drivers/block/ataflop.c static void do_fd_action( int drive )
drive             814 drivers/block/ataflop.c 	    if (IS_BUFFERED( drive, ReqSide, ReqTrack )) {
drive             819 drivers/block/ataflop.c 			setup_req_params( drive );
drive             836 drivers/block/ataflop.c 	if (SelectedDrive != drive)
drive             837 drivers/block/ataflop.c 		fd_select_drive( drive );
drive            1410 drivers/block/ataflop.c 	unsigned int drive = p - unit;
drive            1411 drivers/block/ataflop.c 	if (test_bit (drive, &fake_change)) {
drive            1415 drivers/block/ataflop.c 	if (test_bit (drive, &changed_floppies)) {
drive            1432 drivers/block/ataflop.c 	unsigned int drive = p - unit;
drive            1434 drivers/block/ataflop.c 	if (test_bit(drive, &changed_floppies) ||
drive            1435 drivers/block/ataflop.c 	    test_bit(drive, &fake_change) ||
drive            1440 drivers/block/ataflop.c 		clear_bit(drive, &fake_change);
drive            1441 drivers/block/ataflop.c 		clear_bit(drive, &changed_floppies);
drive            1445 drivers/block/ataflop.c 		if (default_params[drive].blocks == 0)
drive            1448 drivers/block/ataflop.c 			UDT = &default_params[drive];
drive            1456 drivers/block/ataflop.c static void setup_req_params( int drive )
drive            1488 drivers/block/ataflop.c 	int drive = floppy - unit;
drive            1509 drivers/block/ataflop.c 		printk(KERN_ERR "Unknown Device: fd%d\n", drive );
drive            1525 drivers/block/ataflop.c 			printk(KERN_WARNING "fd%d: invalid disk format", drive );
drive            1530 drivers/block/ataflop.c 			printk(KERN_WARNING "fd%d: unsupported disk format", drive );
drive            1547 drivers/block/ataflop.c 	setup_req_params( drive );
drive            1548 drivers/block/ataflop.c 	do_fd_action( drive );
drive            1564 drivers/block/ataflop.c 	int drive = floppy - unit;
drive            1584 drivers/block/ataflop.c 			        drive, dtp, dtp->name);
drive            1629 drivers/block/ataflop.c 			drive, setprm.size, setprm.sect, setprm.stretch);
drive            1659 drivers/block/ataflop.c 				        drive, dtp->name, dtp);
drive            1665 drivers/block/ataflop.c 				  default_params[drive].name    = dtp->name;
drive            1666 drivers/block/ataflop.c 				  default_params[drive].spt     = dtp->spt;
drive            1667 drivers/block/ataflop.c 				  default_params[drive].blocks  = dtp->blocks;
drive            1668 drivers/block/ataflop.c 				  default_params[drive].fdc_speed = dtp->fdc_speed;
drive            1669 drivers/block/ataflop.c 				  default_params[drive].stretch = dtp->stretch;
drive            1681 drivers/block/ataflop.c 			dtp = &default_params[drive];
drive            1684 drivers/block/ataflop.c 			dtp = &user_params[drive];
drive            1697 drivers/block/ataflop.c 				drive, dtp->blocks, dtp->spt, dtp->stretch);
drive            1723 drivers/block/ataflop.c 		return do_format(drive, type, &fmt_desc);
drive            1727 drivers/block/ataflop.c 		default_params[drive].blocks  = 0;
drive            1734 drivers/block/ataflop.c 		set_bit(drive, &fake_change);
drive            1756 drivers/block/ataflop.c static void __init fd_probe( int drive )
drive            1761 drivers/block/ataflop.c 	if (!fd_test_drive_present( drive ))
drive            1766 drivers/block/ataflop.c 	switch( UserSteprate[drive] ) {
drive            1799 drivers/block/ataflop.c static int __init fd_test_drive_present( int drive )
drive            1805 drivers/block/ataflop.c 	if (drive >= (MACH_IS_FALCON ? 1 : 2)) return( 0 );
drive            1806 drivers/block/ataflop.c 	fd_select_drive( drive );
drive            1848 drivers/block/ataflop.c 	int drive, cnt = 0;
drive            1855 drivers/block/ataflop.c 	for( drive = 0; drive < FD_MAX_UNITS; drive++ ) {
drive            1856 drivers/block/ataflop.c 		fd_probe( drive );
drive            1858 drivers/block/ataflop.c 			printk(KERN_INFO "fd%d\n", drive);
drive            1966 drivers/block/ataflop.c 	int drive = *part & 3;
drive            1968 drivers/block/ataflop.c 	if (drive >= FD_MAX_UNITS || type > NUM_DISK_MINORS)
drive            1971 drivers/block/ataflop.c 	return get_disk_and_module(unit[drive].disk);
drive             314 drivers/block/floppy.c #define UDP	(&drive_params[drive])
drive             315 drivers/block/floppy.c #define UDRS	(&drive_state[drive])
drive             316 drivers/block/floppy.c #define UDRWE	(&write_errors[drive])
drive             317 drivers/block/floppy.c #define UFDCS	(&fdc_state[FDC(drive)])
drive             607 drivers/block/floppy.c static inline bool drive_no_geom(int drive)
drive             609 drivers/block/floppy.c 	return !current_type[drive] && !ITYPE(UDRS->fd_device);
drive             613 drivers/block/floppy.c static inline int fd_eject(int drive)
drive             675 drivers/block/floppy.c static void __reschedule_timeout(int drive, const char *message)
drive             679 drivers/block/floppy.c 	if (drive == current_reqD)
drive             680 drivers/block/floppy.c 		drive = current_drive;
drive             682 drivers/block/floppy.c 	if (drive < 0 || drive >= N_DRIVE) {
drive             684 drivers/block/floppy.c 		drive = 0;
drive             694 drivers/block/floppy.c static void reschedule_timeout(int drive, const char *message)
drive             699 drivers/block/floppy.c 	__reschedule_timeout(drive, message);
drive             739 drivers/block/floppy.c static int disk_change(int drive)
drive             741 drivers/block/floppy.c 	int fdc = FDC(drive);
drive             745 drivers/block/floppy.c 	if (!(FDCS->dor & (0x10 << UNIT(drive))) ||
drive             746 drivers/block/floppy.c 	    (FDCS->dor & 3) != UNIT(drive) || fdc != FDC(drive)) {
drive             748 drivers/block/floppy.c 		DPRINT("drive=%d fdc=%d dor=%x\n", drive, FDC(drive),
drive             753 drivers/block/floppy.c 		  "checking disk change line for drive %d\n", drive);
drive             770 drivers/block/floppy.c 			    current_type[drive] != NULL)
drive             772 drivers/block/floppy.c 			current_type[drive] = NULL;
drive             773 drivers/block/floppy.c 			floppy_sizes[TOMINOR(drive)] = MAX_DISK_SIZE << 1;
drive             798 drivers/block/floppy.c 	unsigned char drive;
drive             810 drivers/block/floppy.c 			drive = REVDRIVE(fdc, unit);
drive             813 drivers/block/floppy.c 			disk_change(drive);
drive             820 drivers/block/floppy.c 			drive = REVDRIVE(fdc, unit);
drive             842 drivers/block/floppy.c 	int drive;
drive             848 drivers/block/floppy.c 	for (drive = 0; drive < N_DRIVE; drive++)
drive             849 drivers/block/floppy.c 		if (FDC(drive) == fdc && (mode || UDRS->track != NEED_1_RECAL))
drive             854 drivers/block/floppy.c static void set_fdc(int drive)
drive             858 drivers/block/floppy.c 	if (drive >= 0 && drive < N_DRIVE) {
drive             859 drivers/block/floppy.c 		new_fdc = FDC(drive);
drive             860 drivers/block/floppy.c 		current_drive = drive;
drive             878 drivers/block/floppy.c static int lock_fdc(int drive)
drive             889 drivers/block/floppy.c 	reschedule_timeout(drive, "lock fdc");
drive             890 drivers/block/floppy.c 	set_fdc(drive);
drive             922 drivers/block/floppy.c static void floppy_off(unsigned int drive)
drive             925 drivers/block/floppy.c 	int fdc = FDC(drive);
drive             927 drivers/block/floppy.c 	if (!(FDCS->dor & (0x10 << UNIT(drive))))
drive             930 drivers/block/floppy.c 	del_timer(motor_off_timer + drive);
drive             938 drivers/block/floppy.c 		motor_off_timer[drive].expires =
drive             941 drivers/block/floppy.c 	add_timer(motor_off_timer + drive);
drive             952 drivers/block/floppy.c 	int drive;
drive             960 drivers/block/floppy.c 		drive = (saved_drive + i + 1) % N_DRIVE;
drive             963 drivers/block/floppy.c 		set_fdc(drive);
drive             964 drivers/block/floppy.c 		if (!(set_dor(fdc, ~3, UNIT(drive) | (0x10 << UNIT(drive))) &
drive             965 drivers/block/floppy.c 		      (0x10 << UNIT(drive))))
drive             968 drivers/block/floppy.c 			set_dor(fdc, ~(0x10 << UNIT(drive)), 0);
drive            2068 drivers/block/floppy.c static void set_floppy(int drive)
drive            2075 drivers/block/floppy.c 		_floppy = current_type[drive];
drive            2185 drivers/block/floppy.c static int do_format(int drive, struct format_descr *tmp_format_req)
drive            2189 drivers/block/floppy.c 	if (lock_fdc(drive))
drive            2192 drivers/block/floppy.c 	set_floppy(drive);
drive            2221 drivers/block/floppy.c 	unsigned int drive = (unsigned long)req->rq_disk->private_data;
drive            2231 drivers/block/floppy.c 	floppy_off(drive);
drive            2812 drivers/block/floppy.c 	int drive;
drive            2832 drivers/block/floppy.c 	drive = (long)current_req->rq_disk->private_data;
drive            2833 drivers/block/floppy.c 	set_fdc(drive);
drive            2836 drivers/block/floppy.c 	set_floppy(drive);
drive            2962 drivers/block/floppy.c static int user_reset_fdc(int drive, int arg, bool interruptible)
drive            2966 drivers/block/floppy.c 	if (lock_fdc(drive))
drive            2997 drivers/block/floppy.c static const char *drive_name(int type, int drive)
drive            3178 drivers/block/floppy.c 	int drive;
drive            3184 drivers/block/floppy.c 	for (drive = 0; drive < N_DRIVE; drive++) {
drive            3185 drivers/block/floppy.c 		if (FDC(drive) != fdc)
drive            3187 drivers/block/floppy.c 		if (drive == current_drive) {
drive            3234 drivers/block/floppy.c 			       int drive, int type, struct block_device *bdev)
drive            3253 drivers/block/floppy.c 		if (lock_fdc(drive)) {
drive            3273 drivers/block/floppy.c 		if (lock_fdc(drive))
drive            3282 drivers/block/floppy.c 		user_params[drive] = *g;
drive            3283 drivers/block/floppy.c 		if (buffer_drive == drive)
drive            3284 drivers/block/floppy.c 			SUPBOUND(buffer_max, user_params[drive].sect);
drive            3285 drivers/block/floppy.c 		current_type[drive] = &user_params[drive];
drive            3286 drivers/block/floppy.c 		floppy_sizes[drive] = user_params[drive].size;
drive            3296 drivers/block/floppy.c 		if (DRS->maxblock > user_params[drive].sect ||
drive            3298 drivers/block/floppy.c 		    ((user_params[drive].sect ^ oldStretch) &
drive            3354 drivers/block/floppy.c static int get_floppy_geometry(int drive, int type, struct floppy_struct **g)
drive            3359 drivers/block/floppy.c 		if (lock_fdc(drive))
drive            3364 drivers/block/floppy.c 		*g = current_type[drive];
drive            3373 drivers/block/floppy.c 	int drive = (long)bdev->bd_disk->private_data;
drive            3374 drivers/block/floppy.c 	int type = ITYPE(drive_state[drive].fd_device);
drive            3378 drivers/block/floppy.c 	ret = get_floppy_geometry(drive, type, &g);
drive            3409 drivers/block/floppy.c 	int drive = (long)bdev->bd_disk->private_data;
drive            3461 drivers/block/floppy.c 		if (lock_fdc(drive))
drive            3466 drivers/block/floppy.c 		ret = fd_eject(UNIT(drive));
drive            3473 drivers/block/floppy.c 		if (lock_fdc(drive))
drive            3475 drivers/block/floppy.c 		current_type[drive] = NULL;
drive            3476 drivers/block/floppy.c 		floppy_sizes[drive] = MAX_DISK_SIZE << 1;
drive            3481 drivers/block/floppy.c 		return set_geometry(cmd, &inparam.g, drive, type, bdev);
drive            3483 drivers/block/floppy.c 		ret = get_floppy_geometry(drive, type,
drive            3498 drivers/block/floppy.c 		if (lock_fdc(drive))
drive            3512 drivers/block/floppy.c 		return do_format(drive, &inparam.f);
drive            3515 drivers/block/floppy.c 		if (lock_fdc(drive))
drive            3528 drivers/block/floppy.c 		outparam = drive_name(type, drive);
drive            3541 drivers/block/floppy.c 		if (lock_fdc(drive))
drive            3551 drivers/block/floppy.c 		return user_reset_fdc(drive, (int)param, true);
drive            3564 drivers/block/floppy.c 		if (lock_fdc(drive))
drive            3566 drivers/block/floppy.c 		set_floppy(drive);
drive            3573 drivers/block/floppy.c 		if (lock_fdc(drive))
drive            3680 drivers/block/floppy.c 	int drive, type;
drive            3694 drivers/block/floppy.c 	drive = (long)bdev->bd_disk->private_data;
drive            3697 drivers/block/floppy.c 			&v, drive, type, bdev);
drive            3702 drivers/block/floppy.c static int compat_get_prm(int drive,
drive            3711 drivers/block/floppy.c 	err = get_floppy_geometry(drive, ITYPE(UDRS->fd_device), &p);
drive            3723 drivers/block/floppy.c static int compat_setdrvprm(int drive,
drive            3758 drivers/block/floppy.c static int compat_getdrvprm(int drive,
drive            3791 drivers/block/floppy.c static int compat_getdrvstat(int drive, bool poll,
drive            3800 drivers/block/floppy.c 		if (lock_fdc(drive))
drive            3830 drivers/block/floppy.c static int compat_getfdcstat(int drive,
drive            3859 drivers/block/floppy.c static int compat_werrorget(int drive,
drive            3883 drivers/block/floppy.c 	int drive = (long)bdev->bd_disk->private_data;
drive            3908 drivers/block/floppy.c 		return compat_get_prm(drive, compat_ptr(param));
drive            3910 drivers/block/floppy.c 		return compat_setdrvprm(drive, compat_ptr(param));
drive            3912 drivers/block/floppy.c 		return compat_getdrvprm(drive, compat_ptr(param));
drive            3914 drivers/block/floppy.c 		return compat_getdrvstat(drive, true, compat_ptr(param));
drive            3916 drivers/block/floppy.c 		return compat_getdrvstat(drive, false, compat_ptr(param));
drive            3918 drivers/block/floppy.c 		return compat_getfdcstat(drive, compat_ptr(param));
drive            3920 drivers/block/floppy.c 		return compat_werrorget(drive, compat_ptr(param));
drive            3929 drivers/block/floppy.c 	int drive;
drive            3932 drivers/block/floppy.c 	drive = 0;
drive            3935 drivers/block/floppy.c 	drive = 1;
drive            3941 drivers/block/floppy.c 	for (drive = 0; drive < N_DRIVE; drive++) {
drive            3951 drivers/block/floppy.c 				allowed_drive_mask |= 1 << drive;
drive            3953 drivers/block/floppy.c 				allowed_drive_mask &= ~(1 << drive);
drive            3970 drivers/block/floppy.c 			pr_cont("%s fd%d is %s", prepend, drive, name);
drive            3981 drivers/block/floppy.c 	int drive = (long)disk->private_data;
drive            3990 drivers/block/floppy.c 		opened_bdev[drive] = NULL;
drive            4002 drivers/block/floppy.c 	int drive = (long)bdev->bd_disk->private_data;
drive            4011 drivers/block/floppy.c 	if (opened_bdev[drive] && opened_bdev[drive] != bdev)
drive            4021 drivers/block/floppy.c 	opened_bdev[drive] = bdev;
drive            4057 drivers/block/floppy.c 	set_capacity(disks[drive], floppy_sizes[new_dev]);
drive            4059 drivers/block/floppy.c 		if (buffer_drive == drive)
drive            4088 drivers/block/floppy.c 		opened_bdev[drive] = NULL;
drive            4101 drivers/block/floppy.c 	int drive = (long)disk->private_data;
drive            4108 drivers/block/floppy.c 		if (lock_fdc(drive))
drive            4116 drivers/block/floppy.c 	    test_bit(drive, &fake_change) ||
drive            4117 drivers/block/floppy.c 	    drive_no_geom(drive))
drive            4129 drivers/block/floppy.c 	int drive;
drive            4136 drivers/block/floppy.c 	int drive = cbdata->drive;
drive            4146 drivers/block/floppy.c static int __floppy_read_block_0(struct block_device *bdev, int drive)
drive            4164 drivers/block/floppy.c 	cbdata.drive = drive;
drive            4194 drivers/block/floppy.c 	int drive = (long)disk->private_data;
drive            4200 drivers/block/floppy.c 	    test_bit(drive, &fake_change) ||
drive            4201 drivers/block/floppy.c 	    drive_no_geom(drive)) {
drive            4206 drivers/block/floppy.c 		res = lock_fdc(drive);
drive            4211 drivers/block/floppy.c 		if (!(cf || test_bit(drive, &fake_change) || drive_no_geom(drive))) {
drive            4217 drivers/block/floppy.c 		if (buffer_drive == drive)
drive            4219 drivers/block/floppy.c 		clear_bit(drive, &fake_change);
drive            4223 drivers/block/floppy.c 		if (drive_no_geom(drive)) {
drive            4225 drivers/block/floppy.c 			res = __floppy_read_block_0(opened_bdev[drive], drive);
drive            4470 drivers/block/floppy.c 	int drive;
drive            4472 drivers/block/floppy.c 	drive = p->id;
drive            4518 drivers/block/floppy.c static bool floppy_available(int drive)
drive            4520 drivers/block/floppy.c 	if (!(allowed_drive_mask & (1 << drive)))
drive            4522 drivers/block/floppy.c 	if (fdc_state[FDC(drive)].version == FDC_NONE)
drive            4529 drivers/block/floppy.c 	int drive = (*part & 3) | ((*part & 0x80) >> 5);
drive            4530 drivers/block/floppy.c 	if (drive >= N_DRIVE || !floppy_available(drive))
drive            4535 drivers/block/floppy.c 	return get_disk_and_module(disks[drive]);
drive            4540 drivers/block/floppy.c 	int i, unit, drive, err;
drive            4556 drivers/block/floppy.c 	for (drive = 0; drive < N_DRIVE; drive++) {
drive            4557 drivers/block/floppy.c 		disks[drive] = alloc_disk(1);
drive            4558 drivers/block/floppy.c 		if (!disks[drive]) {
drive            4563 drivers/block/floppy.c 		disks[drive]->queue = blk_mq_init_sq_queue(&tag_sets[drive],
drive            4566 drivers/block/floppy.c 		if (IS_ERR(disks[drive]->queue)) {
drive            4567 drivers/block/floppy.c 			err = PTR_ERR(disks[drive]->queue);
drive            4568 drivers/block/floppy.c 			disks[drive]->queue = NULL;
drive            4572 drivers/block/floppy.c 		blk_queue_bounce_limit(disks[drive]->queue, BLK_BOUNCE_HIGH);
drive            4573 drivers/block/floppy.c 		blk_queue_max_hw_sectors(disks[drive]->queue, 64);
drive            4574 drivers/block/floppy.c 		disks[drive]->major = FLOPPY_MAJOR;
drive            4575 drivers/block/floppy.c 		disks[drive]->first_minor = TOMINOR(drive);
drive            4576 drivers/block/floppy.c 		disks[drive]->fops = &floppy_fops;
drive            4577 drivers/block/floppy.c 		disks[drive]->events = DISK_EVENT_MEDIA_CHANGE;
drive            4578 drivers/block/floppy.c 		sprintf(disks[drive]->disk_name, "fd%d", drive);
drive            4580 drivers/block/floppy.c 		timer_setup(&motor_off_timer[drive], motor_off_callback, 0);
drive            4637 drivers/block/floppy.c 	for (drive = 0; drive < N_DRIVE; drive++) {
drive            4697 drivers/block/floppy.c 	for (drive = 0; drive < N_DRIVE; drive++) {
drive            4698 drivers/block/floppy.c 		if (!floppy_available(drive))
drive            4701 drivers/block/floppy.c 		floppy_device[drive].name = floppy_device_name;
drive            4702 drivers/block/floppy.c 		floppy_device[drive].id = drive;
drive            4703 drivers/block/floppy.c 		floppy_device[drive].dev.release = floppy_device_release;
drive            4704 drivers/block/floppy.c 		floppy_device[drive].dev.groups = floppy_dev_groups;
drive            4706 drivers/block/floppy.c 		err = platform_device_register(&floppy_device[drive]);
drive            4711 drivers/block/floppy.c 		disks[drive]->private_data = (void *)(long)drive;
drive            4712 drivers/block/floppy.c 		disks[drive]->flags |= GENHD_FL_REMOVABLE;
drive            4713 drivers/block/floppy.c 		device_add_disk(&floppy_device[drive].dev, disks[drive], NULL);
drive            4719 drivers/block/floppy.c 	while (drive--) {
drive            4720 drivers/block/floppy.c 		if (floppy_available(drive)) {
drive            4721 drivers/block/floppy.c 			del_gendisk(disks[drive]);
drive            4722 drivers/block/floppy.c 			platform_device_unregister(&floppy_device[drive]);
drive            4735 drivers/block/floppy.c 	for (drive = 0; drive < N_DRIVE; drive++) {
drive            4736 drivers/block/floppy.c 		if (!disks[drive])
drive            4738 drivers/block/floppy.c 		if (disks[drive]->queue) {
drive            4739 drivers/block/floppy.c 			del_timer_sync(&motor_off_timer[drive]);
drive            4740 drivers/block/floppy.c 			blk_cleanup_queue(disks[drive]->queue);
drive            4741 drivers/block/floppy.c 			disks[drive]->queue = NULL;
drive            4742 drivers/block/floppy.c 			blk_mq_free_tag_set(&tag_sets[drive]);
drive            4744 drivers/block/floppy.c 		put_disk(disks[drive]);
drive            4877 drivers/block/floppy.c 	int drive;
drive            4905 drivers/block/floppy.c 	for (drive = 0; drive < N_FDC * 4; drive++)
drive            4906 drivers/block/floppy.c 		if (timer_pending(motor_off_timer + drive))
drive            4907 drivers/block/floppy.c 			pr_info("motor off timer %d still active\n", drive);
drive            4954 drivers/block/floppy.c 	int drive;
drive            4962 drivers/block/floppy.c 	for (drive = 0; drive < N_DRIVE; drive++) {
drive            4963 drivers/block/floppy.c 		del_timer_sync(&motor_off_timer[drive]);
drive            4965 drivers/block/floppy.c 		if (floppy_available(drive)) {
drive            4966 drivers/block/floppy.c 			del_gendisk(disks[drive]);
drive            4967 drivers/block/floppy.c 			platform_device_unregister(&floppy_device[drive]);
drive            4969 drivers/block/floppy.c 		blk_cleanup_queue(disks[drive]->queue);
drive            4970 drivers/block/floppy.c 		blk_mq_free_tag_set(&tag_sets[drive]);
drive            4976 drivers/block/floppy.c 		if (!(allowed_drive_mask & (1 << drive)) ||
drive            4977 drivers/block/floppy.c 		    fdc_state[FDC(drive)].version == FDC_NONE)
drive            4978 drivers/block/floppy.c 			disks[drive]->queue = NULL;
drive            4980 drivers/block/floppy.c 		put_disk(disks[drive]);
drive             196 drivers/block/paride/pcd.c 	int drive;		/* master/slave */
drive             330 drivers/block/paride/pcd.c 		cd->drive = (*drives[unit])[D_SLV];
drive             405 drivers/block/paride/pcd.c 	write_reg(cd, 6, 0xa0 + 0x10 * cd->drive);
drive             568 drivers/block/paride/pcd.c 	write_reg(cd, 6, 0xa0 + 0x10 * cd->drive);
drive             645 drivers/block/paride/pcd.c 			       cd->name, cd->drive ? "Slave" : "Master");
drive             656 drivers/block/paride/pcd.c 	printk("%s: %s: %s\n", cd->name, cd->drive ? "Slave" : "Master", id);
drive             668 drivers/block/paride/pcd.c 		for (cd->drive = 0; cd->drive <= 1; cd->drive++)
drive             672 drivers/block/paride/pcd.c 		cd->drive = ms;
drive             232 drivers/block/paride/pd.c 	int drive;		/* master=0 slave=1 */
drive             281 drivers/block/paride/pd.c 	return 0xa0+0x10*disk->drive;
drive             709 drivers/block/paride/pd.c 	if (disk->drive == 0)
drive             740 drivers/block/paride/pd.c 	       disk->drive ? "slave" : "master",
drive             927 drivers/block/paride/pd.c 	if (disk->drive == -1) {
drive             928 drivers/block/paride/pd.c 		for (disk->drive = 0; disk->drive <= 1; disk->drive++)
drive             949 drivers/block/paride/pd.c 		disk->drive = parm[D_SLV];
drive             236 drivers/block/paride/pf.c 	int drive;		/* drive */
drive             315 drivers/block/paride/pf.c 		pf->drive = (*drives[unit])[D_SLV];
drive             454 drivers/block/paride/pf.c 	write_reg(pf, 6, 0xa0+0x10*pf->drive);
drive             565 drivers/block/paride/pf.c 	write_reg(pf, 6, 0xa0+0x10*pf->drive);
drive             644 drivers/block/paride/pf.c 			       pf->name, pf->drive, pf->lun, bs);
drive             665 drivers/block/paride/pf.c 			       pf->name, pf->drive, pf->lun, dt);
drive             681 drivers/block/paride/pf.c 	       pf->name, mf, id, ms[pf->drive], pf->lun, dt);
drive             700 drivers/block/paride/pf.c 	if (pf->drive == -1) {
drive             701 drivers/block/paride/pf.c 		for (pf->drive = 0; pf->drive <= 1; pf->drive++)
drive             216 drivers/block/paride/pg.c 	int drive;		/* drive */
drive             256 drivers/block/paride/pg.c 		dev->drive = parm[D_SLV];
drive             280 drivers/block/paride/pg.c 	return 0xa0+0x10*dev->drive;
drive             455 drivers/block/paride/pg.c 		printk("%s: %s %s, %s\n", dev->name, mf, id, ms[dev->drive]);
drive             467 drivers/block/paride/pg.c 	if (dev->drive == -1) {
drive             468 drivers/block/paride/pg.c 		for (dev->drive = 0; dev->drive <= 1; dev->drive++)
drive             221 drivers/block/paride/pt.c 	int drive;		/* drive */
drive             269 drivers/block/paride/pt.c 	return 0xa0+0x10*tape->drive;
drive             548 drivers/block/paride/pt.c 			       tape->name, tape->drive, dt);
drive             571 drivers/block/paride/pt.c 	printk("%s: %s %s, %s", tape->name, mf, id, ms[tape->drive]);
drive             590 drivers/block/paride/pt.c 	if (tape->drive == -1) {
drive             591 drivers/block/paride/pt.c 		for (tape->drive = 0; tape->drive <= 1; tape->drive++)
drive             624 drivers/block/paride/pt.c 		tape->drive = DU[D_SLV];
drive             769 drivers/block/swim.c 	int drive = (*part & 3);
drive             771 drivers/block/swim.c 	if (drive >= swd->floppy_count)
drive             775 drivers/block/swim.c 	return get_disk_and_module(swd->unit[drive].disk);
drive             807 drivers/block/swim.c 	int drive;
drive             832 drivers/block/swim.c 	for (drive = 0; drive < swd->floppy_count; drive++) {
drive             835 drivers/block/swim.c 		swd->unit[drive].disk = alloc_disk(1);
drive             836 drivers/block/swim.c 		if (swd->unit[drive].disk == NULL) {
drive             841 drivers/block/swim.c 		q = blk_mq_init_sq_queue(&swd->unit[drive].tag_set, &swim_mq_ops,
drive             848 drivers/block/swim.c 		swd->unit[drive].disk->queue = q;
drive             849 drivers/block/swim.c 		blk_queue_bounce_limit(swd->unit[drive].disk->queue,
drive             851 drivers/block/swim.c 		swd->unit[drive].disk->queue->queuedata = &swd->unit[drive];
drive             852 drivers/block/swim.c 		swd->unit[drive].swd = swd;
drive             855 drivers/block/swim.c 	for (drive = 0; drive < swd->floppy_count; drive++) {
drive             856 drivers/block/swim.c 		swd->unit[drive].disk->flags = GENHD_FL_REMOVABLE;
drive             857 drivers/block/swim.c 		swd->unit[drive].disk->major = FLOPPY_MAJOR;
drive             858 drivers/block/swim.c 		swd->unit[drive].disk->first_minor = drive;
drive             859 drivers/block/swim.c 		sprintf(swd->unit[drive].disk->disk_name, "fd%d", drive);
drive             860 drivers/block/swim.c 		swd->unit[drive].disk->fops = &floppy_fops;
drive             861 drivers/block/swim.c 		swd->unit[drive].disk->events = DISK_EVENT_MEDIA_CHANGE;
drive             862 drivers/block/swim.c 		swd->unit[drive].disk->private_data = &swd->unit[drive];
drive             863 drivers/block/swim.c 		set_capacity(swd->unit[drive].disk, 2880);
drive             864 drivers/block/swim.c 		add_disk(swd->unit[drive].disk);
drive             875 drivers/block/swim.c 		struct gendisk *disk = swd->unit[drive].disk;
drive             882 drivers/block/swim.c 			blk_mq_free_tag_set(&swd->unit[drive].tag_set);
drive             885 drivers/block/swim.c 	} while (drive--);
drive             950 drivers/block/swim.c 	int drive;
drive             955 drivers/block/swim.c 	for (drive = 0; drive < swd->floppy_count; drive++) {
drive             956 drivers/block/swim.c 		del_gendisk(swd->unit[drive].disk);
drive             957 drivers/block/swim.c 		blk_cleanup_queue(swd->unit[drive].disk->queue);
drive             958 drivers/block/swim.c 		blk_mq_free_tag_set(&swd->unit[drive].tag_set);
drive             959 drivers/block/swim.c 		put_disk(swd->unit[drive].disk);
drive             966 drivers/block/swim.c 	for (drive = 0; drive < swd->floppy_count; drive++)
drive             967 drivers/block/swim.c 		floppy_eject(&swd->unit[drive]);
drive             838 drivers/clk/clk-si5351.c 	enum si5351_drive_strength drive)
drive             845 drivers/clk/clk-si5351.c 	switch (drive) {
drive            1283 drivers/clk/clk-si5351.c 				pdata->clkout[num].drive = val;
drive            1450 drivers/clk/clk-si5351.c 							pdata->clkout[n].drive);
drive            1454 drivers/clk/clk-si5351.c 				n, pdata->clkout[n].drive);
drive              17 drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/i2c.h 	u8 drive;
drive             122 drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.c 		ior->func->dp.drive(ior, i, ocfg.pc, ocfg.dc,
drive              77 drivers/gpu/drm/nouveau/nvkm/engine/disp/ior.h 		void (*drive)(struct nvkm_ior *, int ln, int pc,
drive             272 drivers/gpu/drm/nouveau/nvkm/engine/disp/sorg94.c 		.drive = g94_sor_dp_drive,
drive             171 drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgf119.c 		.drive = gf119_sor_dp_drive,
drive              37 drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgk104.c 		.drive = gf119_sor_dp_drive,
drive              51 drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgm107.c 		.drive = gf119_sor_dp_drive,
drive             109 drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgm200.c 		.drive = gm200_sor_dp_drive,
drive              53 drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgt215.c 		.drive = g94_sor_dp_drive,
drive              98 drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgv100.c 		.drive = gm200_sor_dp_drive,
drive              37 drivers/gpu/drm/nouveau/nvkm/engine/disp/sormcp77.c 		.drive = g94_sor_dp_drive,
drive              37 drivers/gpu/drm/nouveau/nvkm/engine/disp/sormcp89.c 		.drive = g94_sor_dp_drive,
drive              82 drivers/gpu/drm/nouveau/nvkm/engine/disp/sortu102.c 		.drive = gm200_sor_dp_drive,
drive              95 drivers/gpu/drm/nouveau/nvkm/subdev/bios/i2c.c 		info->drive = DCB_I2C_UNUSED;
drive             102 drivers/gpu/drm/nouveau/nvkm/subdev/bios/i2c.c 			info->drive = nvbios_rd08(bios, ent + 0);
drive             106 drivers/gpu/drm/nouveau/nvkm/subdev/bios/i2c.c 			info->drive = nvbios_rd08(bios, ent + 1);
drive             109 drivers/gpu/drm/nouveau/nvkm/subdev/bios/i2c.c 			info->drive = nvbios_rd08(bios, ent + 0) & 0x0f;
drive             119 drivers/gpu/drm/nouveau/nvkm/subdev/bios/i2c.c 			info->drive = (nvbios_rd16(bios, ent + 0) & 0x01f) >> 0;
drive             120 drivers/gpu/drm/nouveau/nvkm/subdev/bios/i2c.c 			if (info->drive == 0x1f)
drive             121 drivers/gpu/drm/nouveau/nvkm/subdev/bios/i2c.c 				info->drive = DCB_I2C_UNUSED;
drive             146 drivers/gpu/drm/nouveau/nvkm/subdev/bios/i2c.c 			info->drive = nvbios_rd08(bios, ent + 4);
drive             147 drivers/gpu/drm/nouveau/nvkm/subdev/bios/i2c.c 			if (!info->drive) info->drive = 0x3f;
drive             152 drivers/gpu/drm/nouveau/nvkm/subdev/bios/i2c.c 			info->drive = nvbios_rd08(bios, ent + 6);
drive             153 drivers/gpu/drm/nouveau/nvkm/subdev/bios/i2c.c 			if (!info->drive) info->drive = 0x37;
drive              32 drivers/gpu/drm/nouveau/nvkm/subdev/gpio/base.c 	return gpio->func->drive(gpio, line, dir, out);
drive              65 drivers/gpu/drm/nouveau/nvkm/subdev/gpio/g94.c 	.drive = nv50_gpio_drive,
drive              77 drivers/gpu/drm/nouveau/nvkm/subdev/gpio/gf119.c 	.drive = gf119_gpio_drive,
drive              65 drivers/gpu/drm/nouveau/nvkm/subdev/gpio/gk104.c 	.drive = gf119_gpio_drive,
drive             110 drivers/gpu/drm/nouveau/nvkm/subdev/gpio/nv10.c 	.drive = nv10_gpio_drive,
drive             123 drivers/gpu/drm/nouveau/nvkm/subdev/gpio/nv50.c 	.drive = nv50_gpio_drive,
drive              22 drivers/gpu/drm/nouveau/nvkm/subdev/gpio/priv.h 	int  (*drive)(struct nvkm_gpio *, int line, int dir, int out);
drive             103 drivers/gpu/drm/nouveau/nvkm/subdev/i2c/anx9805.c anx9805_bus_new(struct nvkm_i2c_pad *base, int id, u8 drive,
drive             232 drivers/gpu/drm/nouveau/nvkm/subdev/i2c/anx9805.c anx9805_aux_new(struct nvkm_i2c_pad *base, int id, u8 drive,
drive             165 drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxg94.c 		 struct nvkm_i2c_pad *pad, int index, u8 drive,
drive             175 drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxg94.c 	aux->ch = drive;
drive             186 drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxg94.c g94_i2c_aux_new(struct nvkm_i2c_pad *pad, int index, u8 drive,
drive             189 drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxg94.c 	return g94_i2c_aux_new_(&g94_i2c_aux, pad, index, drive, paux);
drive              31 drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxgf119.c gf119_i2c_aux_new(struct nvkm_i2c_pad *pad, int index, u8 drive,
drive              34 drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxgf119.c 	return g94_i2c_aux_new_(&gf119_i2c_aux, pad, index, drive, paux);
drive             170 drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxgm200.c gm200_i2c_aux_new(struct nvkm_i2c_pad *pad, int index, u8 drive,
drive             180 drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxgm200.c 	aux->ch = drive;
drive             306 drivers/gpu/drm/nouveau/nvkm/subdev/i2c/base.c 			   ccbE.drive, ccbE.sense, ccbE.share, ccbE.auxch);
drive             326 drivers/gpu/drm/nouveau/nvkm/subdev/i2c/base.c 						   ccbE.drive,
drive             333 drivers/gpu/drm/nouveau/nvkm/subdev/i2c/base.c 		      ccbE.drive != DCB_I2C_UNUSED))) {
drive             335 drivers/gpu/drm/nouveau/nvkm/subdev/i2c/base.c 						   ccbE.drive, &bus);
drive              83 drivers/gpu/drm/nouveau/nvkm/subdev/i2c/busgf119.c gf119_i2c_bus_new(struct nvkm_i2c_pad *pad, int id, u8 drive,
drive              93 drivers/gpu/drm/nouveau/nvkm/subdev/i2c/busgf119.c 	bus->addr = 0x00d014 + (drive * 0x20);
drive              31 drivers/gpu/drm/nouveau/nvkm/subdev/i2c/busnv04.c 	u8 drive;
drive              40 drivers/gpu/drm/nouveau/nvkm/subdev/i2c/busnv04.c 	u8 val = nvkm_rdvgac(device, 0, bus->drive);
drive              43 drivers/gpu/drm/nouveau/nvkm/subdev/i2c/busnv04.c 	nvkm_wrvgac(device, 0, bus->drive, val | 0x01);
drive              51 drivers/gpu/drm/nouveau/nvkm/subdev/i2c/busnv04.c 	u8 val = nvkm_rdvgac(device, 0, bus->drive);
drive              54 drivers/gpu/drm/nouveau/nvkm/subdev/i2c/busnv04.c 	nvkm_wrvgac(device, 0, bus->drive, val | 0x01);
drive              83 drivers/gpu/drm/nouveau/nvkm/subdev/i2c/busnv04.c nv04_i2c_bus_new(struct nvkm_i2c_pad *pad, int id, u8 drive, u8 sense,
drive              93 drivers/gpu/drm/nouveau/nvkm/subdev/i2c/busnv04.c 	bus->drive = drive;
drive              74 drivers/gpu/drm/nouveau/nvkm/subdev/i2c/busnv4e.c nv4e_i2c_bus_new(struct nvkm_i2c_pad *pad, int id, u8 drive,
drive              84 drivers/gpu/drm/nouveau/nvkm/subdev/i2c/busnv4e.c 	bus->addr = 0x600800 + drive;
drive              90 drivers/gpu/drm/nouveau/nvkm/subdev/i2c/busnv50.c nv50_i2c_bus_new(struct nvkm_i2c_pad *pad, int id, u8 drive,
drive             100 drivers/gpu/drm/nouveau/nvkm/subdev/i2c/busnv50.c 	if (drive >= ARRAY_SIZE(addr)) {
drive             101 drivers/gpu/drm/nouveau/nvkm/subdev/i2c/busnv50.c 		nvkm_warn(&pad->i2c->subdev, "bus %d unknown\n", drive);
drive             110 drivers/gpu/drm/nouveau/nvkm/subdev/i2c/busnv50.c 	bus->addr = addr[drive];
drive              24 drivers/gpu/drm/nouveau/nvkm/subdev/i2c/pad.h 	int (*bus_new_0)(struct nvkm_i2c_pad *, int id, u8 drive, u8 sense,
drive              26 drivers/gpu/drm/nouveau/nvkm/subdev/i2c/pad.h 	int (*bus_new_4)(struct nvkm_i2c_pad *, int id, u8 drive,
drive              29 drivers/gpu/drm/nouveau/nvkm/subdev/i2c/pad.h 	int (*aux_new_6)(struct nvkm_i2c_pad *, int id, u8 drive,
drive              85 drivers/ide/aec62xx.c static void aec6210_set_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive              93 drivers/ide/aec62xx.c 	const u8 speed = drive->dma_mode;
drive              98 drivers/ide/aec62xx.c 	pci_read_config_word(dev, 0x40|(2*drive->dn), &d_conf);
drive             101 drivers/ide/aec62xx.c 	pci_write_config_word(dev, 0x40|(2*drive->dn), d_conf);
drive             106 drivers/ide/aec62xx.c 	tmp1 = ((0x00 << (2*drive->dn)) | (ultra & ~(3 << (2*drive->dn))));
drive             108 drivers/ide/aec62xx.c 	tmp2 = ((ultra_conf << (2*drive->dn)) | (tmp1 & ~(3 << (2*drive->dn))));
drive             113 drivers/ide/aec62xx.c static void aec6260_set_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive             118 drivers/ide/aec62xx.c 	u8 unit			= drive->dn & 1;
drive             121 drivers/ide/aec62xx.c 	const u8 speed = drive->dma_mode;
drive             126 drivers/ide/aec62xx.c 	pci_read_config_byte(dev, 0x40|drive->dn, &drive_conf);
drive             128 drivers/ide/aec62xx.c 	pci_write_config_byte(dev, 0x40|drive->dn, drive_conf);
drive             138 drivers/ide/aec62xx.c static void aec_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive             140 drivers/ide/aec62xx.c 	drive->dma_mode = drive->pio_mode;
drive             141 drivers/ide/aec62xx.c 	hwif->port_ops->set_dma_mode(hwif, drive);
drive             113 drivers/ide/ali14xx.c static void ali14xx_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive             120 drivers/ide/ali14xx.c 	const u8 pio = drive->pio_mode - XFER_PIO_0;
drive             124 drivers/ide/ali14xx.c 	time1 = ide_pio_cycle_time(drive, pio);
drive             133 drivers/ide/ali14xx.c 		drive->name, pio, time1, time2, param1, param2, param3, param4);
drive             136 drivers/ide/ali14xx.c 	driveNum = (drive->hwif->index << 1) + (drive->dn & 1);
drive              51 drivers/ide/alim15x3.c static void ali_fifo_control(ide_hwif_t *hwif, ide_drive_t *drive, int on)
drive              56 drivers/ide/alim15x3.c 	int shift = 4 * (drive->dn & 1);
drive              64 drivers/ide/alim15x3.c static void ali_program_timings(ide_hwif_t *hwif, ide_drive_t *drive,
drive              70 drivers/ide/alim15x3.c 	u8 unit = drive->dn & 1, udma;
drive             102 drivers/ide/alim15x3.c static void ali_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive             104 drivers/ide/alim15x3.c 	ide_drive_t *pair = ide_get_pair_dev(drive);
drive             109 drivers/ide/alim15x3.c 	ide_timing_compute(drive, drive->pio_mode, &t, T, 1);
drive             126 drivers/ide/alim15x3.c 	ali_fifo_control(hwif, drive, (drive->media == ide_disk) ? 0x05 : 0x00);
drive             128 drivers/ide/alim15x3.c 	ali_program_timings(hwif, drive, &t, 0);
drive             143 drivers/ide/alim15x3.c static u8 ali_udma_filter(ide_drive_t *drive)
drive             146 drivers/ide/alim15x3.c 		if (drive->media != ide_disk)
drive             149 drivers/ide/alim15x3.c 		    strstr((char *)&drive->id[ATA_ID_PROD], "WDC "))
drive             153 drivers/ide/alim15x3.c 	return drive->hwif->ultra_mask;
drive             164 drivers/ide/alim15x3.c static void ali_set_dma_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive             168 drivers/ide/alim15x3.c 	ide_drive_t *pair	= ide_get_pair_dev(drive);
drive             171 drivers/ide/alim15x3.c 	const u8 speed		= drive->dma_mode;
drive             176 drivers/ide/alim15x3.c 		ide_timing_compute(drive, drive->dma_mode, &t, T, 1);
drive             190 drivers/ide/alim15x3.c 		ali_program_timings(hwif, drive, &t, 0);
drive             192 drivers/ide/alim15x3.c 		ali_program_timings(hwif, drive, NULL,
drive             210 drivers/ide/alim15x3.c static int ali_dma_check(ide_drive_t *drive, struct ide_cmd *cmd)
drive             212 drivers/ide/alim15x3.c 	if (m5229_revision < 0xC2 && drive->media != ide_disk) {
drive              78 drivers/ide/amd74xx.c static void amd_set_drive(ide_hwif_t *hwif, ide_drive_t *drive)
drive              81 drivers/ide/amd74xx.c 	ide_drive_t *peer = ide_get_pair_dev(drive);
drive              85 drivers/ide/amd74xx.c 	const u8 speed = drive->dma_mode;
drive              90 drivers/ide/amd74xx.c 	ide_timing_compute(drive, speed, &t, T, UT);
drive             100 drivers/ide/amd74xx.c 	amd_set_speed(dev, drive->dn, udma_mask, &t);
drive             107 drivers/ide/amd74xx.c static void amd_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive             109 drivers/ide/amd74xx.c 	drive->dma_mode = drive->pio_mode;
drive             110 drivers/ide/amd74xx.c 	amd_set_drive(hwif, drive);
drive              52 drivers/ide/atiixp.c static void atiixp_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive              56 drivers/ide/atiixp.c 	int timing_shift = (drive->dn ^ 1) * 8;
drive              59 drivers/ide/atiixp.c 	const u8 pio = drive->pio_mode - XFER_PIO_0;
drive              64 drivers/ide/atiixp.c 	pio_mode_data &= ~(0x07 << (drive->dn * 4));
drive              65 drivers/ide/atiixp.c 	pio_mode_data |= (pio << (drive->dn * 4));
drive              86 drivers/ide/atiixp.c static void atiixp_set_dma_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive              90 drivers/ide/atiixp.c 	int timing_shift = (drive->dn ^ 1) * 8;
drive              94 drivers/ide/atiixp.c 	const u8 speed = drive->dma_mode;
drive             102 drivers/ide/atiixp.c 		tmp16 &= ~(0x07 << (drive->dn * 4));
drive             103 drivers/ide/atiixp.c 		tmp16 |= ((speed & 0x07) << (drive->dn * 4));
drive             106 drivers/ide/atiixp.c 		udma_ctl |= (1 << drive->dn);
drive             116 drivers/ide/atiixp.c 		udma_ctl &= ~(1 << drive->dn);
drive              93 drivers/ide/au1xxx-ide.c static void au1xxx_input_data(ide_drive_t *drive, struct ide_cmd *cmd,
drive              96 drivers/ide/au1xxx-ide.c 	auide_insw(drive->hwif->io_ports.data_addr, buf, (len + 1) / 2);
drive              99 drivers/ide/au1xxx-ide.c static void au1xxx_output_data(ide_drive_t *drive, struct ide_cmd *cmd,
drive             102 drivers/ide/au1xxx-ide.c 	auide_outsw(drive->hwif->io_ports.data_addr, buf, (len + 1) / 2);
drive             106 drivers/ide/au1xxx-ide.c static void au1xxx_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive             110 drivers/ide/au1xxx-ide.c 	switch (drive->pio_mode - XFER_PIO_0) {
drive             167 drivers/ide/au1xxx-ide.c static void auide_set_dma_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive             171 drivers/ide/au1xxx-ide.c 	switch (drive->dma_mode) {
drive             215 drivers/ide/au1xxx-ide.c static int auide_build_dmatable(ide_drive_t *drive, struct ide_cmd *cmd)
drive             217 drivers/ide/au1xxx-ide.c 	ide_hwif_t *hwif = drive->hwif;
drive             224 drivers/ide/au1xxx-ide.c 	ahwif->drive = drive;
drive             241 drivers/ide/au1xxx-ide.c 				       drive->name);
drive             278 drivers/ide/au1xxx-ide.c static int auide_dma_end(ide_drive_t *drive)
drive             283 drivers/ide/au1xxx-ide.c static void auide_dma_start(ide_drive_t *drive )
drive             288 drivers/ide/au1xxx-ide.c static int auide_dma_setup(ide_drive_t *drive, struct ide_cmd *cmd)
drive             290 drivers/ide/au1xxx-ide.c 	if (auide_build_dmatable(drive, cmd) == 0)
drive             296 drivers/ide/au1xxx-ide.c static int auide_dma_test_irq(ide_drive_t *drive)
drive             301 drivers/ide/au1xxx-ide.c 	drive->waiting_for_dma++;
drive             302 drivers/ide/au1xxx-ide.c 	if (drive->waiting_for_dma >= DMA_WAIT_TIMEOUT) {
drive             304 drivers/ide/au1xxx-ide.c 		       drive->name);
drive             311 drivers/ide/au1xxx-ide.c static void auide_dma_host_set(ide_drive_t *drive, int on)
drive             113 drivers/ide/buddha.c static void xsurf_clear_irq(ide_drive_t *drive)
drive             118 drivers/ide/buddha.c     z_writeb(0, drive->hwif->io_ports.irq_addr);
drive             380 drivers/ide/cmd640.c static void __set_prefetch_mode(ide_drive_t *drive, int mode)
drive             384 drivers/ide/cmd640.c 		drive->dev_flags |= IDE_DFLAG_NO_UNMASK;
drive             385 drivers/ide/cmd640.c 		drive->dev_flags &= ~IDE_DFLAG_UNMASK;
drive             387 drivers/ide/cmd640.c 		drive->dev_flags &= ~IDE_DFLAG_NO_IO_32BIT;
drive             389 drivers/ide/cmd640.c 		drive->dev_flags &= ~IDE_DFLAG_NO_UNMASK;
drive             390 drivers/ide/cmd640.c 		drive->dev_flags |= IDE_DFLAG_NO_IO_32BIT;
drive             391 drivers/ide/cmd640.c 		drive->io_32bit = 0;
drive             400 drivers/ide/cmd640.c static void __init check_prefetch(ide_drive_t *drive, unsigned int index)
drive             404 drivers/ide/cmd640.c 	__set_prefetch_mode(drive, (b & prefetch_masks[index]) ? 0 : 1);
drive             411 drivers/ide/cmd640.c static void set_prefetch_mode(ide_drive_t *drive, unsigned int index, int mode)
drive             419 drivers/ide/cmd640.c 	__set_prefetch_mode(drive, mode);
drive             459 drivers/ide/cmd640.c static void program_drive_counts(ide_drive_t *drive, unsigned int index)
drive             473 drivers/ide/cmd640.c 		ide_drive_t *peer = ide_get_pair_dev(drive);
drive             515 drivers/ide/cmd640.c static void cmd640_set_mode(ide_drive_t *drive, unsigned int index,
drive             574 drivers/ide/cmd640.c 	program_drive_counts(drive, index);
drive             577 drivers/ide/cmd640.c static void cmd640_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive             580 drivers/ide/cmd640.c 	const u8 pio = drive->pio_mode - XFER_PIO_0;
drive             591 drivers/ide/cmd640.c 			drive->name, (pio & 1) ? "en" : "dis");
drive             595 drivers/ide/cmd640.c 		set_prefetch_mode(drive, index, pio & 1);
drive             597 drivers/ide/cmd640.c 			drive->name, (pio & 1) ? "en" : "dis");
drive             601 drivers/ide/cmd640.c 	cycle_time = ide_pio_cycle_time(drive, pio);
drive             602 drivers/ide/cmd640.c 	cmd640_set_mode(drive, index, pio, cycle_time);
drive             605 drivers/ide/cmd640.c 		drive->name, pio, cycle_time);
drive             611 drivers/ide/cmd640.c static void __init cmd640_init_dev(ide_drive_t *drive)
drive             613 drivers/ide/cmd640.c 	unsigned int i = drive->hwif->channel * 2 + (drive->dn & 1);
drive             623 drivers/ide/cmd640.c 	program_drive_counts(drive, i);
drive             624 drivers/ide/cmd640.c 	set_prefetch_mode(drive, i, 0);
drive             630 drivers/ide/cmd640.c 	check_prefetch(drive, i);
drive             632 drivers/ide/cmd640.c 		i, (drive->dev_flags & IDE_DFLAG_NO_IO_32BIT) ? "off" : "on");
drive              55 drivers/ide/cmd64x.c static void cmd64x_program_timings(ide_drive_t *drive, u8 mode)
drive              57 drivers/ide/cmd64x.c 	ide_hwif_t *hwif = drive->hwif;
drive              58 drivers/ide/cmd64x.c 	struct pci_dev *dev = to_pci_dev(drive->hwif->dev);
drive              69 drivers/ide/cmd64x.c 	if (drive->dn >= ARRAY_SIZE(drwtim_regs))
drive              72 drivers/ide/cmd64x.c 	ide_timing_compute(drive, mode, &t, T, 0);
drive              92 drivers/ide/cmd64x.c 	pci_write_config_byte(dev, drwtim_regs[drive->dn],
drive             102 drivers/ide/cmd64x.c 		ide_drive_t *pair = ide_get_pair_dev(drive);
drive             124 drivers/ide/cmd64x.c 	(void) pci_read_config_byte (dev, arttim_regs[drive->dn], &arttim);
drive             129 drivers/ide/cmd64x.c 	(void) pci_write_config_byte(dev, arttim_regs[drive->dn], arttim);
drive             137 drivers/ide/cmd64x.c static void cmd64x_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive             139 drivers/ide/cmd64x.c 	const u8 pio = drive->pio_mode - XFER_PIO_0;
drive             148 drivers/ide/cmd64x.c 	cmd64x_program_timings(drive, XFER_PIO_0 + pio);
drive             151 drivers/ide/cmd64x.c static void cmd64x_set_dma_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive             154 drivers/ide/cmd64x.c 	u8 unit			= drive->dn & 0x01;
drive             156 drivers/ide/cmd64x.c 	const u8 speed		= drive->dma_mode;
drive             183 drivers/ide/cmd64x.c 		cmd64x_program_timings(drive, speed);
drive             190 drivers/ide/cmd64x.c static void cmd648_clear_irq(ide_drive_t *drive)
drive             192 drivers/ide/cmd64x.c 	ide_hwif_t *hwif	= drive->hwif;
drive             204 drivers/ide/cmd64x.c static void cmd64x_clear_irq(ide_drive_t *drive)
drive             206 drivers/ide/cmd64x.c 	ide_hwif_t *hwif	= drive->hwif;
drive             253 drivers/ide/cmd64x.c static int cmd646_1_dma_end(ide_drive_t *drive)
drive             255 drivers/ide/cmd64x.c 	ide_hwif_t *hwif = drive->hwif;
drive              60 drivers/ide/cs5520.c static void cs5520_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive              63 drivers/ide/cs5520.c 	int controller = drive->dn > 1 ? 1 : 0;
drive              64 drivers/ide/cs5520.c 	const u8 pio = drive->pio_mode - XFER_PIO_0;
drive              75 drivers/ide/cs5520.c 	pci_write_config_byte(pdev, 0x64 + 4*controller + (drive->dn&1),
drive              79 drivers/ide/cs5520.c 	pci_write_config_byte(pdev, 0x66 + 4*controller + (drive->dn&1),
drive              84 drivers/ide/cs5520.c static void cs5520_set_dma_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive              88 drivers/ide/cs5520.c 	drive->pio_mode = XFER_PIO_0 + 0;
drive              89 drivers/ide/cs5520.c 	cs5520_set_pio_mode(hwif, drive);
drive              53 drivers/ide/cs5530.c static void cs5530_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive              57 drivers/ide/cs5530.c 	const u8 pio = drive->pio_mode - XFER_PIO_0;
drive              59 drivers/ide/cs5530.c 	outl(cs5530_pio_timings[format][pio], basereg + ((drive->dn & 1)<<3));
drive              81 drivers/ide/cs5530.c static u8 cs5530_udma_filter(ide_drive_t *drive)
drive              83 drivers/ide/cs5530.c 	ide_hwif_t *hwif = drive->hwif;
drive              84 drivers/ide/cs5530.c 	ide_drive_t *mate = ide_get_pair_dev(drive);
drive             103 drivers/ide/cs5530.c static void cs5530_set_dma_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive             108 drivers/ide/cs5530.c 	switch (drive->dma_mode) {
drive             119 drivers/ide/cs5530.c 	if ((drive-> dn & 1) == 0) {		/* are we configuring drive0? */
drive              73 drivers/ide/cs5535.c static void cs5535_set_speed(ide_drive_t *drive, const u8 speed)
drive              76 drivers/ide/cs5535.c 	u8 unit = drive->dn & 1;
drive              80 drivers/ide/cs5535.c 		ide_drive_t *pair = ide_get_pair_dev(drive);
drive             135 drivers/ide/cs5535.c static void cs5535_set_dma_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive             137 drivers/ide/cs5535.c 	cs5535_set_speed(drive, drive->dma_mode);
drive             148 drivers/ide/cs5535.c static void cs5535_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive             150 drivers/ide/cs5535.c 	cs5535_set_speed(drive, drive->pio_mode);
drive              80 drivers/ide/cs5536.c static void cs5536_program_dtc(ide_drive_t *drive, u8 tim)
drive              82 drivers/ide/cs5536.c 	struct pci_dev *pdev = to_pci_dev(drive->hwif->dev);
drive              83 drivers/ide/cs5536.c 	int dshift = (drive->dn & 1) ? IDE_D1_SHIFT : IDE_D0_SHIFT;
drive             120 drivers/ide/cs5536.c static void cs5536_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive             135 drivers/ide/cs5536.c 	ide_drive_t *pair = ide_get_pair_dev(drive);
drive             136 drivers/ide/cs5536.c 	int cshift = (drive->dn & 1) ? IDE_CAST_D1_SHIFT : IDE_CAST_D0_SHIFT;
drive             137 drivers/ide/cs5536.c 	unsigned long timings = (unsigned long)ide_get_drivedata(drive);
drive             139 drivers/ide/cs5536.c 	const u8 pio = drive->pio_mode - XFER_PIO_0;
drive             147 drivers/ide/cs5536.c 	ide_set_drivedata(drive, (void *)timings);
drive             149 drivers/ide/cs5536.c 	cs5536_program_dtc(drive, drv_timings[pio]);
drive             168 drivers/ide/cs5536.c static void cs5536_set_dma_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive             179 drivers/ide/cs5536.c 	int dshift = (drive->dn & 1) ? IDE_D1_SHIFT : IDE_D0_SHIFT;
drive             180 drivers/ide/cs5536.c 	unsigned long timings = (unsigned long)ide_get_drivedata(drive);
drive             182 drivers/ide/cs5536.c 	const u8 mode = drive->dma_mode;
drive             193 drivers/ide/cs5536.c 		ide_set_drivedata(drive, (void *)timings);
drive             199 drivers/ide/cs5536.c static void cs5536_dma_start(ide_drive_t *drive)
drive             201 drivers/ide/cs5536.c 	unsigned long timings = (unsigned long)ide_get_drivedata(drive);
drive             203 drivers/ide/cs5536.c 	if (drive->current_speed < XFER_UDMA_0 &&
drive             205 drivers/ide/cs5536.c 		cs5536_program_dtc(drive, timings >> 8);
drive             207 drivers/ide/cs5536.c 	ide_dma_start(drive);
drive             210 drivers/ide/cs5536.c static int cs5536_dma_end(ide_drive_t *drive)
drive             212 drivers/ide/cs5536.c 	int ret = ide_dma_end(drive);
drive             213 drivers/ide/cs5536.c 	unsigned long timings = (unsigned long)ide_get_drivedata(drive);
drive             215 drivers/ide/cs5536.c 	if (drive->current_speed < XFER_UDMA_0 &&
drive             217 drivers/ide/cs5536.c 		cs5536_program_dtc(drive, timings & IDE_DRV_MASK);
drive              57 drivers/ide/cy82c693.c static void cy82c693_set_dma_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive              59 drivers/ide/cy82c693.c 	const u8 mode = drive->dma_mode;
drive              84 drivers/ide/cy82c693.c static void cy82c693_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive              94 drivers/ide/cy82c693.c 	if (drive->dn > 1) {  /* drive is on the secondary channel */
drive              99 drivers/ide/cy82c693.c 				drive->name);
drive             104 drivers/ide/cy82c693.c 	ide_timing_compute(drive, drive->pio_mode, &t, T, 1);
drive             112 drivers/ide/cy82c693.c 	if ((drive->dn & 1) == 0) {
drive             145 drivers/ide/cy82c693.c 	if (drive->dn > 1)
drive              72 drivers/ide/dtc2278.c static void dtc2278_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive              76 drivers/ide/dtc2278.c 	if (drive->pio_mode >= XFER_PIO_3) {
drive              66 drivers/ide/falconide.c static void falconide_input_data(ide_drive_t *drive, struct ide_cmd *cmd,
drive              69 drivers/ide/falconide.c 	unsigned long data_addr = drive->hwif->io_ports.data_addr;
drive              71 drivers/ide/falconide.c 	if (drive->media == ide_disk && cmd && (cmd->tf_flags & IDE_TFLAG_FS)) {
drive              79 drivers/ide/falconide.c static void falconide_output_data(ide_drive_t *drive, struct ide_cmd *cmd,
drive              82 drivers/ide/falconide.c 	unsigned long data_addr = drive->hwif->io_ports.data_addr;
drive              84 drivers/ide/falconide.c 	if (drive->media == ide_disk && cmd && (cmd->tf_flags & IDE_TFLAG_FS)) {
drive              71 drivers/ide/gayle.c static void gayle_a1200_clear_irq(ide_drive_t *drive)
drive              73 drivers/ide/gayle.c 	ide_hwif_t *hwif = drive->hwif;
drive             535 drivers/ide/hpt366.c static bool check_in_drive_list(ide_drive_t *drive, const char **list)
drive             537 drivers/ide/hpt366.c 	return match_string(list, -1, (char *)&drive->id[ATA_ID_PROD]) >= 0;
drive             553 drivers/ide/hpt366.c static u8 hpt3xx_udma_filter(ide_drive_t *drive)
drive             555 drivers/ide/hpt366.c 	ide_hwif_t *hwif	= drive->hwif;
drive             562 drivers/ide/hpt366.c 		    check_in_drive_list(drive, bad_ata66_4))
drive             566 drivers/ide/hpt366.c 		    check_in_drive_list(drive, bad_ata66_3))
drive             571 drivers/ide/hpt366.c 		    check_in_drive_list(drive, bad_ata100_5))
drive             576 drivers/ide/hpt366.c 		    check_in_drive_list(drive, bad_ata100_5))
drive             583 drivers/ide/hpt366.c 		if (ata_id_is_sata(drive->id))
drive             590 drivers/ide/hpt366.c 	return check_in_drive_list(drive, bad_ata33) ? 0x00 : mask;
drive             593 drivers/ide/hpt366.c static u8 hpt3xx_mdma_filter(ide_drive_t *drive)
drive             595 drivers/ide/hpt366.c 	ide_hwif_t *hwif	= drive->hwif;
drive             603 drivers/ide/hpt366.c 		if (ata_id_is_sata(drive->id))
drive             628 drivers/ide/hpt366.c static void hpt3xx_set_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive             633 drivers/ide/hpt366.c 	u8  itr_addr		= 0x40 + (drive->dn * 4);
drive             635 drivers/ide/hpt366.c 	const u8 speed		= drive->dma_mode;
drive             652 drivers/ide/hpt366.c static void hpt3xx_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive             654 drivers/ide/hpt366.c 	drive->dma_mode = drive->pio_mode;
drive             655 drivers/ide/hpt366.c 	hpt3xx_set_mode(hwif, drive);
drive             658 drivers/ide/hpt366.c static void hpt3xx_maskproc(ide_drive_t *drive, int mask)
drive             660 drivers/ide/hpt366.c 	ide_hwif_t *hwif	= drive->hwif;
drive             664 drivers/ide/hpt366.c 	if ((drive->dev_flags & IDE_DFLAG_NIEN_QUIRK) == 0)
drive             688 drivers/ide/hpt366.c static void hpt366_dma_lost_irq(ide_drive_t *drive)
drive             690 drivers/ide/hpt366.c 	struct pci_dev *dev = to_pci_dev(drive->hwif->dev);
drive             697 drivers/ide/hpt366.c 		drive->name, __func__, mcr1, mcr3, scr1);
drive             700 drivers/ide/hpt366.c 	ide_dma_lost_irq(drive);
drive             703 drivers/ide/hpt366.c static void hpt370_clear_engine(ide_drive_t *drive)
drive             705 drivers/ide/hpt366.c 	ide_hwif_t *hwif = drive->hwif;
drive             712 drivers/ide/hpt366.c static void hpt370_irq_timeout(ide_drive_t *drive)
drive             714 drivers/ide/hpt366.c 	ide_hwif_t *hwif	= drive->hwif;
drive             720 drivers/ide/hpt366.c 	printk(KERN_DEBUG "%s: %d bytes in FIFO\n", drive->name, bfifo & 0x1ff);
drive             726 drivers/ide/hpt366.c 	hpt370_clear_engine(drive);
drive             729 drivers/ide/hpt366.c static void hpt370_dma_start(ide_drive_t *drive)
drive             732 drivers/ide/hpt366.c 	hpt370_clear_engine(drive);
drive             734 drivers/ide/hpt366.c 	ide_dma_start(drive);
drive             737 drivers/ide/hpt366.c static int hpt370_dma_end(ide_drive_t *drive)
drive             739 drivers/ide/hpt366.c 	ide_hwif_t *hwif	= drive->hwif;
drive             747 drivers/ide/hpt366.c 			hpt370_irq_timeout(drive);
drive             749 drivers/ide/hpt366.c 	return ide_dma_end(drive);
drive             753 drivers/ide/hpt366.c static int hpt374_dma_test_irq(ide_drive_t *drive)
drive             755 drivers/ide/hpt366.c 	ide_hwif_t *hwif	= drive->hwif;
drive             774 drivers/ide/hpt366.c static int hpt374_dma_end(ide_drive_t *drive)
drive             776 drivers/ide/hpt366.c 	ide_hwif_t *hwif	= drive->hwif;
drive             785 drivers/ide/hpt366.c 	return ide_dma_end(drive);
drive             836 drivers/ide/hpt366.c static void hpt3xxn_rw_disk(ide_drive_t *drive, struct request *rq)
drive             838 drivers/ide/hpt366.c 	hpt3xxn_set_clock(drive->hwif, rq_data_dir(rq) ? 0x21 : 0x23);
drive              48 drivers/ide/ht6560b.c static inline u8 HT_CONFIG(ide_drive_t *drive)
drive              50 drivers/ide/ht6560b.c 	return ((unsigned long)ide_get_drivedata(drive) & 0xff00) >> 8;
drive              98 drivers/ide/ht6560b.c static inline u8 HT_TIMING(ide_drive_t *drive)
drive             100 drivers/ide/ht6560b.c 	return (unsigned long)ide_get_drivedata(drive) & 0x00ff;
drive             115 drivers/ide/ht6560b.c static void ht6560b_dev_select(ide_drive_t *drive)
drive             117 drivers/ide/ht6560b.c 	ide_hwif_t *hwif = drive->hwif;
drive             125 drivers/ide/ht6560b.c 	select = HT_CONFIG(drive);
drive             126 drivers/ide/ht6560b.c 	timing = HT_TIMING(drive);
drive             132 drivers/ide/ht6560b.c 	if (drive->media != ide_disk ||
drive             133 drivers/ide/ht6560b.c 	    (drive->dev_flags & IDE_DFLAG_PRESENT) == 0)
drive             151 drivers/ide/ht6560b.c 			drive->name, select, timing);
drive             156 drivers/ide/ht6560b.c 	outb(drive->select | ATA_DEVICE_OBS, hwif->io_ports.device_addr);
drive             200 drivers/ide/ht6560b.c static u8 ht_pio2timings(ide_drive_t *drive, const u8 pio)
drive             210 drivers/ide/ht6560b.c 		cycle_time = ide_pio_cycle_time(drive, pio);
drive             233 drivers/ide/ht6560b.c 		printk("ht6560b: drive %s setting pio=%d recovery=%d (%dns) active=%d (%dns)\n", drive->name, pio, recovery_cycles, recovery_time, active_cycles, active_time);
drive             240 drivers/ide/ht6560b.c 		printk("ht6560b: drive %s setting pio=0\n", drive->name);
drive             252 drivers/ide/ht6560b.c static void ht_set_prefetch(ide_drive_t *drive, u8 state)
drive             259 drivers/ide/ht6560b.c 	config = (unsigned long)ide_get_drivedata(drive);
drive             266 drivers/ide/ht6560b.c 		drive->dev_flags |= IDE_DFLAG_NO_UNMASK;
drive             267 drivers/ide/ht6560b.c 		drive->dev_flags &= ~IDE_DFLAG_UNMASK;
drive             270 drivers/ide/ht6560b.c 		drive->dev_flags &= ~IDE_DFLAG_NO_UNMASK;
drive             273 drivers/ide/ht6560b.c 	ide_set_drivedata(drive, (void *)config);
drive             278 drivers/ide/ht6560b.c 	printk("ht6560b: drive %s prefetch mode %sabled\n", drive->name, (state ? "en" : "dis"));
drive             282 drivers/ide/ht6560b.c static void ht6560b_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive             285 drivers/ide/ht6560b.c 	const u8 pio = drive->pio_mode - XFER_PIO_0;
drive             291 drivers/ide/ht6560b.c 		ht_set_prefetch(drive, pio & 1);
drive             295 drivers/ide/ht6560b.c 	timing = ht_pio2timings(drive, pio);
drive             298 drivers/ide/ht6560b.c 	config = (unsigned long)ide_get_drivedata(drive);
drive             301 drivers/ide/ht6560b.c 	ide_set_drivedata(drive, (void *)config);
drive             305 drivers/ide/ht6560b.c 	printk("ht6560b: drive %s tuned to pio mode %#x timing=%#x\n", drive->name, pio, timing);
drive             309 drivers/ide/ht6560b.c static void __init ht6560b_init_dev(ide_drive_t *drive)
drive             311 drivers/ide/ht6560b.c 	ide_hwif_t *hwif = drive->hwif;
drive             318 drivers/ide/ht6560b.c 	ide_set_drivedata(drive, (void *)t);
drive             168 drivers/ide/icside.c static void icside_maskproc(ide_drive_t *drive, int mask)
drive             170 drivers/ide/icside.c 	ide_hwif_t *hwif = drive->hwif;
drive             238 drivers/ide/icside.c static void icside_set_dma_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive             242 drivers/ide/icside.c 	const u8 xfer_mode = drive->dma_mode;
drive             270 drivers/ide/icside.c 	if (use_dma_info && drive->id[ATA_ID_EIDE_DMA_TIME] > cycle_time)
drive             271 drivers/ide/icside.c 		cycle_time = drive->id[ATA_ID_EIDE_DMA_TIME];
drive             273 drivers/ide/icside.c 	ide_set_drivedata(drive, (void *)cycle_time);
drive             276 drivers/ide/icside.c 	       drive->name, ide_xfer_verbose(xfer_mode),
drive             285 drivers/ide/icside.c static void icside_dma_host_set(ide_drive_t *drive, int on)
drive             289 drivers/ide/icside.c static int icside_dma_end(ide_drive_t *drive)
drive             291 drivers/ide/icside.c 	ide_hwif_t *hwif = drive->hwif;
drive             299 drivers/ide/icside.c static void icside_dma_start(ide_drive_t *drive)
drive             301 drivers/ide/icside.c 	ide_hwif_t *hwif = drive->hwif;
drive             309 drivers/ide/icside.c static int icside_dma_setup(ide_drive_t *drive, struct ide_cmd *cmd)
drive             311 drivers/ide/icside.c 	ide_hwif_t *hwif = drive->hwif;
drive             329 drivers/ide/icside.c 	icside_maskproc(drive, 0);
drive             339 drivers/ide/icside.c 	set_dma_speed(ec->dma, (unsigned long)ide_get_drivedata(drive));
drive             351 drivers/ide/icside.c static int icside_dma_test_irq(ide_drive_t *drive)
drive             353 drivers/ide/icside.c 	ide_hwif_t *hwif = drive->hwif;
drive              15 drivers/ide/ide-4drives.c static void ide_4drives_init_dev(ide_drive_t *drive)
drive              17 drivers/ide/ide-4drives.c 	if (drive->hwif->channel)
drive              18 drivers/ide/ide-4drives.c 		drive->select ^= 0x20;
drive             226 drivers/ide/ide-acpi.c static int do_drive_get_GTF(ide_drive_t *drive,
drive             239 drivers/ide/ide-acpi.c 	if (!drive->acpidata->obj_handle) {
drive             240 drivers/ide/ide-acpi.c 		DEBPRINT("No ACPI object found for %s\n", drive->name);
drive             250 drivers/ide/ide-acpi.c 	status = acpi_evaluate_object(drive->acpidata->obj_handle, "_GTF",
drive             307 drivers/ide/ide-acpi.c static int do_drive_set_taskfiles(ide_drive_t *drive,
drive             339 drivers/ide/ide-acpi.c 		err = ide_no_data_taskfile(drive, &cmd);
drive             362 drivers/ide/ide-acpi.c int ide_acpi_exec_tfs(ide_drive_t *drive)
drive             369 drivers/ide/ide-acpi.c 	DEBPRINT("call get_GTF, drive=%s port=%d\n", drive->name, drive->dn);
drive             371 drivers/ide/ide-acpi.c 	ret = do_drive_get_GTF(drive, &gtf_length, &gtf_address, &obj_loc);
drive             377 drivers/ide/ide-acpi.c 	DEBPRINT("call set_taskfiles, drive=%s\n", drive->name);
drive             379 drivers/ide/ide-acpi.c 	ret = do_drive_set_taskfiles(drive, gtf_length, gtf_address);
drive             518 drivers/ide/ide-acpi.c 	ide_drive_t *drive;
drive             530 drivers/ide/ide-acpi.c 	ide_port_for_each_present_dev(i, drive, hwif) {
drive             531 drivers/ide/ide-acpi.c 		if (drive->acpidata->obj_handle)
drive             532 drivers/ide/ide-acpi.c 			acpi_bus_set_power(drive->acpidata->obj_handle,
drive             568 drivers/ide/ide-acpi.c 	ide_drive_t *drive;
drive             583 drivers/ide/ide-acpi.c 	ide_port_for_each_present_dev(i, drive, hwif) {
drive             587 drivers/ide/ide-acpi.c 			 drive->name, hwif->channel, drive->dn & 1);
drive             591 drivers/ide/ide-acpi.c 					    drive->dn & 1);
drive             593 drivers/ide/ide-acpi.c 		DEBPRINT("drive %s handle 0x%p\n", drive->name, dev_handle);
drive             595 drivers/ide/ide-acpi.c 		drive->acpidata->obj_handle = dev_handle;
drive             599 drivers/ide/ide-acpi.c 	ide_port_for_each_present_dev(i, drive, hwif) {
drive             600 drivers/ide/ide-acpi.c 		err = taskfile_lib_get_identify(drive, drive->acpidata->idbuff);
drive             603 drivers/ide/ide-acpi.c 				 drive->name, err);
drive             619 drivers/ide/ide-acpi.c 	ide_port_for_each_present_dev(i, drive, hwif) {
drive             620 drivers/ide/ide-acpi.c 		ide_acpi_exec_tfs(drive);
drive              28 drivers/ide/ide-atapi.c static inline int dev_is_idecd(ide_drive_t *drive)
drive              30 drivers/ide/ide-atapi.c 	return drive->media == ide_cdrom || drive->media == ide_optical;
drive              37 drivers/ide/ide-atapi.c int ide_check_atapi_device(ide_drive_t *drive, const char *s)
drive              39 drivers/ide/ide-atapi.c 	u16 *id = drive->id;
drive              52 drivers/ide/ide-atapi.c 	if (drive->media == ide_floppy && device_type == 5 &&
drive              60 drivers/ide/ide-atapi.c 			s, drive->name, protocol);
drive              61 drivers/ide/ide-atapi.c 	else if ((drive->media == ide_floppy && device_type != 0) ||
drive              62 drivers/ide/ide-atapi.c 		 (drive->media == ide_tape && device_type != 1))
drive              64 drivers/ide/ide-atapi.c 			s, drive->name, device_type);
drive              67 drivers/ide/ide-atapi.c 			s, drive->name);
drive              68 drivers/ide/ide-atapi.c 	else if (drive->media == ide_floppy && drq_type == 3)
drive              70 drivers/ide/ide-atapi.c 			"supported\n", s, drive->name, drq_type);
drive              73 drivers/ide/ide-atapi.c 			"bytes\n", s, drive->name, packet_size);
drive              90 drivers/ide/ide-atapi.c int ide_queue_pc_tail(ide_drive_t *drive, struct gendisk *disk,
drive              96 drivers/ide/ide-atapi.c 	rq = blk_get_request(drive->queue, REQ_OP_DRV_IN, 0);
drive             101 drivers/ide/ide-atapi.c 		error = blk_rq_map_kern(drive->queue, rq, buf, bufflen,
drive             108 drivers/ide/ide-atapi.c 	if (drive->media == ide_tape)
drive             110 drivers/ide/ide-atapi.c 	blk_execute_rq(drive->queue, disk, rq, 0);
drive             118 drivers/ide/ide-atapi.c int ide_do_test_unit_ready(ide_drive_t *drive, struct gendisk *disk)
drive             125 drivers/ide/ide-atapi.c 	return ide_queue_pc_tail(drive, disk, &pc, NULL, 0);
drive             129 drivers/ide/ide-atapi.c int ide_do_start_stop(ide_drive_t *drive, struct gendisk *disk, int start)
drive             137 drivers/ide/ide-atapi.c 	if (drive->media == ide_tape)
drive             140 drivers/ide/ide-atapi.c 	return ide_queue_pc_tail(drive, disk, &pc, NULL, 0);
drive             144 drivers/ide/ide-atapi.c int ide_set_media_lock(ide_drive_t *drive, struct gendisk *disk, int on)
drive             148 drivers/ide/ide-atapi.c 	if ((drive->dev_flags & IDE_DFLAG_DOORLOCKING) == 0)
drive             155 drivers/ide/ide-atapi.c 	return ide_queue_pc_tail(drive, disk, &pc, NULL, 0);
drive             159 drivers/ide/ide-atapi.c void ide_create_request_sense_cmd(ide_drive_t *drive, struct ide_atapi_pc *pc)
drive             163 drivers/ide/ide-atapi.c 	if (drive->media == ide_floppy) {
drive             173 drivers/ide/ide-atapi.c void ide_prep_sense(ide_drive_t *drive, struct request *rq)
drive             175 drivers/ide/ide-atapi.c 	struct request_sense *sense = &drive->sense_data;
drive             181 drivers/ide/ide-atapi.c 	switch (drive->media) {
drive             197 drivers/ide/ide-atapi.c 	if (ata_sense_request(rq) || drive->sense_rq_armed)
drive             200 drivers/ide/ide-atapi.c 	sense_rq = drive->sense_rq;
drive             202 drivers/ide/ide-atapi.c 		sense_rq = blk_mq_alloc_request(drive->queue, REQ_OP_DRV_IN,
drive             204 drivers/ide/ide-atapi.c 		drive->sense_rq = sense_rq;
drive             212 drivers/ide/ide-atapi.c 	err = blk_rq_map_kern(drive->queue, sense_rq, sense, sense_len,
drive             217 drivers/ide/ide-atapi.c 					    "buffer\n", drive->name);
drive             219 drivers/ide/ide-atapi.c 		drive->sense_rq = NULL;
drive             230 drivers/ide/ide-atapi.c 	if (drive->media == ide_tape)
drive             233 drivers/ide/ide-atapi.c 	drive->sense_rq_armed = true;
drive             237 drivers/ide/ide-atapi.c int ide_queue_sense_rq(ide_drive_t *drive, void *special)
drive             239 drivers/ide/ide-atapi.c 	ide_hwif_t *hwif = drive->hwif;
drive             246 drivers/ide/ide-atapi.c 	if (!drive->sense_rq_armed) {
drive             248 drivers/ide/ide-atapi.c 		       drive->name);
drive             253 drivers/ide/ide-atapi.c 	sense_rq = drive->sense_rq;
drive             255 drivers/ide/ide-atapi.c 	drive->sense_rq_armed = false;
drive             257 drivers/ide/ide-atapi.c 	drive->hwif->rq = NULL;
drive             259 drivers/ide/ide-atapi.c 	ide_insert_request_head(drive, sense_rq);
drive             270 drivers/ide/ide-atapi.c void ide_retry_pc(ide_drive_t *drive)
drive             272 drivers/ide/ide-atapi.c 	struct request *failed_rq = drive->hwif->rq;
drive             273 drivers/ide/ide-atapi.c 	struct request *sense_rq = drive->sense_rq;
drive             274 drivers/ide/ide-atapi.c 	struct ide_atapi_pc *pc = &drive->request_sense_pc;
drive             276 drivers/ide/ide-atapi.c 	(void)ide_read_error(drive);
drive             282 drivers/ide/ide-atapi.c 	if (drive->media == ide_tape)
drive             283 drivers/ide/ide-atapi.c 		drive->atapi_flags |= IDE_AFLAG_IGNORE_DSC;
drive             290 drivers/ide/ide-atapi.c 	drive->hwif->rq = NULL;
drive             291 drivers/ide/ide-atapi.c 	ide_requeue_and_plug(drive, failed_rq);
drive             292 drivers/ide/ide-atapi.c 	if (ide_queue_sense_rq(drive, pc))
drive             293 drivers/ide/ide-atapi.c 		ide_complete_rq(drive, BLK_STS_IOERR, blk_rq_bytes(failed_rq));
drive             297 drivers/ide/ide-atapi.c int ide_cd_expiry(ide_drive_t *drive)
drive             299 drivers/ide/ide-atapi.c 	struct request *rq = drive->hwif->rq;
drive             350 drivers/ide/ide-atapi.c void ide_read_bcount_and_ireason(ide_drive_t *drive, u16 *bcount, u8 *ireason)
drive             354 drivers/ide/ide-atapi.c 	drive->hwif->tp_ops->tf_read(drive, &tf, IDE_VALID_NSECT |
drive             370 drivers/ide/ide-atapi.c int ide_check_ireason(ide_drive_t *drive, struct request *rq, int len,
drive             373 drivers/ide/ide-atapi.c 	ide_hwif_t *hwif = drive->hwif;
drive             381 drivers/ide/ide-atapi.c 				drive->name, __func__);
drive             383 drivers/ide/ide-atapi.c 		if (dev_is_idecd(drive))
drive             384 drivers/ide/ide-atapi.c 			ide_pad_transfer(drive, rw, len);
drive             386 drivers/ide/ide-atapi.c 		if (dev_is_idecd(drive)) {
drive             396 drivers/ide/ide-atapi.c 			printk(KERN_ERR PFX "%s: CoD != 0 in %s\n", drive->name,
drive             401 drivers/ide/ide-atapi.c 				drive->name, __func__, ireason);
drive             404 drivers/ide/ide-atapi.c 	if (dev_is_idecd(drive) && ata_pc_request(rq))
drive             416 drivers/ide/ide-atapi.c static ide_startstop_t ide_pc_intr(ide_drive_t *drive)
drive             418 drivers/ide/ide-atapi.c 	struct ide_atapi_pc *pc = drive->pc;
drive             419 drivers/ide/ide-atapi.c 	ide_hwif_t *hwif = drive->hwif;
drive             430 drivers/ide/ide-atapi.c 	timeout = (drive->media == ide_floppy) ? WAIT_FLOPPY_CMD
drive             439 drivers/ide/ide-atapi.c 		drive->waiting_for_dma = 0;
drive             440 drivers/ide/ide-atapi.c 		rc = hwif->dma_ops->dma_end(drive);
drive             441 drivers/ide/ide-atapi.c 		ide_dma_unmap_sg(drive, cmd);
drive             443 drivers/ide/ide-atapi.c 		if (rc || (drive->media == ide_tape && (stat & ATA_ERR))) {
drive             444 drivers/ide/ide-atapi.c 			if (drive->media == ide_floppy)
drive             446 drivers/ide/ide-atapi.c 					drive->name, rq_data_dir(pc->rq)
drive             451 drivers/ide/ide-atapi.c 		debug_log("%s: DMA finished\n", drive->name);
drive             466 drivers/ide/ide-atapi.c 		if (drive->media == ide_tape &&
drive             472 drivers/ide/ide-atapi.c 			debug_log("%s: I/O error\n", drive->name);
drive             474 drivers/ide/ide-atapi.c 			if (drive->media != ide_tape)
drive             479 drivers/ide/ide-atapi.c 						"sense command\n", drive->name);
drive             480 drivers/ide/ide-atapi.c 				return ide_do_reset(drive);
drive             486 drivers/ide/ide-atapi.c 			ide_retry_pc(drive);
drive             503 drivers/ide/ide-atapi.c 		uptodate = drive->pc_callback(drive, dsc);
drive             506 drivers/ide/ide-atapi.c 			drive->failed_pc = NULL;
drive             521 drivers/ide/ide-atapi.c 		ide_complete_rq(drive, error, blk_rq_bytes(rq));
drive             528 drivers/ide/ide-atapi.c 				"interrupts in DMA mode\n", drive->name);
drive             529 drivers/ide/ide-atapi.c 		ide_dma_off(drive);
drive             530 drivers/ide/ide-atapi.c 		return ide_do_reset(drive);
drive             534 drivers/ide/ide-atapi.c 	ide_read_bcount_and_ireason(drive, &bcount, &ireason);
drive             536 drivers/ide/ide-atapi.c 	if (ide_check_ireason(drive, rq, bcount, ireason, write))
drive             537 drivers/ide/ide-atapi.c 		return ide_do_reset(drive);
drive             540 drivers/ide/ide-atapi.c 	ide_pio_bytes(drive, cmd, write, done);
drive             548 drivers/ide/ide-atapi.c 		ide_pad_transfer(drive, write, bcount);
drive             554 drivers/ide/ide-atapi.c 	ide_set_handler(drive, ide_pc_intr, timeout);
drive             570 drivers/ide/ide-atapi.c static u8 ide_read_ireason(ide_drive_t *drive)
drive             574 drivers/ide/ide-atapi.c 	drive->hwif->tp_ops->tf_read(drive, &tf, IDE_VALID_NSECT);
drive             579 drivers/ide/ide-atapi.c static u8 ide_wait_ireason(ide_drive_t *drive, u8 ireason)
drive             586 drivers/ide/ide-atapi.c 				"a packet command, retrying\n", drive->name);
drive             588 drivers/ide/ide-atapi.c 		ireason = ide_read_ireason(drive);
drive             592 drivers/ide/ide-atapi.c 					drive->name);
drive             601 drivers/ide/ide-atapi.c static int ide_delayed_transfer_pc(ide_drive_t *drive)
drive             604 drivers/ide/ide-atapi.c 	drive->hwif->tp_ops->output_data(drive, NULL, drive->pc->c, 12);
drive             610 drivers/ide/ide-atapi.c static ide_startstop_t ide_transfer_pc(ide_drive_t *drive)
drive             613 drivers/ide/ide-atapi.c 	ide_hwif_t *hwif = drive->hwif;
drive             621 drivers/ide/ide-atapi.c 	if (ide_wait_stat(&startstop, drive, ATA_DRQ, ATA_BUSY, WAIT_READY)) {
drive             623 drivers/ide/ide-atapi.c 				"DRQ isn't asserted\n", drive->name);
drive             627 drivers/ide/ide-atapi.c 	if (drive->atapi_flags & IDE_AFLAG_DRQ_INTERRUPT) {
drive             628 drivers/ide/ide-atapi.c 		if (drive->dma)
drive             629 drivers/ide/ide-atapi.c 			drive->waiting_for_dma = 1;
drive             632 drivers/ide/ide-atapi.c 	if (dev_is_idecd(drive)) {
drive             641 drivers/ide/ide-atapi.c 		pc = drive->pc;
drive             650 drivers/ide/ide-atapi.c 		if (drive->atapi_flags & IDE_AFLAG_ZIP_DRIVE) {
drive             651 drivers/ide/ide-atapi.c 			timeout = drive->pc_delay;
drive             654 drivers/ide/ide-atapi.c 			timeout = (drive->media == ide_floppy) ? WAIT_FLOPPY_CMD
drive             659 drivers/ide/ide-atapi.c 		ireason = ide_read_ireason(drive);
drive             660 drivers/ide/ide-atapi.c 		if (drive->media == ide_tape)
drive             661 drivers/ide/ide-atapi.c 			ireason = ide_wait_ireason(drive, ireason);
drive             665 drivers/ide/ide-atapi.c 				"issuing a packet command\n", drive->name);
drive             667 drivers/ide/ide-atapi.c 			return ide_do_reset(drive);
drive             674 drivers/ide/ide-atapi.c 	ide_set_handler(drive,
drive             675 drivers/ide/ide-atapi.c 			(dev_is_idecd(drive) ? drive->irq_handler
drive             680 drivers/ide/ide-atapi.c 	if ((drive->atapi_flags & IDE_AFLAG_ZIP_DRIVE) == 0)
drive             681 drivers/ide/ide-atapi.c 		hwif->tp_ops->output_data(drive, NULL, scsi_req(rq)->cmd, cmd_len);
drive             684 drivers/ide/ide-atapi.c 	if (dev_is_idecd(drive)) {
drive             685 drivers/ide/ide-atapi.c 		if (drive->dma)
drive             686 drivers/ide/ide-atapi.c 			hwif->dma_ops->dma_start(drive);
drive             690 drivers/ide/ide-atapi.c 			hwif->dma_ops->dma_start(drive);
drive             697 drivers/ide/ide-atapi.c ide_startstop_t ide_issue_pc(ide_drive_t *drive, struct ide_cmd *cmd)
drive             700 drivers/ide/ide-atapi.c 	ide_hwif_t *hwif = drive->hwif;
drive             706 drivers/ide/ide-atapi.c 	u8 drq_int = !!(drive->atapi_flags & IDE_AFLAG_DRQ_INTERRUPT);
drive             708 drivers/ide/ide-atapi.c 	if (dev_is_idecd(drive)) {
drive             714 drivers/ide/ide-atapi.c 		if (drive->dma)
drive             715 drivers/ide/ide-atapi.c 			drive->dma = !ide_dma_prepare(drive, cmd);
drive             717 drivers/ide/ide-atapi.c 		pc = drive->pc;
drive             721 drivers/ide/ide-atapi.c 		bcount = ((drive->media == ide_tape) ? bytes
drive             730 drivers/ide/ide-atapi.c 			ide_dma_off(drive);
drive             734 drivers/ide/ide-atapi.c 			drive->dma = !ide_dma_prepare(drive, cmd);
drive             736 drivers/ide/ide-atapi.c 		if (!drive->dma)
drive             739 drivers/ide/ide-atapi.c 		timeout = (drive->media == ide_floppy) ? WAIT_FLOPPY_CMD
drive             743 drivers/ide/ide-atapi.c 	ide_init_packet_cmd(cmd, valid_tf, bcount, drive->dma);
drive             745 drivers/ide/ide-atapi.c 	(void)do_rw_taskfile(drive, cmd);
drive             748 drivers/ide/ide-atapi.c 		if (drive->dma)
drive             749 drivers/ide/ide-atapi.c 			drive->waiting_for_dma = 0;
drive             753 drivers/ide/ide-atapi.c 	ide_execute_command(drive, cmd, ide_transfer_pc, timeout);
drive             755 drivers/ide/ide-atapi.c 	return drq_int ? ide_started : ide_transfer_pc(drive);
drive              66 drivers/ide/ide-cd.c 		if (ide_device_get(cd->drive))
drive              78 drivers/ide/ide-cd.c 	ide_drive_t *drive = cd->drive;
drive              82 drivers/ide/ide-cd.c 	ide_device_put(drive);
drive              91 drivers/ide/ide-cd.c static void cdrom_saw_media_change(ide_drive_t *drive)
drive              93 drivers/ide/ide-cd.c 	drive->dev_flags |= IDE_DFLAG_MEDIA_CHANGED;
drive              94 drivers/ide/ide-cd.c 	drive->atapi_flags &= ~IDE_AFLAG_TOC_VALID;
drive              97 drivers/ide/ide-cd.c static int cdrom_log_sense(ide_drive_t *drive, struct request *rq)
drive              99 drivers/ide/ide-cd.c 	struct request_sense *sense = &drive->sense_data;
drive             135 drivers/ide/ide-cd.c 		cdrom_saw_media_change(drive);
drive             144 drivers/ide/ide-cd.c static void cdrom_analyze_sense_data(ide_drive_t *drive,
drive             147 drivers/ide/ide-cd.c 	struct request_sense *sense = &drive->sense_data;
drive             148 drivers/ide/ide-cd.c 	struct cdrom_info *info = drive->driver_data;
drive             159 drivers/ide/ide-cd.c 	if (!cdrom_log_sense(drive, failed_command))
drive             187 drivers/ide/ide-cd.c 			if (queue_logical_block_size(drive->queue) == 2048)
drive             203 drivers/ide/ide-cd.c 			    drive->probed_capacity - sector < 4 * 75)
drive             208 drivers/ide/ide-cd.c 	ide_cd_log_error(drive->name, failed_command, sense);
drive             211 drivers/ide/ide-cd.c static void ide_cd_complete_failed_rq(ide_drive_t *drive, struct request *rq)
drive             229 drivers/ide/ide-cd.c 		cdrom_analyze_sense_data(drive, failed);
drive             231 drivers/ide/ide-cd.c 		if (ide_end_rq(drive, failed, BLK_STS_IOERR, blk_rq_bytes(failed)))
drive             234 drivers/ide/ide-cd.c 		cdrom_analyze_sense_data(drive, NULL);
drive             245 drivers/ide/ide-cd.c static int ide_cd_breathe(ide_drive_t *drive, struct request *rq)
drive             248 drivers/ide/ide-cd.c 	struct cdrom_info *info = drive->driver_data;
drive             262 drivers/ide/ide-cd.c 		blk_mq_delay_kick_requeue_list(drive->queue, 1);
drive             267 drivers/ide/ide-cd.c static void ide_cd_free_sense(ide_drive_t *drive)
drive             269 drivers/ide/ide-cd.c 	if (!drive->sense_rq)
drive             272 drivers/ide/ide-cd.c 	blk_mq_free_request(drive->sense_rq);
drive             273 drivers/ide/ide-cd.c 	drive->sense_rq = NULL;
drive             274 drivers/ide/ide-cd.c 	drive->sense_rq_armed = false;
drive             283 drivers/ide/ide-cd.c static int cdrom_decode_status(ide_drive_t *drive, u8 stat)
drive             285 drivers/ide/ide-cd.c 	ide_hwif_t *hwif = drive->hwif;
drive             290 drivers/ide/ide-cd.c 	err = ide_read_error(drive);
drive             317 drivers/ide/ide-cd.c 			if (ide_cd_breathe(drive, rq))
drive             320 drivers/ide/ide-cd.c 			cdrom_saw_media_change(drive);
drive             325 drivers/ide/ide-cd.c 					drive->name);
drive             330 drivers/ide/ide-cd.c 		cdrom_saw_media_change(drive);
drive             359 drivers/ide/ide-cd.c 			ide_dump_status(drive, "command error", stat);
drive             368 drivers/ide/ide-cd.c 			ide_dump_status(drive, "media error "
drive             375 drivers/ide/ide-cd.c 			ide_dump_status(drive, "media error (blank)",
drive             384 drivers/ide/ide-cd.c 			ide_error(drive, "cdrom_decode_status", stat);
drive             405 drivers/ide/ide-cd.c 		return ide_queue_sense_rq(drive, NULL) ? 2 : 1;
drive             411 drivers/ide/ide-cd.c 		return ide_queue_sense_rq(drive, rq) ? 2 : 1;
drive             416 drivers/ide/ide-cd.c static void ide_cd_request_sense_fixup(ide_drive_t *drive, struct ide_cmd *cmd)
drive             431 drivers/ide/ide-cd.c int ide_cd_queue_pc(ide_drive_t *drive, const unsigned char *cmd,
drive             436 drivers/ide/ide-cd.c 	struct cdrom_info *info = drive->driver_data;
drive             454 drivers/ide/ide-cd.c 		rq = blk_get_request(drive->queue,
drive             461 drivers/ide/ide-cd.c 			error = blk_rq_map_kern(drive->queue, rq, buffer,
drive             469 drivers/ide/ide-cd.c 		blk_execute_rq(drive->queue, info->disk, rq, 0);
drive             488 drivers/ide/ide-cd.c 				cdrom_saw_media_change(drive);
drive             515 drivers/ide/ide-cd.c static bool ide_cd_error_cmd(ide_drive_t *drive, struct ide_cmd *cmd)
drive             523 drivers/ide/ide-cd.c 		ide_complete_rq(drive, BLK_STS_OK, nr_bytes);
drive             594 drivers/ide/ide-cd.c static bool ide_cdrom_prep_rq(ide_drive_t *drive, struct request *rq)
drive             599 drivers/ide/ide-cd.c 		return ide_cdrom_prep_fs(drive->queue, rq);
drive             606 drivers/ide/ide-cd.c static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive)
drive             608 drivers/ide/ide-cd.c 	ide_hwif_t *hwif = drive->hwif;
drive             622 drivers/ide/ide-cd.c 	dma = drive->dma;
drive             624 drivers/ide/ide-cd.c 		drive->dma = 0;
drive             625 drivers/ide/ide-cd.c 		drive->waiting_for_dma = 0;
drive             626 drivers/ide/ide-cd.c 		dma_error = hwif->dma_ops->dma_end(drive);
drive             627 drivers/ide/ide-cd.c 		ide_dma_unmap_sg(drive, cmd);
drive             629 drivers/ide/ide-cd.c 			printk(KERN_ERR PFX "%s: DMA %s error\n", drive->name,
drive             631 drivers/ide/ide-cd.c 			ide_dma_off(drive);
drive             639 drivers/ide/ide-cd.c 		rc = cdrom_decode_status(drive, stat);
drive             650 drivers/ide/ide-cd.c 			return ide_error(drive, "dma error", stat);
drive             655 drivers/ide/ide-cd.c 	ide_read_bcount_and_ireason(drive, &len, &ireason);
drive             675 drivers/ide/ide-cd.c 					"(%u bytes)\n", drive->name, __func__,
drive             684 drivers/ide/ide-cd.c 			ide_cd_request_sense_fixup(drive, cmd);
drive             693 drivers/ide/ide-cd.c 				ide_pio_bytes(drive, cmd, write, thislen);
drive             706 drivers/ide/ide-cd.c 	rc = ide_check_ireason(drive, rq, len, ireason, write);
drive             723 drivers/ide/ide-cd.c 		ide_pio_bytes(drive, cmd, write, blen);
drive             736 drivers/ide/ide-cd.c 			ide_pad_transfer(drive, write, len);
drive             739 drivers/ide/ide-cd.c 				drive->name);
drive             759 drivers/ide/ide-cd.c 	ide_set_handler(drive, cdrom_newpc_intr, timeout);
drive             769 drivers/ide/ide-cd.c 			ide_cd_complete_failed_rq(drive, rq);
drive             780 drivers/ide/ide-cd.c 			if (ide_cd_error_cmd(drive, cmd))
drive             790 drivers/ide/ide-cd.c 		ide_complete_rq(drive, uptodate ? BLK_STS_OK : BLK_STS_IOERR, blk_rq_bytes(rq));
drive             793 drivers/ide/ide-cd.c 			ide_error(drive, "request sense failure", stat);
drive             796 drivers/ide/ide-cd.c 	ide_cd_free_sense(drive);
drive             800 drivers/ide/ide-cd.c static ide_startstop_t cdrom_start_rw(ide_drive_t *drive, struct request *rq)
drive             802 drivers/ide/ide-cd.c 	struct cdrom_info *cd = drive->driver_data;
drive             803 drivers/ide/ide-cd.c 	struct request_queue *q = drive->queue;
drive             821 drivers/ide/ide-cd.c 		ide_cdrom_prep_rq(drive, rq);
drive             830 drivers/ide/ide-cd.c 	drive->dma = !!(drive->dev_flags & IDE_DFLAG_USING_DMA);
drive             840 drivers/ide/ide-cd.c static void cdrom_do_block_pc(ide_drive_t *drive, struct request *rq)
drive             851 drivers/ide/ide-cd.c 	drive->dma = 0;
drive             855 drivers/ide/ide-cd.c 		struct request_queue *q = drive->queue;
drive             859 drivers/ide/ide-cd.c 		drive->dma = !!(drive->dev_flags & IDE_DFLAG_USING_DMA);
drive             871 drivers/ide/ide-cd.c 			drive->dma = 0;
drive             875 drivers/ide/ide-cd.c static ide_startstop_t ide_cd_do_request(ide_drive_t *drive, struct request *rq,
drive             885 drivers/ide/ide-cd.c 	if (drive->debug_mask & IDE_DBG_RQ)
drive             890 drivers/ide/ide-cd.c 		if (cdrom_start_rw(drive, rq) == ide_stopped)
drive             898 drivers/ide/ide-cd.c 		cdrom_do_block_pc(drive, rq);
drive             916 drivers/ide/ide-cd.c 	ide_prep_sense(drive, rq);
drive             927 drivers/ide/ide-cd.c 		ide_map_sg(drive, &cmd);
drive             930 drivers/ide/ide-cd.c 	return ide_issue_pc(drive, &cmd);
drive             937 drivers/ide/ide-cd.c 	ide_complete_rq(drive, uptodate ? BLK_STS_OK : BLK_STS_IOERR, nsectors << 9);
drive             958 drivers/ide/ide-cd.c int cdrom_check_status(ide_drive_t *drive, struct scsi_sense_hdr *sshdr)
drive             960 drivers/ide/ide-cd.c 	struct cdrom_info *info = drive->driver_data;
drive             980 drivers/ide/ide-cd.c 	return ide_cd_queue_pc(drive, cmd, 0, NULL, NULL, sshdr, 0, RQF_QUIET);
drive             983 drivers/ide/ide-cd.c static int cdrom_read_capacity(ide_drive_t *drive, unsigned long *capacity,
drive            1001 drivers/ide/ide-cd.c 	stat = ide_cd_queue_pc(drive, cmd, 0, &capbuf, &len, NULL, 0,
drive            1022 drivers/ide/ide-cd.c 				drive->name, blocklen);
drive            1036 drivers/ide/ide-cd.c static int cdrom_read_tocentry(ide_drive_t *drive, int trackno, int msf_flag,
drive            1054 drivers/ide/ide-cd.c 	return ide_cd_queue_pc(drive, cmd, 0, buf, &buflen, NULL, 0, RQF_QUIET);
drive            1058 drivers/ide/ide-cd.c int ide_cd_read_toc(ide_drive_t *drive)
drive            1061 drivers/ide/ide-cd.c 	struct cdrom_info *info = drive->driver_data;
drive            1078 drivers/ide/ide-cd.c 					drive->name);
drive            1088 drivers/ide/ide-cd.c 	(void) cdrom_check_status(drive, NULL);
drive            1090 drivers/ide/ide-cd.c 	if (drive->atapi_flags & IDE_AFLAG_TOC_VALID)
drive            1094 drivers/ide/ide-cd.c 	stat = cdrom_read_capacity(drive, &toc->capacity, &sectors_per_frame);
drive            1100 drivers/ide/ide-cd.c 	drive->probed_capacity = toc->capacity * sectors_per_frame;
drive            1102 drivers/ide/ide-cd.c 	blk_queue_logical_block_size(drive->queue,
drive            1106 drivers/ide/ide-cd.c 	stat = cdrom_read_tocentry(drive, 0, 1, 0, (char *) &toc->hdr,
drive            1111 drivers/ide/ide-cd.c 	if (drive->atapi_flags & IDE_AFLAG_TOCTRACKS_AS_BCD) {
drive            1123 drivers/ide/ide-cd.c 	stat = cdrom_read_tocentry(drive, toc->hdr.first_track, 1, 0,
drive            1143 drivers/ide/ide-cd.c 		stat = cdrom_read_tocentry(drive, CDROM_LEADOUT, 1, 0,
drive            1151 drivers/ide/ide-cd.c 		if (drive->atapi_flags & IDE_AFLAG_TOCTRACKS_AS_BCD) {
drive            1165 drivers/ide/ide-cd.c 	if (drive->atapi_flags & IDE_AFLAG_TOCTRACKS_AS_BCD) {
drive            1171 drivers/ide/ide-cd.c 		if (drive->atapi_flags & IDE_AFLAG_TOCADDR_AS_BCD) {
drive            1172 drivers/ide/ide-cd.c 			if (drive->atapi_flags & IDE_AFLAG_TOCTRACKS_AS_BCD)
drive            1183 drivers/ide/ide-cd.c 		stat = cdrom_read_tocentry(drive, 0, 0, 1, (char *)&ms_tmp,
drive            1195 drivers/ide/ide-cd.c 	if (drive->atapi_flags & IDE_AFLAG_TOCADDR_AS_BCD) {
drive            1197 drivers/ide/ide-cd.c 		stat = cdrom_read_tocentry(drive, 0, 1, 1, (char *)&ms_tmp,
drive            1215 drivers/ide/ide-cd.c 		drive->probed_capacity = toc->capacity * sectors_per_frame;
drive            1219 drivers/ide/ide-cd.c 	drive->atapi_flags |= IDE_AFLAG_TOC_VALID;
drive            1224 drivers/ide/ide-cd.c int ide_cdrom_get_capabilities(ide_drive_t *drive, u8 *buf)
drive            1226 drivers/ide/ide-cd.c 	struct cdrom_info *info = drive->driver_data;
drive            1233 drivers/ide/ide-cd.c 	if ((drive->atapi_flags & IDE_AFLAG_FULL_CAPS_PAGE) == 0)
drive            1246 drivers/ide/ide-cd.c void ide_cdrom_update_speed(ide_drive_t *drive, u8 *buf)
drive            1248 drivers/ide/ide-cd.c 	struct cdrom_info *cd = drive->driver_data;
drive            1253 drivers/ide/ide-cd.c 	if (drive->atapi_flags & IDE_AFLAG_LE_SPEED_FIELDS) {
drive            1291 drivers/ide/ide-cd.c static int ide_cdrom_register(ide_drive_t *drive, int nslots)
drive            1293 drivers/ide/ide-cd.c 	struct cdrom_info *info = drive->driver_data;
drive            1301 drivers/ide/ide-cd.c 	devinfo->handle = drive;
drive            1302 drivers/ide/ide-cd.c 	strcpy(devinfo->name, drive->name);
drive            1304 drivers/ide/ide-cd.c 	if (drive->atapi_flags & IDE_AFLAG_NO_SPEED_SELECT)
drive            1311 drivers/ide/ide-cd.c static int ide_cdrom_probe_capabilities(ide_drive_t *drive)
drive            1313 drivers/ide/ide-cd.c 	struct cdrom_info *cd = drive->driver_data;
drive            1320 drivers/ide/ide-cd.c 				     drive->media, drive->atapi_flags);
drive            1326 drivers/ide/ide-cd.c 	if (drive->media == ide_optical) {
drive            1329 drivers/ide/ide-cd.c 				drive->name);
drive            1333 drivers/ide/ide-cd.c 	if (drive->atapi_flags & IDE_AFLAG_PRE_ATAPI12) {
drive            1334 drivers/ide/ide-cd.c 		drive->atapi_flags &= ~IDE_AFLAG_NO_EJECT;
drive            1345 drivers/ide/ide-cd.c 	cdi->handle = drive;
drive            1348 drivers/ide/ide-cd.c 	if (ide_cdrom_get_capabilities(drive, buf))
drive            1352 drivers/ide/ide-cd.c 		drive->dev_flags &= ~IDE_DFLAG_DOORLOCKING;
drive            1354 drivers/ide/ide-cd.c 		drive->atapi_flags &= ~IDE_AFLAG_NO_EJECT;
drive            1365 drivers/ide/ide-cd.c 	if ((buf[8 + 4] & 0x01) || (drive->atapi_flags & IDE_AFLAG_PLAY_AUDIO_OK))
drive            1371 drivers/ide/ide-cd.c 	    (drive->atapi_flags & IDE_AFLAG_NO_AUTOCLOSE))
drive            1384 drivers/ide/ide-cd.c 	ide_cdrom_update_speed(drive, buf);
drive            1386 drivers/ide/ide-cd.c 	printk(KERN_INFO PFX "%s: ATAPI", drive->name);
drive            1422 drivers/ide/ide-cd.c static sector_t ide_cdrom_capacity(ide_drive_t *drive)
drive            1426 drivers/ide/ide-cd.c 	if (cdrom_read_capacity(drive, &capacity, &sectors_per_frame))
drive            1434 drivers/ide/ide-cd.c 	ide_drive_t *drive = m->private;
drive            1436 drivers/ide/ide-cd.c 	seq_printf(m, "%llu\n", (long long)ide_cdrom_capacity(drive));
drive            1445 drivers/ide/ide-cd.c static ide_proc_entry_t *ide_cd_proc_entries(ide_drive_t *drive)
drive            1450 drivers/ide/ide-cd.c static const struct ide_proc_devset *ide_cd_proc_devsets(ide_drive_t *drive)
drive            1513 drivers/ide/ide-cd.c static int ide_cdrom_setup(ide_drive_t *drive)
drive            1515 drivers/ide/ide-cd.c 	struct cdrom_info *cd = drive->driver_data;
drive            1517 drivers/ide/ide-cd.c 	struct request_queue *q = drive->queue;
drive            1518 drivers/ide/ide-cd.c 	u16 *id = drive->id;
drive            1524 drivers/ide/ide-cd.c 	drive->prep_rq = ide_cdrom_prep_rq;
drive            1528 drivers/ide/ide-cd.c 	drive->dev_flags |= IDE_DFLAG_MEDIA_CHANGED;
drive            1529 drivers/ide/ide-cd.c 	drive->atapi_flags = IDE_AFLAG_NO_EJECT | ide_cd_flags(id);
drive            1531 drivers/ide/ide-cd.c 	if ((drive->atapi_flags & IDE_AFLAG_VERTOS_300_SSD) &&
drive            1533 drivers/ide/ide-cd.c 		drive->atapi_flags |= (IDE_AFLAG_TOCTRACKS_AS_BCD |
drive            1535 drivers/ide/ide-cd.c 	else if ((drive->atapi_flags & IDE_AFLAG_VERTOS_600_ESD) &&
drive            1537 drivers/ide/ide-cd.c 		drive->atapi_flags |= IDE_AFLAG_TOCTRACKS_AS_BCD;
drive            1538 drivers/ide/ide-cd.c 	else if (drive->atapi_flags & IDE_AFLAG_SANYO_3CD)
drive            1542 drivers/ide/ide-cd.c 	nslots = ide_cdrom_probe_capabilities(drive);
drive            1546 drivers/ide/ide-cd.c 	if (ide_cdrom_register(drive, nslots)) {
drive            1548 drivers/ide/ide-cd.c 				" cdrom driver.\n", drive->name, __func__);
drive            1553 drivers/ide/ide-cd.c 	ide_proc_register_driver(drive, cd->driver);
drive            1557 drivers/ide/ide-cd.c static void ide_cd_remove(ide_drive_t *drive)
drive            1559 drivers/ide/ide-cd.c 	struct cdrom_info *info = drive->driver_data;
drive            1563 drivers/ide/ide-cd.c 	ide_proc_unregister_driver(drive, info->driver);
drive            1576 drivers/ide/ide-cd.c 	ide_drive_t *drive = info->drive;
drive            1582 drivers/ide/ide-cd.c 	if (devinfo->handle == drive)
drive            1584 drivers/ide/ide-cd.c 	drive->driver_data = NULL;
drive            1585 drivers/ide/ide-cd.c 	drive->prep_rq = NULL;
drive            1694 drivers/ide/ide-cd.c 	err = generic_ide_ioctl(info->drive, bdev, cmd, arg);
drive            1725 drivers/ide/ide-cd.c 	ide_cd_read_toc(info->drive);
drive            1745 drivers/ide/ide-cd.c static int ide_cd_probe(ide_drive_t *drive)
drive            1751 drivers/ide/ide-cd.c 				     drive->driver_req, drive->media);
drive            1753 drivers/ide/ide-cd.c 	if (!strstr("ide-cdrom", drive->driver_req))
drive            1756 drivers/ide/ide-cd.c 	if (drive->media != ide_cdrom && drive->media != ide_optical)
drive            1759 drivers/ide/ide-cd.c 	drive->debug_mask = debug_mask;
drive            1760 drivers/ide/ide-cd.c 	drive->irq_handler = cdrom_newpc_intr;
drive            1765 drivers/ide/ide-cd.c 				drive->name);
drive            1773 drivers/ide/ide-cd.c 	ide_init_disk(g, drive);
drive            1775 drivers/ide/ide-cd.c 	info->dev.parent = &drive->gendev;
drive            1777 drivers/ide/ide-cd.c 	dev_set_name(&info->dev, "%s", dev_name(&drive->gendev));
drive            1782 drivers/ide/ide-cd.c 	info->drive = drive;
drive            1788 drivers/ide/ide-cd.c 	drive->driver_data = info;
drive            1792 drivers/ide/ide-cd.c 	if (ide_cdrom_setup(drive)) {
drive            1797 drivers/ide/ide-cd.c 	ide_cd_read_toc(drive);
drive            1801 drivers/ide/ide-cd.c 	device_add_disk(&drive->gendev, g, NULL);
drive              77 drivers/ide/ide-cd.h 	ide_drive_t		*drive;
drive              31 drivers/ide/ide-cd_ioctl.c 	ide_drive_t *drive = cdi->handle;
drive              34 drivers/ide/ide-cd_ioctl.c 		drive->atapi_flags &= ~IDE_AFLAG_TOC_VALID;
drive              44 drivers/ide/ide-cd_ioctl.c 	ide_drive_t *drive = cdi->handle;
drive              52 drivers/ide/ide-cd_ioctl.c 	stat = cdrom_check_status(drive, &sshdr);
drive              93 drivers/ide/ide-cd_ioctl.c 	ide_drive_t *drive = cdi->handle;
drive              97 drivers/ide/ide-cd_ioctl.c 		(void) cdrom_check_status(drive, NULL);
drive              98 drivers/ide/ide-cd_ioctl.c 		retval = (drive->dev_flags & IDE_DFLAG_MEDIA_CHANGED) ? 1 : 0;
drive              99 drivers/ide/ide-cd_ioctl.c 		drive->dev_flags &= ~IDE_DFLAG_MEDIA_CHANGED;
drive             109 drivers/ide/ide-cd_ioctl.c int cdrom_eject(ide_drive_t *drive, int ejectflag)
drive             111 drivers/ide/ide-cd_ioctl.c 	struct cdrom_info *cd = drive->driver_data;
drive             116 drivers/ide/ide-cd_ioctl.c 	if ((drive->atapi_flags & IDE_AFLAG_NO_EJECT) && !ejectflag)
drive             120 drivers/ide/ide-cd_ioctl.c 	if ((drive->atapi_flags & IDE_AFLAG_DOOR_LOCKED) && ejectflag)
drive             132 drivers/ide/ide-cd_ioctl.c 	return ide_cd_queue_pc(drive, cmd, 0, NULL, NULL, NULL, 0, 0);
drive             137 drivers/ide/ide-cd_ioctl.c int ide_cd_lockdoor(ide_drive_t *drive, int lockflag)
drive             143 drivers/ide/ide-cd_ioctl.c 	if ((drive->dev_flags & IDE_DFLAG_DOORLOCKING) == 0) {
drive             153 drivers/ide/ide-cd_ioctl.c 		stat = ide_cd_queue_pc(drive, cmd, 0, NULL, NULL,
drive             163 drivers/ide/ide-cd_ioctl.c 			drive->name);
drive             164 drivers/ide/ide-cd_ioctl.c 		drive->dev_flags &= ~IDE_DFLAG_DOORLOCKING;
drive             174 drivers/ide/ide-cd_ioctl.c 			drive->atapi_flags |= IDE_AFLAG_DOOR_LOCKED;
drive             176 drivers/ide/ide-cd_ioctl.c 			drive->atapi_flags &= ~IDE_AFLAG_DOOR_LOCKED;
drive             184 drivers/ide/ide-cd_ioctl.c 	ide_drive_t *drive = cdi->handle;
drive             187 drivers/ide/ide-cd_ioctl.c 		int stat = ide_cd_lockdoor(drive, 0);
drive             193 drivers/ide/ide-cd_ioctl.c 	return cdrom_eject(drive, !position);
drive             198 drivers/ide/ide-cd_ioctl.c 	ide_drive_t *drive = cdi->handle;
drive             200 drivers/ide/ide-cd_ioctl.c 	return ide_cd_lockdoor(drive, lock);
drive             209 drivers/ide/ide-cd_ioctl.c 	ide_drive_t *drive = cdi->handle;
drive             210 drivers/ide/ide-cd_ioctl.c 	struct cdrom_info *cd = drive->driver_data;
drive             233 drivers/ide/ide-cd_ioctl.c 	stat = ide_cd_queue_pc(drive, cmd, 0, NULL, NULL, NULL, 0, 0);
drive             235 drivers/ide/ide-cd_ioctl.c 	if (!ide_cdrom_get_capabilities(drive, buf)) {
drive             236 drivers/ide/ide-cd_ioctl.c 		ide_cdrom_update_speed(drive, buf);
drive             247 drivers/ide/ide-cd_ioctl.c 	ide_drive_t *drive = cdi->handle;
drive             248 drivers/ide/ide-cd_ioctl.c 	struct cdrom_info *info = drive->driver_data;
drive             251 drivers/ide/ide-cd_ioctl.c 	if ((drive->atapi_flags & IDE_AFLAG_TOC_VALID) == 0 || !info->toc) {
drive             252 drivers/ide/ide-cd_ioctl.c 		ret = ide_cd_read_toc(drive);
drive             267 drivers/ide/ide-cd_ioctl.c 	ide_drive_t *drive = cdi->handle;
drive             281 drivers/ide/ide-cd_ioctl.c 	stat = ide_cd_queue_pc(drive, cmd, 0, buf, &len, NULL, 0, 0);
drive             294 drivers/ide/ide-cd_ioctl.c 	ide_drive_t *drive = cdi->handle;
drive             295 drivers/ide/ide-cd_ioctl.c 	struct cdrom_info *cd = drive->driver_data;
drive             299 drivers/ide/ide-cd_ioctl.c 	rq = blk_get_request(drive->queue, REQ_OP_DRV_IN, 0);
drive             302 drivers/ide/ide-cd_ioctl.c 	blk_execute_rq(drive->queue, cd->disk, rq, 0);
drive             309 drivers/ide/ide-cd_ioctl.c 	if (drive->atapi_flags & IDE_AFLAG_DOOR_LOCKED)
drive             310 drivers/ide/ide-cd_ioctl.c 		(void)ide_cd_lockdoor(drive, 1);
drive             315 drivers/ide/ide-cd_ioctl.c static int ide_cd_get_toc_entry(ide_drive_t *drive, int track,
drive             318 drivers/ide/ide-cd_ioctl.c 	struct cdrom_info *info = drive->driver_data;
drive             325 drivers/ide/ide-cd_ioctl.c 	if ((drive->atapi_flags & IDE_AFLAG_TOC_VALID) == 0)
drive             344 drivers/ide/ide-cd_ioctl.c static int ide_cd_fake_play_trkind(ide_drive_t *drive, void *arg)
drive             352 drivers/ide/ide-cd_ioctl.c 	stat = ide_cd_get_toc_entry(drive, ti->cdti_trk0, &first_toc);
drive             356 drivers/ide/ide-cd_ioctl.c 	stat = ide_cd_get_toc_entry(drive, ti->cdti_trk1, &last_toc);
drive             374 drivers/ide/ide-cd_ioctl.c 	return ide_cd_queue_pc(drive, cmd, 0, NULL, NULL, NULL, 0, 0);
drive             377 drivers/ide/ide-cd_ioctl.c static int ide_cd_read_tochdr(ide_drive_t *drive, void *arg)
drive             379 drivers/ide/ide-cd_ioctl.c 	struct cdrom_info *cd = drive->driver_data;
drive             385 drivers/ide/ide-cd_ioctl.c 	stat = ide_cd_read_toc(drive);
drive             396 drivers/ide/ide-cd_ioctl.c static int ide_cd_read_tocentry(ide_drive_t *drive, void *arg)
drive             402 drivers/ide/ide-cd_ioctl.c 	stat = ide_cd_get_toc_entry(drive, tocentry->cdte_track, &toce);
drive             422 drivers/ide/ide-cd_ioctl.c 	ide_drive_t *drive = cdi->handle;
drive             430 drivers/ide/ide-cd_ioctl.c 		return ide_cd_fake_play_trkind(drive, arg);
drive             432 drivers/ide/ide-cd_ioctl.c 		return ide_cd_read_tochdr(drive, arg);
drive             434 drivers/ide/ide-cd_ioctl.c 		return ide_cd_read_tocentry(drive, arg);
drive             444 drivers/ide/ide-cd_ioctl.c 	ide_drive_t *drive = cdi->handle;
drive             461 drivers/ide/ide-cd_ioctl.c 	cgc->stat = ide_cd_queue_pc(drive, cgc->cmd,
drive              11 drivers/ide/ide-devsets.c static int set_io_32bit(ide_drive_t *drive, int arg)
drive              13 drivers/ide/ide-devsets.c 	if (drive->dev_flags & IDE_DFLAG_NO_IO_32BIT)
drive              19 drivers/ide/ide-devsets.c 	drive->io_32bit = arg;
drive              26 drivers/ide/ide-devsets.c static int set_ksettings(ide_drive_t *drive, int arg)
drive              32 drivers/ide/ide-devsets.c 		drive->dev_flags |= IDE_DFLAG_KEEP_SETTINGS;
drive              34 drivers/ide/ide-devsets.c 		drive->dev_flags &= ~IDE_DFLAG_KEEP_SETTINGS;
drive              41 drivers/ide/ide-devsets.c static int set_using_dma(ide_drive_t *drive, int arg)
drive              49 drivers/ide/ide-devsets.c 	if (ata_id_has_dma(drive->id) == 0)
drive              52 drivers/ide/ide-devsets.c 	if (drive->hwif->dma_ops == NULL)
drive              58 drivers/ide/ide-devsets.c 		if (ide_set_dma(drive))
drive              61 drivers/ide/ide-devsets.c 		ide_dma_off(drive);
drive              97 drivers/ide/ide-devsets.c static int set_pio_mode(ide_drive_t *drive, int arg)
drive              99 drivers/ide/ide-devsets.c 	ide_hwif_t *hwif = drive->hwif;
drive             109 drivers/ide/ide-devsets.c 	if (set_pio_mode_abuse(drive->hwif, arg)) {
drive             110 drivers/ide/ide-devsets.c 		drive->pio_mode = arg + XFER_PIO_0;
drive             117 drivers/ide/ide-devsets.c 			port_ops->set_pio_mode(hwif, drive);
drive             120 drivers/ide/ide-devsets.c 			port_ops->set_pio_mode(hwif, drive);
drive             122 drivers/ide/ide-devsets.c 		int keep_dma = !!(drive->dev_flags & IDE_DFLAG_USING_DMA);
drive             124 drivers/ide/ide-devsets.c 		ide_set_pio(drive, arg);
drive             128 drivers/ide/ide-devsets.c 				ide_dma_on(drive);
drive             137 drivers/ide/ide-devsets.c static int set_unmaskirq(ide_drive_t *drive, int arg)
drive             139 drivers/ide/ide-devsets.c 	if (drive->dev_flags & IDE_DFLAG_NO_UNMASK)
drive             146 drivers/ide/ide-devsets.c 		drive->dev_flags |= IDE_DFLAG_UNMASK;
drive             148 drivers/ide/ide-devsets.c 		drive->dev_flags &= ~IDE_DFLAG_UNMASK;
drive             159 drivers/ide/ide-devsets.c int ide_devset_execute(ide_drive_t *drive, const struct ide_devset *setting,
drive             162 drivers/ide/ide-devsets.c 	struct request_queue *q = drive->queue;
drive             167 drivers/ide/ide-devsets.c 		return setting->set(drive, arg);
drive             183 drivers/ide/ide-devsets.c ide_startstop_t ide_do_devset(ide_drive_t *drive, struct request *rq)
drive             187 drivers/ide/ide-devsets.c 	err = setfunc(drive, *(int *)&scsi_req(rq)->cmd[1]);
drive             190 drivers/ide/ide-devsets.c 	ide_complete_rq(drive, 0, blk_rq_bytes(rq));
drive              56 drivers/ide/ide-disk.c static void ide_tf_set_cmd(ide_drive_t *drive, struct ide_cmd *cmd, u8 dma)
drive              68 drivers/ide/ide-disk.c 		if (drive->mult_count) {
drive              82 drivers/ide/ide-disk.c static ide_startstop_t __ide_do_rw_disk(ide_drive_t *drive, struct request *rq,
drive              85 drivers/ide/ide-disk.c 	ide_hwif_t *hwif	= drive->hwif;
drive              87 drivers/ide/ide-disk.c 	u8 lba48		= !!(drive->dev_flags & IDE_DFLAG_LBA48);
drive              88 drivers/ide/ide-disk.c 	u8 dma			= !!(drive->dev_flags & IDE_DFLAG_USING_DMA);
drive             104 drivers/ide/ide-disk.c 	if (drive->dev_flags & IDE_DFLAG_LBA) {
drive             106 drivers/ide/ide-disk.c 			pr_debug("%s: LBA=0x%012llx\n", drive->name,
drive             136 drivers/ide/ide-disk.c 		track = (int)block / drive->sect;
drive             137 drivers/ide/ide-disk.c 		sect  = (int)block % drive->sect + 1;
drive             138 drivers/ide/ide-disk.c 		head  = track % drive->head;
drive             139 drivers/ide/ide-disk.c 		cyl   = track / drive->head;
drive             141 drivers/ide/ide-disk.c 		pr_debug("%s: CHS=%u/%u/%u\n", drive->name, cyl, head, sect);
drive             155 drivers/ide/ide-disk.c 	ide_tf_set_cmd(drive, &cmd, dma);
drive             160 drivers/ide/ide-disk.c 		ide_map_sg(drive, &cmd);
drive             163 drivers/ide/ide-disk.c 	rc = do_rw_taskfile(drive, &cmd);
drive             168 drivers/ide/ide-disk.c 		ide_tf_set_cmd(drive, &cmd, 0);
drive             170 drivers/ide/ide-disk.c 		rc = do_rw_taskfile(drive, &cmd);
drive             182 drivers/ide/ide-disk.c static ide_startstop_t ide_do_rw_disk(ide_drive_t *drive, struct request *rq,
drive             185 drivers/ide/ide-disk.c 	ide_hwif_t *hwif = drive->hwif;
drive             187 drivers/ide/ide-disk.c 	BUG_ON(drive->dev_flags & IDE_DFLAG_BLOCKED);
drive             193 drivers/ide/ide-disk.c 		 drive->name, rq_data_dir(rq) == READ ? "read" : "writ",
drive             197 drivers/ide/ide-disk.c 		hwif->rw_disk(drive, rq);
drive             199 drivers/ide/ide-disk.c 	return __ide_do_rw_disk(drive, rq, block);
drive             206 drivers/ide/ide-disk.c static u64 idedisk_read_native_max_address(ide_drive_t *drive, int lba48)
drive             227 drivers/ide/ide-disk.c 	ide_no_data_taskfile(drive, &cmd);
drive             240 drivers/ide/ide-disk.c static u64 idedisk_set_max_address(ide_drive_t *drive, u64 addr_req, int lba48)
drive             271 drivers/ide/ide-disk.c 	ide_no_data_taskfile(drive, &cmd);
drive             298 drivers/ide/ide-disk.c static u64 ide_disk_hpa_get_native_capacity(ide_drive_t *drive, int lba48)
drive             302 drivers/ide/ide-disk.c 	capacity = drive->capacity64;
drive             303 drivers/ide/ide-disk.c 	set_max  = idedisk_read_native_max_address(drive, lba48);
drive             305 drivers/ide/ide-disk.c 	if (ide_in_drive_list(drive->id, hpa_list)) {
drive             317 drivers/ide/ide-disk.c static u64 ide_disk_hpa_set_capacity(ide_drive_t *drive, u64 set_max, int lba48)
drive             319 drivers/ide/ide-disk.c 	set_max = idedisk_set_max_address(drive, set_max, lba48);
drive             321 drivers/ide/ide-disk.c 		drive->capacity64 = set_max;
drive             326 drivers/ide/ide-disk.c static void idedisk_check_hpa(ide_drive_t *drive)
drive             329 drivers/ide/ide-disk.c 	int lba48 = ata_id_lba48_enabled(drive->id);
drive             331 drivers/ide/ide-disk.c 	capacity = drive->capacity64;
drive             332 drivers/ide/ide-disk.c 	set_max  = ide_disk_hpa_get_native_capacity(drive, lba48);
drive             337 drivers/ide/ide-disk.c 	drive->probed_capacity = set_max;
drive             342 drivers/ide/ide-disk.c 			 drive->name,
drive             346 drivers/ide/ide-disk.c 	if ((drive->dev_flags & IDE_DFLAG_NOHPA) == 0)
drive             349 drivers/ide/ide-disk.c 	set_max = ide_disk_hpa_set_capacity(drive, set_max, lba48);
drive             352 drivers/ide/ide-disk.c 				 drive->name);
drive             355 drivers/ide/ide-disk.c static int ide_disk_get_capacity(ide_drive_t *drive)
drive             357 drivers/ide/ide-disk.c 	u16 *id = drive->id;
drive             363 drivers/ide/ide-disk.c 		drive->capacity64 = ata_id_u64(id, ATA_ID_LBA_CAPACITY_2);
drive             367 drivers/ide/ide-disk.c 		drive->capacity64 = ata_id_u32(id, ATA_ID_LBA_CAPACITY);
drive             371 drivers/ide/ide-disk.c 		drive->capacity64 = drive->cyl * drive->head * drive->sect;
drive             374 drivers/ide/ide-disk.c 	drive->probed_capacity = drive->capacity64;
drive             377 drivers/ide/ide-disk.c 		drive->dev_flags |= IDE_DFLAG_LBA;
drive             384 drivers/ide/ide-disk.c 			idedisk_check_hpa(drive);
drive             388 drivers/ide/ide-disk.c 	if ((drive->dev_flags & IDE_DFLAG_LBA48) == 0 &&
drive             389 drivers/ide/ide-disk.c 	    drive->capacity64 > 1ULL << 28) {
drive             392 drivers/ide/ide-disk.c 		       drive->name, (unsigned long long)drive->capacity64,
drive             393 drivers/ide/ide-disk.c 		       sectors_to_MB(drive->capacity64));
drive             394 drivers/ide/ide-disk.c 		drive->probed_capacity = drive->capacity64 = 1ULL << 28;
drive             397 drivers/ide/ide-disk.c 	if ((drive->hwif->host_flags & IDE_HFLAG_NO_LBA48_DMA) &&
drive             398 drivers/ide/ide-disk.c 	    (drive->dev_flags & IDE_DFLAG_LBA48)) {
drive             399 drivers/ide/ide-disk.c 		if (drive->capacity64 > 1ULL << 28) {
drive             402 drivers/ide/ide-disk.c 					 "> %u\n", drive->name, 1 << 28);
drive             404 drivers/ide/ide-disk.c 			drive->dev_flags &= ~IDE_DFLAG_LBA48;
drive             410 drivers/ide/ide-disk.c static void ide_disk_unlock_native_capacity(ide_drive_t *drive)
drive             412 drivers/ide/ide-disk.c 	u16 *id = drive->id;
drive             415 drivers/ide/ide-disk.c 	if ((drive->dev_flags & IDE_DFLAG_LBA) == 0 ||
drive             423 drivers/ide/ide-disk.c 	if (!ide_disk_hpa_get_native_capacity(drive, lba48))
drive             426 drivers/ide/ide-disk.c 	if (ide_disk_hpa_set_capacity(drive, drive->probed_capacity, lba48))
drive             427 drivers/ide/ide-disk.c 		drive->dev_flags |= IDE_DFLAG_NOHPA; /* disable HPA on resume */
drive             430 drivers/ide/ide-disk.c static bool idedisk_prep_rq(ide_drive_t *drive, struct request *rq)
drive             447 drivers/ide/ide-disk.c 	if (ata_id_flush_ext_enabled(drive->id) &&
drive             448 drivers/ide/ide-disk.c 	    (drive->capacity64 >= (1UL << 28)))
drive             470 drivers/ide/ide-disk.c static int set_multcount(ide_drive_t *drive, int arg)
drive             474 drivers/ide/ide-disk.c 	if (arg < 0 || arg > (drive->id[ATA_ID_MAX_MULTSECT] & 0xff))
drive             477 drivers/ide/ide-disk.c 	if (drive->special_flags & IDE_SFLAG_SET_MULTMODE)
drive             480 drivers/ide/ide-disk.c 	rq = blk_get_request(drive->queue, REQ_OP_DRV_IN, 0);
drive             483 drivers/ide/ide-disk.c 	drive->mult_req = arg;
drive             484 drivers/ide/ide-disk.c 	drive->special_flags |= IDE_SFLAG_SET_MULTMODE;
drive             485 drivers/ide/ide-disk.c 	blk_execute_rq(drive->queue, NULL, rq, 0);
drive             488 drivers/ide/ide-disk.c 	return (drive->mult_count == arg) ? 0 : -EIO;
drive             493 drivers/ide/ide-disk.c static int set_nowerr(ide_drive_t *drive, int arg)
drive             499 drivers/ide/ide-disk.c 		drive->dev_flags |= IDE_DFLAG_NOWERR;
drive             501 drivers/ide/ide-disk.c 		drive->dev_flags &= ~IDE_DFLAG_NOWERR;
drive             503 drivers/ide/ide-disk.c 	drive->bad_wstat = arg ? BAD_R_STAT : BAD_W_STAT;
drive             508 drivers/ide/ide-disk.c static int ide_do_setfeature(ide_drive_t *drive, u8 feature, u8 nsect)
drive             519 drivers/ide/ide-disk.c 	return ide_no_data_taskfile(drive, &cmd);
drive             522 drivers/ide/ide-disk.c static void update_flush(ide_drive_t *drive)
drive             524 drivers/ide/ide-disk.c 	u16 *id = drive->id;
drive             527 drivers/ide/ide-disk.c 	if (drive->dev_flags & IDE_DFLAG_WCACHE) {
drive             538 drivers/ide/ide-disk.c 		capacity = ide_gd_capacity(drive);
drive             540 drivers/ide/ide-disk.c 			(drive->dev_flags & IDE_DFLAG_NOFLUSH) == 0 &&
drive             541 drivers/ide/ide-disk.c 			((drive->dev_flags & IDE_DFLAG_LBA48) == 0 ||
drive             546 drivers/ide/ide-disk.c 		       drive->name, barrier ? "" : "not ");
drive             550 drivers/ide/ide-disk.c 			drive->prep_rq = idedisk_prep_rq;
drive             554 drivers/ide/ide-disk.c 	blk_queue_write_cache(drive->queue, wc, false);
drive             559 drivers/ide/ide-disk.c static int set_wcache(ide_drive_t *drive, int arg)
drive             566 drivers/ide/ide-disk.c 	if (ata_id_flush_enabled(drive->id)) {
drive             567 drivers/ide/ide-disk.c 		err = ide_do_setfeature(drive,
drive             571 drivers/ide/ide-disk.c 				drive->dev_flags |= IDE_DFLAG_WCACHE;
drive             573 drivers/ide/ide-disk.c 				drive->dev_flags &= ~IDE_DFLAG_WCACHE;
drive             577 drivers/ide/ide-disk.c 	update_flush(drive);
drive             582 drivers/ide/ide-disk.c static int do_idedisk_flushcache(ide_drive_t *drive)
drive             587 drivers/ide/ide-disk.c 	if (ata_id_flush_ext_enabled(drive->id))
drive             594 drivers/ide/ide-disk.c 	return ide_no_data_taskfile(drive, &cmd);
drive             599 drivers/ide/ide-disk.c static int set_acoustic(ide_drive_t *drive, int arg)
drive             604 drivers/ide/ide-disk.c 	ide_do_setfeature(drive,
drive             607 drivers/ide/ide-disk.c 	drive->acoustic = arg;
drive             620 drivers/ide/ide-disk.c static int set_addressing(ide_drive_t *drive, int arg)
drive             625 drivers/ide/ide-disk.c 	if (arg && ((drive->hwif->host_flags & IDE_HFLAG_NO_LBA48) ||
drive             626 drivers/ide/ide-disk.c 	    ata_id_lba48_enabled(drive->id) == 0))
drive             633 drivers/ide/ide-disk.c 		drive->dev_flags |= IDE_DFLAG_LBA48;
drive             635 drivers/ide/ide-disk.c 		drive->dev_flags &= ~IDE_DFLAG_LBA48;
drive             647 drivers/ide/ide-disk.c static int ide_disk_check(ide_drive_t *drive, const char *s)
drive             652 drivers/ide/ide-disk.c static void ide_disk_setup(ide_drive_t *drive)
drive             654 drivers/ide/ide-disk.c 	struct ide_disk_obj *idkp = drive->driver_data;
drive             655 drivers/ide/ide-disk.c 	struct request_queue *q = drive->queue;
drive             656 drivers/ide/ide-disk.c 	ide_hwif_t *hwif = drive->hwif;
drive             657 drivers/ide/ide-disk.c 	u16 *id = drive->id;
drive             661 drivers/ide/ide-disk.c 	ide_proc_register_driver(drive, idkp->driver);
drive             663 drivers/ide/ide-disk.c 	if ((drive->dev_flags & IDE_DFLAG_ID_READ) == 0)
drive             666 drivers/ide/ide-disk.c 	if (drive->dev_flags & IDE_DFLAG_REMOVABLE) {
drive             671 drivers/ide/ide-disk.c 			drive->dev_flags |= IDE_DFLAG_DOORLOCKING;
drive             674 drivers/ide/ide-disk.c 	(void)set_addressing(drive, 1);
drive             676 drivers/ide/ide-disk.c 	if (drive->dev_flags & IDE_DFLAG_LBA48) {
drive             685 drivers/ide/ide-disk.c 	printk(KERN_INFO "%s: max request size: %dKiB\n", drive->name,
drive             694 drivers/ide/ide-disk.c 	ide_disk_get_capacity(drive);
drive             700 drivers/ide/ide-disk.c 	capacity = ide_gd_capacity(drive);
drive             702 drivers/ide/ide-disk.c 	if ((drive->dev_flags & IDE_DFLAG_FORCED_GEOM) == 0) {
drive             703 drivers/ide/ide-disk.c 		if (ata_id_lba48_enabled(drive->id)) {
drive             705 drivers/ide/ide-disk.c 			drive->bios_sect = 63;
drive             706 drivers/ide/ide-disk.c 			drive->bios_head = 255;
drive             709 drivers/ide/ide-disk.c 		if (drive->bios_sect && drive->bios_head) {
drive             714 drivers/ide/ide-disk.c 				drive->bios_cyl = 65535;
drive             716 drivers/ide/ide-disk.c 				cylsz = drive->bios_sect * drive->bios_head;
drive             720 drivers/ide/ide-disk.c 				if (cyl > drive->bios_cyl)
drive             721 drivers/ide/ide-disk.c 					drive->bios_cyl = cyl;
drive             726 drivers/ide/ide-disk.c 			 drive->name, capacity, sectors_to_MB(capacity));
drive             733 drivers/ide/ide-disk.c 			 drive->bios_cyl, drive->bios_head, drive->bios_sect);
drive             737 drivers/ide/ide-disk.c 		drive->dev_flags |= IDE_DFLAG_WCACHE;
drive             739 drivers/ide/ide-disk.c 	set_wcache(drive, 1);
drive             741 drivers/ide/ide-disk.c 	if ((drive->dev_flags & IDE_DFLAG_LBA) == 0 &&
drive             742 drivers/ide/ide-disk.c 	    (drive->head == 0 || drive->head > 16)) {
drive             744 drivers/ide/ide-disk.c 			drive->name, drive->head);
drive             745 drivers/ide/ide-disk.c 		drive->dev_flags &= ~IDE_DFLAG_ATTACH;
drive             747 drivers/ide/ide-disk.c 		drive->dev_flags |= IDE_DFLAG_ATTACH;
drive             750 drivers/ide/ide-disk.c static void ide_disk_flush(ide_drive_t *drive)
drive             752 drivers/ide/ide-disk.c 	if (ata_id_flush_enabled(drive->id) == 0 ||
drive             753 drivers/ide/ide-disk.c 	    (drive->dev_flags & IDE_DFLAG_WCACHE) == 0)
drive             756 drivers/ide/ide-disk.c 	if (do_idedisk_flushcache(drive))
drive             757 drivers/ide/ide-disk.c 		printk(KERN_INFO "%s: wcache flush failed!\n", drive->name);
drive             760 drivers/ide/ide-disk.c static int ide_disk_init_media(ide_drive_t *drive, struct gendisk *disk)
drive             765 drivers/ide/ide-disk.c static int ide_disk_set_doorlock(ide_drive_t *drive, struct gendisk *disk,
drive             771 drivers/ide/ide-disk.c 	if ((drive->dev_flags & IDE_DFLAG_DOORLOCKING) == 0)
drive             779 drivers/ide/ide-disk.c 	ret = ide_no_data_taskfile(drive, &cmd);
drive             782 drivers/ide/ide-disk.c 		drive->dev_flags &= ~IDE_DFLAG_DOORLOCKING;
drive              19 drivers/ide/ide-disk_ioctl.c int ide_disk_ioctl(ide_drive_t *drive, struct block_device *bdev, fmode_t mode,
drive              25 drivers/ide/ide-disk_ioctl.c 	err = ide_setting_ioctl(drive, bdev, cmd, arg, ide_disk_ioctl_settings);
drive              29 drivers/ide/ide-disk_ioctl.c 	err = generic_ide_ioctl(drive, bdev, cmd, arg);
drive              10 drivers/ide/ide-disk_proc.c static int smart_enable(ide_drive_t *drive)
drive              23 drivers/ide/ide-disk_proc.c 	return ide_no_data_taskfile(drive, &cmd);
drive              26 drivers/ide/ide-disk_proc.c static int get_smart_data(ide_drive_t *drive, u8 *buf, u8 sub_cmd)
drive              41 drivers/ide/ide-disk_proc.c 	return ide_raw_taskfile(drive, &cmd, buf, 1);
drive              46 drivers/ide/ide-disk_proc.c 	ide_drive_t	*drive = (ide_drive_t *) m->private;
drive              48 drivers/ide/ide-disk_proc.c 	if (drive->dev_flags & IDE_DFLAG_ID_READ)
drive              49 drivers/ide/ide-disk_proc.c 		seq_printf(m, "%i\n", drive->id[ATA_ID_BUF_SIZE] / 2);
drive              57 drivers/ide/ide-disk_proc.c 	ide_drive_t*drive = (ide_drive_t *)m->private;
drive              59 drivers/ide/ide-disk_proc.c 	seq_printf(m, "%llu\n", (long long)ide_gd_capacity(drive));
drive              63 drivers/ide/ide-disk_proc.c static int __idedisk_proc_show(struct seq_file *m, ide_drive_t *drive, u8 sub_cmd)
drive              71 drivers/ide/ide-disk_proc.c 	(void)smart_enable(drive);
drive              73 drivers/ide/ide-disk_proc.c 	if (get_smart_data(drive, buf, sub_cmd) == 0) {
drive              21 drivers/ide/ide-dma-sff.c int config_drive_for_dma(ide_drive_t *drive)
drive              23 drivers/ide/ide-dma-sff.c 	ide_hwif_t *hwif = drive->hwif;
drive              24 drivers/ide/ide-dma-sff.c 	u16 *id = drive->id;
drive              26 drivers/ide/ide-dma-sff.c 	if (drive->media != ide_disk) {
drive              48 drivers/ide/ide-dma-sff.c 	if (ide_dma_good_drive(drive))
drive              83 drivers/ide/ide-dma-sff.c void ide_dma_host_set(ide_drive_t *drive, int on)
drive              85 drivers/ide/ide-dma-sff.c 	ide_hwif_t *hwif = drive->hwif;
drive              86 drivers/ide/ide-dma-sff.c 	u8 unit = drive->dn & 1;
drive             115 drivers/ide/ide-dma-sff.c int ide_build_dmatable(ide_drive_t *drive, struct ide_cmd *cmd)
drive             117 drivers/ide/ide-dma-sff.c 	ide_hwif_t *hwif = drive->hwif;
drive             167 drivers/ide/ide-dma-sff.c 	printk(KERN_ERR "%s: %s\n", drive->name,
drive             188 drivers/ide/ide-dma-sff.c int ide_dma_setup(ide_drive_t *drive, struct ide_cmd *cmd)
drive             190 drivers/ide/ide-dma-sff.c 	ide_hwif_t *hwif = drive->hwif;
drive             196 drivers/ide/ide-dma-sff.c 	if (ide_build_dmatable(drive, cmd) == 0) {
drive             197 drivers/ide/ide-dma-sff.c 		ide_map_sg(drive, cmd);
drive             238 drivers/ide/ide-dma-sff.c int ide_dma_sff_timer_expiry(ide_drive_t *drive)
drive             240 drivers/ide/ide-dma-sff.c 	ide_hwif_t *hwif = drive->hwif;
drive             244 drivers/ide/ide-dma-sff.c 		drive->name, __func__, dma_stat);
drive             264 drivers/ide/ide-dma-sff.c void ide_dma_start(ide_drive_t *drive)
drive             266 drivers/ide/ide-dma-sff.c 	ide_hwif_t *hwif = drive->hwif;
drive             286 drivers/ide/ide-dma-sff.c int ide_dma_end(ide_drive_t *drive)
drive             288 drivers/ide/ide-dma-sff.c 	ide_hwif_t *hwif = drive->hwif;
drive             317 drivers/ide/ide-dma-sff.c int ide_dma_test_irq(ide_drive_t *drive)
drive             319 drivers/ide/ide-dma-sff.c 	ide_hwif_t *hwif = drive->hwif;
drive              91 drivers/ide/ide-dma.c ide_startstop_t ide_dma_intr(ide_drive_t *drive)
drive              93 drivers/ide/ide-dma.c 	ide_hwif_t *hwif = drive->hwif;
drive              97 drivers/ide/ide-dma.c 	drive->waiting_for_dma = 0;
drive              98 drivers/ide/ide-dma.c 	dma_stat = hwif->dma_ops->dma_end(drive);
drive              99 drivers/ide/ide-dma.c 	ide_dma_unmap_sg(drive, cmd);
drive             102 drivers/ide/ide-dma.c 	if (OK_STAT(stat, DRIVE_READY, drive->bad_wstat | ATA_DRQ)) {
drive             105 drivers/ide/ide-dma.c 				ide_finish_cmd(drive, cmd, stat);
drive             107 drivers/ide/ide-dma.c 				ide_complete_rq(drive, BLK_STS_OK,
drive             112 drivers/ide/ide-dma.c 			drive->name, __func__, dma_stat);
drive             114 drivers/ide/ide-dma.c 	return ide_error(drive, "dma_intr", stat);
drive             117 drivers/ide/ide-dma.c int ide_dma_good_drive(ide_drive_t *drive)
drive             119 drivers/ide/ide-dma.c 	return ide_in_drive_list(drive->id, drive_whitelist);
drive             133 drivers/ide/ide-dma.c static int ide_dma_map_sg(ide_drive_t *drive, struct ide_cmd *cmd)
drive             135 drivers/ide/ide-dma.c 	ide_hwif_t *hwif = drive->hwif;
drive             164 drivers/ide/ide-dma.c void ide_dma_unmap_sg(ide_drive_t *drive, struct ide_cmd *cmd)
drive             166 drivers/ide/ide-dma.c 	ide_hwif_t *hwif = drive->hwif;
drive             180 drivers/ide/ide-dma.c void ide_dma_off_quietly(ide_drive_t *drive)
drive             182 drivers/ide/ide-dma.c 	drive->dev_flags &= ~IDE_DFLAG_USING_DMA;
drive             184 drivers/ide/ide-dma.c 	drive->hwif->dma_ops->dma_host_set(drive, 0);
drive             196 drivers/ide/ide-dma.c void ide_dma_off(ide_drive_t *drive)
drive             198 drivers/ide/ide-dma.c 	printk(KERN_INFO "%s: DMA disabled\n", drive->name);
drive             199 drivers/ide/ide-dma.c 	ide_dma_off_quietly(drive);
drive             210 drivers/ide/ide-dma.c void ide_dma_on(ide_drive_t *drive)
drive             212 drivers/ide/ide-dma.c 	drive->dev_flags |= IDE_DFLAG_USING_DMA;
drive             214 drivers/ide/ide-dma.c 	drive->hwif->dma_ops->dma_host_set(drive, 1);
drive             217 drivers/ide/ide-dma.c int __ide_dma_bad_drive(ide_drive_t *drive)
drive             219 drivers/ide/ide-dma.c 	u16 *id = drive->id;
drive             224 drivers/ide/ide-dma.c 				    drive->name, (char *)&id[ATA_ID_PROD]);
drive             237 drivers/ide/ide-dma.c static unsigned int ide_get_mode_mask(ide_drive_t *drive, u8 base, u8 req_mode)
drive             239 drivers/ide/ide-dma.c 	u16 *id = drive->id;
drive             240 drivers/ide/ide-dma.c 	ide_hwif_t *hwif = drive->hwif;
drive             250 drivers/ide/ide-dma.c 			mask &= port_ops->udma_filter(drive);
drive             258 drivers/ide/ide-dma.c 			if ((mask & 0x78) && (eighty_ninty_three(drive) == 0))
drive             273 drivers/ide/ide-dma.c 			mask &= port_ops->mdma_filter(drive);
drive             311 drivers/ide/ide-dma.c u8 ide_find_dma_mode(ide_drive_t *drive, u8 req_mode)
drive             313 drivers/ide/ide-dma.c 	ide_hwif_t *hwif = drive->hwif;
drive             318 drivers/ide/ide-dma.c 	if (drive->media != ide_disk) {
drive             326 drivers/ide/ide-dma.c 		mask = ide_get_mode_mask(drive, xfer_mode_bases[i], req_mode);
drive             338 drivers/ide/ide-dma.c 		if (ide_dma_good_drive(drive) &&
drive             339 drivers/ide/ide-dma.c 		    drive->id[ATA_ID_EIDE_DMA_TIME] < 150)
drive             345 drivers/ide/ide-dma.c 	printk(KERN_INFO "%s: %s mode selected\n", drive->name,
drive             351 drivers/ide/ide-dma.c static int ide_tune_dma(ide_drive_t *drive)
drive             353 drivers/ide/ide-dma.c 	ide_hwif_t *hwif = drive->hwif;
drive             356 drivers/ide/ide-dma.c 	if (ata_id_has_dma(drive->id) == 0 ||
drive             357 drivers/ide/ide-dma.c 	    (drive->dev_flags & IDE_DFLAG_NODMA))
drive             361 drivers/ide/ide-dma.c 	if (__ide_dma_bad_drive(drive))
drive             365 drivers/ide/ide-dma.c 		return config_drive_for_dma(drive);
drive             367 drivers/ide/ide-dma.c 	speed = ide_max_dma_mode(drive);
drive             372 drivers/ide/ide-dma.c 	if (ide_set_dma_mode(drive, speed))
drive             378 drivers/ide/ide-dma.c static int ide_dma_check(ide_drive_t *drive)
drive             380 drivers/ide/ide-dma.c 	ide_hwif_t *hwif = drive->hwif;
drive             382 drivers/ide/ide-dma.c 	if (ide_tune_dma(drive))
drive             389 drivers/ide/ide-dma.c 	ide_set_max_pio(drive);
drive             394 drivers/ide/ide-dma.c int ide_set_dma(ide_drive_t *drive)
drive             404 drivers/ide/ide-dma.c 	ide_dma_off_quietly(drive);
drive             406 drivers/ide/ide-dma.c 	rc = ide_dma_check(drive);
drive             410 drivers/ide/ide-dma.c 	ide_dma_on(drive);
drive             415 drivers/ide/ide-dma.c void ide_check_dma_crc(ide_drive_t *drive)
drive             419 drivers/ide/ide-dma.c 	ide_dma_off_quietly(drive);
drive             420 drivers/ide/ide-dma.c 	drive->crc_count = 0;
drive             421 drivers/ide/ide-dma.c 	mode = drive->current_speed;
drive             430 drivers/ide/ide-dma.c 	ide_set_xfer_rate(drive, mode);
drive             431 drivers/ide/ide-dma.c 	if (drive->current_speed >= XFER_SW_DMA_0)
drive             432 drivers/ide/ide-dma.c 		ide_dma_on(drive);
drive             435 drivers/ide/ide-dma.c void ide_dma_lost_irq(ide_drive_t *drive)
drive             437 drivers/ide/ide-dma.c 	printk(KERN_ERR "%s: DMA interrupt recovery\n", drive->name);
drive             446 drivers/ide/ide-dma.c ide_startstop_t ide_dma_timeout_retry(ide_drive_t *drive, int error)
drive             448 drivers/ide/ide-dma.c 	ide_hwif_t *hwif = drive->hwif;
drive             458 drivers/ide/ide-dma.c 		printk(KERN_WARNING "%s: DMA timeout error\n", drive->name);
drive             459 drivers/ide/ide-dma.c 		drive->waiting_for_dma = 0;
drive             460 drivers/ide/ide-dma.c 		(void)dma_ops->dma_end(drive);
drive             461 drivers/ide/ide-dma.c 		ide_dma_unmap_sg(drive, cmd);
drive             462 drivers/ide/ide-dma.c 		ret = ide_error(drive, "dma timeout error",
drive             465 drivers/ide/ide-dma.c 		printk(KERN_WARNING "%s: DMA timeout retry\n", drive->name);
drive             467 drivers/ide/ide-dma.c 			dma_ops->dma_clear(drive);
drive             468 drivers/ide/ide-dma.c 		printk(KERN_ERR "%s: timeout waiting for DMA\n", drive->name);
drive             469 drivers/ide/ide-dma.c 		if (dma_ops->dma_test_irq(drive) == 0) {
drive             470 drivers/ide/ide-dma.c 			ide_dump_status(drive, "DMA timeout",
drive             472 drivers/ide/ide-dma.c 			drive->waiting_for_dma = 0;
drive             473 drivers/ide/ide-dma.c 			(void)dma_ops->dma_end(drive);
drive             474 drivers/ide/ide-dma.c 			ide_dma_unmap_sg(drive, cmd);
drive             483 drivers/ide/ide-dma.c 	drive->dev_flags |= IDE_DFLAG_DMA_PIO_RETRY;
drive             484 drivers/ide/ide-dma.c 	drive->retry_pio++;
drive             485 drivers/ide/ide-dma.c 	ide_dma_off_quietly(drive);
drive             531 drivers/ide/ide-dma.c int ide_dma_prepare(ide_drive_t *drive, struct ide_cmd *cmd)
drive             533 drivers/ide/ide-dma.c 	const struct ide_dma_ops *dma_ops = drive->hwif->dma_ops;
drive             535 drivers/ide/ide-dma.c 	if ((drive->dev_flags & IDE_DFLAG_USING_DMA) == 0 ||
drive             536 drivers/ide/ide-dma.c 	    (dma_ops->dma_check && dma_ops->dma_check(drive, cmd)))
drive             538 drivers/ide/ide-dma.c 	ide_map_sg(drive, cmd);
drive             539 drivers/ide/ide-dma.c 	if (ide_dma_map_sg(drive, cmd) == 0)
drive             541 drivers/ide/ide-dma.c 	if (dma_ops->dma_setup(drive, cmd))
drive             543 drivers/ide/ide-dma.c 	drive->waiting_for_dma = 1;
drive             546 drivers/ide/ide-dma.c 	ide_dma_unmap_sg(drive, cmd);
drive             548 drivers/ide/ide-dma.c 	ide_map_sg(drive, cmd);
drive               8 drivers/ide/ide-eh.c static ide_startstop_t ide_ata_error(ide_drive_t *drive, struct request *rq,
drive              11 drivers/ide/ide-eh.c 	ide_hwif_t *hwif = drive->hwif;
drive              14 drivers/ide/ide-eh.c 	    ((stat & ATA_DF) && (drive->dev_flags & IDE_DFLAG_NOWERR) == 0)) {
drive              20 drivers/ide/ide-eh.c 			if ((drive->dev_flags & IDE_DFLAG_LBA) &&
drive              26 drivers/ide/ide-eh.c 			drive->crc_count++;
drive              38 drivers/ide/ide-eh.c 		int nsect = drive->mult_count ? drive->mult_count : 1;
drive              40 drivers/ide/ide-eh.c 		ide_pad_transfer(drive, READ, nsect * SECTOR_SIZE);
drive              44 drivers/ide/ide-eh.c 		ide_kill_rq(drive, rq);
drive              53 drivers/ide/ide-eh.c 		return ide_do_reset(drive);
drive              57 drivers/ide/ide-eh.c 		drive->special_flags |= IDE_SFLAG_RECALIBRATE;
drive              64 drivers/ide/ide-eh.c static ide_startstop_t ide_atapi_error(ide_drive_t *drive, struct request *rq,
drive              67 drivers/ide/ide-eh.c 	ide_hwif_t *hwif = drive->hwif;
drive              70 drivers/ide/ide-eh.c 	    ((stat & ATA_DF) && (drive->dev_flags & IDE_DFLAG_NOWERR) == 0)) {
drive              82 drivers/ide/ide-eh.c 		ide_kill_rq(drive, rq);
drive              86 drivers/ide/ide-eh.c 			return ide_do_reset(drive);
drive              94 drivers/ide/ide-eh.c static ide_startstop_t __ide_error(ide_drive_t *drive, struct request *rq,
drive              97 drivers/ide/ide-eh.c 	if (drive->media == ide_disk)
drive              98 drivers/ide/ide-eh.c 		return ide_ata_error(drive, rq, stat, err);
drive              99 drivers/ide/ide-eh.c 	return ide_atapi_error(drive, rq, stat, err);
drive             115 drivers/ide/ide-eh.c ide_startstop_t ide_error(ide_drive_t *drive, const char *msg, u8 stat)
drive             120 drivers/ide/ide-eh.c 	err = ide_dump_status(drive, msg, stat);
drive             122 drivers/ide/ide-eh.c 	rq = drive->hwif->rq;
drive             132 drivers/ide/ide-eh.c 				ide_complete_cmd(drive, cmd, stat, err);
drive             135 drivers/ide/ide-eh.c 			ide_complete_pm_rq(drive, rq);
drive             139 drivers/ide/ide-eh.c 		ide_complete_rq(drive, err ? BLK_STS_IOERR : BLK_STS_OK, blk_rq_bytes(rq));
drive             143 drivers/ide/ide-eh.c 	return __ide_error(drive, rq, stat, err);
drive             147 drivers/ide/ide-eh.c static inline void ide_complete_drive_reset(ide_drive_t *drive, blk_status_t err)
drive             149 drivers/ide/ide-eh.c 	struct request *rq = drive->hwif->rq;
drive             155 drivers/ide/ide-eh.c 		ide_complete_rq(drive, err, blk_rq_bytes(rq));
drive             168 drivers/ide/ide-eh.c static ide_startstop_t atapi_reset_pollfunc(ide_drive_t *drive)
drive             170 drivers/ide/ide-eh.c 	ide_hwif_t *hwif = drive->hwif;
drive             174 drivers/ide/ide-eh.c 	tp_ops->dev_select(drive);
drive             179 drivers/ide/ide-eh.c 		printk(KERN_INFO "%s: ATAPI reset complete\n", drive->name);
drive             182 drivers/ide/ide-eh.c 			ide_set_handler(drive, &atapi_reset_pollfunc, HZ/20);
drive             189 drivers/ide/ide-eh.c 			drive->name, stat);
drive             191 drivers/ide/ide-eh.c 		return do_reset1(drive, 1);
drive             195 drivers/ide/ide-eh.c 	ide_complete_drive_reset(drive, BLK_STS_OK);
drive             224 drivers/ide/ide-eh.c static ide_startstop_t reset_pollfunc(ide_drive_t *drive)
drive             226 drivers/ide/ide-eh.c 	ide_hwif_t *hwif = drive->hwif;
drive             232 drivers/ide/ide-eh.c 		err = port_ops->reset_poll(drive);
drive             235 drivers/ide/ide-eh.c 				hwif->name, drive->name);
drive             244 drivers/ide/ide-eh.c 			ide_set_handler(drive, &reset_pollfunc, HZ/20);
drive             250 drivers/ide/ide-eh.c 		drive->failures++;
drive             253 drivers/ide/ide-eh.c 		tmp = ide_read_error(drive);
drive             257 drivers/ide/ide-eh.c 			drive->failures = 0;
drive             260 drivers/ide/ide-eh.c 			drive->failures++;
drive             266 drivers/ide/ide-eh.c 	ide_complete_drive_reset(drive, err);
drive             270 drivers/ide/ide-eh.c static void ide_disk_pre_reset(ide_drive_t *drive)
drive             272 drivers/ide/ide-eh.c 	int legacy = (drive->id[ATA_ID_CFS_ENABLE_2] & 0x0400) ? 0 : 1;
drive             274 drivers/ide/ide-eh.c 	drive->special_flags =
drive             277 drivers/ide/ide-eh.c 	drive->mult_count = 0;
drive             278 drivers/ide/ide-eh.c 	drive->dev_flags &= ~IDE_DFLAG_PARKED;
drive             280 drivers/ide/ide-eh.c 	if ((drive->dev_flags & IDE_DFLAG_KEEP_SETTINGS) == 0 &&
drive             281 drivers/ide/ide-eh.c 	    (drive->dev_flags & IDE_DFLAG_USING_DMA) == 0)
drive             282 drivers/ide/ide-eh.c 		drive->mult_req = 0;
drive             284 drivers/ide/ide-eh.c 	if (drive->mult_req != drive->mult_count)
drive             285 drivers/ide/ide-eh.c 		drive->special_flags |= IDE_SFLAG_SET_MULTMODE;
drive             288 drivers/ide/ide-eh.c static void pre_reset(ide_drive_t *drive)
drive             290 drivers/ide/ide-eh.c 	const struct ide_port_ops *port_ops = drive->hwif->port_ops;
drive             292 drivers/ide/ide-eh.c 	if (drive->media == ide_disk)
drive             293 drivers/ide/ide-eh.c 		ide_disk_pre_reset(drive);
drive             295 drivers/ide/ide-eh.c 		drive->dev_flags |= IDE_DFLAG_POST_RESET;
drive             297 drivers/ide/ide-eh.c 	if (drive->dev_flags & IDE_DFLAG_USING_DMA) {
drive             298 drivers/ide/ide-eh.c 		if (drive->crc_count)
drive             299 drivers/ide/ide-eh.c 			ide_check_dma_crc(drive);
drive             301 drivers/ide/ide-eh.c 			ide_dma_off(drive);
drive             304 drivers/ide/ide-eh.c 	if ((drive->dev_flags & IDE_DFLAG_KEEP_SETTINGS) == 0) {
drive             305 drivers/ide/ide-eh.c 		if ((drive->dev_flags & IDE_DFLAG_USING_DMA) == 0) {
drive             306 drivers/ide/ide-eh.c 			drive->dev_flags &= ~IDE_DFLAG_UNMASK;
drive             307 drivers/ide/ide-eh.c 			drive->io_32bit = 0;
drive             313 drivers/ide/ide-eh.c 		port_ops->pre_reset(drive);
drive             315 drivers/ide/ide-eh.c 	if (drive->current_speed != 0xff)
drive             316 drivers/ide/ide-eh.c 		drive->desired_speed = drive->current_speed;
drive             317 drivers/ide/ide-eh.c 	drive->current_speed = 0xff;
drive             335 drivers/ide/ide-eh.c static ide_startstop_t do_reset1(ide_drive_t *drive, int do_not_try_atapi)
drive             337 drivers/ide/ide-eh.c 	ide_hwif_t *hwif = drive->hwif;
drive             352 drivers/ide/ide-eh.c 	if (drive->media != ide_disk && !do_not_try_atapi) {
drive             353 drivers/ide/ide-eh.c 		pre_reset(drive);
drive             354 drivers/ide/ide-eh.c 		tp_ops->dev_select(drive);
drive             360 drivers/ide/ide-eh.c 		__ide_set_handler(drive, &atapi_reset_pollfunc, HZ/20);
drive             396 drivers/ide/ide-eh.c 		ide_complete_drive_reset(drive, BLK_STS_IOERR);
drive             414 drivers/ide/ide-eh.c 		((drive->dev_flags & IDE_DFLAG_NIEN_QUIRK) ? 0 : ATA_NIEN) |
drive             420 drivers/ide/ide-eh.c 	__ide_set_handler(drive, &reset_pollfunc, HZ/20);
drive             429 drivers/ide/ide-eh.c 		port_ops->resetproc(drive);
drive             439 drivers/ide/ide-eh.c ide_startstop_t ide_do_reset(ide_drive_t *drive)
drive             441 drivers/ide/ide-eh.c 	return do_reset1(drive, 0);
drive              63 drivers/ide/ide-floppy.c static int ide_floppy_callback(ide_drive_t *drive, int dsc)
drive              65 drivers/ide/ide-floppy.c 	struct ide_disk_obj *floppy = drive->driver_data;
drive              66 drivers/ide/ide-floppy.c 	struct ide_atapi_pc *pc = drive->pc;
drive              72 drivers/ide/ide-floppy.c 	if (drive->failed_pc == pc)
drive              73 drivers/ide/ide-floppy.c 		drive->failed_pc = NULL;
drive              89 drivers/ide/ide-floppy.c 			if (drive->failed_pc)
drive              91 drivers/ide/ide-floppy.c 					      drive->failed_pc->c[0]);
drive             118 drivers/ide/ide-floppy.c 			floppy->drive->name, pc->c[0], floppy->sense_key,
drive             123 drivers/ide/ide-floppy.c static ide_startstop_t ide_floppy_issue_pc(ide_drive_t *drive,
drive             127 drivers/ide/ide-floppy.c 	struct ide_disk_obj *floppy = drive->driver_data;
drive             129 drivers/ide/ide-floppy.c 	if (drive->failed_pc == NULL &&
drive             131 drivers/ide/ide-floppy.c 		drive->failed_pc = pc;
drive             134 drivers/ide/ide-floppy.c 	drive->pc = pc;
drive             137 drivers/ide/ide-floppy.c 		unsigned int done = blk_rq_bytes(drive->hwif->rq);
drive             145 drivers/ide/ide-floppy.c 		drive->failed_pc = NULL;
drive             146 drivers/ide/ide-floppy.c 		drive->pc_callback(drive, 0);
drive             147 drivers/ide/ide-floppy.c 		ide_complete_rq(drive, BLK_STS_IOERR, done);
drive             155 drivers/ide/ide-floppy.c 	return ide_issue_pc(drive, cmd);
drive             191 drivers/ide/ide-floppy.c static void idefloppy_create_rw_cmd(ide_drive_t *drive,
drive             195 drivers/ide/ide-floppy.c 	struct ide_disk_obj *floppy = drive->driver_data;
drive             229 drivers/ide/ide-floppy.c static ide_startstop_t ide_floppy_do_request(ide_drive_t *drive,
drive             232 drivers/ide/ide-floppy.c 	struct ide_disk_obj *floppy = drive->driver_data;
drive             238 drivers/ide/ide-floppy.c 	if (drive->debug_mask & IDE_DBG_RQ)
drive             244 drivers/ide/ide-floppy.c 		if (drive->failed_pc) {
drive             245 drivers/ide/ide-floppy.c 			ide_floppy_report_error(floppy, drive->failed_pc);
drive             246 drivers/ide/ide-floppy.c 			drive->failed_pc = NULL;
drive             248 drivers/ide/ide-floppy.c 			printk(KERN_ERR PFX "%s: I/O error\n", drive->name);
drive             252 drivers/ide/ide-floppy.c 			ide_complete_rq(drive, BLK_STS_OK, blk_rq_bytes(rq));
drive             263 drivers/ide/ide-floppy.c 				drive->name);
drive             267 drivers/ide/ide-floppy.c 		idefloppy_create_rw_cmd(drive, pc, rq, (unsigned long)block);
drive             286 drivers/ide/ide-floppy.c 	ide_prep_sense(drive, rq);
drive             297 drivers/ide/ide-floppy.c 		ide_map_sg(drive, &cmd);
drive             302 drivers/ide/ide-floppy.c 	return ide_floppy_issue_pc(drive, &cmd, pc);
drive             304 drivers/ide/ide-floppy.c 	drive->failed_pc = NULL;
drive             307 drivers/ide/ide-floppy.c 	ide_complete_rq(drive, BLK_STS_IOERR, blk_rq_bytes(rq));
drive             315 drivers/ide/ide-floppy.c static int ide_floppy_get_flexible_disk_page(ide_drive_t *drive,
drive             318 drivers/ide/ide-floppy.c 	struct ide_disk_obj *floppy = drive->driver_data;
drive             327 drivers/ide/ide-floppy.c 	if (ide_queue_pc_tail(drive, disk, pc, buf, pc->req_xfer)) {
drive             333 drivers/ide/ide-floppy.c 		drive->dev_flags |= IDE_DFLAG_WP;
drive             335 drivers/ide/ide-floppy.c 		drive->dev_flags &= ~IDE_DFLAG_WP;
drive             337 drivers/ide/ide-floppy.c 	set_disk_ro(disk, !!(drive->dev_flags & IDE_DFLAG_WP));
drive             353 drivers/ide/ide-floppy.c 				drive->name, capacity / 1024, cyls, heads,
drive             357 drivers/ide/ide-floppy.c 	drive->bios_cyl = cyls;
drive             358 drivers/ide/ide-floppy.c 	drive->bios_head = heads;
drive             359 drivers/ide/ide-floppy.c 	drive->bios_sect = sectors;
drive             365 drivers/ide/ide-floppy.c 			drive->name, lba_capacity, capacity);
drive             368 drivers/ide/ide-floppy.c 		drive->capacity64 = floppy->blocks * floppy->bs_factor;
drive             378 drivers/ide/ide-floppy.c static int ide_floppy_get_capacity(ide_drive_t *drive)
drive             380 drivers/ide/ide-floppy.c 	struct ide_disk_obj *floppy = drive->driver_data;
drive             389 drivers/ide/ide-floppy.c 	drive->bios_cyl = 0;
drive             390 drivers/ide/ide-floppy.c 	drive->bios_head = drive->bios_sect = 0;
drive             393 drivers/ide/ide-floppy.c 	drive->capacity64 = 0;
drive             396 drivers/ide/ide-floppy.c 	if (ide_queue_pc_tail(drive, disk, &pc, pc_buf, pc.req_xfer)) {
drive             424 drivers/ide/ide-floppy.c 			if (!(drive->atapi_flags & IDE_AFLAG_CLIK_DRIVE))
drive             436 drivers/ide/ide-floppy.c 				       drive->name, blocks * length / 1024,
drive             442 drivers/ide/ide-floppy.c 				       " not supported\n", drive->name, length);
drive             451 drivers/ide/ide-floppy.c 					       drive->name);
drive             452 drivers/ide/ide-floppy.c 				drive->capacity64 =
drive             463 drivers/ide/ide-floppy.c 			       drive->name);
drive             467 drivers/ide/ide-floppy.c 				"in drive\n", drive->name);
drive             475 drivers/ide/ide-floppy.c 	if (!(drive->atapi_flags & IDE_AFLAG_CLIK_DRIVE))
drive             476 drivers/ide/ide-floppy.c 		(void) ide_floppy_get_flexible_disk_page(drive, &pc);
drive             481 drivers/ide/ide-floppy.c static void ide_floppy_setup(ide_drive_t *drive)
drive             483 drivers/ide/ide-floppy.c 	struct ide_disk_obj *floppy = drive->driver_data;
drive             484 drivers/ide/ide-floppy.c 	u16 *id = drive->id;
drive             486 drivers/ide/ide-floppy.c 	drive->pc_callback	 = ide_floppy_callback;
drive             498 drivers/ide/ide-floppy.c 		drive->atapi_flags |= IDE_AFLAG_ZIP_DRIVE;
drive             500 drivers/ide/ide-floppy.c 		drive->pc_delay = IDEFLOPPY_PC_DELAY;
drive             501 drivers/ide/ide-floppy.c 		blk_queue_max_hw_sectors(drive->queue, 64);
drive             509 drivers/ide/ide-floppy.c 		blk_queue_max_hw_sectors(drive->queue, 64);
drive             510 drivers/ide/ide-floppy.c 		drive->atapi_flags |= IDE_AFLAG_CLIK_DRIVE;
drive             512 drivers/ide/ide-floppy.c 		drive->dev_flags &= ~IDE_DFLAG_DOORLOCKING;
drive             515 drivers/ide/ide-floppy.c 	(void) ide_floppy_get_capacity(drive);
drive             517 drivers/ide/ide-floppy.c 	ide_proc_register_driver(drive, floppy->driver);
drive             519 drivers/ide/ide-floppy.c 	drive->dev_flags |= IDE_DFLAG_ATTACH;
drive             522 drivers/ide/ide-floppy.c static void ide_floppy_flush(ide_drive_t *drive)
drive             526 drivers/ide/ide-floppy.c static int ide_floppy_init_media(ide_drive_t *drive, struct gendisk *disk)
drive             530 drivers/ide/ide-floppy.c 	if (ide_do_test_unit_ready(drive, disk))
drive             531 drivers/ide/ide-floppy.c 		ide_do_start_stop(drive, disk, 1);
drive             533 drivers/ide/ide-floppy.c 	ret = ide_floppy_get_capacity(drive);
drive             535 drivers/ide/ide-floppy.c 	set_capacity(disk, ide_gd_capacity(drive));
drive              37 drivers/ide/ide-floppy_ioctl.c static int ide_floppy_get_format_capacities(ide_drive_t *drive,
drive              41 drivers/ide/ide-floppy_ioctl.c 	struct ide_disk_obj *floppy = drive->driver_data;
drive              54 drivers/ide/ide-floppy_ioctl.c 	if (ide_queue_pc_tail(drive, floppy->disk, pc, pc_buf, pc->req_xfer)) {
drive             120 drivers/ide/ide-floppy_ioctl.c static int ide_floppy_get_sfrp_bit(ide_drive_t *drive, struct ide_atapi_pc *pc)
drive             122 drivers/ide/ide-floppy_ioctl.c 	struct ide_disk_obj *floppy = drive->driver_data;
drive             125 drivers/ide/ide-floppy_ioctl.c 	drive->atapi_flags &= ~IDE_AFLAG_SRFP;
drive             130 drivers/ide/ide-floppy_ioctl.c 	if (ide_queue_pc_tail(drive, floppy->disk, pc, buf, pc->req_xfer))
drive             134 drivers/ide/ide-floppy_ioctl.c 		drive->atapi_flags |= IDE_AFLAG_SRFP;
drive             139 drivers/ide/ide-floppy_ioctl.c static int ide_floppy_format_unit(ide_drive_t *drive, struct ide_atapi_pc *pc,
drive             142 drivers/ide/ide-floppy_ioctl.c 	struct ide_disk_obj *floppy = drive->driver_data;
drive             148 drivers/ide/ide-floppy_ioctl.c 		drive->dev_flags &= ~IDE_DFLAG_FORMAT_IN_PROGRESS;
drive             152 drivers/ide/ide-floppy_ioctl.c 	drive->dev_flags |= IDE_DFLAG_FORMAT_IN_PROGRESS;
drive             176 drivers/ide/ide-floppy_ioctl.c 	ide_floppy_get_sfrp_bit(drive, pc);
drive             179 drivers/ide/ide-floppy_ioctl.c 	if (ide_queue_pc_tail(drive, floppy->disk, pc, buf, pc->req_xfer))
drive             184 drivers/ide/ide-floppy_ioctl.c 		drive->dev_flags &= ~IDE_DFLAG_FORMAT_IN_PROGRESS;
drive             198 drivers/ide/ide-floppy_ioctl.c static int ide_floppy_get_format_progress(ide_drive_t *drive,
drive             202 drivers/ide/ide-floppy_ioctl.c 	struct ide_disk_obj *floppy = drive->driver_data;
drive             206 drivers/ide/ide-floppy_ioctl.c 	if (drive->atapi_flags & IDE_AFLAG_SRFP) {
drive             207 drivers/ide/ide-floppy_ioctl.c 		ide_create_request_sense_cmd(drive, pc);
drive             208 drivers/ide/ide-floppy_ioctl.c 		if (ide_queue_pc_tail(drive, floppy->disk, pc, sense_buf,
drive             219 drivers/ide/ide-floppy_ioctl.c 		ide_hwif_t *hwif = drive->hwif;
drive             236 drivers/ide/ide-floppy_ioctl.c static int ide_floppy_lockdoor(ide_drive_t *drive, struct ide_atapi_pc *pc,
drive             239 drivers/ide/ide-floppy_ioctl.c 	struct ide_disk_obj *floppy = drive->driver_data;
drive             246 drivers/ide/ide-floppy_ioctl.c 	ide_set_media_lock(drive, disk, prevent);
drive             249 drivers/ide/ide-floppy_ioctl.c 		ide_do_start_stop(drive, disk, 2);
drive             254 drivers/ide/ide-floppy_ioctl.c static int ide_floppy_format_ioctl(ide_drive_t *drive, struct ide_atapi_pc *pc,
drive             262 drivers/ide/ide-floppy_ioctl.c 		return ide_floppy_get_format_capacities(drive, pc, argp);
drive             266 drivers/ide/ide-floppy_ioctl.c 		return ide_floppy_format_unit(drive, pc, (int __user *)argp);
drive             268 drivers/ide/ide-floppy_ioctl.c 		return ide_floppy_get_format_progress(drive, pc, argp);
drive             274 drivers/ide/ide-floppy_ioctl.c int ide_floppy_ioctl(ide_drive_t *drive, struct block_device *bdev,
drive             283 drivers/ide/ide-floppy_ioctl.c 		err = ide_floppy_lockdoor(drive, &pc, arg, cmd);
drive             287 drivers/ide/ide-floppy_ioctl.c 	err = ide_floppy_format_ioctl(drive, &pc, mode, cmd, argp);
drive             299 drivers/ide/ide-floppy_ioctl.c 		err = generic_ide_ioctl(drive, bdev, cmd, arg);
drive              11 drivers/ide/ide-floppy_proc.c 	ide_drive_t*drive = (ide_drive_t *)m->private;
drive              13 drivers/ide/ide-floppy_proc.c 	seq_printf(m, "%llu\n", (long long)ide_gd_capacity(drive));
drive              41 drivers/ide/ide-gd.c 		if (ide_device_get(idkp->drive))
drive              52 drivers/ide/ide-gd.c 	ide_drive_t *drive = idkp->drive;
drive              56 drivers/ide/ide-gd.c 	ide_device_put(drive);
drive              60 drivers/ide/ide-gd.c sector_t ide_gd_capacity(ide_drive_t *drive)
drive              62 drivers/ide/ide-gd.c 	return drive->capacity64;
drive              67 drivers/ide/ide-gd.c static void ide_gd_remove(ide_drive_t *drive)
drive              69 drivers/ide/ide-gd.c 	struct ide_disk_obj *idkp = drive->driver_data;
drive              72 drivers/ide/ide-gd.c 	ide_proc_unregister_driver(drive, idkp->driver);
drive              75 drivers/ide/ide-gd.c 	drive->disk_ops->flush(drive);
drive              85 drivers/ide/ide-gd.c 	ide_drive_t *drive = idkp->drive;
drive              88 drivers/ide/ide-gd.c 	drive->disk_ops = NULL;
drive              89 drivers/ide/ide-gd.c 	drive->driver_data = NULL;
drive             100 drivers/ide/ide-gd.c static void ide_gd_resume(ide_drive_t *drive)
drive             102 drivers/ide/ide-gd.c 	if (ata_id_hpa_enabled(drive->id))
drive             103 drivers/ide/ide-gd.c 		(void)drive->disk_ops->get_capacity(drive);
drive             119 drivers/ide/ide-gd.c static void ide_gd_shutdown(ide_drive_t *drive)
drive             138 drivers/ide/ide-gd.c 		drive->disk_ops->flush(drive);
drive             142 drivers/ide/ide-gd.c 	printk(KERN_INFO "Shutdown: %s\n", drive->name);
drive             144 drivers/ide/ide-gd.c 	drive->gendev.bus->suspend(&drive->gendev, PMSG_SUSPEND);
drive             148 drivers/ide/ide-gd.c static ide_proc_entry_t *ide_disk_proc_entries(ide_drive_t *drive)
drive             150 drivers/ide/ide-gd.c 	return (drive->media == ide_disk) ? ide_disk_proc : ide_floppy_proc;
drive             153 drivers/ide/ide-gd.c static const struct ide_proc_devset *ide_disk_proc_devsets(ide_drive_t *drive)
drive             155 drivers/ide/ide-gd.c 	return (drive->media == ide_disk) ? ide_disk_settings
drive             160 drivers/ide/ide-gd.c static ide_startstop_t ide_gd_do_request(ide_drive_t *drive,
drive             163 drivers/ide/ide-gd.c 	return drive->disk_ops->do_request(drive, rq, sector);
drive             188 drivers/ide/ide-gd.c 	ide_drive_t *drive;
drive             195 drivers/ide/ide-gd.c 	drive = idkp->drive;
drive             201 drivers/ide/ide-gd.c 	if ((drive->dev_flags & IDE_DFLAG_REMOVABLE) && idkp->openers == 1) {
drive             202 drivers/ide/ide-gd.c 		drive->dev_flags &= ~IDE_DFLAG_FORMAT_IN_PROGRESS;
drive             205 drivers/ide/ide-gd.c 		ret = drive->disk_ops->init_media(drive, disk);
drive             217 drivers/ide/ide-gd.c 		if ((drive->dev_flags & IDE_DFLAG_WP) && (mode & FMODE_WRITE)) {
drive             227 drivers/ide/ide-gd.c 		drive->disk_ops->set_doorlock(drive, disk, 1);
drive             228 drivers/ide/ide-gd.c 		drive->dev_flags |= IDE_DFLAG_MEDIA_CHANGED;
drive             230 drivers/ide/ide-gd.c 	} else if (drive->dev_flags & IDE_DFLAG_FORMAT_IN_PROGRESS) {
drive             257 drivers/ide/ide-gd.c 	ide_drive_t *drive = idkp->drive;
drive             263 drivers/ide/ide-gd.c 		drive->disk_ops->flush(drive);
drive             265 drivers/ide/ide-gd.c 	if ((drive->dev_flags & IDE_DFLAG_REMOVABLE) && idkp->openers == 1) {
drive             266 drivers/ide/ide-gd.c 		drive->disk_ops->set_doorlock(drive, disk, 0);
drive             267 drivers/ide/ide-gd.c 		drive->dev_flags &= ~IDE_DFLAG_FORMAT_IN_PROGRESS;
drive             279 drivers/ide/ide-gd.c 	ide_drive_t *drive = idkp->drive;
drive             281 drivers/ide/ide-gd.c 	geo->heads = drive->bios_head;
drive             282 drivers/ide/ide-gd.c 	geo->sectors = drive->bios_sect;
drive             283 drivers/ide/ide-gd.c 	geo->cylinders = (u16)drive->bios_cyl; /* truncate */
drive             291 drivers/ide/ide-gd.c 	ide_drive_t *drive = idkp->drive;
drive             295 drivers/ide/ide-gd.c 	if (drive->dev_flags & IDE_DFLAG_ATTACH) {
drive             296 drivers/ide/ide-gd.c 		drive->dev_flags &= ~IDE_DFLAG_ATTACH;
drive             307 drivers/ide/ide-gd.c 	ret = drive->dev_flags & IDE_DFLAG_MEDIA_CHANGED;
drive             308 drivers/ide/ide-gd.c 	drive->dev_flags &= ~IDE_DFLAG_MEDIA_CHANGED;
drive             316 drivers/ide/ide-gd.c 	ide_drive_t *drive = idkp->drive;
drive             317 drivers/ide/ide-gd.c 	const struct ide_disk_ops *disk_ops = drive->disk_ops;
drive             320 drivers/ide/ide-gd.c 		disk_ops->unlock_native_capacity(drive);
drive             326 drivers/ide/ide-gd.c 	ide_drive_t *drive = idkp->drive;
drive             329 drivers/ide/ide-gd.c 		drive->disk_ops->get_capacity(drive);
drive             331 drivers/ide/ide-gd.c 	set_capacity(disk, ide_gd_capacity(drive));
drive             339 drivers/ide/ide-gd.c 	ide_drive_t *drive = idkp->drive;
drive             341 drivers/ide/ide-gd.c 	return drive->disk_ops->ioctl(drive, bdev, mode, cmd, arg);
drive             355 drivers/ide/ide-gd.c static int ide_gd_probe(ide_drive_t *drive)
drive             362 drivers/ide/ide-gd.c 	if (!strstr("ide-gd", drive->driver_req))
drive             366 drivers/ide/ide-gd.c 	if (drive->media == ide_disk)
drive             370 drivers/ide/ide-gd.c 	if (drive->media == ide_floppy)
drive             376 drivers/ide/ide-gd.c 	if (disk_ops->check(drive, DRV_NAME) == 0) {
drive             378 drivers/ide/ide-gd.c 			drive->name);
drive             385 drivers/ide/ide-gd.c 			drive->name);
drive             389 drivers/ide/ide-gd.c 	g = alloc_disk_node(IDE_DISK_MINORS, hwif_to_node(drive->hwif));
drive             393 drivers/ide/ide-gd.c 	ide_init_disk(g, drive);
drive             395 drivers/ide/ide-gd.c 	idkp->dev.parent = &drive->gendev;
drive             397 drivers/ide/ide-gd.c 	dev_set_name(&idkp->dev, "%s", dev_name(&drive->gendev));
drive             402 drivers/ide/ide-gd.c 	idkp->drive = drive;
drive             408 drivers/ide/ide-gd.c 	drive->driver_data = idkp;
drive             409 drivers/ide/ide-gd.c 	drive->debug_mask = debug_mask;
drive             410 drivers/ide/ide-gd.c 	drive->disk_ops = disk_ops;
drive             412 drivers/ide/ide-gd.c 	disk_ops->setup(drive);
drive             414 drivers/ide/ide-gd.c 	set_capacity(g, ide_gd_capacity(drive));
drive             418 drivers/ide/ide-gd.c 	if (drive->dev_flags & IDE_DFLAG_REMOVABLE)
drive             422 drivers/ide/ide-gd.c 	device_add_disk(&drive->gendev, g, NULL);
drive              18 drivers/ide/ide-gd.h 	ide_drive_t		*drive;
drive              78 drivers/ide/ide-io-std.c void ide_dev_select(ide_drive_t *drive)
drive              80 drivers/ide/ide-io-std.c 	ide_hwif_t *hwif = drive->hwif;
drive              81 drivers/ide/ide-io-std.c 	u8 select = drive->select | ATA_DEVICE_OBS;
drive              90 drivers/ide/ide-io-std.c void ide_tf_load(ide_drive_t *drive, struct ide_taskfile *tf, u8 valid)
drive              92 drivers/ide/ide-io-std.c 	ide_hwif_t *hwif = drive->hwif;
drive             117 drivers/ide/ide-io-std.c void ide_tf_read(ide_drive_t *drive, struct ide_taskfile *tf, u8 valid)
drive             119 drivers/ide/ide-io-std.c 	ide_hwif_t *hwif = drive->hwif;
drive             165 drivers/ide/ide-io-std.c void ide_input_data(ide_drive_t *drive, struct ide_cmd *cmd, void *buf,
drive             168 drivers/ide/ide-io-std.c 	ide_hwif_t *hwif = drive->hwif;
drive             172 drivers/ide/ide-io-std.c 	u8 io_32bit = drive->io_32bit;
drive             209 drivers/ide/ide-io-std.c void ide_output_data(ide_drive_t *drive, struct ide_cmd *cmd, void *buf,
drive             212 drivers/ide/ide-io-std.c 	ide_hwif_t *hwif = drive->hwif;
drive             216 drivers/ide/ide-io-std.c 	u8 io_32bit = drive->io_32bit;
drive              57 drivers/ide/ide-io.c int ide_end_rq(ide_drive_t *drive, struct request *rq, blk_status_t error,
drive              64 drivers/ide/ide-io.c 	if ((drive->dev_flags & IDE_DFLAG_DMA_PIO_RETRY) &&
drive              65 drivers/ide/ide-io.c 	    drive->retry_pio <= 3) {
drive              66 drivers/ide/ide-io.c 		drive->dev_flags &= ~IDE_DFLAG_DMA_PIO_RETRY;
drive              67 drivers/ide/ide-io.c 		ide_dma_on(drive);
drive              71 drivers/ide/ide-io.c 		if (rq == drive->sense_rq) {
drive              72 drivers/ide/ide-io.c 			drive->sense_rq = NULL;
drive              73 drivers/ide/ide-io.c 			drive->sense_rq_active = false;
drive              84 drivers/ide/ide-io.c void ide_complete_cmd(ide_drive_t *drive, struct ide_cmd *cmd, u8 stat, u8 err)
drive              86 drivers/ide/ide-io.c 	const struct ide_tp_ops *tp_ops = drive->hwif->tp_ops;
drive              97 drivers/ide/ide-io.c 		tp_ops->input_data(drive, cmd, data, 2);
drive             103 drivers/ide/ide-io.c 	ide_tf_readback(drive, cmd);
drive             109 drivers/ide/ide-io.c 			       drive->name);
drive             110 drivers/ide/ide-io.c 			ide_tf_dump(drive->name, cmd);
drive             112 drivers/ide/ide-io.c 			drive->dev_flags |= IDE_DFLAG_PARKED;
drive             125 drivers/ide/ide-io.c int ide_complete_rq(ide_drive_t *drive, blk_status_t error, unsigned int nr_bytes)
drive             127 drivers/ide/ide-io.c 	ide_hwif_t *hwif = drive->hwif;
drive             138 drivers/ide/ide-io.c 	rc = ide_end_rq(drive, rq, error, nr_bytes);
drive             146 drivers/ide/ide-io.c void ide_kill_rq(ide_drive_t *drive, struct request *rq)
drive             149 drivers/ide/ide-io.c 	u8 media = drive->media;
drive             151 drivers/ide/ide-io.c 	drive->failed_pc = NULL;
drive             162 drivers/ide/ide-io.c 	ide_complete_rq(drive, BLK_STS_IOERR, blk_rq_bytes(rq));
drive             165 drivers/ide/ide-io.c static void ide_tf_set_specify_cmd(ide_drive_t *drive, struct ide_taskfile *tf)
drive             167 drivers/ide/ide-io.c 	tf->nsect   = drive->sect;
drive             168 drivers/ide/ide-io.c 	tf->lbal    = drive->sect;
drive             169 drivers/ide/ide-io.c 	tf->lbam    = drive->cyl;
drive             170 drivers/ide/ide-io.c 	tf->lbah    = drive->cyl >> 8;
drive             171 drivers/ide/ide-io.c 	tf->device  = (drive->head - 1) | drive->select;
drive             175 drivers/ide/ide-io.c static void ide_tf_set_restore_cmd(ide_drive_t *drive, struct ide_taskfile *tf)
drive             177 drivers/ide/ide-io.c 	tf->nsect   = drive->sect;
drive             181 drivers/ide/ide-io.c static void ide_tf_set_setmult_cmd(ide_drive_t *drive, struct ide_taskfile *tf)
drive             183 drivers/ide/ide-io.c 	tf->nsect   = drive->mult_req;
drive             195 drivers/ide/ide-io.c static ide_startstop_t do_special(ide_drive_t *drive)
drive             200 drivers/ide/ide-io.c 	printk(KERN_DEBUG "%s: %s: 0x%02x\n", drive->name, __func__,
drive             201 drivers/ide/ide-io.c 		drive->special_flags);
drive             203 drivers/ide/ide-io.c 	if (drive->media != ide_disk) {
drive             204 drivers/ide/ide-io.c 		drive->special_flags = 0;
drive             205 drivers/ide/ide-io.c 		drive->mult_req = 0;
drive             212 drivers/ide/ide-io.c 	if (drive->special_flags & IDE_SFLAG_SET_GEOMETRY) {
drive             213 drivers/ide/ide-io.c 		drive->special_flags &= ~IDE_SFLAG_SET_GEOMETRY;
drive             214 drivers/ide/ide-io.c 		ide_tf_set_specify_cmd(drive, &cmd.tf);
drive             215 drivers/ide/ide-io.c 	} else if (drive->special_flags & IDE_SFLAG_RECALIBRATE) {
drive             216 drivers/ide/ide-io.c 		drive->special_flags &= ~IDE_SFLAG_RECALIBRATE;
drive             217 drivers/ide/ide-io.c 		ide_tf_set_restore_cmd(drive, &cmd.tf);
drive             218 drivers/ide/ide-io.c 	} else if (drive->special_flags & IDE_SFLAG_SET_MULTMODE) {
drive             219 drivers/ide/ide-io.c 		drive->special_flags &= ~IDE_SFLAG_SET_MULTMODE;
drive             220 drivers/ide/ide-io.c 		ide_tf_set_setmult_cmd(drive, &cmd.tf);
drive             228 drivers/ide/ide-io.c 	do_rw_taskfile(drive, &cmd);
drive             233 drivers/ide/ide-io.c void ide_map_sg(ide_drive_t *drive, struct ide_cmd *cmd)
drive             235 drivers/ide/ide-io.c 	ide_hwif_t *hwif = drive->hwif;
drive             239 drivers/ide/ide-io.c 	cmd->sg_nents = blk_rq_map_sg(drive->queue, rq, sg);
drive             263 drivers/ide/ide-io.c static ide_startstop_t execute_drive_cmd (ide_drive_t *drive,
drive             271 drivers/ide/ide-io.c 			ide_map_sg(drive, cmd);
drive             274 drivers/ide/ide-io.c 		return do_rw_taskfile(drive, cmd);
drive             282 drivers/ide/ide-io.c  	printk("%s: DRIVE_CMD (null)\n", drive->name);
drive             285 drivers/ide/ide-io.c 	ide_complete_rq(drive, BLK_STS_OK, blk_rq_bytes(rq));
drive             290 drivers/ide/ide-io.c static ide_startstop_t ide_special_rq(ide_drive_t *drive, struct request *rq)
drive             297 drivers/ide/ide-io.c 		return ide_do_park_unpark(drive, rq);
drive             299 drivers/ide/ide-io.c 		return ide_do_devset(drive, rq);
drive             301 drivers/ide/ide-io.c 		return ide_do_reset(drive);
drive             316 drivers/ide/ide-io.c static ide_startstop_t start_request (ide_drive_t *drive, struct request *rq)
drive             322 drivers/ide/ide-io.c 		drive->hwif->name, (unsigned long) rq);
drive             326 drivers/ide/ide-io.c 	if (drive->max_failures && (drive->failures > drive->max_failures)) {
drive             331 drivers/ide/ide-io.c 	if (drive->prep_rq && !drive->prep_rq(drive, rq))
drive             335 drivers/ide/ide-io.c 		ide_check_pm_state(drive, rq);
drive             337 drivers/ide/ide-io.c 	drive->hwif->tp_ops->dev_select(drive);
drive             338 drivers/ide/ide-io.c 	if (ide_wait_stat(&startstop, drive, drive->ready_stat,
drive             340 drivers/ide/ide-io.c 		printk(KERN_ERR "%s: drive not ready for command\n", drive->name);
drive             344 drivers/ide/ide-io.c 	if (drive->special_flags == 0) {
drive             351 drivers/ide/ide-io.c 		if (drive->current_speed == 0xff)
drive             352 drivers/ide/ide-io.c 			ide_config_drive_speed(drive, drive->desired_speed);
drive             355 drivers/ide/ide-io.c 			return execute_drive_cmd(drive, rq);
drive             360 drivers/ide/ide-io.c 				drive->name, pm->pm_step);
drive             362 drivers/ide/ide-io.c 			startstop = ide_start_power_step(drive, rq);
drive             365 drivers/ide/ide-io.c 				ide_complete_pm_rq(drive, rq);
drive             376 drivers/ide/ide-io.c 			return ide_special_rq(drive, rq);
drive             380 drivers/ide/ide-io.c 		return drv->do_request(drive, rq, blk_rq_pos(rq));
drive             382 drivers/ide/ide-io.c 	return do_special(drive);
drive             384 drivers/ide/ide-io.c 	ide_kill_rq(drive, rq);
drive             397 drivers/ide/ide-io.c void ide_stall_queue (ide_drive_t *drive, unsigned long timeout)
drive             401 drivers/ide/ide-io.c 	drive->sleep = timeout + jiffies;
drive             402 drivers/ide/ide-io.c 	drive->dev_flags |= IDE_DFLAG_SLEEPING;
drive             444 drivers/ide/ide-io.c void ide_requeue_and_plug(ide_drive_t *drive, struct request *rq)
drive             446 drivers/ide/ide-io.c 	struct request_queue *q = drive->queue;
drive             456 drivers/ide/ide-io.c blk_status_t ide_issue_rq(ide_drive_t *drive, struct request *rq,
drive             459 drivers/ide/ide-io.c 	ide_hwif_t *hwif = drive->hwif;
drive             482 drivers/ide/ide-io.c 		if (drive->dev_flags & IDE_DFLAG_SLEEPING &&
drive             483 drivers/ide/ide-io.c 		    time_after(drive->sleep, jiffies)) {
drive             505 drivers/ide/ide-io.c 		hwif->cur_dev = drive;
drive             506 drivers/ide/ide-io.c 		drive->dev_flags &= ~(IDE_DFLAG_SLEEPING | IDE_DFLAG_PARKED);
drive             521 drivers/ide/ide-io.c 		if ((drive->dev_flags & IDE_DFLAG_BLOCKED) &&
drive             533 drivers/ide/ide-io.c 		startstop = start_request(drive, rq);
drive             547 drivers/ide/ide-io.c 			list_add(&rq->queuelist, &drive->rq_list);
drive             551 drivers/ide/ide-io.c 			ide_requeue_and_plug(drive, rq);
drive             568 drivers/ide/ide-io.c 	ide_drive_t *drive = hctx->queue->queuedata;
drive             569 drivers/ide/ide-io.c 	ide_hwif_t *hwif = drive->hwif;
drive             572 drivers/ide/ide-io.c 	if (drive->sense_rq_active) {
drive             579 drivers/ide/ide-io.c 	return ide_issue_rq(drive, bd->rq, false);
drive             582 drivers/ide/ide-io.c static int drive_is_ready(ide_drive_t *drive)
drive             584 drivers/ide/ide-io.c 	ide_hwif_t *hwif = drive->hwif;
drive             587 drivers/ide/ide-io.c 	if (drive->waiting_for_dma)
drive             588 drivers/ide/ide-io.c 		return hwif->dma_ops->dma_test_irq(drive);
drive             622 drivers/ide/ide-io.c 	ide_drive_t	*uninitialized_var(drive);
drive             644 drivers/ide/ide-io.c 		drive = hwif->cur_dev;
drive             647 drivers/ide/ide-io.c 			wait = expiry(drive);
drive             669 drivers/ide/ide-io.c 			startstop = handler(drive);
drive             670 drivers/ide/ide-io.c 		} else if (drive_is_ready(drive)) {
drive             671 drivers/ide/ide-io.c 			if (drive->waiting_for_dma)
drive             672 drivers/ide/ide-io.c 				hwif->dma_ops->dma_lost_irq(drive);
drive             674 drivers/ide/ide-io.c 				hwif->port_ops->clear_irq(drive);
drive             677 drivers/ide/ide-io.c 				drive->name);
drive             678 drivers/ide/ide-io.c 			startstop = handler(drive);
drive             680 drivers/ide/ide-io.c 			if (drive->waiting_for_dma)
drive             681 drivers/ide/ide-io.c 				startstop = ide_dma_timeout_retry(drive, wait);
drive             683 drivers/ide/ide-io.c 				startstop = ide_error(drive, "irq timeout",
drive             700 drivers/ide/ide-io.c 		ide_requeue_and_plug(drive, rq_in_flight);
drive             780 drivers/ide/ide-io.c 	ide_drive_t *uninitialized_var(drive);
drive             830 drivers/ide/ide-io.c 	drive = hwif->cur_dev;
drive             832 drivers/ide/ide-io.c 	if (!drive_is_ready(drive))
drive             849 drivers/ide/ide-io.c 		hwif->port_ops->clear_irq(drive);
drive             851 drivers/ide/ide-io.c 	if (drive->dev_flags & IDE_DFLAG_UNMASK)
drive             855 drivers/ide/ide-io.c 	startstop = handler(drive);
drive             878 drivers/ide/ide-io.c 		ide_requeue_and_plug(drive, rq_in_flight);
drive             885 drivers/ide/ide-io.c void ide_pad_transfer(ide_drive_t *drive, int write, int len)
drive             887 drivers/ide/ide-io.c 	ide_hwif_t *hwif = drive->hwif;
drive             892 drivers/ide/ide-io.c 			hwif->tp_ops->output_data(drive, NULL, buf, min(4, len));
drive             894 drivers/ide/ide-io.c 			hwif->tp_ops->input_data(drive, NULL, buf, min(4, len));
drive             900 drivers/ide/ide-io.c void ide_insert_request_head(ide_drive_t *drive, struct request *rq)
drive             902 drivers/ide/ide-io.c 	drive->sense_rq_active = true;
drive             903 drivers/ide/ide-io.c 	list_add_tail(&rq->queuelist, &drive->rq_list);
drive             904 drivers/ide/ide-io.c 	kblockd_schedule_work(&drive->rq_work);
drive              20 drivers/ide/ide-ioctls.c int ide_setting_ioctl(ide_drive_t *drive, struct block_device *bdev,
drive              38 drivers/ide/ide-ioctls.c 	err = ds->get(drive);
drive              50 drivers/ide/ide-ioctls.c 			err = ide_devset_execute(drive, ds, arg);
drive              58 drivers/ide/ide-ioctls.c static int ide_get_identity_ioctl(ide_drive_t *drive, unsigned int cmd,
drive              65 drivers/ide/ide-ioctls.c 	if ((drive->dev_flags & IDE_DFLAG_ID_READ) == 0) {
drive              77 drivers/ide/ide-ioctls.c 	memcpy(id, drive->id, size);
drive              88 drivers/ide/ide-ioctls.c static int ide_get_nice_ioctl(ide_drive_t *drive, unsigned long arg)
drive              90 drivers/ide/ide-ioctls.c 	return put_user((!!(drive->dev_flags & IDE_DFLAG_DSC_OVERLAP)
drive              92 drivers/ide/ide-ioctls.c 			(!!(drive->dev_flags & IDE_DFLAG_NICE1)
drive              96 drivers/ide/ide-ioctls.c static int ide_set_nice_ioctl(ide_drive_t *drive, unsigned long arg)
drive             102 drivers/ide/ide-ioctls.c 	    (drive->media != ide_tape))
drive             106 drivers/ide/ide-ioctls.c 		drive->dev_flags |= IDE_DFLAG_DSC_OVERLAP;
drive             108 drivers/ide/ide-ioctls.c 		drive->dev_flags &= ~IDE_DFLAG_DSC_OVERLAP;
drive             111 drivers/ide/ide-ioctls.c 		drive->dev_flags |= IDE_DFLAG_NICE1;
drive             113 drivers/ide/ide-ioctls.c 		drive->dev_flags &= ~IDE_DFLAG_NICE1;
drive             118 drivers/ide/ide-ioctls.c static int ide_cmd_ioctl(ide_drive_t *drive, unsigned long arg)
drive             129 drivers/ide/ide-ioctls.c 		rq = blk_get_request(drive->queue, REQ_OP_DRV_IN, 0);
drive             131 drivers/ide/ide-ioctls.c 		blk_execute_rq(drive->queue, NULL, rq, 0);
drive             169 drivers/ide/ide-ioctls.c 		xfer_rate = ide_find_dma_mode(drive, tf->nsect);
drive             178 drivers/ide/ide-ioctls.c 	err = ide_raw_taskfile(drive, &cmd, buf, args[3]);
drive             194 drivers/ide/ide-ioctls.c static int ide_task_ioctl(ide_drive_t *drive, unsigned long arg)
drive             210 drivers/ide/ide-ioctls.c 	err = ide_no_data_taskfile(drive, &cmd);
drive             221 drivers/ide/ide-ioctls.c static int generic_drive_reset(ide_drive_t *drive)
drive             226 drivers/ide/ide-ioctls.c 	rq = blk_get_request(drive->queue, REQ_OP_DRV_IN, 0);
drive             230 drivers/ide/ide-ioctls.c 	blk_execute_rq(drive->queue, NULL, rq, 1);
drive             236 drivers/ide/ide-ioctls.c int generic_ide_ioctl(ide_drive_t *drive, struct block_device *bdev,
drive             241 drivers/ide/ide-ioctls.c 	err = ide_setting_ioctl(drive, bdev, cmd, arg, ide_ioctl_settings);
drive             250 drivers/ide/ide-ioctls.c 		return ide_get_identity_ioctl(drive, cmd, arg);
drive             252 drivers/ide/ide-ioctls.c 		return ide_get_nice_ioctl(drive, arg);
drive             256 drivers/ide/ide-ioctls.c 		return ide_set_nice_ioctl(drive, arg);
drive             261 drivers/ide/ide-ioctls.c 		if (drive->media == ide_disk)
drive             262 drivers/ide/ide-ioctls.c 			return ide_taskfile_ioctl(drive, arg);
drive             268 drivers/ide/ide-ioctls.c 		return ide_cmd_ioctl(drive, arg);
drive             272 drivers/ide/ide-ioctls.c 		return ide_task_ioctl(drive, arg);
drive             276 drivers/ide/ide-ioctls.c 		return generic_drive_reset(drive);
drive              31 drivers/ide/ide-iops.c void SELECT_MASK(ide_drive_t *drive, int mask)
drive              33 drivers/ide/ide-iops.c 	const struct ide_port_ops *port_ops = drive->hwif->port_ops;
drive              36 drivers/ide/ide-iops.c 		port_ops->maskproc(drive, mask);
drive              39 drivers/ide/ide-iops.c u8 ide_read_error(ide_drive_t *drive)
drive              43 drivers/ide/ide-iops.c 	drive->hwif->tp_ops->tf_read(drive, &tf, IDE_VALID_ERROR);
drive             106 drivers/ide/ide-iops.c int __ide_wait_stat(ide_drive_t *drive, u8 good, u8 bad,
drive             109 drivers/ide/ide-iops.c 	ide_hwif_t *hwif = drive->hwif;
drive             170 drivers/ide/ide-iops.c int ide_wait_stat(ide_startstop_t *startstop, ide_drive_t *drive, u8 good,
drive             177 drivers/ide/ide-iops.c 	if (drive->max_failures && (drive->failures > drive->max_failures)) {
drive             182 drivers/ide/ide-iops.c 	err = __ide_wait_stat(drive, good, bad, timeout, &stat);
drive             186 drivers/ide/ide-iops.c 		*startstop = ide_error(drive, s, stat);
drive             234 drivers/ide/ide-iops.c u8 eighty_ninty_three(ide_drive_t *drive)
drive             236 drivers/ide/ide-iops.c 	ide_hwif_t *hwif = drive->hwif;
drive             237 drivers/ide/ide-iops.c 	u16 *id = drive->id;
drive             245 drivers/ide/ide-iops.c 				  drive->name);
drive             279 drivers/ide/ide-iops.c 	if (drive->dev_flags & IDE_DFLAG_UDMA33_WARNED)
drive             284 drivers/ide/ide-iops.c 			    drive->name,
drive             287 drivers/ide/ide-iops.c 	drive->dev_flags |= IDE_DFLAG_UDMA33_WARNED;
drive             305 drivers/ide/ide-iops.c void ide_check_nien_quirk_list(ide_drive_t *drive)
drive             307 drivers/ide/ide-iops.c 	const char **list, *m = (char *)&drive->id[ATA_ID_PROD];
drive             311 drivers/ide/ide-iops.c 			drive->dev_flags |= IDE_DFLAG_NIEN_QUIRK;
drive             316 drivers/ide/ide-iops.c int ide_driveid_update(ide_drive_t *drive)
drive             325 drivers/ide/ide-iops.c 	SELECT_MASK(drive, 1);
drive             326 drivers/ide/ide-iops.c 	rc = ide_dev_read_id(drive, ATA_CMD_ID_ATA, id, 1);
drive             327 drivers/ide/ide-iops.c 	SELECT_MASK(drive, 0);
drive             332 drivers/ide/ide-iops.c 	drive->id[ATA_ID_UDMA_MODES]  = id[ATA_ID_UDMA_MODES];
drive             333 drivers/ide/ide-iops.c 	drive->id[ATA_ID_MWDMA_MODES] = id[ATA_ID_MWDMA_MODES];
drive             334 drivers/ide/ide-iops.c 	drive->id[ATA_ID_SWDMA_MODES] = id[ATA_ID_SWDMA_MODES];
drive             335 drivers/ide/ide-iops.c 	drive->id[ATA_ID_CFA_MODES]   = id[ATA_ID_CFA_MODES];
drive             343 drivers/ide/ide-iops.c 		printk(KERN_ERR "%s: %s: bad status\n", drive->name, __func__);
drive             348 drivers/ide/ide-iops.c int ide_config_drive_speed(ide_drive_t *drive, u8 speed)
drive             350 drivers/ide/ide-iops.c 	ide_hwif_t *hwif = drive->hwif;
drive             353 drivers/ide/ide-iops.c 	u16 *id = drive->id, i;
drive             359 drivers/ide/ide-iops.c 		hwif->dma_ops->dma_host_set(drive, 0);
drive             363 drivers/ide/ide-iops.c 	if ((speed & 0xf8) == XFER_PIO_0 && ata_id_has_iordy(drive->id) == 0)
drive             374 drivers/ide/ide-iops.c 	tp_ops->dev_select(drive);
drive             375 drivers/ide/ide-iops.c 	SELECT_MASK(drive, 1);
drive             383 drivers/ide/ide-iops.c 	tp_ops->tf_load(drive, &tf, IDE_VALID_FEATURE | IDE_VALID_NSECT);
drive             387 drivers/ide/ide-iops.c 	if (drive->dev_flags & IDE_DFLAG_NIEN_QUIRK)
drive             390 drivers/ide/ide-iops.c 	error = __ide_wait_stat(drive, drive->ready_stat,
drive             394 drivers/ide/ide-iops.c 	SELECT_MASK(drive, 0);
drive             397 drivers/ide/ide-iops.c 		(void) ide_dump_status(drive, "set_drive_speed_status", stat);
drive             412 drivers/ide/ide-iops.c 	if (speed >= XFER_SW_DMA_0 && (drive->dev_flags & IDE_DFLAG_USING_DMA))
drive             413 drivers/ide/ide-iops.c 		hwif->dma_ops->dma_host_set(drive, 1);
drive             415 drivers/ide/ide-iops.c 		ide_dma_off_quietly(drive);
drive             435 drivers/ide/ide-iops.c 	if (!drive->init_speed)
drive             436 drivers/ide/ide-iops.c 		drive->init_speed = speed;
drive             437 drivers/ide/ide-iops.c 	drive->current_speed = speed;
drive             450 drivers/ide/ide-iops.c void __ide_set_handler(ide_drive_t *drive, ide_handler_t *handler,
drive             453 drivers/ide/ide-iops.c 	ide_hwif_t *hwif = drive->hwif;
drive             462 drivers/ide/ide-iops.c void ide_set_handler(ide_drive_t *drive, ide_handler_t *handler,
drive             465 drivers/ide/ide-iops.c 	ide_hwif_t *hwif = drive->hwif;
drive             469 drivers/ide/ide-iops.c 	__ide_set_handler(drive, handler, timeout);
drive             487 drivers/ide/ide-iops.c void ide_execute_command(ide_drive_t *drive, struct ide_cmd *cmd,
drive             490 drivers/ide/ide-iops.c 	ide_hwif_t *hwif = drive->hwif;
drive             496 drivers/ide/ide-iops.c 	    (drive->atapi_flags & IDE_AFLAG_DRQ_INTERRUPT))
drive             497 drivers/ide/ide-iops.c 		__ide_set_handler(drive, handler, timeout);
drive              26 drivers/ide/ide-lib.c static void ide_dump_sector(ide_drive_t *drive)
drive              30 drivers/ide/ide-lib.c 	u8 lba48 = !!(drive->dev_flags & IDE_DFLAG_LBA48);
drive              40 drivers/ide/ide-lib.c 	ide_tf_readback(drive, &cmd);
drive              50 drivers/ide/ide-lib.c static void ide_dump_ata_error(ide_drive_t *drive, u8 err)
drive              69 drivers/ide/ide-lib.c 		struct request *rq = drive->hwif->rq;
drive              71 drivers/ide/ide-lib.c 		ide_dump_sector(drive);
drive              80 drivers/ide/ide-lib.c static void ide_dump_atapi_error(ide_drive_t *drive, u8 err)
drive             108 drivers/ide/ide-lib.c u8 ide_dump_status(ide_drive_t *drive, const char *msg, u8 stat)
drive             112 drivers/ide/ide-lib.c 	printk(KERN_ERR "%s: %s: status=0x%02x { ", drive->name, msg, stat);
drive             133 drivers/ide/ide-lib.c 		err = ide_read_error(drive);
drive             134 drivers/ide/ide-lib.c 		printk(KERN_ERR "%s: %s: error=0x%02x ", drive->name, msg, err);
drive             135 drivers/ide/ide-lib.c 		if (drive->media == ide_disk)
drive             136 drivers/ide/ide-lib.c 			ide_dump_ata_error(drive, err);
drive             138 drivers/ide/ide-lib.c 			ide_dump_atapi_error(drive, err);
drive             142 drivers/ide/ide-lib.c 		drive->name, drive->hwif->cmd.tf.command);
drive              10 drivers/ide/ide-park.c static void issue_park_cmd(ide_drive_t *drive, unsigned long timeout)
drive              12 drivers/ide/ide-park.c 	ide_hwif_t *hwif = drive->hwif;
drive              13 drivers/ide/ide-park.c 	struct request_queue *q = drive->queue;
drive              19 drivers/ide/ide-park.c 	if (drive->dev_flags & IDE_DFLAG_PARKED) {
drive              20 drivers/ide/ide-park.c 		int reset_timer = time_before(timeout, drive->sleep);
drive              23 drivers/ide/ide-park.c 		drive->sleep = timeout;
drive              58 drivers/ide/ide-park.c 	ide_insert_request_head(drive, rq);
drive              65 drivers/ide/ide-park.c ide_startstop_t ide_do_park_unpark(ide_drive_t *drive, struct request *rq)
drive              72 drivers/ide/ide-park.c 		drive->sleep = *(unsigned long *)ide_req(rq)->special;
drive              73 drivers/ide/ide-park.c 		drive->dev_flags |= IDE_DFLAG_SLEEPING;
drive              89 drivers/ide/ide-park.c 	return do_rw_taskfile(drive, &cmd);
drive              95 drivers/ide/ide-park.c 	ide_drive_t *drive = to_ide_device(dev);
drive              96 drivers/ide/ide-park.c 	ide_hwif_t *hwif = drive->hwif;
drive             100 drivers/ide/ide-park.c 	if (drive->dev_flags & IDE_DFLAG_NO_UNLOAD)
drive             105 drivers/ide/ide-park.c 	if (drive->dev_flags & IDE_DFLAG_PARKED &&
drive             106 drivers/ide/ide-park.c 	    time_after(drive->sleep, now))
drive             107 drivers/ide/ide-park.c 		msecs = jiffies_to_msecs(drive->sleep - now);
drive             119 drivers/ide/ide-park.c 	ide_drive_t *drive = to_ide_device(dev);
drive             135 drivers/ide/ide-park.c 		if (drive->dev_flags & IDE_DFLAG_NO_UNLOAD)
drive             137 drivers/ide/ide-park.c 		else if (input || drive->dev_flags & IDE_DFLAG_PARKED)
drive             138 drivers/ide/ide-park.c 			issue_park_cmd(drive, msecs_to_jiffies(input));
drive             140 drivers/ide/ide-park.c 		if (drive->media == ide_disk)
drive             143 drivers/ide/ide-park.c 				drive->dev_flags &= ~IDE_DFLAG_NO_UNLOAD;
drive             146 drivers/ide/ide-park.c 				drive->dev_flags |= IDE_DFLAG_NO_UNLOAD;
drive              36 drivers/ide/ide-pci-generic.c static void netcell_quirkproc(ide_drive_t *drive)
drive              39 drivers/ide/ide-pci-generic.c 	drive->id[ATA_ID_CSF_DEFAULT] |= 0x4000;
drive               8 drivers/ide/ide-pm.c 	ide_drive_t *drive = to_ide_device(dev);
drive               9 drivers/ide/ide-pm.c 	ide_drive_t *pair = ide_get_pair_dev(drive);
drive              10 drivers/ide/ide-pm.c 	ide_hwif_t *hwif = drive->hwif;
drive              17 drivers/ide/ide-pm.c 		if ((drive->dn & 1) == 0 || pair == NULL)
drive              22 drivers/ide/ide-pm.c 	rq = blk_get_request(drive->queue, REQ_OP_DRV_IN, 0);
drive              30 drivers/ide/ide-pm.c 	blk_execute_rq(drive->queue, NULL, rq, 0);
drive              36 drivers/ide/ide-pm.c 		if ((drive->dn & 1) || pair == NULL)
drive              60 drivers/ide/ide-pm.c 	ide_drive_t *drive = to_ide_device(dev);
drive              61 drivers/ide/ide-pm.c 	ide_drive_t *pair = ide_get_pair_dev(drive);
drive              62 drivers/ide/ide-pm.c 	ide_hwif_t *hwif = drive->hwif;
drive              67 drivers/ide/ide-pm.c 	blk_mq_start_stopped_hw_queues(drive->queue, true);
drive              71 drivers/ide/ide-pm.c 		if ((drive->dn & 1) == 0 || pair == NULL) {
drive              76 drivers/ide/ide-pm.c 		ide_acpi_exec_tfs(drive);
drive              80 drivers/ide/ide-pm.c 	rq = blk_get_request(drive->queue, REQ_OP_DRV_IN, BLK_MQ_REQ_PREEMPT);
drive              93 drivers/ide/ide-pm.c 			drv->resume(drive);
drive              99 drivers/ide/ide-pm.c void ide_complete_power_step(ide_drive_t *drive, struct request *rq)
drive             105 drivers/ide/ide-pm.c 		drive->name, pm->pm_step);
drive             107 drivers/ide/ide-pm.c 	if (drive->media != ide_disk)
drive             129 drivers/ide/ide-pm.c ide_startstop_t ide_start_power_step(ide_drive_t *drive, struct request *rq)
drive             136 drivers/ide/ide-pm.c 		if (drive->media != ide_disk)
drive             139 drivers/ide/ide-pm.c 		if (ata_id_flush_enabled(drive->id) == 0 ||
drive             140 drivers/ide/ide-pm.c 		    (drive->dev_flags & IDE_DFLAG_WCACHE) == 0) {
drive             141 drivers/ide/ide-pm.c 			ide_complete_power_step(drive, rq);
drive             144 drivers/ide/ide-pm.c 		if (ata_id_flush_ext_enabled(drive->id))
drive             153 drivers/ide/ide-pm.c 		ide_set_max_pio(drive);
drive             157 drivers/ide/ide-pm.c 		if (drive->media != ide_disk)
drive             160 drivers/ide/ide-pm.c 			ide_complete_power_step(drive, rq);
drive             171 drivers/ide/ide-pm.c 		if (drive->hwif->dma_ops == NULL)
drive             176 drivers/ide/ide-pm.c 		ide_set_dma(drive);
drive             189 drivers/ide/ide-pm.c 	return do_rw_taskfile(drive, &cmd);
drive             200 drivers/ide/ide-pm.c void ide_complete_pm_rq(ide_drive_t *drive, struct request *rq)
drive             202 drivers/ide/ide-pm.c 	struct request_queue *q = drive->queue;
drive             205 drivers/ide/ide-pm.c 	ide_complete_power_step(drive, rq);
drive             210 drivers/ide/ide-pm.c 	printk("%s: completing PM request, %s\n", drive->name,
drive             216 drivers/ide/ide-pm.c 		drive->dev_flags &= ~IDE_DFLAG_BLOCKED;
drive             218 drivers/ide/ide-pm.c 	drive->hwif->rq = NULL;
drive             223 drivers/ide/ide-pm.c void ide_check_pm_state(ide_drive_t *drive, struct request *rq)
drive             231 drivers/ide/ide-pm.c 		drive->dev_flags |= IDE_DFLAG_BLOCKED;
drive             243 drivers/ide/ide-pm.c 		ide_hwif_t *hwif = drive->hwif;
drive             245 drivers/ide/ide-pm.c 		struct request_queue *q = drive->queue;
drive             248 drivers/ide/ide-pm.c 		printk("%s: Wakeup request inited, waiting for !BSY...\n", drive->name);
drive             252 drivers/ide/ide-pm.c 			printk(KERN_WARNING "%s: bus not ready on wakeup\n", drive->name);
drive             253 drivers/ide/ide-pm.c 		tp_ops->dev_select(drive);
drive             257 drivers/ide/ide-pm.c 			printk(KERN_WARNING "%s: drive not ready on wakeup\n", drive->name);
drive              52 drivers/ide/ide-probe.c static void generic_id(ide_drive_t *drive)
drive              54 drivers/ide/ide-probe.c 	u16 *id = drive->id;
drive              56 drivers/ide/ide-probe.c 	id[ATA_ID_CUR_CYLS]	= id[ATA_ID_CYLS]	= drive->cyl;
drive              57 drivers/ide/ide-probe.c 	id[ATA_ID_CUR_HEADS]	= id[ATA_ID_HEADS]	= drive->head;
drive              58 drivers/ide/ide-probe.c 	id[ATA_ID_CUR_SECTORS]	= id[ATA_ID_SECTORS]	= drive->sect;
drive              61 drivers/ide/ide-probe.c static void ide_disk_init_chs(ide_drive_t *drive)
drive              63 drivers/ide/ide-probe.c 	u16 *id = drive->id;
drive              66 drivers/ide/ide-probe.c 	if (!drive->cyl || !drive->head || !drive->sect) {
drive              67 drivers/ide/ide-probe.c 		drive->cyl  = drive->bios_cyl  = id[ATA_ID_CYLS];
drive              68 drivers/ide/ide-probe.c 		drive->head = drive->bios_head = id[ATA_ID_HEADS];
drive              69 drivers/ide/ide-probe.c 		drive->sect = drive->bios_sect = id[ATA_ID_SECTORS];
drive              74 drivers/ide/ide-probe.c 		drive->cyl  = id[ATA_ID_CUR_CYLS];
drive              75 drivers/ide/ide-probe.c 		drive->head = id[ATA_ID_CUR_HEADS];
drive              76 drivers/ide/ide-probe.c 		drive->sect = id[ATA_ID_CUR_SECTORS];
drive              80 drivers/ide/ide-probe.c 	if (drive->head > 16 && id[ATA_ID_HEADS] && id[ATA_ID_HEADS] <= 16) {
drive              81 drivers/ide/ide-probe.c 		drive->cyl  = id[ATA_ID_CYLS];
drive              82 drivers/ide/ide-probe.c 		drive->head = id[ATA_ID_HEADS];
drive              83 drivers/ide/ide-probe.c 		drive->sect = id[ATA_ID_SECTORS];
drive              87 drivers/ide/ide-probe.c static void ide_disk_init_mult_count(ide_drive_t *drive)
drive              89 drivers/ide/ide-probe.c 	u16 *id = drive->id;
drive              98 drivers/ide/ide-probe.c 		drive->mult_req = id[ATA_ID_MULTSECT] & 0xff;
drive             100 drivers/ide/ide-probe.c 		if (drive->mult_req)
drive             101 drivers/ide/ide-probe.c 			drive->special_flags |= IDE_SFLAG_SET_MULTMODE;
drive             105 drivers/ide/ide-probe.c static void ide_classify_ata_dev(ide_drive_t *drive)
drive             107 drivers/ide/ide-probe.c 	u16 *id = drive->id;
drive             113 drivers/ide/ide-probe.c 		drive->dev_flags |= IDE_DFLAG_REMOVABLE;
drive             115 drivers/ide/ide-probe.c 	drive->media = ide_disk;
drive             117 drivers/ide/ide-probe.c 	if (!ata_id_has_unload(drive->id))
drive             118 drivers/ide/ide-probe.c 		drive->dev_flags |= IDE_DFLAG_NO_UNLOAD;
drive             120 drivers/ide/ide-probe.c 	printk(KERN_INFO "%s: %s, %s DISK drive\n", drive->name, m,
drive             124 drivers/ide/ide-probe.c static void ide_classify_atapi_dev(ide_drive_t *drive)
drive             126 drivers/ide/ide-probe.c 	u16 *id = drive->id;
drive             130 drivers/ide/ide-probe.c 	printk(KERN_INFO "%s: %s, ATAPI ", drive->name, m);
drive             138 drivers/ide/ide-probe.c 			if (drive->media != ide_cdrom) {
drive             140 drivers/ide/ide-probe.c 				drive->dev_flags |= IDE_DFLAG_REMOVABLE;
drive             148 drivers/ide/ide-probe.c 		drive->dev_flags |= IDE_DFLAG_REMOVABLE;
drive             164 drivers/ide/ide-probe.c 		drive->dev_flags |= IDE_DFLAG_REMOVABLE;
drive             172 drivers/ide/ide-probe.c 	drive->media = type;
drive             174 drivers/ide/ide-probe.c 	drive->ready_stat = 0;
drive             176 drivers/ide/ide-probe.c 		drive->atapi_flags |= IDE_AFLAG_DRQ_INTERRUPT;
drive             177 drivers/ide/ide-probe.c 	drive->dev_flags |= IDE_DFLAG_DOORLOCKING;
drive             179 drivers/ide/ide-probe.c 	drive->dev_flags |= IDE_DFLAG_NO_UNLOAD;
drive             193 drivers/ide/ide-probe.c static void do_identify(ide_drive_t *drive, u8 cmd, u16 *id)
drive             195 drivers/ide/ide-probe.c 	ide_hwif_t *hwif = drive->hwif;
drive             203 drivers/ide/ide-probe.c 	hwif->tp_ops->input_data(drive, NULL, id, SECTOR_SIZE);
drive             206 drivers/ide/ide-probe.c 	drive->dev_flags |= IDE_DFLAG_ID_READ;
drive             208 drivers/ide/ide-probe.c 	printk(KERN_INFO "%s: dumping identify data\n", drive->name);
drive             233 drivers/ide/ide-probe.c 		drive->dev_flags &= ~IDE_DFLAG_PRESENT;
drive             235 drivers/ide/ide-probe.c 		drive->dev_flags |= IDE_DFLAG_PRESENT;
drive             252 drivers/ide/ide-probe.c int ide_dev_read_id(ide_drive_t *drive, u8 cmd, u16 *id, int irq_ctx)
drive             254 drivers/ide/ide-probe.c 	ide_hwif_t *hwif = drive->hwif;
drive             282 drivers/ide/ide-probe.c 					 drive->name, s, a);
drive             296 drivers/ide/ide-probe.c 		tp_ops->tf_load(drive, &tf, IDE_VALID_FEATURE);
drive             306 drivers/ide/ide-probe.c 		rc = __ide_wait_stat(drive, ATA_DRQ, BAD_R_STAT, timeout, &s);
drive             310 drivers/ide/ide-probe.c 		rc = ide_busy_sleep(drive, timeout, use_altstatus);
drive             320 drivers/ide/ide-probe.c 		do_identify(drive, cmd, id);
drive             332 drivers/ide/ide-probe.c int ide_busy_sleep(ide_drive_t *drive, unsigned long timeout, int altstatus)
drive             334 drivers/ide/ide-probe.c 	ide_hwif_t *hwif = drive->hwif;
drive             347 drivers/ide/ide-probe.c 	printk(KERN_ERR "%s: timeout in %s\n", drive->name, __func__);
drive             352 drivers/ide/ide-probe.c static u8 ide_read_device(ide_drive_t *drive)
drive             356 drivers/ide/ide-probe.c 	drive->hwif->tp_ops->tf_read(drive, &tf, IDE_VALID_DEVICE);
drive             382 drivers/ide/ide-probe.c static int do_probe (ide_drive_t *drive, u8 cmd)
drive             384 drivers/ide/ide-probe.c 	ide_hwif_t *hwif = drive->hwif;
drive             386 drivers/ide/ide-probe.c 	u16 *id = drive->id;
drive             388 drivers/ide/ide-probe.c 	u8 present = !!(drive->dev_flags & IDE_DFLAG_PRESENT), stat;
drive             391 drivers/ide/ide-probe.c 	if (present && drive->media != ide_disk && cmd == ATA_CMD_ID_ATA)
drive             396 drivers/ide/ide-probe.c 		drive->name, present, drive->media,
drive             404 drivers/ide/ide-probe.c 	tp_ops->dev_select(drive);
drive             407 drivers/ide/ide-probe.c 	if (ide_read_device(drive) != drive->select && present == 0) {
drive             408 drivers/ide/ide-probe.c 		if (drive->dn & 1) {
drive             422 drivers/ide/ide-probe.c 		rc = ide_dev_read_id(drive, cmd, id, 0);
drive             425 drivers/ide/ide-probe.c 			rc = ide_dev_read_id(drive, cmd, id, 0);
drive             434 drivers/ide/ide-probe.c 					"resetting drive\n", drive->name, stat);
drive             436 drivers/ide/ide-probe.c 			tp_ops->dev_select(drive);
drive             439 drivers/ide/ide-probe.c 			(void)ide_busy_sleep(drive, WAIT_WORSTCASE, 0);
drive             440 drivers/ide/ide-probe.c 			rc = ide_dev_read_id(drive, cmd, id, 0);
drive             448 drivers/ide/ide-probe.c 					drive->name, stat);
drive             453 drivers/ide/ide-probe.c 	if (drive->dn & 1) {
drive             475 drivers/ide/ide-probe.c static u8 probe_for_drive(ide_drive_t *drive)
drive             481 drivers/ide/ide-probe.c 	drive->dev_flags &= ~IDE_DFLAG_ID_READ;
drive             483 drivers/ide/ide-probe.c 	m = (char *)&drive->id[ATA_ID_PROD];
drive             487 drivers/ide/ide-probe.c 	if ((drive->dev_flags & IDE_DFLAG_NOPROBE) == 0) {
drive             490 drivers/ide/ide-probe.c 		rc = do_probe(drive, cmd);
drive             494 drivers/ide/ide-probe.c 			rc = do_probe(drive, cmd);
drive             497 drivers/ide/ide-probe.c 		if ((drive->dev_flags & IDE_DFLAG_PRESENT) == 0)
drive             501 drivers/ide/ide-probe.c 		if ((drive->dev_flags & IDE_DFLAG_ID_READ) == 0) {
drive             502 drivers/ide/ide-probe.c 			if (drive->media == ide_disk) {
drive             504 drivers/ide/ide-probe.c 					drive->name, drive->cyl,
drive             505 drivers/ide/ide-probe.c 					drive->head, drive->sect);
drive             506 drivers/ide/ide-probe.c 			} else if (drive->media == ide_cdrom) {
drive             507 drivers/ide/ide-probe.c 				printk(KERN_INFO "%s: ATAPI cdrom (?)\n", drive->name);
drive             510 drivers/ide/ide-probe.c 				printk(KERN_WARNING "%s: Unknown device on bus refused identification. Ignoring.\n", drive->name);
drive             511 drivers/ide/ide-probe.c 				drive->dev_flags &= ~IDE_DFLAG_PRESENT;
drive             515 drivers/ide/ide-probe.c 				ide_classify_atapi_dev(drive);
drive             517 drivers/ide/ide-probe.c 				ide_classify_ata_dev(drive);
drive             521 drivers/ide/ide-probe.c 	if ((drive->dev_flags & IDE_DFLAG_PRESENT) == 0)
drive             525 drivers/ide/ide-probe.c 	if ((drive->dev_flags & IDE_DFLAG_ID_READ) == 0) {
drive             526 drivers/ide/ide-probe.c 		generic_id(drive);
drive             530 drivers/ide/ide-probe.c 	if (drive->media == ide_disk) {
drive             531 drivers/ide/ide-probe.c 		ide_disk_init_chs(drive);
drive             532 drivers/ide/ide-probe.c 		ide_disk_init_mult_count(drive);
drive             602 drivers/ide/ide-probe.c 	ide_drive_t *drive;
drive             620 drivers/ide/ide-probe.c 	ide_port_for_each_dev(i, drive, hwif) {
drive             622 drivers/ide/ide-probe.c 		if ((drive->dev_flags & IDE_DFLAG_NOPROBE) == 0 ||
drive             623 drivers/ide/ide-probe.c 		    (drive->dev_flags & IDE_DFLAG_PRESENT)) {
drive             624 drivers/ide/ide-probe.c 			tp_ops->dev_select(drive);
drive             632 drivers/ide/ide-probe.c 					  drive->name);
drive             682 drivers/ide/ide-probe.c 	ide_drive_t *drive;
drive             707 drivers/ide/ide-probe.c 	ide_port_for_each_dev(i, drive, hwif) {
drive             708 drivers/ide/ide-probe.c 		(void) probe_for_drive(drive);
drive             709 drivers/ide/ide-probe.c 		if (drive->dev_flags & IDE_DFLAG_PRESENT)
drive             726 drivers/ide/ide-probe.c 	ide_drive_t *drive;
drive             729 drivers/ide/ide-probe.c 	ide_port_for_each_present_dev(i, drive, hwif) {
drive             730 drivers/ide/ide-probe.c 		ide_check_nien_quirk_list(drive);
drive             733 drivers/ide/ide-probe.c 			port_ops->quirkproc(drive);
drive             736 drivers/ide/ide-probe.c 	ide_port_for_each_present_dev(i, drive, hwif) {
drive             737 drivers/ide/ide-probe.c 		ide_set_max_pio(drive);
drive             739 drivers/ide/ide-probe.c 		drive->dev_flags |= IDE_DFLAG_NICE1;
drive             742 drivers/ide/ide-probe.c 			ide_set_dma(drive);
drive             763 drivers/ide/ide-probe.c static int ide_init_queue(ide_drive_t *drive)
drive             766 drivers/ide/ide-probe.c 	ide_hwif_t *hwif = drive->hwif;
drive             779 drivers/ide/ide-probe.c 	set = &drive->tag_set;
drive             798 drivers/ide/ide-probe.c 	q->queuedata = drive;
drive             821 drivers/ide/ide-probe.c 	drive->queue = q;
drive             834 drivers/ide/ide-probe.c 	ide_drive_t *drive;
drive             838 drivers/ide/ide-probe.c 	ide_port_for_each_present_dev(i, drive, hwif) {
drive             839 drivers/ide/ide-probe.c 		if (ide_init_queue(drive)) {
drive             841 drivers/ide/ide-probe.c 					drive->name);
drive             842 drivers/ide/ide-probe.c 			drive->dev_flags &= ~IDE_DFLAG_PRESENT;
drive             915 drivers/ide/ide-probe.c 	ide_drive_t *drive = hwif->devices[unit];
drive             917 drivers/ide/ide-probe.c 	if ((drive->dev_flags & IDE_DFLAG_PRESENT) == 0)
drive             920 drivers/ide/ide-probe.c 	if (drive->media == ide_disk)
drive             922 drivers/ide/ide-probe.c 	if (drive->media == ide_cdrom || drive->media == ide_optical)
drive             924 drivers/ide/ide-probe.c 	if (drive->media == ide_tape)
drive             926 drivers/ide/ide-probe.c 	if (drive->media == ide_floppy)
drive             964 drivers/ide/ide-probe.c void ide_init_disk(struct gendisk *disk, ide_drive_t *drive)
drive             966 drivers/ide/ide-probe.c 	ide_hwif_t *hwif = drive->hwif;
drive             967 drivers/ide/ide-probe.c 	unsigned int unit = drive->dn & 1;
drive             972 drivers/ide/ide-probe.c 	disk->queue = drive->queue;
drive             979 drivers/ide/ide-probe.c 	ide_drive_t *drive = container_of(dev, ide_drive_t, gendev);
drive             981 drivers/ide/ide-probe.c 	ide_proc_unregister_device(drive);
drive             983 drivers/ide/ide-probe.c 	if (drive->sense_rq)
drive             984 drivers/ide/ide-probe.c 		blk_mq_free_request(drive->sense_rq);
drive             986 drivers/ide/ide-probe.c 	blk_cleanup_queue(drive->queue);
drive             987 drivers/ide/ide-probe.c 	drive->queue = NULL;
drive             988 drivers/ide/ide-probe.c 	blk_mq_free_tag_set(&drive->tag_set);
drive             990 drivers/ide/ide-probe.c 	drive->dev_flags &= ~IDE_DFLAG_PRESENT;
drive             992 drivers/ide/ide-probe.c 	complete(&drive->gendev_rel_comp);
drive            1035 drivers/ide/ide-probe.c 	ide_drive_t *drive;
drive            1038 drivers/ide/ide-probe.c 	ide_port_for_each_present_dev(i, drive, hwif) {
drive            1039 drivers/ide/ide-probe.c 		struct device *dev = &drive->gendev;
drive            1043 drivers/ide/ide-probe.c 		dev_set_drvdata(dev, drive);
drive            1058 drivers/ide/ide-probe.c 	ide_drive_t *drive;
drive            1061 drivers/ide/ide-probe.c 	ide_port_for_each_dev(i, drive, hwif) {
drive            1062 drivers/ide/ide-probe.c 		drive->dn = i + hwif->channel * 2;
drive            1065 drivers/ide/ide-probe.c 			drive->io_32bit = 1;
drive            1067 drivers/ide/ide-probe.c 			drive->dev_flags |= IDE_DFLAG_NO_IO_32BIT;
drive            1069 drivers/ide/ide-probe.c 			drive->dev_flags |= IDE_DFLAG_UNMASK;
drive            1071 drivers/ide/ide-probe.c 			drive->dev_flags |= IDE_DFLAG_NO_UNMASK;
drive            1073 drivers/ide/ide-probe.c 		drive->pio_mode = XFER_PIO_0;
drive            1076 drivers/ide/ide-probe.c 			port_ops->init_dev(drive);
drive            1160 drivers/ide/ide-probe.c 	ide_drive_t *drive = container_of(work, ide_drive_t, rq_work);
drive            1161 drivers/ide/ide-probe.c 	ide_hwif_t *hwif = drive->hwif;
drive            1166 drivers/ide/ide-probe.c 	blk_mq_quiesce_queue(drive->queue);
drive            1170 drivers/ide/ide-probe.c 	while (!list_empty(&drive->rq_list)) {
drive            1171 drivers/ide/ide-probe.c 		rq = list_first_entry(&drive->rq_list, struct request, queuelist);
drive            1175 drivers/ide/ide-probe.c 		ret = ide_issue_rq(drive, rq, true);
drive            1180 drivers/ide/ide-probe.c 	blk_mq_unquiesce_queue(drive->queue);
drive            1183 drivers/ide/ide-probe.c 		kblockd_schedule_work(&drive->rq_work);
drive            1192 drivers/ide/ide-probe.c 	ide_drive_t *drive;
drive            1195 drivers/ide/ide-probe.c 	ide_port_for_each_dev(i, drive, hwif) {
drive            1197 drivers/ide/ide-probe.c 		u16 *saved_id = drive->id;
drive            1199 drivers/ide/ide-probe.c 		memset(drive, 0, sizeof(*drive));
drive            1201 drivers/ide/ide-probe.c 		drive->id = saved_id;
drive            1203 drivers/ide/ide-probe.c 		drive->media			= ide_disk;
drive            1204 drivers/ide/ide-probe.c 		drive->select			= (i << 4) | ATA_DEVICE_OBS;
drive            1205 drivers/ide/ide-probe.c 		drive->hwif			= hwif;
drive            1206 drivers/ide/ide-probe.c 		drive->ready_stat		= ATA_DRDY;
drive            1207 drivers/ide/ide-probe.c 		drive->bad_wstat		= BAD_W_STAT;
drive            1208 drivers/ide/ide-probe.c 		drive->special_flags		= IDE_SFLAG_RECALIBRATE |
drive            1210 drivers/ide/ide-probe.c 		drive->name[0]			= 'h';
drive            1211 drivers/ide/ide-probe.c 		drive->name[1]			= 'd';
drive            1212 drivers/ide/ide-probe.c 		drive->name[2]			= 'a' + j;
drive            1213 drivers/ide/ide-probe.c 		drive->max_failures		= IDE_DEFAULT_MAX_FAILURES;
drive            1215 drivers/ide/ide-probe.c 		INIT_LIST_HEAD(&drive->list);
drive            1216 drivers/ide/ide-probe.c 		init_completion(&drive->gendev_rel_comp);
drive            1218 drivers/ide/ide-probe.c 		INIT_WORK(&drive->rq_work, drive_rq_insert_work);
drive            1219 drivers/ide/ide-probe.c 		INIT_LIST_HEAD(&drive->rq_list);
drive            1305 drivers/ide/ide-probe.c 	ide_drive_t *drive;
drive            1308 drivers/ide/ide-probe.c 	ide_port_for_each_dev(i, drive, hwif) {
drive            1309 drivers/ide/ide-probe.c 		kfree(drive->id);
drive            1310 drivers/ide/ide-probe.c 		kfree(drive);
drive            1316 drivers/ide/ide-probe.c 	ide_drive_t *drive;
drive            1320 drivers/ide/ide-probe.c 		drive = kzalloc_node(sizeof(*drive), GFP_KERNEL, node);
drive            1321 drivers/ide/ide-probe.c 		if (drive == NULL)
drive            1332 drivers/ide/ide-probe.c 		drive->id = kzalloc_node(SECTOR_SIZE, GFP_KERNEL, node);
drive            1333 drivers/ide/ide-probe.c 		if (drive->id == NULL)
drive            1336 drivers/ide/ide-probe.c 		hwif->devices[i] = drive;
drive            1341 drivers/ide/ide-probe.c 	kfree(drive);
drive            1560 drivers/ide/ide-probe.c 	ide_drive_t *drive;
drive            1563 drivers/ide/ide-probe.c 	ide_port_for_each_present_dev(i, drive, hwif) {
drive            1564 drivers/ide/ide-probe.c 		device_unregister(&drive->gendev);
drive            1565 drivers/ide/ide-probe.c 		wait_for_completion(&drive->gendev_rel_comp);
drive              81 drivers/ide/ide-proc.c 	ide_drive_t *drive = (ide_drive_t *)m->private;
drive              84 drivers/ide/ide-proc.c 	if (!drive) {
drive              92 drivers/ide/ide-proc.c 	if (taskfile_lib_get_identify(drive, buf) == 0) {
drive             141 drivers/ide/ide-proc.c static int ide_read_setting(ide_drive_t *drive,
drive             148 drivers/ide/ide-proc.c 		val = ds->get(drive);
drive             171 drivers/ide/ide-proc.c static int ide_write_setting(ide_drive_t *drive,
drive             183 drivers/ide/ide-proc.c 	return ide_devset_execute(drive, ds, val);
drive             188 drivers/ide/ide-proc.c static int set_xfer_rate (ide_drive_t *drive, int arg)
drive             203 drivers/ide/ide-proc.c 	return ide_no_data_taskfile(drive, &cmd);
drive             234 drivers/ide/ide-proc.c 	ide_drive_t	*drive = (ide_drive_t *) m->private;
drive             241 drivers/ide/ide-proc.c 	d = drive->settings;
drive             255 drivers/ide/ide-proc.c 		mul_factor = setting->mulf ? setting->mulf(drive) : 1;
drive             256 drivers/ide/ide-proc.c 		div_factor = setting->divf ? setting->divf(drive) : 1;
drive             258 drivers/ide/ide-proc.c 		rc = ide_read_setting(drive, setting);
drive             285 drivers/ide/ide-proc.c 	ide_drive_t	*drive = PDE_DATA(file_inode(file));
drive             361 drivers/ide/ide-proc.c 				if (drive->settings)
drive             362 drivers/ide/ide-proc.c 					setting = ide_find_setting(drive->settings, name);
drive             369 drivers/ide/ide-proc.c 				mul_factor = setting->mulf ? setting->mulf(drive) : 1;
drive             370 drivers/ide/ide-proc.c 				div_factor = setting->divf ? setting->divf(drive) : 1;
drive             371 drivers/ide/ide-proc.c 				ide_write_setting(drive, setting, val * div_factor / mul_factor);
drive             402 drivers/ide/ide-proc.c 	ide_drive_t	*drive = (ide_drive_t *) m->private;
drive             405 drivers/ide/ide-proc.c 			drive->cyl, drive->head, drive->sect);
drive             407 drivers/ide/ide-proc.c 			drive->bios_cyl, drive->bios_head, drive->bios_sect);
drive             414 drivers/ide/ide-proc.c 	ide_drive_t	*drive = (ide_drive_t *) seq->private;
drive             415 drivers/ide/ide-proc.c 	char		*m = (char *)&drive->id[ATA_ID_PROD];
drive             423 drivers/ide/ide-proc.c 	ide_drive_t		*drive = (ide_drive_t *)m->private;
drive             424 drivers/ide/ide-proc.c 	struct device		*dev = &drive->gendev;
drive             438 drivers/ide/ide-proc.c 	ide_drive_t	*drive = (ide_drive_t *) m->private;
drive             441 drivers/ide/ide-proc.c 	switch (drive->media) {
drive             497 drivers/ide/ide-proc.c void ide_proc_register_driver(ide_drive_t *drive, struct ide_driver *driver)
drive             500 drivers/ide/ide-proc.c 	drive->settings = driver->proc_devsets(drive);
drive             503 drivers/ide/ide-proc.c 	ide_add_proc_entries(drive->proc, driver->proc_entries(drive), drive);
drive             519 drivers/ide/ide-proc.c void ide_proc_unregister_driver(ide_drive_t *drive, struct ide_driver *driver)
drive             521 drivers/ide/ide-proc.c 	ide_remove_proc_entries(drive->proc, driver->proc_entries(drive));
drive             528 drivers/ide/ide-proc.c 	drive->settings = NULL;
drive             537 drivers/ide/ide-proc.c 	ide_drive_t *drive;
drive             541 drivers/ide/ide-proc.c 	ide_port_for_each_dev(i, drive, hwif) {
drive             542 drivers/ide/ide-proc.c 		if ((drive->dev_flags & IDE_DFLAG_PRESENT) == 0)
drive             545 drivers/ide/ide-proc.c 		drive->proc = proc_mkdir(drive->name, parent);
drive             546 drivers/ide/ide-proc.c 		if (drive->proc) {
drive             547 drivers/ide/ide-proc.c 			ide_add_proc_entries(drive->proc, generic_drive_entries, drive);
drive             549 drivers/ide/ide-proc.c 					drive->proc, &ide_settings_proc_fops,
drive             550 drivers/ide/ide-proc.c 					drive);
drive             552 drivers/ide/ide-proc.c 		sprintf(name, "ide%d/%s", (drive->name[2]-'a')/2, drive->name);
drive             553 drivers/ide/ide-proc.c 		ent = proc_symlink(drive->name, proc_ide_root, name);
drive             558 drivers/ide/ide-proc.c void ide_proc_unregister_device(ide_drive_t *drive)
drive             560 drivers/ide/ide-proc.c 	if (drive->proc) {
drive             561 drivers/ide/ide-proc.c 		remove_proc_entry("settings", drive->proc);
drive             562 drivers/ide/ide-proc.c 		ide_remove_proc_entries(drive->proc, generic_drive_entries);
drive             563 drivers/ide/ide-proc.c 		remove_proc_entry(drive->name, proc_ide_root);
drive             564 drivers/ide/ide-proc.c 		remove_proc_entry(drive->name, drive->hwif->proc);
drive             565 drivers/ide/ide-proc.c 		drive->proc = NULL;
drive               5 drivers/ide/ide-sysfs.c char *ide_media_string(ide_drive_t *drive)
drive               7 drivers/ide/ide-sysfs.c 	switch (drive->media) {
drive              26 drivers/ide/ide-sysfs.c 	ide_drive_t *drive = to_ide_device(dev);
drive              27 drivers/ide/ide-sysfs.c 	return sprintf(buf, "%s\n", ide_media_string(drive));
drive              34 drivers/ide/ide-sysfs.c 	ide_drive_t *drive = to_ide_device(dev);
drive              35 drivers/ide/ide-sysfs.c 	return sprintf(buf, "%s\n", drive->name);
drive              42 drivers/ide/ide-sysfs.c 	ide_drive_t *drive = to_ide_device(dev);
drive              43 drivers/ide/ide-sysfs.c 	return sprintf(buf, "ide:m-%s\n", ide_media_string(drive));
drive              50 drivers/ide/ide-sysfs.c 	ide_drive_t *drive = to_ide_device(dev);
drive              51 drivers/ide/ide-sysfs.c 	return sprintf(buf, "%s\n", (char *)&drive->id[ATA_ID_PROD]);
drive              58 drivers/ide/ide-sysfs.c 	ide_drive_t *drive = to_ide_device(dev);
drive              59 drivers/ide/ide-sysfs.c 	return sprintf(buf, "%s\n", (char *)&drive->id[ATA_ID_FW_REV]);
drive              66 drivers/ide/ide-sysfs.c 	ide_drive_t *drive = to_ide_device(dev);
drive              67 drivers/ide/ide-sysfs.c 	return sprintf(buf, "%s\n", (char *)&drive->id[ATA_ID_SERNO]);
drive             141 drivers/ide/ide-tape.c 	ide_drive_t		*drive;
drive             244 drivers/ide/ide-tape.c 		if (ide_device_get(tape->drive))
drive             256 drivers/ide/ide-tape.c 	ide_drive_t *drive = tape->drive;
drive             260 drivers/ide/ide-tape.c 	ide_device_put(drive);
drive             268 drivers/ide/ide-tape.c static void idetape_analyze_error(ide_drive_t *drive)
drive             270 drivers/ide/ide-tape.c 	idetape_tape_t *tape = drive->driver_data;
drive             271 drivers/ide/ide-tape.c 	struct ide_atapi_pc *pc = drive->failed_pc;
drive             272 drivers/ide/ide-tape.c 	struct request *rq = drive->hwif->rq;
drive             326 drivers/ide/ide-tape.c static int ide_tape_callback(ide_drive_t *drive, int dsc)
drive             328 drivers/ide/ide-tape.c 	idetape_tape_t *tape = drive->driver_data;
drive             329 drivers/ide/ide-tape.c 	struct ide_atapi_pc *pc = drive->pc;
drive             330 drivers/ide/ide-tape.c 	struct request *rq = drive->hwif->rq;
drive             338 drivers/ide/ide-tape.c 		ide_tape_handle_dsc(drive);
drive             340 drivers/ide/ide-tape.c 	if (drive->failed_pc == pc)
drive             341 drivers/ide/ide-tape.c 		drive->failed_pc = NULL;
drive             345 drivers/ide/ide-tape.c 			idetape_analyze_error(drive);
drive             378 drivers/ide/ide-tape.c static void ide_tape_stall_queue(ide_drive_t *drive)
drive             380 drivers/ide/ide-tape.c 	idetape_tape_t *tape = drive->driver_data;
drive             383 drivers/ide/ide-tape.c 		      drive->hwif->rq->cmd[0], tape->dsc_poll_freq);
drive             387 drivers/ide/ide-tape.c 	ide_stall_queue(drive, tape->dsc_poll_freq);
drive             390 drivers/ide/ide-tape.c static void ide_tape_handle_dsc(ide_drive_t *drive)
drive             392 drivers/ide/ide-tape.c 	idetape_tape_t *tape = drive->driver_data;
drive             399 drivers/ide/ide-tape.c 	ide_tape_stall_queue(drive);
drive             439 drivers/ide/ide-tape.c static ide_startstop_t ide_tape_issue_pc(ide_drive_t *drive,
drive             443 drivers/ide/ide-tape.c 	idetape_tape_t *tape = drive->driver_data;
drive             444 drivers/ide/ide-tape.c 	struct request *rq = drive->hwif->rq;
drive             446 drivers/ide/ide-tape.c 	if (drive->failed_pc == NULL && pc->c[0] != REQUEST_SENSE)
drive             447 drivers/ide/ide-tape.c 		drive->failed_pc = pc;
drive             450 drivers/ide/ide-tape.c 	drive->pc = pc;
drive             475 drivers/ide/ide-tape.c 		drive->failed_pc = NULL;
drive             476 drivers/ide/ide-tape.c 		drive->pc_callback(drive, 0);
drive             477 drivers/ide/ide-tape.c 		ide_complete_rq(drive, BLK_STS_IOERR, blk_rq_bytes(rq));
drive             485 drivers/ide/ide-tape.c 	return ide_issue_pc(drive, cmd);
drive             515 drivers/ide/ide-tape.c static ide_startstop_t idetape_media_access_finished(ide_drive_t *drive)
drive             517 drivers/ide/ide-tape.c 	ide_hwif_t *hwif = drive->hwif;
drive             518 drivers/ide/ide-tape.c 	idetape_tape_t *tape = drive->driver_data;
drive             519 drivers/ide/ide-tape.c 	struct ide_atapi_pc *pc = drive->pc;
drive             531 drivers/ide/ide-tape.c 			ide_retry_pc(drive);
drive             537 drivers/ide/ide-tape.c 		drive->failed_pc = NULL;
drive             539 drivers/ide/ide-tape.c 	drive->pc_callback(drive, 0);
drive             566 drivers/ide/ide-tape.c static ide_startstop_t idetape_do_request(ide_drive_t *drive,
drive             569 drivers/ide/ide-tape.c 	ide_hwif_t *hwif = drive->hwif;
drive             570 drivers/ide/ide-tape.c 	idetape_tape_t *tape = drive->driver_data;
drive             585 drivers/ide/ide-tape.c 	if (drive->failed_pc && drive->pc->c[0] == REQUEST_SENSE) {
drive             586 drivers/ide/ide-tape.c 		pc = drive->failed_pc;
drive             596 drivers/ide/ide-tape.c 	if ((drive->dev_flags & IDE_DFLAG_DSC_OVERLAP) == 0 &&
drive             598 drivers/ide/ide-tape.c 		drive->atapi_flags |= IDE_AFLAG_IGNORE_DSC;
drive             600 drivers/ide/ide-tape.c 	if (drive->dev_flags & IDE_DFLAG_POST_RESET) {
drive             601 drivers/ide/ide-tape.c 		drive->atapi_flags |= IDE_AFLAG_IGNORE_DSC;
drive             602 drivers/ide/ide-tape.c 		drive->dev_flags &= ~IDE_DFLAG_POST_RESET;
drive             605 drivers/ide/ide-tape.c 	if (!(drive->atapi_flags & IDE_AFLAG_IGNORE_DSC) &&
drive             615 drivers/ide/ide-tape.c 				idetape_media_access_finished(drive);
drive             618 drivers/ide/ide-tape.c 				return ide_do_reset(drive);
drive             624 drivers/ide/ide-tape.c 		ide_tape_stall_queue(drive);
drive             627 drivers/ide/ide-tape.c 		drive->atapi_flags &= ~IDE_AFLAG_IGNORE_DSC;
drive             648 drivers/ide/ide-tape.c 		idetape_media_access_finished(drive);
drive             655 drivers/ide/ide-tape.c 	ide_prep_sense(drive, rq);
drive             665 drivers/ide/ide-tape.c 	ide_map_sg(drive, &cmd);
drive             667 drivers/ide/ide-tape.c 	return ide_tape_issue_pc(drive, &cmd, pc);
drive             674 drivers/ide/ide-tape.c static void idetape_create_write_filemark_cmd(ide_drive_t *drive,
drive             683 drivers/ide/ide-tape.c static int idetape_wait_ready(ide_drive_t *drive, unsigned long timeout)
drive             685 drivers/ide/ide-tape.c 	idetape_tape_t *tape = drive->driver_data;
drive             690 drivers/ide/ide-tape.c 	set_bit(ilog2(IDE_AFLAG_MEDIUM_PRESENT), &drive->atapi_flags);
drive             693 drivers/ide/ide-tape.c 		if (ide_do_test_unit_ready(drive, disk) == 0)
drive             700 drivers/ide/ide-tape.c 			ide_do_start_stop(drive, disk, IDETAPE_LU_LOAD_MASK);
drive             711 drivers/ide/ide-tape.c static int idetape_flush_tape_buffers(ide_drive_t *drive)
drive             713 drivers/ide/ide-tape.c 	struct ide_tape_obj *tape = drive->driver_data;
drive             717 drivers/ide/ide-tape.c 	idetape_create_write_filemark_cmd(drive, &pc, 0);
drive             718 drivers/ide/ide-tape.c 	rc = ide_queue_pc_tail(drive, tape->disk, &pc, NULL, 0);
drive             721 drivers/ide/ide-tape.c 	idetape_wait_ready(drive, 60 * 5 * HZ);
drive             725 drivers/ide/ide-tape.c static int ide_tape_read_position(ide_drive_t *drive)
drive             727 drivers/ide/ide-tape.c 	idetape_tape_t *tape = drive->driver_data;
drive             738 drivers/ide/ide-tape.c 	if (ide_queue_pc_tail(drive, tape->disk, &pc, buf, pc.req_xfer))
drive             751 drivers/ide/ide-tape.c 				  &drive->atapi_flags);
drive             760 drivers/ide/ide-tape.c 				&drive->atapi_flags);
drive             767 drivers/ide/ide-tape.c static void idetape_create_locate_cmd(ide_drive_t *drive,
drive             779 drivers/ide/ide-tape.c static void __ide_tape_discard_merge_buffer(ide_drive_t *drive)
drive             781 drivers/ide/ide-tape.c 	idetape_tape_t *tape = drive->driver_data;
drive             786 drivers/ide/ide-tape.c 	clear_bit(ilog2(IDE_AFLAG_FILEMARK), &drive->atapi_flags);
drive             802 drivers/ide/ide-tape.c static int idetape_position_tape(ide_drive_t *drive, unsigned int block,
drive             805 drivers/ide/ide-tape.c 	idetape_tape_t *tape = drive->driver_data;
drive             811 drivers/ide/ide-tape.c 		__ide_tape_discard_merge_buffer(drive);
drive             812 drivers/ide/ide-tape.c 	idetape_wait_ready(drive, 60 * 5 * HZ);
drive             813 drivers/ide/ide-tape.c 	idetape_create_locate_cmd(drive, &pc, block, partition, skip);
drive             814 drivers/ide/ide-tape.c 	ret = ide_queue_pc_tail(drive, disk, &pc, NULL, 0);
drive             818 drivers/ide/ide-tape.c 	ret = ide_tape_read_position(drive);
drive             824 drivers/ide/ide-tape.c static void ide_tape_discard_merge_buffer(ide_drive_t *drive,
drive             827 drivers/ide/ide-tape.c 	idetape_tape_t *tape = drive->driver_data;
drive             830 drivers/ide/ide-tape.c 	__ide_tape_discard_merge_buffer(drive);
drive             832 drivers/ide/ide-tape.c 		position = ide_tape_read_position(drive);
drive             834 drivers/ide/ide-tape.c 		if (idetape_position_tape(drive, seek, 0, 0)) {
drive             846 drivers/ide/ide-tape.c static int idetape_queue_rw_tail(ide_drive_t *drive, int cmd, int size)
drive             848 drivers/ide/ide-tape.c 	idetape_tape_t *tape = drive->driver_data;
drive             857 drivers/ide/ide-tape.c 	rq = blk_get_request(drive->queue, REQ_OP_DRV_IN, 0);
drive             864 drivers/ide/ide-tape.c 		ret = blk_rq_map_kern(drive->queue, rq, tape->buf, size,
drive             870 drivers/ide/ide-tape.c 	blk_execute_rq(drive->queue, tape->disk, rq, 0);
drive             896 drivers/ide/ide-tape.c static void idetape_create_rewind_cmd(ide_drive_t *drive,
drive             921 drivers/ide/ide-tape.c static void ide_tape_flush_merge_buffer(ide_drive_t *drive)
drive             923 drivers/ide/ide-tape.c 	idetape_tape_t *tape = drive->driver_data;
drive             934 drivers/ide/ide-tape.c 		idetape_queue_rw_tail(drive, REQ_IDETAPE_WRITE, aligned);
drive             941 drivers/ide/ide-tape.c static int idetape_init_rw(ide_drive_t *drive, int dir)
drive             943 drivers/ide/ide-tape.c 	idetape_tape_t *tape = drive->driver_data;
drive             952 drivers/ide/ide-tape.c 		ide_tape_discard_merge_buffer(drive, 1);
drive             954 drivers/ide/ide-tape.c 		ide_tape_flush_merge_buffer(drive);
drive             955 drivers/ide/ide-tape.c 		idetape_flush_tape_buffers(drive);
drive             975 drivers/ide/ide-tape.c 	if (drive->dev_flags & IDE_DFLAG_DSC_OVERLAP) {
drive             979 drivers/ide/ide-tape.c 		rc = idetape_queue_rw_tail(drive, cmd, 0);
drive             991 drivers/ide/ide-tape.c static void idetape_pad_zeros(ide_drive_t *drive, int bcount)
drive             993 drivers/ide/ide-tape.c 	idetape_tape_t *tape = drive->driver_data;
drive            1000 drivers/ide/ide-tape.c 		idetape_queue_rw_tail(drive, REQ_IDETAPE_WRITE, count);
drive            1009 drivers/ide/ide-tape.c static int idetape_rewind_tape(ide_drive_t *drive)
drive            1011 drivers/ide/ide-tape.c 	struct ide_tape_obj *tape = drive->driver_data;
drive            1018 drivers/ide/ide-tape.c 	idetape_create_rewind_cmd(drive, &pc);
drive            1019 drivers/ide/ide-tape.c 	ret = ide_queue_pc_tail(drive, disk, &pc, NULL, 0);
drive            1023 drivers/ide/ide-tape.c 	ret = ide_tape_read_position(drive);
drive            1030 drivers/ide/ide-tape.c static int idetape_blkdev_ioctl(ide_drive_t *drive, unsigned int cmd,
drive            1033 drivers/ide/ide-tape.c 	idetape_tape_t *tape = drive->driver_data;
drive            1063 drivers/ide/ide-tape.c static int idetape_space_over_filemarks(ide_drive_t *drive, short mt_op,
drive            1066 drivers/ide/ide-tape.c 	idetape_tape_t *tape = drive->driver_data;
drive            1086 drivers/ide/ide-tape.c 				       &drive->atapi_flags))
drive            1088 drivers/ide/ide-tape.c 		ide_tape_discard_merge_buffer(drive, 0);
drive            1096 drivers/ide/ide-tape.c 		return ide_queue_pc_tail(drive, disk, &pc, NULL, 0);
drive            1101 drivers/ide/ide-tape.c 		retval = idetape_space_over_filemarks(drive, MTFSF,
drive            1106 drivers/ide/ide-tape.c 		return idetape_space_over_filemarks(drive, MTFSF, count);
drive            1133 drivers/ide/ide-tape.c 	ide_drive_t *drive = tape->drive;
drive            1141 drivers/ide/ide-tape.c 		if (test_bit(ilog2(IDE_AFLAG_DETECT_BS), &drive->atapi_flags))
drive            1147 drivers/ide/ide-tape.c 	rc = idetape_init_rw(drive, IDETAPE_DIR_READ);
drive            1158 drivers/ide/ide-tape.c 				     &drive->atapi_flags))
drive            1161 drivers/ide/ide-tape.c 			if (idetape_queue_rw_tail(drive, REQ_IDETAPE_READ,
drive            1176 drivers/ide/ide-tape.c 	if (!done && test_bit(ilog2(IDE_AFLAG_FILEMARK), &drive->atapi_flags)) {
drive            1177 drivers/ide/ide-tape.c 		idetape_space_over_filemarks(drive, MTFSF, 1);
drive            1188 drivers/ide/ide-tape.c 	ide_drive_t *drive = tape->drive;
drive            1200 drivers/ide/ide-tape.c 	rc = idetape_init_rw(drive, IDETAPE_DIR_WRITE);
drive            1209 drivers/ide/ide-tape.c 		    idetape_queue_rw_tail(drive, REQ_IDETAPE_WRITE,
drive            1227 drivers/ide/ide-tape.c static int idetape_write_filemark(ide_drive_t *drive)
drive            1229 drivers/ide/ide-tape.c 	struct ide_tape_obj *tape = drive->driver_data;
drive            1233 drivers/ide/ide-tape.c 	idetape_create_write_filemark_cmd(drive, &pc, 1);
drive            1234 drivers/ide/ide-tape.c 	if (ide_queue_pc_tail(drive, tape->disk, &pc, NULL, 0)) {
drive            1254 drivers/ide/ide-tape.c static int idetape_mtioctop(ide_drive_t *drive, short mt_op, int mt_count)
drive            1256 drivers/ide/ide-tape.c 	idetape_tape_t *tape = drive->driver_data;
drive            1271 drivers/ide/ide-tape.c 		return idetape_space_over_filemarks(drive, mt_op, mt_count);
drive            1280 drivers/ide/ide-tape.c 		ide_tape_discard_merge_buffer(drive, 1);
drive            1282 drivers/ide/ide-tape.c 			retval = idetape_write_filemark(drive);
drive            1288 drivers/ide/ide-tape.c 		ide_tape_discard_merge_buffer(drive, 0);
drive            1289 drivers/ide/ide-tape.c 		if (idetape_rewind_tape(drive))
drive            1293 drivers/ide/ide-tape.c 		ide_tape_discard_merge_buffer(drive, 0);
drive            1294 drivers/ide/ide-tape.c 		return ide_do_start_stop(drive, disk, IDETAPE_LU_LOAD_MASK);
drive            1302 drivers/ide/ide-tape.c 			if (!ide_set_media_lock(drive, disk, 0))
drive            1305 drivers/ide/ide-tape.c 		ide_tape_discard_merge_buffer(drive, 0);
drive            1306 drivers/ide/ide-tape.c 		retval = ide_do_start_stop(drive, disk, !IDETAPE_LU_LOAD_MASK);
drive            1309 drivers/ide/ide-tape.c 				  &drive->atapi_flags);
drive            1312 drivers/ide/ide-tape.c 		ide_tape_discard_merge_buffer(drive, 0);
drive            1313 drivers/ide/ide-tape.c 		return idetape_flush_tape_buffers(drive);
drive            1315 drivers/ide/ide-tape.c 		ide_tape_discard_merge_buffer(drive, 0);
drive            1316 drivers/ide/ide-tape.c 		return ide_do_start_stop(drive, disk,
drive            1320 drivers/ide/ide-tape.c 		return ide_queue_pc_tail(drive, disk, &pc, NULL, 0);
drive            1322 drivers/ide/ide-tape.c 		(void)idetape_rewind_tape(drive);
drive            1324 drivers/ide/ide-tape.c 		return ide_queue_pc_tail(drive, disk, &pc, NULL, 0);
drive            1332 drivers/ide/ide-tape.c 				  &drive->atapi_flags);
drive            1335 drivers/ide/ide-tape.c 				&drive->atapi_flags);
drive            1338 drivers/ide/ide-tape.c 		ide_tape_discard_merge_buffer(drive, 0);
drive            1339 drivers/ide/ide-tape.c 		return idetape_position_tape(drive,
drive            1342 drivers/ide/ide-tape.c 		ide_tape_discard_merge_buffer(drive, 0);
drive            1343 drivers/ide/ide-tape.c 		return idetape_position_tape(drive, 0, mt_count, 0);
drive            1347 drivers/ide/ide-tape.c 		retval = ide_set_media_lock(drive, disk, 1);
drive            1353 drivers/ide/ide-tape.c 		retval = ide_set_media_lock(drive, disk, 0);
drive            1374 drivers/ide/ide-tape.c 	ide_drive_t *drive = tape->drive;
drive            1384 drivers/ide/ide-tape.c 		ide_tape_flush_merge_buffer(drive);
drive            1385 drivers/ide/ide-tape.c 		idetape_flush_tape_buffers(drive);
drive            1390 drivers/ide/ide-tape.c 		position = ide_tape_read_position(drive);
drive            1398 drivers/ide/ide-tape.c 		return idetape_mtioctop(drive, mtop.mt_op, mtop.mt_count);
drive            1420 drivers/ide/ide-tape.c 			ide_tape_discard_merge_buffer(drive, 1);
drive            1421 drivers/ide/ide-tape.c 		return idetape_blkdev_ioctl(drive, cmd, arg);
drive            1439 drivers/ide/ide-tape.c static void ide_tape_get_bsize_from_bdesc(ide_drive_t *drive)
drive            1441 drivers/ide/ide-tape.c 	idetape_tape_t *tape = drive->driver_data;
drive            1446 drivers/ide/ide-tape.c 	if (ide_queue_pc_tail(drive, tape->disk, &pc, buf, pc.req_xfer)) {
drive            1467 drivers/ide/ide-tape.c 	ide_drive_t *drive;
drive            1482 drivers/ide/ide-tape.c 	drive = tape->drive;
drive            1495 drivers/ide/ide-tape.c 	if (test_and_set_bit(ilog2(IDE_AFLAG_BUSY), &drive->atapi_flags)) {
drive            1500 drivers/ide/ide-tape.c 	retval = idetape_wait_ready(drive, 60 * HZ);
drive            1502 drivers/ide/ide-tape.c 		clear_bit(ilog2(IDE_AFLAG_BUSY), &drive->atapi_flags);
drive            1507 drivers/ide/ide-tape.c 	ide_tape_read_position(drive);
drive            1508 drivers/ide/ide-tape.c 	if (!test_bit(ilog2(IDE_AFLAG_ADDRESS_VALID), &drive->atapi_flags))
drive            1509 drivers/ide/ide-tape.c 		(void)idetape_rewind_tape(drive);
drive            1512 drivers/ide/ide-tape.c 	ide_tape_get_bsize_from_bdesc(drive);
drive            1524 drivers/ide/ide-tape.c 			clear_bit(ilog2(IDE_AFLAG_BUSY), &drive->atapi_flags);
drive            1532 drivers/ide/ide-tape.c 		if (!ide_set_media_lock(drive, tape->disk, 1)) {
drive            1549 drivers/ide/ide-tape.c static void idetape_write_release(ide_drive_t *drive, unsigned int minor)
drive            1551 drivers/ide/ide-tape.c 	idetape_tape_t *tape = drive->driver_data;
drive            1553 drivers/ide/ide-tape.c 	ide_tape_flush_merge_buffer(drive);
drive            1556 drivers/ide/ide-tape.c 		idetape_pad_zeros(drive, tape->blk_size *
drive            1561 drivers/ide/ide-tape.c 	idetape_write_filemark(drive);
drive            1562 drivers/ide/ide-tape.c 	idetape_flush_tape_buffers(drive);
drive            1563 drivers/ide/ide-tape.c 	idetape_flush_tape_buffers(drive);
drive            1569 drivers/ide/ide-tape.c 	ide_drive_t *drive = tape->drive;
drive            1574 drivers/ide/ide-tape.c 	tape = drive->driver_data;
drive            1579 drivers/ide/ide-tape.c 		idetape_write_release(drive, minor);
drive            1582 drivers/ide/ide-tape.c 			ide_tape_discard_merge_buffer(drive, 1);
drive            1586 drivers/ide/ide-tape.c 				    &drive->atapi_flags))
drive            1587 drivers/ide/ide-tape.c 		(void) idetape_rewind_tape(drive);
drive            1591 drivers/ide/ide-tape.c 			if (!ide_set_media_lock(drive, tape->disk, 0))
drive            1595 drivers/ide/ide-tape.c 	clear_bit(ilog2(IDE_AFLAG_BUSY), &drive->atapi_flags);
drive            1603 drivers/ide/ide-tape.c static void idetape_get_inquiry_results(ide_drive_t *drive)
drive            1605 drivers/ide/ide-tape.c 	idetape_tape_t *tape = drive->driver_data;
drive            1611 drivers/ide/ide-tape.c 	if (ide_queue_pc_tail(drive, tape->disk, &pc, pc_buf, pc.req_xfer)) {
drive            1625 drivers/ide/ide-tape.c 			drive->name, tape->name, vendor_id, product_id, fw_rev);
drive            1632 drivers/ide/ide-tape.c static void idetape_get_mode_sense_results(ide_drive_t *drive)
drive            1634 drivers/ide/ide-tape.c 	idetape_tape_t *tape = drive->driver_data;
drive            1640 drivers/ide/ide-tape.c 	if (ide_queue_pc_tail(drive, tape->disk, &pc, buf, pc.req_xfer)) {
drive            1662 drivers/ide/ide-tape.c 				"(assuming 650KB/sec)\n", drive->name);
drive            1667 drivers/ide/ide-tape.c 				"(assuming 650KB/sec)\n", drive->name);
drive            1675 drivers/ide/ide-tape.c 		drive->dev_flags &= ~IDE_DFLAG_DOORLOCKING;
drive            1685 drivers/ide/ide-tape.c static int get_##name(ide_drive_t *drive) \
drive            1687 drivers/ide/ide-tape.c 	idetape_tape_t *tape = drive->driver_data; \
drive            1692 drivers/ide/ide-tape.c static int set_##name(ide_drive_t *drive, int arg) \
drive            1694 drivers/ide/ide-tape.c 	idetape_tape_t *tape = drive->driver_data; \
drive            1708 drivers/ide/ide-tape.c static int mulf_tdsc(ide_drive_t *drive)	{ return 1000; }
drive            1709 drivers/ide/ide-tape.c static int divf_tdsc(ide_drive_t *drive)	{ return   HZ; }
drive            1710 drivers/ide/ide-tape.c static int divf_buffer(ide_drive_t *drive)	{ return    2; }
drive            1711 drivers/ide/ide-tape.c static int divf_buffer_size(ide_drive_t *drive)	{ return 1024; }
drive            1745 drivers/ide/ide-tape.c static void idetape_setup(ide_drive_t *drive, idetape_tape_t *tape, int minor)
drive            1753 drivers/ide/ide-tape.c 	drive->pc_callback = ide_tape_callback;
drive            1755 drivers/ide/ide-tape.c 	drive->dev_flags |= IDE_DFLAG_DSC_OVERLAP;
drive            1757 drivers/ide/ide-tape.c 	if (drive->hwif->host_flags & IDE_HFLAG_NO_DSC) {
drive            1760 drivers/ide/ide-tape.c 		drive->dev_flags &= ~IDE_DFLAG_DSC_OVERLAP;
drive            1764 drivers/ide/ide-tape.c 	if (strstr((char *)&drive->id[ATA_ID_PROD], "Seagate STT3401"))
drive            1765 drivers/ide/ide-tape.c 		drive->dev_flags &= ~IDE_DFLAG_DSC_OVERLAP;
drive            1773 drivers/ide/ide-tape.c 	idetape_get_inquiry_results(drive);
drive            1774 drivers/ide/ide-tape.c 	idetape_get_mode_sense_results(drive);
drive            1775 drivers/ide/ide-tape.c 	ide_tape_get_bsize_from_bdesc(drive);
drive            1797 drivers/ide/ide-tape.c 		drive->name, tape->name, *(u16 *)&tape->caps[14],
drive            1801 drivers/ide/ide-tape.c 		(drive->dev_flags & IDE_DFLAG_USING_DMA) ? ", DMA" : "");
drive            1803 drivers/ide/ide-tape.c 	ide_proc_register_driver(drive, tape->driver);
drive            1806 drivers/ide/ide-tape.c static void ide_tape_remove(ide_drive_t *drive)
drive            1808 drivers/ide/ide-tape.c 	idetape_tape_t *tape = drive->driver_data;
drive            1810 drivers/ide/ide-tape.c 	ide_proc_unregister_driver(drive, tape->driver);
drive            1822 drivers/ide/ide-tape.c 	ide_drive_t *drive = tape->drive;
drive            1827 drivers/ide/ide-tape.c 	drive->dev_flags &= ~IDE_DFLAG_DSC_OVERLAP;
drive            1828 drivers/ide/ide-tape.c 	drive->driver_data = NULL;
drive            1841 drivers/ide/ide-tape.c 	ide_drive_t	*drive = (ide_drive_t *) m->private;
drive            1842 drivers/ide/ide-tape.c 	idetape_tape_t	*tape = drive->driver_data;
drive            1854 drivers/ide/ide-tape.c static ide_proc_entry_t *ide_tape_proc_entries(ide_drive_t *drive)
drive            1859 drivers/ide/ide-tape.c static const struct ide_proc_devset *ide_tape_proc_devsets(ide_drive_t *drive)
drive            1921 drivers/ide/ide-tape.c 	ide_drive_t *drive = tape->drive;
drive            1925 drivers/ide/ide-tape.c 	err = generic_ide_ioctl(drive, bdev, cmd, arg);
drive            1927 drivers/ide/ide-tape.c 		err = idetape_blkdev_ioctl(drive, cmd, arg);
drive            1940 drivers/ide/ide-tape.c static int ide_tape_probe(ide_drive_t *drive)
drive            1948 drivers/ide/ide-tape.c 	if (!strstr(DRV_NAME, drive->driver_req))
drive            1951 drivers/ide/ide-tape.c 	if (drive->media != ide_tape)
drive            1954 drivers/ide/ide-tape.c 	if ((drive->dev_flags & IDE_DFLAG_ID_READ) &&
drive            1955 drivers/ide/ide-tape.c 	    ide_check_atapi_device(drive, DRV_NAME) == 0) {
drive            1957 drivers/ide/ide-tape.c 				" the driver\n", drive->name);
drive            1963 drivers/ide/ide-tape.c 				drive->name);
drive            1971 drivers/ide/ide-tape.c 	ide_init_disk(g, drive);
drive            1973 drivers/ide/ide-tape.c 	tape->dev.parent = &drive->gendev;
drive            1975 drivers/ide/ide-tape.c 	dev_set_name(&tape->dev, "%s", dev_name(&drive->gendev));
drive            1980 drivers/ide/ide-tape.c 	tape->drive = drive;
drive            1986 drivers/ide/ide-tape.c 	drive->driver_data = tape;
drive            1994 drivers/ide/ide-tape.c 	idetape_setup(drive, tape, minor);
drive            1996 drivers/ide/ide-tape.c 	device_create(idetape_sysfs_class, &drive->gendev,
drive            1998 drivers/ide/ide-tape.c 	device_create(idetape_sysfs_class, &drive->gendev,
drive              29 drivers/ide/ide-taskfile.c void ide_tf_readback(ide_drive_t *drive, struct ide_cmd *cmd)
drive              31 drivers/ide/ide-taskfile.c 	ide_hwif_t *hwif = drive->hwif;
drive              37 drivers/ide/ide-taskfile.c 	tp_ops->tf_read(drive, &cmd->tf, cmd->valid.in.tf);
drive              42 drivers/ide/ide-taskfile.c 		tp_ops->tf_read(drive, &cmd->hob, cmd->valid.in.hob);
drive              59 drivers/ide/ide-taskfile.c int taskfile_lib_get_identify(ide_drive_t *drive, u8 *buf)
drive              65 drivers/ide/ide-taskfile.c 	if (drive->media == ide_disk)
drive              73 drivers/ide/ide-taskfile.c 	return ide_raw_taskfile(drive, &cmd, buf, 1);
drive              80 drivers/ide/ide-taskfile.c ide_startstop_t do_rw_taskfile(ide_drive_t *drive, struct ide_cmd *orig_cmd)
drive              82 drivers/ide/ide-taskfile.c 	ide_hwif_t *hwif = drive->hwif;
drive              91 drivers/ide/ide-taskfile.c 	    drive->mult_count == 0) {
drive              92 drivers/ide/ide-taskfile.c 		pr_err("%s: multimode not set!\n", drive->name);
drive             102 drivers/ide/ide-taskfile.c 		ide_tf_dump(drive->name, cmd);
drive             108 drivers/ide/ide-taskfile.c 			tp_ops->output_data(drive, cmd, data, 2);
drive             117 drivers/ide/ide-taskfile.c 			cmd->tf.device |= drive->select;
drive             120 drivers/ide/ide-taskfile.c 		tp_ops->tf_load(drive, &cmd->hob, cmd->valid.out.hob);
drive             121 drivers/ide/ide-taskfile.c 		tp_ops->tf_load(drive, &cmd->tf,  cmd->valid.out.tf);
drive             129 drivers/ide/ide-taskfile.c 			return pre_task_out_intr(drive, cmd);
drive             136 drivers/ide/ide-taskfile.c 		ide_execute_command(drive, cmd, handler, WAIT_WORSTCASE);
drive             139 drivers/ide/ide-taskfile.c 		if (ide_dma_prepare(drive, cmd))
drive             142 drivers/ide/ide-taskfile.c 		ide_execute_command(drive, cmd, ide_dma_intr, 2 * WAIT_CMD);
drive             143 drivers/ide/ide-taskfile.c 		dma_ops->dma_start(drive);
drive             151 drivers/ide/ide-taskfile.c static ide_startstop_t task_no_data_intr(ide_drive_t *drive)
drive             153 drivers/ide/ide-taskfile.c 	ide_hwif_t *hwif = drive->hwif;
drive             171 drivers/ide/ide-taskfile.c 			drive->mult_req = drive->mult_count = 0;
drive             172 drivers/ide/ide-taskfile.c 			drive->special_flags |= IDE_SFLAG_RECALIBRATE;
drive             173 drivers/ide/ide-taskfile.c 			(void)ide_dump_status(drive, __func__, stat);
drive             177 drivers/ide/ide-taskfile.c 				ide_set_handler(drive, &task_no_data_intr,
drive             182 drivers/ide/ide-taskfile.c 		return ide_error(drive, "task_no_data_intr", stat);
drive             186 drivers/ide/ide-taskfile.c 		drive->mult_count = drive->mult_req;
drive             193 drivers/ide/ide-taskfile.c 			ide_complete_pm_rq(drive, rq);
drive             195 drivers/ide/ide-taskfile.c 			ide_finish_cmd(drive, cmd, stat);
drive             201 drivers/ide/ide-taskfile.c static u8 wait_drive_not_busy(ide_drive_t *drive)
drive             203 drivers/ide/ide-taskfile.c 	ide_hwif_t *hwif = drive->hwif;
drive             221 drivers/ide/ide-taskfile.c 		pr_err("%s: drive still BUSY!\n", drive->name);
drive             226 drivers/ide/ide-taskfile.c void ide_pio_bytes(ide_drive_t *drive, struct ide_cmd *cmd,
drive             229 drivers/ide/ide-taskfile.c 	ide_hwif_t *hwif = drive->hwif;
drive             264 drivers/ide/ide-taskfile.c 			hwif->tp_ops->output_data(drive, cmd, buf, nr_bytes);
drive             266 drivers/ide/ide-taskfile.c 			hwif->tp_ops->input_data(drive, cmd, buf, nr_bytes);
drive             275 drivers/ide/ide-taskfile.c static void ide_pio_datablock(ide_drive_t *drive, struct ide_cmd *cmd,
drive             280 drivers/ide/ide-taskfile.c 	u8 saved_io_32bit = drive->io_32bit;
drive             286 drivers/ide/ide-taskfile.c 		drive->io_32bit = 0;
drive             291 drivers/ide/ide-taskfile.c 		nr_bytes = min_t(unsigned, cmd->nleft, drive->mult_count << 9);
drive             295 drivers/ide/ide-taskfile.c 	ide_pio_bytes(drive, cmd, write, nr_bytes);
drive             297 drivers/ide/ide-taskfile.c 	drive->io_32bit = saved_io_32bit;
drive             300 drivers/ide/ide-taskfile.c static void ide_error_cmd(ide_drive_t *drive, struct ide_cmd *cmd)
drive             308 drivers/ide/ide-taskfile.c 				nr_bytes -= drive->mult_count << 9;
drive             314 drivers/ide/ide-taskfile.c 			ide_complete_rq(drive, BLK_STS_OK, nr_bytes);
drive             318 drivers/ide/ide-taskfile.c void ide_finish_cmd(ide_drive_t *drive, struct ide_cmd *cmd, u8 stat)
drive             320 drivers/ide/ide-taskfile.c 	struct request *rq = drive->hwif->rq;
drive             321 drivers/ide/ide-taskfile.c 	u8 err = ide_read_error(drive), nsect = cmd->tf.nsect;
drive             324 drivers/ide/ide-taskfile.c 	ide_complete_cmd(drive, cmd, stat, err);
drive             328 drivers/ide/ide-taskfile.c 		ide_set_xfer_rate(drive, nsect);
drive             329 drivers/ide/ide-taskfile.c 		ide_driveid_update(drive);
drive             332 drivers/ide/ide-taskfile.c 	ide_complete_rq(drive, err ? BLK_STS_IOERR : BLK_STS_OK, blk_rq_bytes(rq));
drive             338 drivers/ide/ide-taskfile.c static ide_startstop_t task_pio_intr(ide_drive_t *drive)
drive             340 drivers/ide/ide-taskfile.c 	ide_hwif_t *hwif = drive->hwif;
drive             341 drivers/ide/ide-taskfile.c 	struct ide_cmd *cmd = &drive->hwif->cmd;
drive             360 drivers/ide/ide-taskfile.c 		if (!OK_STAT(stat, DRIVE_READY, drive->bad_wstat))
drive             372 drivers/ide/ide-taskfile.c 	ide_pio_datablock(drive, cmd, write);
drive             376 drivers/ide/ide-taskfile.c 		stat = wait_drive_not_busy(drive);
drive             384 drivers/ide/ide-taskfile.c 	ide_set_handler(drive, &task_pio_intr, WAIT_WORSTCASE);
drive             388 drivers/ide/ide-taskfile.c 		ide_finish_cmd(drive, cmd, stat);
drive             390 drivers/ide/ide-taskfile.c 		ide_complete_rq(drive, BLK_STS_OK, blk_rq_sectors(cmd->rq) << 9);
drive             393 drivers/ide/ide-taskfile.c 	ide_error_cmd(drive, cmd);
drive             394 drivers/ide/ide-taskfile.c 	return ide_error(drive, __func__, stat);
drive             397 drivers/ide/ide-taskfile.c static ide_startstop_t pre_task_out_intr(ide_drive_t *drive,
drive             402 drivers/ide/ide-taskfile.c 	if (ide_wait_stat(&startstop, drive, ATA_DRQ,
drive             403 drivers/ide/ide-taskfile.c 			  drive->bad_wstat, WAIT_DRQ)) {
drive             404 drivers/ide/ide-taskfile.c 		pr_err("%s: no DRQ after issuing %sWRITE%s\n", drive->name,
drive             406 drivers/ide/ide-taskfile.c 			(drive->dev_flags & IDE_DFLAG_LBA48) ? "_EXT" : "");
drive             410 drivers/ide/ide-taskfile.c 	if (!force_irqthreads && (drive->dev_flags & IDE_DFLAG_UNMASK) == 0)
drive             413 drivers/ide/ide-taskfile.c 	ide_set_handler(drive, &task_pio_intr, WAIT_WORSTCASE);
drive             415 drivers/ide/ide-taskfile.c 	ide_pio_datablock(drive, cmd, 1);
drive             420 drivers/ide/ide-taskfile.c int ide_raw_taskfile(ide_drive_t *drive, struct ide_cmd *cmd, u8 *buf,
drive             426 drivers/ide/ide-taskfile.c 	rq = blk_get_request(drive->queue,
drive             438 drivers/ide/ide-taskfile.c 		error = blk_rq_map_kern(drive->queue, rq, buf,
drive             447 drivers/ide/ide-taskfile.c 	blk_execute_rq(drive->queue, NULL, rq, 0);
drive             455 drivers/ide/ide-taskfile.c int ide_no_data_taskfile(ide_drive_t *drive, struct ide_cmd *cmd)
drive             459 drivers/ide/ide-taskfile.c 	return ide_raw_taskfile(drive, cmd, NULL, 0);
drive             464 drivers/ide/ide-taskfile.c int ide_taskfile_ioctl(ide_drive_t *drive, unsigned long arg)
drive             525 drivers/ide/ide-taskfile.c 	if (drive->dev_flags & IDE_DFLAG_LBA48) {
drive             575 drivers/ide/ide-taskfile.c 		if (!drive->mult_count) {
drive             578 drivers/ide/ide-taskfile.c 				drive->name, __func__);
drive             594 drivers/ide/ide-taskfile.c 		if (!drive->mult_count) {
drive             597 drivers/ide/ide-taskfile.c 				drive->name, __func__);
drive             626 drivers/ide/ide-taskfile.c 					drive->name);
drive             632 drivers/ide/ide-taskfile.c 	err = ide_raw_taskfile(drive, &cmd, data_buf, nsect);
drive             640 drivers/ide/ide-taskfile.c 		if (drive->dev_flags & IDE_DFLAG_LBA48)
drive              68 drivers/ide/ide-timings.c u16 ide_pio_cycle_time(ide_drive_t *drive, u8 pio)
drive              70 drivers/ide/ide-timings.c 	u16 *id = drive->id;
drive              75 drivers/ide/ide-timings.c 		if (ata_id_has_iordy(drive->id))
drive             131 drivers/ide/ide-timings.c int ide_timing_compute(ide_drive_t *drive, u8 speed,
drive             134 drivers/ide/ide-timings.c 	u16 *id = drive->id;
drive             179 drivers/ide/ide-timings.c 		ide_timing_compute(drive, drive->pio_mode, &p, T, UT);
drive              63 drivers/ide/ide-xfer-mode.c static u8 ide_get_best_pio_mode(ide_drive_t *drive, u8 mode_wanted, u8 max_mode)
drive              65 drivers/ide/ide-xfer-mode.c 	u16 *id = drive->id;
drive              71 drivers/ide/ide-xfer-mode.c 	if ((drive->hwif->host_flags & IDE_HFLAG_PIO_NO_BLACKLIST) == 0)
drive              75 drivers/ide/ide-xfer-mode.c 		printk(KERN_INFO "%s: is on PIO blacklist\n", drive->name);
drive             102 drivers/ide/ide-xfer-mode.c 					 drive->name);
drive             111 drivers/ide/ide-xfer-mode.c int ide_pio_need_iordy(ide_drive_t *drive, const u8 pio)
drive             117 drivers/ide/ide-xfer-mode.c 	if (pio == 0 && (drive->hwif->port_flags & IDE_PFLAG_PROBING))
drive             119 drivers/ide/ide-xfer-mode.c 	return ata_id_pio_need_iordy(drive->id, pio);
drive             123 drivers/ide/ide-xfer-mode.c int ide_set_pio_mode(ide_drive_t *drive, const u8 mode)
drive             125 drivers/ide/ide-xfer-mode.c 	ide_hwif_t *hwif = drive->hwif;
drive             139 drivers/ide/ide-xfer-mode.c 		drive->pio_mode = mode;
drive             140 drivers/ide/ide-xfer-mode.c 		port_ops->set_pio_mode(hwif, drive);
drive             145 drivers/ide/ide-xfer-mode.c 		if (ide_config_drive_speed(drive, mode))
drive             147 drivers/ide/ide-xfer-mode.c 		drive->pio_mode = mode;
drive             148 drivers/ide/ide-xfer-mode.c 		port_ops->set_pio_mode(hwif, drive);
drive             151 drivers/ide/ide-xfer-mode.c 		drive->pio_mode = mode;
drive             152 drivers/ide/ide-xfer-mode.c 		port_ops->set_pio_mode(hwif, drive);
drive             153 drivers/ide/ide-xfer-mode.c 		return ide_config_drive_speed(drive, mode);
drive             157 drivers/ide/ide-xfer-mode.c int ide_set_dma_mode(ide_drive_t *drive, const u8 mode)
drive             159 drivers/ide/ide-xfer-mode.c 	ide_hwif_t *hwif = drive->hwif;
drive             169 drivers/ide/ide-xfer-mode.c 		if (ide_config_drive_speed(drive, mode))
drive             171 drivers/ide/ide-xfer-mode.c 		drive->dma_mode = mode;
drive             172 drivers/ide/ide-xfer-mode.c 		port_ops->set_dma_mode(hwif, drive);
drive             175 drivers/ide/ide-xfer-mode.c 		drive->dma_mode = mode;
drive             176 drivers/ide/ide-xfer-mode.c 		port_ops->set_dma_mode(hwif, drive);
drive             177 drivers/ide/ide-xfer-mode.c 		return ide_config_drive_speed(drive, mode);
drive             183 drivers/ide/ide-xfer-mode.c void ide_set_pio(ide_drive_t *drive, u8 req_pio)
drive             185 drivers/ide/ide-xfer-mode.c 	ide_hwif_t *hwif = drive->hwif;
drive             197 drivers/ide/ide-xfer-mode.c 	pio = ide_get_best_pio_mode(drive, req_pio, host_pio);
drive             205 drivers/ide/ide-xfer-mode.c 			  drive->name, host_pio, req_pio,
drive             208 drivers/ide/ide-xfer-mode.c 	(void)ide_set_pio_mode(drive, XFER_PIO_0 + pio);
drive             223 drivers/ide/ide-xfer-mode.c static u8 ide_rate_filter(ide_drive_t *drive, u8 speed)
drive             225 drivers/ide/ide-xfer-mode.c 	ide_hwif_t *hwif = drive->hwif;
drive             226 drivers/ide/ide-xfer-mode.c 	u8 mode = ide_find_dma_mode(drive, speed);
drive             250 drivers/ide/ide-xfer-mode.c int ide_set_xfer_rate(ide_drive_t *drive, u8 rate)
drive             252 drivers/ide/ide-xfer-mode.c 	ide_hwif_t *hwif = drive->hwif;
drive             259 drivers/ide/ide-xfer-mode.c 	rate = ide_rate_filter(drive, rate);
drive             264 drivers/ide/ide-xfer-mode.c 		return ide_set_pio_mode(drive, rate);
drive             266 drivers/ide/ide-xfer-mode.c 	return ide_set_dma_mode(drive, rate);
drive              72 drivers/ide/ide.c int ide_device_get(ide_drive_t *drive)
drive              77 drivers/ide/ide.c 	if (!get_device(&drive->gendev))
drive              80 drivers/ide/ide.c 	host_dev = drive->hwif->host->dev[0];
drive              84 drivers/ide/ide.c 		put_device(&drive->gendev);
drive              99 drivers/ide/ide.c void ide_device_put(ide_drive_t *drive)
drive             102 drivers/ide/ide.c 	struct device *host_dev = drive->hwif->host->dev[0];
drive             107 drivers/ide/ide.c 	put_device(&drive->gendev);
drive             118 drivers/ide/ide.c 	ide_drive_t *drive = to_ide_device(dev);
drive             120 drivers/ide/ide.c 	add_uevent_var(env, "MEDIA=%s", ide_media_string(drive));
drive             121 drivers/ide/ide.c 	add_uevent_var(env, "DRIVENAME=%s", drive->name);
drive             122 drivers/ide/ide.c 	add_uevent_var(env, "MODALIAS=ide:m-%s", ide_media_string(drive));
drive             128 drivers/ide/ide.c 	ide_drive_t *drive = to_ide_device(dev);
drive             131 drivers/ide/ide.c 	return drv->probe ? drv->probe(drive) : -ENODEV;
drive             136 drivers/ide/ide.c 	ide_drive_t *drive = to_ide_device(dev);
drive             140 drivers/ide/ide.c 		drv->remove(drive);
drive             147 drivers/ide/ide.c 	ide_drive_t *drive = to_ide_device(dev);
drive             151 drivers/ide/ide.c 		drv->shutdown(drive);
drive             281 drivers/ide/ide.c static void ide_dev_apply_params(ide_drive_t *drive, u8 unit)
drive             283 drivers/ide/ide.c 	int i = drive->hwif->index * MAX_DRIVES + unit;
drive             286 drivers/ide/ide.c 		printk(KERN_INFO "ide: disallowing DMA for %s\n", drive->name);
drive             287 drivers/ide/ide.c 		drive->dev_flags |= IDE_DFLAG_NODMA;
drive             291 drivers/ide/ide.c 				 drive->name);
drive             292 drivers/ide/ide.c 		drive->dev_flags |= IDE_DFLAG_NOFLUSH;
drive             296 drivers/ide/ide.c 				 drive->name);
drive             297 drivers/ide/ide.c 		drive->dev_flags |= IDE_DFLAG_NOHPA;
drive             300 drivers/ide/ide.c 		printk(KERN_INFO "ide: skipping probe for %s\n", drive->name);
drive             301 drivers/ide/ide.c 		drive->dev_flags |= IDE_DFLAG_NOPROBE;
drive             305 drivers/ide/ide.c 				 drive->name);
drive             306 drivers/ide/ide.c 		drive->bad_wstat = BAD_R_STAT;
drive             309 drivers/ide/ide.c 		printk(KERN_INFO "ide: forcing %s as a CD-ROM\n", drive->name);
drive             310 drivers/ide/ide.c 		drive->dev_flags |= IDE_DFLAG_PRESENT;
drive             311 drivers/ide/ide.c 		drive->media = ide_cdrom;
drive             313 drivers/ide/ide.c 		drive->ready_stat = 0;
drive             316 drivers/ide/ide.c 		drive->cyl  = drive->bios_cyl  = ide_disks_chs[i].cyl;
drive             317 drivers/ide/ide.c 		drive->head = drive->bios_head = ide_disks_chs[i].head;
drive             318 drivers/ide/ide.c 		drive->sect = drive->bios_sect = ide_disks_chs[i].sect;
drive             321 drivers/ide/ide.c 				 drive->name,
drive             322 drivers/ide/ide.c 				 drive->cyl, drive->head, drive->sect);
drive             324 drivers/ide/ide.c 		drive->dev_flags |= IDE_DFLAG_FORCED_GEOM | IDE_DFLAG_PRESENT;
drive             325 drivers/ide/ide.c 		drive->media = ide_disk;
drive             326 drivers/ide/ide.c 		drive->ready_stat = ATA_DRDY;
drive             357 drivers/ide/ide.c 	ide_drive_t *drive;
drive             366 drivers/ide/ide.c 	ide_port_for_each_dev(i, drive, hwif)
drive             367 drivers/ide/ide.c 		ide_dev_apply_params(drive, i);
drive              40 drivers/ide/it8172.c static void it8172_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive              45 drivers/ide/it8172.c 	const u8 pio = drive->pio_mode - XFER_PIO_0;
drive              65 drivers/ide/it8172.c 	drive_enables &= drive->dn ? 0xc006 : 0xc060;
drive              66 drivers/ide/it8172.c 	if (drive->media == ide_disk)
drive              68 drivers/ide/it8172.c 		drive_enables |= 0x0004 << (drive->dn * 4);
drive              69 drivers/ide/it8172.c 	if (ide_pio_need_iordy(drive, pio))
drive              71 drivers/ide/it8172.c 		drive_enables |= 0x0002 << (drive->dn * 4);
drive              73 drivers/ide/it8172.c 	drive_timing &= drive->dn ? 0x00003f00 : 0x000fc000;
drive              74 drivers/ide/it8172.c 	drive_timing |= timings[pio] << (drive->dn * 6 + 8);
drive              80 drivers/ide/it8172.c static void it8172_set_dma_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive              83 drivers/ide/it8172.c 	int a_speed		= 3 << (drive->dn * 4);
drive              84 drivers/ide/it8172.c 	int u_flag		= 1 << drive->dn;
drive              87 drivers/ide/it8172.c 	const u8 speed		= drive->dma_mode;
drive              94 drivers/ide/it8172.c 		u_speed = udma << (drive->dn * 4);
drive             105 drivers/ide/it8172.c 		drive->pio_mode =
drive             108 drivers/ide/it8172.c 		it8172_set_pio_mode(hwif, drive);
drive              27 drivers/ide/it8213.c static void it8213_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive              30 drivers/ide/it8213.c 	int is_slave		= drive->dn & 1;
drive              38 drivers/ide/it8213.c 	const u8 pio = drive->pio_mode - XFER_PIO_0;
drive              52 drivers/ide/it8213.c 	if (drive->media != ide_disk)
drive              54 drivers/ide/it8213.c 	if (ide_pio_need_iordy(drive, pio))
drive              84 drivers/ide/it8213.c static void it8213_set_dma_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive              88 drivers/ide/it8213.c 	int a_speed		= 3 << (drive->dn * 4);
drive              89 drivers/ide/it8213.c 	int u_flag		= 1 << drive->dn;
drive              90 drivers/ide/it8213.c 	int v_flag		= 0x01 << drive->dn;
drive              91 drivers/ide/it8213.c 	int w_flag		= 0x10 << drive->dn;
drive              95 drivers/ide/it8213.c 	const u8 speed		= drive->dma_mode;
drive             106 drivers/ide/it8213.c 		u_speed = min_t(u8, 2 - (udma & 1), udma) << (drive->dn * 4);
drive             135 drivers/ide/it8213.c 			drive->pio_mode =
drive             138 drivers/ide/it8213.c 			drive->pio_mode = XFER_PIO_2; /* for SWDMA2 */
drive             140 drivers/ide/it8213.c 		it8213_set_pio_mode(hwif, drive);
drive             112 drivers/ide/it821x.c static void it821x_program(ide_drive_t *drive, u16 timing)
drive             114 drivers/ide/it821x.c 	ide_hwif_t *hwif = drive->hwif;
drive             138 drivers/ide/it821x.c static void it821x_program_udma(ide_drive_t *drive, u16 timing)
drive             140 drivers/ide/it821x.c 	ide_hwif_t *hwif = drive->hwif;
drive             144 drivers/ide/it821x.c 	u8 unit = drive->dn & 1, conf;
drive             168 drivers/ide/it821x.c static void it821x_clock_strategy(ide_drive_t *drive)
drive             170 drivers/ide/it821x.c 	ide_hwif_t *hwif = drive->hwif;
drive             173 drivers/ide/it821x.c 	ide_drive_t *pair = ide_get_pair_dev(drive);
drive             175 drivers/ide/it821x.c 	u8 unit = drive->dn & 1, v;
drive             225 drivers/ide/it821x.c 		it821x_program_udma(drive, itdev->udma[unit]);
drive             226 drivers/ide/it821x.c 		it821x_program(drive, itdev->pio[unit]);
drive             239 drivers/ide/it821x.c static void it821x_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive             242 drivers/ide/it821x.c 	ide_drive_t *pair = ide_get_pair_dev(drive);
drive             243 drivers/ide/it821x.c 	const u8 pio = drive->pio_mode - XFER_PIO_0;
drive             244 drivers/ide/it821x.c 	u8 unit = drive->dn & 1, set_pio = pio;
drive             266 drivers/ide/it821x.c 	it821x_clock_strategy(drive);
drive             267 drivers/ide/it821x.c 	it821x_program(drive, itdev->pio[unit]);
drive             281 drivers/ide/it821x.c static void it821x_tune_mwdma(ide_drive_t *drive, u8 mode_wanted)
drive             283 drivers/ide/it821x.c 	ide_hwif_t *hwif = drive->hwif;
drive             286 drivers/ide/it821x.c 	u8 unit = drive->dn & 1, channel = hwif->channel, conf;
drive             304 drivers/ide/it821x.c 	it821x_clock_strategy(drive);
drive             318 drivers/ide/it821x.c static void it821x_tune_udma(ide_drive_t *drive, u8 mode_wanted)
drive             320 drivers/ide/it821x.c 	ide_hwif_t *hwif = drive->hwif;
drive             323 drivers/ide/it821x.c 	u8 unit = drive->dn & 1, channel = hwif->channel, conf;
drive             343 drivers/ide/it821x.c 	it821x_clock_strategy(drive);
drive             344 drivers/ide/it821x.c 	it821x_program_udma(drive, itdev->udma[unit]);
drive             361 drivers/ide/it821x.c static void it821x_dma_start(ide_drive_t *drive)
drive             363 drivers/ide/it821x.c 	ide_hwif_t *hwif = drive->hwif;
drive             365 drivers/ide/it821x.c 	u8 unit = drive->dn & 1;
drive             368 drivers/ide/it821x.c 		it821x_program(drive, itdev->mwdma[unit]);
drive             370 drivers/ide/it821x.c 		it821x_program_udma(drive, itdev->udma[unit]);
drive             371 drivers/ide/it821x.c 	ide_dma_start(drive);
drive             383 drivers/ide/it821x.c static int it821x_dma_end(ide_drive_t *drive)
drive             385 drivers/ide/it821x.c 	ide_hwif_t *hwif = drive->hwif;
drive             387 drivers/ide/it821x.c 	int ret = ide_dma_end(drive);
drive             388 drivers/ide/it821x.c 	u8 unit = drive->dn & 1;
drive             391 drivers/ide/it821x.c 		it821x_program(drive, itdev->pio[unit]);
drive             403 drivers/ide/it821x.c static void it821x_set_dma_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive             405 drivers/ide/it821x.c 	const u8 speed = drive->dma_mode;
drive             413 drivers/ide/it821x.c 		it821x_tune_udma(drive, speed - XFER_UDMA_0);
drive             415 drivers/ide/it821x.c 		it821x_tune_mwdma(drive, speed - XFER_MW_DMA_0);
drive             442 drivers/ide/it821x.c static void it821x_quirkproc(ide_drive_t *drive)
drive             444 drivers/ide/it821x.c 	struct it821x_dev *itdev = ide_get_hwifdata(drive->hwif);
drive             445 drivers/ide/it821x.c 	u16 *id = drive->id;
drive             454 drivers/ide/it821x.c 		drive->dev_flags |= IDE_DFLAG_UNMASK;
drive             474 drivers/ide/it821x.c 				drive->name, id[147] ? "Bootable " : "",
drive             495 drivers/ide/it821x.c 				drive->name);
drive             505 drivers/ide/it821x.c 			drive->current_speed = XFER_MW_DMA_0;
drive              83 drivers/ide/jmicron.c static void jmicron_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive              95 drivers/ide/jmicron.c static void jmicron_set_dma_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive              64 drivers/ide/macide.c static void macide_clear_irq(ide_drive_t *drive)
drive              65 drivers/ide/ns87415.c static void superio_tf_read(ide_drive_t *drive, struct ide_taskfile *tf,
drive              68 drivers/ide/ns87415.c 	struct ide_io_ports *io_ports = &drive->hwif->io_ports;
drive              84 drivers/ide/ns87415.c static void ns87415_dev_select(ide_drive_t *drive);
drive             123 drivers/ide/ns87415.c static void ns87415_prepare_drive (ide_drive_t *drive, unsigned int use_dma)
drive             125 drivers/ide/ns87415.c 	ide_hwif_t *hwif = drive->hwif;
drive             136 drivers/ide/ns87415.c 	if (drive->dev_flags & IDE_DFLAG_PRESENT)
drive             142 drivers/ide/ns87415.c 	bit   = 1 << (20 + (drive->dn & 1) + (hwif->channel << 1));
drive             143 drivers/ide/ns87415.c 	other = 1 << (20 + (1 - (drive->dn & 1)) + (hwif->channel << 1));
drive             171 drivers/ide/ns87415.c static void ns87415_dev_select(ide_drive_t *drive)
drive             173 drivers/ide/ns87415.c 	ns87415_prepare_drive(drive,
drive             174 drivers/ide/ns87415.c 			      !!(drive->dev_flags & IDE_DFLAG_USING_DMA));
drive             176 drivers/ide/ns87415.c 	outb(drive->select | ATA_DEVICE_OBS, drive->hwif->io_ports.device_addr);
drive             179 drivers/ide/ns87415.c static void ns87415_dma_start(ide_drive_t *drive)
drive             181 drivers/ide/ns87415.c 	ns87415_prepare_drive(drive, 1);
drive             182 drivers/ide/ns87415.c 	ide_dma_start(drive);
drive             185 drivers/ide/ns87415.c static int ns87415_dma_end(ide_drive_t *drive)
drive             187 drivers/ide/ns87415.c 	ide_hwif_t *hwif = drive->hwif;
drive             199 drivers/ide/ns87415.c 	ns87415_prepare_drive(drive, 0);
drive              66 drivers/ide/opti621.c static void opti621_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive              68 drivers/ide/opti621.c 	ide_drive_t *pair = ide_get_pair_dev(drive);
drive              70 drivers/ide/opti621.c 	unsigned long mode = drive->pio_mode, pair_mode;
drive              84 drivers/ide/opti621.c 	ide_set_drivedata(drive, (void *)mode);
drive             114 drivers/ide/opti621.c 	write_reg(drive->dn & 1, MISC_REG);
drive             178 drivers/ide/palm_bk3710.c static void palm_bk3710_set_dma_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive             180 drivers/ide/palm_bk3710.c 	int is_slave = drive->dn & 1;
drive             182 drivers/ide/palm_bk3710.c 	const u8 xferspeed = drive->dma_mode;
drive             189 drivers/ide/palm_bk3710.c 				       drive->id[ATA_ID_EIDE_DMA_MIN],
drive             194 drivers/ide/palm_bk3710.c static void palm_bk3710_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive             197 drivers/ide/palm_bk3710.c 	int is_slave = drive->dn & 1;
drive             200 drivers/ide/palm_bk3710.c 	const u8 pio = drive->pio_mode - XFER_PIO_0;
drive             205 drivers/ide/palm_bk3710.c 	cycle_time = ide_pio_cycle_time(drive, pio);
drive             206 drivers/ide/palm_bk3710.c 	mate = ide_get_pair_dev(drive);
drive             128 drivers/ide/pdc202xx_new.c static void pdcnew_set_dma_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive             131 drivers/ide/pdc202xx_new.c 	u8 adj			= (drive->dn & 1) ? 0x08 : 0x00;
drive             132 drivers/ide/pdc202xx_new.c 	const u8 speed		= drive->dma_mode;
drive             166 drivers/ide/pdc202xx_new.c static void pdcnew_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive             169 drivers/ide/pdc202xx_new.c 	u8 adj = (drive->dn & 1) ? 0x08 : 0x00;
drive             170 drivers/ide/pdc202xx_new.c 	const u8 pio = drive->pio_mode - XFER_PIO_0;
drive             187 drivers/ide/pdc202xx_new.c static void pdcnew_reset(ide_drive_t *drive)
drive             193 drivers/ide/pdc202xx_new.c 		drive->hwif->channel ? "Secondary" : "Primary");
drive              25 drivers/ide/pdc202xx_old.c static void pdc202xx_set_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive              28 drivers/ide/pdc202xx_old.c 	u8 drive_pci		= 0x60 + (drive->dn << 2);
drive              29 drivers/ide/pdc202xx_old.c 	const u8 speed		= drive->dma_mode;
drive              62 drivers/ide/pdc202xx_old.c 		if (ide_pio_need_iordy(drive, speed - XFER_PIO_0))
drive              64 drivers/ide/pdc202xx_old.c 		if (drive->media == ide_disk)
drive              80 drivers/ide/pdc202xx_old.c static void pdc202xx_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive              82 drivers/ide/pdc202xx_old.c 	drive->dma_mode = drive->pio_mode;
drive              83 drivers/ide/pdc202xx_old.c 	pdc202xx_set_mode(hwif, drive);
drive             147 drivers/ide/pdc202xx_old.c static void pdc202xx_dma_start(ide_drive_t *drive)
drive             149 drivers/ide/pdc202xx_old.c 	if (drive->current_speed > XFER_UDMA_2)
drive             150 drivers/ide/pdc202xx_old.c 		pdc_old_enable_66MHz_clock(drive->hwif);
drive             151 drivers/ide/pdc202xx_old.c 	if (drive->media != ide_disk || (drive->dev_flags & IDE_DFLAG_LBA48)) {
drive             152 drivers/ide/pdc202xx_old.c 		ide_hwif_t *hwif	= drive->hwif;
drive             166 drivers/ide/pdc202xx_old.c 	ide_dma_start(drive);
drive             169 drivers/ide/pdc202xx_old.c static int pdc202xx_dma_end(ide_drive_t *drive)
drive             171 drivers/ide/pdc202xx_old.c 	if (drive->media != ide_disk || (drive->dev_flags & IDE_DFLAG_LBA48)) {
drive             172 drivers/ide/pdc202xx_old.c 		ide_hwif_t *hwif	= drive->hwif;
drive             181 drivers/ide/pdc202xx_old.c 	if (drive->current_speed > XFER_UDMA_2)
drive             182 drivers/ide/pdc202xx_old.c 		pdc_old_disable_66MHz_clock(drive->hwif);
drive             183 drivers/ide/pdc202xx_old.c 	return ide_dma_end(drive);
drive              68 drivers/ide/piix.c static void piix_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive              71 drivers/ide/piix.c 	int is_slave		= drive->dn & 1;
drive              79 drivers/ide/piix.c 	const u8 pio = drive->pio_mode - XFER_PIO_0;
drive              99 drivers/ide/piix.c 	if (drive->media == ide_disk)
drive             101 drivers/ide/piix.c 	if (ide_pio_need_iordy(drive, pio))
drive             137 drivers/ide/piix.c static void piix_set_dma_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive             141 drivers/ide/piix.c 	int a_speed		= 3 << (drive->dn * 4);
drive             142 drivers/ide/piix.c 	int u_flag		= 1 << drive->dn;
drive             143 drivers/ide/piix.c 	int v_flag		= 0x01 << drive->dn;
drive             144 drivers/ide/piix.c 	int w_flag		= 0x10 << drive->dn;
drive             149 drivers/ide/piix.c 	const u8 speed		= drive->dma_mode;
drive             161 drivers/ide/piix.c 		u_speed = min_t(u8, 2 - (udma & 1), udma) << (drive->dn * 4);
drive             190 drivers/ide/piix.c 			drive->pio_mode =
drive             193 drivers/ide/piix.c 			drive->pio_mode = XFER_PIO_2; /* for SWDMA2 */
drive             195 drivers/ide/piix.c 		piix_set_pio_mode(hwif, drive);
drive             225 drivers/ide/piix.c static void ich_clear_irq(ide_drive_t *drive)
drive             227 drivers/ide/piix.c 	ide_hwif_t *hwif = drive->hwif;
drive             235 drivers/ide/piix.c 	if (drive->waiting_for_dma || hwif->dma_base == 0)
drive             403 drivers/ide/pmac.c 	((void __iomem *)((drive)->hwif->io_ports.data_addr + (x)))
drive             410 drivers/ide/pmac.c static void pmac_ide_apply_timings(ide_drive_t *drive)
drive             412 drivers/ide/pmac.c 	ide_hwif_t *hwif = drive->hwif;
drive             415 drivers/ide/pmac.c 	if (drive->dn & 1)
drive             427 drivers/ide/pmac.c static void pmac_ide_kauai_apply_timings(ide_drive_t *drive)
drive             429 drivers/ide/pmac.c 	ide_hwif_t *hwif = drive->hwif;
drive             432 drivers/ide/pmac.c 	if (drive->dn & 1) {
drive             446 drivers/ide/pmac.c pmac_ide_do_update_timings(ide_drive_t *drive)
drive             448 drivers/ide/pmac.c 	ide_hwif_t *hwif = drive->hwif;
drive             454 drivers/ide/pmac.c 		pmac_ide_kauai_apply_timings(drive);
drive             456 drivers/ide/pmac.c 		pmac_ide_apply_timings(drive);
drive             459 drivers/ide/pmac.c static void pmac_dev_select(ide_drive_t *drive)
drive             461 drivers/ide/pmac.c 	pmac_ide_apply_timings(drive);
drive             463 drivers/ide/pmac.c 	writeb(drive->select | ATA_DEVICE_OBS,
drive             464 drivers/ide/pmac.c 	       (void __iomem *)drive->hwif->io_ports.device_addr);
drive             467 drivers/ide/pmac.c static void pmac_kauai_dev_select(ide_drive_t *drive)
drive             469 drivers/ide/pmac.c 	pmac_ide_kauai_apply_timings(drive);
drive             471 drivers/ide/pmac.c 	writeb(drive->select | ATA_DEVICE_OBS,
drive             472 drivers/ide/pmac.c 	       (void __iomem *)drive->hwif->io_ports.device_addr);
drive             492 drivers/ide/pmac.c static void pmac_ide_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive             495 drivers/ide/pmac.c 	const u8 pio = drive->pio_mode - XFER_PIO_0;
drive             503 drivers/ide/pmac.c 	timings = &pmif->timings[drive->dn & 1];
drive             506 drivers/ide/pmac.c 	cycle_time = ide_pio_cycle_time(drive, pio);
drive             564 drivers/ide/pmac.c 		drive->name, pio,  *timings);
drive             568 drivers/ide/pmac.c 	pmac_ide_do_update_timings(drive);
drive             639 drivers/ide/pmac.c set_timings_mdma(ide_drive_t *drive, int intf_type, u32 *timings, u32 *timings2,
drive             642 drivers/ide/pmac.c 	u16 *id = drive->id;
drive             695 drivers/ide/pmac.c 			drive->name, cycleTime, accessTime, recTime);
drive             769 drivers/ide/pmac.c 		drive->name, speed & 0xf,  *timings);
drive             773 drivers/ide/pmac.c static void pmac_ide_set_dma_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive             778 drivers/ide/pmac.c 	u8 unit = drive->dn & 1;
drive             779 drivers/ide/pmac.c 	const u8 speed = drive->dma_mode;
drive             799 drivers/ide/pmac.c 		set_timings_mdma(drive, pmif->kind, &tl[0], &tl[1], speed);
drive             808 drivers/ide/pmac.c 	pmac_ide_do_update_timings(drive);	
drive             941 drivers/ide/pmac.c static void pmac_ide_init_dev(ide_drive_t *drive)
drive             943 drivers/ide/pmac.c 	ide_hwif_t *hwif = drive->hwif;
drive             948 drivers/ide/pmac.c 			drive->dev_flags &= ~IDE_DFLAG_NOPROBE;
drive             951 drivers/ide/pmac.c 		drive->dev_flags |= IDE_DFLAG_NOPROBE;
drive            1453 drivers/ide/pmac.c static int pmac_ide_build_dmatable(ide_drive_t *drive, struct ide_cmd *cmd)
drive            1455 drivers/ide/pmac.c 	ide_hwif_t *hwif = drive->hwif;
drive            1483 drivers/ide/pmac.c 				       "switching to PIO on Ohare chipset\n", drive->name);
drive            1493 drivers/ide/pmac.c 				       drive->name);
drive            1521 drivers/ide/pmac.c 	printk(KERN_DEBUG "%s: empty DMA table?\n", drive->name);
drive            1530 drivers/ide/pmac.c static int pmac_ide_dma_setup(ide_drive_t *drive, struct ide_cmd *cmd)
drive            1532 drivers/ide/pmac.c 	ide_hwif_t *hwif = drive->hwif;
drive            1534 drivers/ide/pmac.c 	u8 unit = drive->dn & 1, ata4 = (pmif->kind == controller_kl_ata4);
drive            1537 drivers/ide/pmac.c 	if (pmac_ide_build_dmatable(drive, cmd) == 0)
drive            1555 drivers/ide/pmac.c pmac_ide_dma_start(ide_drive_t *drive)
drive            1557 drivers/ide/pmac.c 	ide_hwif_t *hwif = drive->hwif;
drive            1572 drivers/ide/pmac.c pmac_ide_dma_end (ide_drive_t *drive)
drive            1574 drivers/ide/pmac.c 	ide_hwif_t *hwif = drive->hwif;
drive            1596 drivers/ide/pmac.c pmac_ide_dma_test_irq (ide_drive_t *drive)
drive            1598 drivers/ide/pmac.c 	ide_hwif_t *hwif = drive->hwif;
drive            1645 drivers/ide/pmac.c static void pmac_ide_dma_host_set(ide_drive_t *drive, int on)
drive            1650 drivers/ide/pmac.c pmac_ide_dma_lost_irq (ide_drive_t *drive)
drive            1652 drivers/ide/pmac.c 	ide_hwif_t *hwif = drive->hwif;
drive              73 drivers/ide/q40ide.c static void q40ide_input_data(ide_drive_t *drive, struct ide_cmd *cmd,
drive              76 drivers/ide/q40ide.c 	unsigned long data_addr = drive->hwif->io_ports.data_addr;
drive              78 drivers/ide/q40ide.c 	if (drive->media == ide_disk && cmd && (cmd->tf_flags & IDE_TFLAG_FS)) {
drive              86 drivers/ide/q40ide.c static void q40ide_output_data(ide_drive_t *drive, struct ide_cmd *cmd,
drive              89 drivers/ide/q40ide.c 	unsigned long data_addr = drive->hwif->io_ports.data_addr;
drive              91 drivers/ide/q40ide.c 	if (drive->media == ide_disk && cmd && (cmd->tf_flags & IDE_TFLAG_FS)) {
drive              93 drivers/ide/qd65xx.c static void qd65xx_dev_select(ide_drive_t *drive)
drive              95 drivers/ide/qd65xx.c 	u8 index = ((	(QD_TIMREG(drive)) & 0x80 ) >> 7) |
drive              96 drivers/ide/qd65xx.c 			(QD_TIMREG(drive) & 0x02);
drive              98 drivers/ide/qd65xx.c 	if (timings[index] != QD_TIMING(drive))
drive              99 drivers/ide/qd65xx.c 		outb(timings[index] = QD_TIMING(drive), QD_TIMREG(drive));
drive             101 drivers/ide/qd65xx.c 	outb(drive->select | ATA_DEVICE_OBS, drive->hwif->io_ports.device_addr);
drive             151 drivers/ide/qd65xx.c static int qd_find_disk_type (ide_drive_t *drive,
drive             155 drivers/ide/qd65xx.c 	char *m = (char *)&drive->id[ATA_ID_PROD];
drive             166 drivers/ide/qd65xx.c 			printk(KERN_DEBUG "%s: listed !\n", drive->name);
drive             181 drivers/ide/qd65xx.c static void qd_set_timing (ide_drive_t *drive, u8 timing)
drive             183 drivers/ide/qd65xx.c 	unsigned long data = (unsigned long)ide_get_drivedata(drive);
drive             187 drivers/ide/qd65xx.c 	ide_set_drivedata(drive, (void *)data);
drive             189 drivers/ide/qd65xx.c 	printk(KERN_DEBUG "%s: %#x\n", drive->name, timing);
drive             192 drivers/ide/qd65xx.c static void qd6500_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive             194 drivers/ide/qd65xx.c 	u16 *id = drive->id;
drive             199 drivers/ide/qd65xx.c 	if (!qd_find_disk_type(drive, &active_time, &recovery_time) &&
drive             202 drivers/ide/qd65xx.c 		printk(KERN_INFO "%s: PIO mode%d\n", drive->name,
drive             205 drivers/ide/qd65xx.c 		recovery_time = drive->id[ATA_ID_EIDE_PIO] - 120;
drive             208 drivers/ide/qd65xx.c 	qd_set_timing(drive, qd6500_compute_timing(drive->hwif,
drive             212 drivers/ide/qd65xx.c static void qd6580_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive             214 drivers/ide/qd65xx.c 	const u8 pio = drive->pio_mode - XFER_PIO_0;
drive             221 drivers/ide/qd65xx.c 	if (drive->id && !qd_find_disk_type(drive, &active_time, &recovery_time)) {
drive             222 drivers/ide/qd65xx.c 		cycle_time = ide_pio_cycle_time(drive, pio);
drive             231 drivers/ide/qd65xx.c 					printk(KERN_WARNING "%s: Strange recovery time !\n",drive->name);
drive             238 drivers/ide/qd65xx.c 					printk(KERN_WARNING "%s: Strange recovery time !\n",drive->name);
drive             249 drivers/ide/qd65xx.c 		printk(KERN_INFO "%s: PIO mode%d\n", drive->name,pio);
drive             252 drivers/ide/qd65xx.c 	if (!hwif->channel && drive->media != ide_disk) {
drive             256 drivers/ide/qd65xx.c 			drive->name, hwif->name);
drive             259 drivers/ide/qd65xx.c 	qd_set_timing(drive, qd6580_compute_timing(active_time, recovery_time));
drive             290 drivers/ide/qd65xx.c static void __init qd6500_init_dev(ide_drive_t *drive)
drive             292 drivers/ide/qd65xx.c 	ide_hwif_t *hwif = drive->hwif;
drive             296 drivers/ide/qd65xx.c 	ide_set_drivedata(drive, (void *)QD6500_DEF_DATA);
drive             299 drivers/ide/qd65xx.c static void __init qd6580_init_dev(ide_drive_t *drive)
drive             301 drivers/ide/qd65xx.c 	ide_hwif_t *hwif = drive->hwif;
drive             312 drivers/ide/qd65xx.c 	ide_set_drivedata(drive, (void *)((drive->dn & 1) ? t2 : t1));
drive              35 drivers/ide/qd65xx.h static inline u8 QD_TIMING(ide_drive_t *drive)
drive              37 drivers/ide/qd65xx.h 	return (unsigned long)ide_get_drivedata(drive) & 0x00ff;
drive              40 drivers/ide/qd65xx.h static inline u8 QD_TIMREG(ide_drive_t *drive)
drive              42 drivers/ide/qd65xx.h 	return ((unsigned long)ide_get_drivedata(drive) & 0xff00) >> 8;
drive              81 drivers/ide/sc1200.c static void sc1200_tunepio(ide_drive_t *drive, u8 pio)
drive              83 drivers/ide/sc1200.c 	ide_hwif_t *hwif = drive->hwif;
drive              91 drivers/ide/sc1200.c 	pci_write_config_dword(pdev, basereg + ((drive->dn & 1) << 3),
drive             104 drivers/ide/sc1200.c static u8 sc1200_udma_filter(ide_drive_t *drive)
drive             106 drivers/ide/sc1200.c 	ide_hwif_t *hwif = drive->hwif;
drive             107 drivers/ide/sc1200.c 	ide_drive_t *mate = ide_get_pair_dev(drive);
drive             126 drivers/ide/sc1200.c static void sc1200_set_dma_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive             132 drivers/ide/sc1200.c 	const u8		mode = drive->dma_mode;
drive             158 drivers/ide/sc1200.c 	if ((drive->dn & 1) == 0) {
drive             171 drivers/ide/sc1200.c static int sc1200_dma_end(ide_drive_t *drive)
drive             173 drivers/ide/sc1200.c 	ide_hwif_t *hwif = drive->hwif;
drive             197 drivers/ide/sc1200.c static void sc1200_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive             200 drivers/ide/sc1200.c 	const u8	pio = drive->pio_mode - XFER_PIO_0;
drive             214 drivers/ide/sc1200.c 		printk("SC1200: %s: changing (U)DMA mode\n", drive->name);
drive             215 drivers/ide/sc1200.c 		ide_dma_off_quietly(drive);
drive             216 drivers/ide/sc1200.c 		if (ide_set_dma_mode(drive, mode) == 0 &&
drive             217 drivers/ide/sc1200.c 		    (drive->dev_flags & IDE_DFLAG_USING_DMA))
drive             218 drivers/ide/sc1200.c 			hwif->dma_ops->dma_host_set(drive, 1);
drive             222 drivers/ide/sc1200.c 	sc1200_tunepio(drive, pio);
drive              56 drivers/ide/serverworks.c static int check_in_drive_lists (ide_drive_t *drive, const char **list)
drive              58 drivers/ide/serverworks.c 	char *m = (char *)&drive->id[ATA_ID_PROD];
drive              66 drivers/ide/serverworks.c static u8 svwks_udma_filter(ide_drive_t *drive)
drive              68 drivers/ide/serverworks.c 	struct pci_dev *dev = to_pci_dev(drive->hwif->dev);
drive              82 drivers/ide/serverworks.c 		if (mode > 2 && check_in_drive_lists(drive, svwks_bad_ata100))
drive             110 drivers/ide/serverworks.c static void svwks_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive             116 drivers/ide/serverworks.c 	const u8 pio = drive->pio_mode - XFER_PIO_0;
drive             118 drivers/ide/serverworks.c 	if (drive->dn >= ARRAY_SIZE(drive_pci))
drive             121 drivers/ide/serverworks.c 	pci_write_config_byte(dev, drive_pci[drive->dn], pio_modes[pio]);
drive             128 drivers/ide/serverworks.c 		csb_pio &= ~(0x0f << (4 * drive->dn));
drive             129 drivers/ide/serverworks.c 		csb_pio |= (pio << (4 * drive->dn));
drive             135 drivers/ide/serverworks.c static void svwks_set_dma_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive             142 drivers/ide/serverworks.c 	const u8 speed		= drive->dma_mode;
drive             143 drivers/ide/serverworks.c 	u8 unit			= drive->dn & 1;
drive             147 drivers/ide/serverworks.c 	if (drive->dn >= ARRAY_SIZE(drive_pci2))
drive             154 drivers/ide/serverworks.c 	ultra_enable	&= ~(0x01 << drive->dn);
drive             159 drivers/ide/serverworks.c 		ultra_enable |= (0x01 << drive->dn);
drive             163 drivers/ide/serverworks.c 	pci_write_config_byte(dev, drive_pci2[drive->dn], dma_timing);
drive             114 drivers/ide/siimage.c static inline unsigned long siimage_seldev(ide_drive_t *drive, int r)
drive             116 drivers/ide/siimage.c 	ide_hwif_t *hwif	= drive->hwif;
drive             118 drivers/ide/siimage.c 	u8 unit			= drive->dn & 1;
drive             195 drivers/ide/siimage.c static u8 sil_pata_udma_filter(ide_drive_t *drive)
drive             197 drivers/ide/siimage.c 	ide_hwif_t *hwif	= drive->hwif;
drive             223 drivers/ide/siimage.c static u8 sil_sata_udma_filter(ide_drive_t *drive)
drive             225 drivers/ide/siimage.c 	char *m = (char *)&drive->id[ATA_ID_PROD];
drive             239 drivers/ide/siimage.c static void sil_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive             245 drivers/ide/siimage.c 	ide_drive_t *pair	= ide_get_pair_dev(drive);
drive             248 drivers/ide/siimage.c 	unsigned long addr	= siimage_seldev(drive, 0x04);
drive             251 drivers/ide/siimage.c 	const u8 pio		= drive->pio_mode - XFER_PIO_0;
drive             257 drivers/ide/siimage.c 	u8 unit			= drive->dn & 1;
drive             281 drivers/ide/siimage.c 	if (ide_pio_need_iordy(drive, pio)) {
drive             298 drivers/ide/siimage.c static void sil_set_dma_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive             307 drivers/ide/siimage.c 	u8 mode = 0, unit	= drive->dn & 1;
drive             311 drivers/ide/siimage.c 	unsigned long ma	= siimage_seldev(drive, 0x08);
drive             312 drivers/ide/siimage.c 	unsigned long ua	= siimage_seldev(drive, 0x0C);
drive             313 drivers/ide/siimage.c 	const u8 speed		= drive->dma_mode;
drive             359 drivers/ide/siimage.c static int siimage_mmio_dma_test_irq(ide_drive_t *drive)
drive             361 drivers/ide/siimage.c 	ide_hwif_t *hwif	= drive->hwif;
drive             377 drivers/ide/siimage.c 				drive->name, sata_error, watchdog, __func__);
drive             393 drivers/ide/siimage.c static int siimage_dma_test_irq(ide_drive_t *drive)
drive             395 drivers/ide/siimage.c 	if (drive->hwif->host_flags & IDE_HFLAG_MMIO)
drive             396 drivers/ide/siimage.c 		return siimage_mmio_dma_test_irq(drive);
drive             398 drivers/ide/siimage.c 		return ide_dma_test_irq(drive);
drive             409 drivers/ide/siimage.c static blk_status_t sil_sata_reset_poll(ide_drive_t *drive)
drive             411 drivers/ide/siimage.c 	ide_hwif_t *hwif = drive->hwif;
drive             437 drivers/ide/siimage.c static void sil_sata_pre_reset(ide_drive_t *drive)
drive             439 drivers/ide/siimage.c 	if (drive->media == ide_disk) {
drive             440 drivers/ide/siimage.c 		drive->special_flags &=
drive             605 drivers/ide/siimage.c static int is_dev_seagate_sata(ide_drive_t *drive)
drive             607 drivers/ide/siimage.c 	const char *s	= (const char *)&drive->id[ATA_ID_PROD];
drive             614 drivers/ide/siimage.c 					 "errata fix\n", drive->name);
drive             630 drivers/ide/siimage.c static void sil_quirkproc(ide_drive_t *drive)
drive             632 drivers/ide/siimage.c 	ide_hwif_t *hwif = drive->hwif;
drive             635 drivers/ide/siimage.c 	if (!is_sata(hwif) || !is_dev_seagate_sata(drive))
drive             187 drivers/ide/sis5513.c static u8 sis_ata133_get_base(ide_drive_t *drive)
drive             189 drivers/ide/sis5513.c 	struct pci_dev *dev = to_pci_dev(drive->hwif->dev);
drive             194 drivers/ide/sis5513.c 	return ((reg54 & 0x40000000) ? 0x70 : 0x40) + drive->dn * 4;
drive             197 drivers/ide/sis5513.c static void sis_ata16_program_timings(ide_drive_t *drive, const u8 mode)
drive             199 drivers/ide/sis5513.c 	struct pci_dev *dev = to_pci_dev(drive->hwif->dev);
drive             201 drivers/ide/sis5513.c 	u8 drive_pci = 0x40 + drive->dn * 2;
drive             220 drivers/ide/sis5513.c static void sis_ata100_program_timings(ide_drive_t *drive, const u8 mode)
drive             222 drivers/ide/sis5513.c 	struct pci_dev *dev = to_pci_dev(drive->hwif->dev);
drive             223 drivers/ide/sis5513.c 	u8 t1, drive_pci = 0x40 + drive->dn * 2;
drive             243 drivers/ide/sis5513.c static void sis_ata133_program_timings(ide_drive_t *drive, const u8 mode)
drive             245 drivers/ide/sis5513.c 	struct pci_dev *dev = to_pci_dev(drive->hwif->dev);
drive             247 drivers/ide/sis5513.c 	u8 drive_pci = sis_ata133_get_base(drive), clk, idx;
drive             265 drivers/ide/sis5513.c static void sis_program_timings(ide_drive_t *drive, const u8 mode)
drive             268 drivers/ide/sis5513.c 		sis_ata16_program_timings(drive, mode);
drive             270 drivers/ide/sis5513.c 		sis_ata100_program_timings(drive, mode);
drive             272 drivers/ide/sis5513.c 		sis_ata133_program_timings(drive, mode);
drive             275 drivers/ide/sis5513.c static void config_drive_art_rwp(ide_drive_t *drive)
drive             277 drivers/ide/sis5513.c 	ide_hwif_t *hwif	= drive->hwif;
drive             284 drivers/ide/sis5513.c 	rw_prefetch = reg4bh & ~(0x11 << drive->dn);
drive             286 drivers/ide/sis5513.c 	if (drive->media == ide_disk)
drive             287 drivers/ide/sis5513.c 		rw_prefetch |= 0x11 << drive->dn;
drive             293 drivers/ide/sis5513.c static void sis_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive             295 drivers/ide/sis5513.c 	config_drive_art_rwp(drive);
drive             296 drivers/ide/sis5513.c 	sis_program_timings(drive, drive->pio_mode);
drive             299 drivers/ide/sis5513.c static void sis_ata133_program_udma_timings(ide_drive_t *drive, const u8 mode)
drive             301 drivers/ide/sis5513.c 	struct pci_dev *dev = to_pci_dev(drive->hwif->dev);
drive             303 drivers/ide/sis5513.c 	u8 drive_pci = sis_ata133_get_base(drive), clk, idx;
drive             318 drivers/ide/sis5513.c static void sis_ata33_program_udma_timings(ide_drive_t *drive, const u8 mode)
drive             320 drivers/ide/sis5513.c 	struct pci_dev *dev = to_pci_dev(drive->hwif->dev);
drive             321 drivers/ide/sis5513.c 	u8 drive_pci = 0x40 + drive->dn * 2, reg = 0, i = chipset_family;
drive             335 drivers/ide/sis5513.c static void sis_program_udma_timings(ide_drive_t *drive, const u8 mode)
drive             338 drivers/ide/sis5513.c 		sis_ata133_program_udma_timings(drive, mode);
drive             340 drivers/ide/sis5513.c 		sis_ata33_program_udma_timings(drive, mode);
drive             343 drivers/ide/sis5513.c static void sis_set_dma_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive             345 drivers/ide/sis5513.c 	const u8 speed = drive->dma_mode;
drive             348 drivers/ide/sis5513.c 		sis_program_udma_timings(drive, speed);
drive             350 drivers/ide/sis5513.c 		sis_program_timings(drive, speed);
drive             353 drivers/ide/sis5513.c static u8 sis_ata133_udma_filter(ide_drive_t *drive)
drive             355 drivers/ide/sis5513.c 	struct pci_dev *dev = to_pci_dev(drive->hwif->dev);
drive             357 drivers/ide/sis5513.c 	u8 drive_pci = sis_ata133_get_base(drive);
drive              43 drivers/ide/sl82c105.c static unsigned int get_pio_timings(ide_drive_t *drive, u8 pio)
drive              50 drivers/ide/sl82c105.c 	cmd_off = (ide_pio_cycle_time(drive, pio) - 30 * cmd_on + 29) / 30;
drive              58 drivers/ide/sl82c105.c 	if (ide_pio_need_iordy(drive, pio))
drive              67 drivers/ide/sl82c105.c static void sl82c105_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive              70 drivers/ide/sl82c105.c 	unsigned long timings	= (unsigned long)ide_get_drivedata(drive);
drive              71 drivers/ide/sl82c105.c 	int reg			= 0x44 + drive->dn * 4;
drive              73 drivers/ide/sl82c105.c 	const u8 pio		= drive->pio_mode - XFER_PIO_0;
drive              75 drivers/ide/sl82c105.c 	drv_ctrl = get_pio_timings(drive, pio);
drive              83 drivers/ide/sl82c105.c 	ide_set_drivedata(drive, (void *)timings);
drive              88 drivers/ide/sl82c105.c 	printk(KERN_DEBUG "%s: selected %s (%dns) (%04X)\n", drive->name,
drive              90 drivers/ide/sl82c105.c 			  ide_pio_cycle_time(drive, pio), drv_ctrl);
drive              96 drivers/ide/sl82c105.c static void sl82c105_set_dma_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive              99 drivers/ide/sl82c105.c 	unsigned long timings = (unsigned long)ide_get_drivedata(drive);
drive             101 drivers/ide/sl82c105.c 	const u8 speed = drive->dma_mode;
drive             111 drivers/ide/sl82c105.c 	ide_set_drivedata(drive, (void *)timings);
drive             148 drivers/ide/sl82c105.c static void sl82c105_dma_lost_irq(ide_drive_t *drive)
drive             150 drivers/ide/sl82c105.c 	ide_hwif_t *hwif	= drive->hwif;
drive             186 drivers/ide/sl82c105.c static void sl82c105_dma_start(ide_drive_t *drive)
drive             188 drivers/ide/sl82c105.c 	ide_hwif_t *hwif	= drive->hwif;
drive             190 drivers/ide/sl82c105.c 	int reg 		= 0x44 + drive->dn * 4;
drive             193 drivers/ide/sl82c105.c 			      (unsigned long)ide_get_drivedata(drive) >> 16);
drive             196 drivers/ide/sl82c105.c 	ide_dma_start(drive);
drive             199 drivers/ide/sl82c105.c static void sl82c105_dma_clear(ide_drive_t *drive)
drive             201 drivers/ide/sl82c105.c 	struct pci_dev *dev = to_pci_dev(drive->hwif->dev);
drive             206 drivers/ide/sl82c105.c static int sl82c105_dma_end(ide_drive_t *drive)
drive             208 drivers/ide/sl82c105.c 	struct pci_dev *dev	= to_pci_dev(drive->hwif->dev);
drive             209 drivers/ide/sl82c105.c 	int reg 		= 0x44 + drive->dn * 4;
drive             210 drivers/ide/sl82c105.c 	int ret			= ide_dma_end(drive);
drive             213 drivers/ide/sl82c105.c 			      (unsigned long)ide_get_drivedata(drive));
drive             222 drivers/ide/sl82c105.c static void sl82c105_resetproc(ide_drive_t *drive)
drive             224 drivers/ide/sl82c105.c 	struct pci_dev *dev = to_pci_dev(drive->hwif->dev);
drive              22 drivers/ide/slc90e66.c static void slc90e66_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive              25 drivers/ide/slc90e66.c 	int is_slave		= drive->dn & 1;
drive              32 drivers/ide/slc90e66.c 	const u8 pio = drive->pio_mode - XFER_PIO_0;
drive              47 drivers/ide/slc90e66.c 	if (drive->media == ide_disk)
drive              49 drivers/ide/slc90e66.c 	if (ide_pio_need_iordy(drive, pio))
drive              76 drivers/ide/slc90e66.c static void slc90e66_set_dma_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive              80 drivers/ide/slc90e66.c 	int sitre = 0, a_speed	= 7 << (drive->dn * 4);
drive              81 drivers/ide/slc90e66.c 	int u_speed = 0, u_flag = 1 << drive->dn;
drive              83 drivers/ide/slc90e66.c 	const u8 speed		= drive->dma_mode;
drive              92 drivers/ide/slc90e66.c 		u_speed = (speed - XFER_UDMA_0) << (drive->dn * 4);
drive             110 drivers/ide/slc90e66.c 			drive->pio_mode =
drive             113 drivers/ide/slc90e66.c 			drive->pio_mode = XFER_PIO_2; /* for SWDMA2 */
drive             115 drivers/ide/slc90e66.c 		slc90e66_set_pio_mode(hwif, drive);
drive              17 drivers/ide/tc86c001.c static void tc86c001_set_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive              19 drivers/ide/tc86c001.c 	unsigned long scr_port	= hwif->config_data + (drive->dn ? 0x02 : 0x00);
drive              21 drivers/ide/tc86c001.c 	const u8 speed		= drive->dma_mode;
drive              45 drivers/ide/tc86c001.c static void tc86c001_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive              47 drivers/ide/tc86c001.c 	drive->dma_mode = drive->pio_mode;
drive              48 drivers/ide/tc86c001.c 	tc86c001_set_mode(hwif, drive);
drive              65 drivers/ide/tc86c001.c static int tc86c001_timer_expiry(ide_drive_t *drive)
drive              67 drivers/ide/tc86c001.c 	ide_hwif_t *hwif	= drive->hwif;
drive              76 drivers/ide/tc86c001.c 		unsigned long twcr_port	= sc_base + (drive->dn ? 0x06 : 0x04);
drive              80 drivers/ide/tc86c001.c 		       "attempting recovery...\n", drive->name);
drive             106 drivers/ide/tc86c001.c 		return expiry(drive);
drive             112 drivers/ide/tc86c001.c static void tc86c001_dma_start(ide_drive_t *drive)
drive             114 drivers/ide/tc86c001.c 	ide_hwif_t *hwif	= drive->hwif;
drive             116 drivers/ide/tc86c001.c 	unsigned long twcr_port	= sc_base + (drive->dn ? 0x06 : 0x04);
drive             131 drivers/ide/tc86c001.c 	ide_dma_start(drive);
drive              25 drivers/ide/triflex.c static void triflex_set_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive              30 drivers/ide/triflex.c 	u8 channel_offset = hwif->channel ? 0x74 : 0x70, unit = drive->dn & 1;
drive              34 drivers/ide/triflex.c 	switch (drive->dma_mode) {
drive              72 drivers/ide/triflex.c static void triflex_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive              74 drivers/ide/triflex.c 	drive->dma_mode = drive->pio_mode;
drive              75 drivers/ide/triflex.c 	triflex_set_mode(hwif, drive);
drive             145 drivers/ide/trm290.c static void trm290_prepare_drive (ide_drive_t *drive, unsigned int use_dma)
drive             147 drivers/ide/trm290.c 	ide_hwif_t *hwif = drive->hwif;
drive             164 drivers/ide/trm290.c 	if (drive->dev_flags & IDE_DFLAG_PRESENT) {
drive             174 drivers/ide/trm290.c static void trm290_dev_select(ide_drive_t *drive)
drive             176 drivers/ide/trm290.c 	trm290_prepare_drive(drive, !!(drive->dev_flags & IDE_DFLAG_USING_DMA));
drive             178 drivers/ide/trm290.c 	outb(drive->select | ATA_DEVICE_OBS, drive->hwif->io_ports.device_addr);
drive             181 drivers/ide/trm290.c static int trm290_dma_check(ide_drive_t *drive, struct ide_cmd *cmd)
drive             192 drivers/ide/trm290.c static int trm290_dma_setup(ide_drive_t *drive, struct ide_cmd *cmd)
drive             194 drivers/ide/trm290.c 	ide_hwif_t *hwif = drive->hwif;
drive             197 drivers/ide/trm290.c 	count = ide_build_dmatable(drive, cmd);
drive             209 drivers/ide/trm290.c static void trm290_dma_start(ide_drive_t *drive)
drive             211 drivers/ide/trm290.c 	trm290_prepare_drive(drive, 1);
drive             214 drivers/ide/trm290.c static int trm290_dma_end(ide_drive_t *drive)
drive             216 drivers/ide/trm290.c 	u16 status = inw(drive->hwif->dma_base + 2);
drive             218 drivers/ide/trm290.c 	trm290_prepare_drive(drive, 0);
drive             223 drivers/ide/trm290.c static int trm290_dma_test_irq(ide_drive_t *drive)
drive             225 drivers/ide/trm290.c 	u16 status = inw(drive->hwif->dma_base + 2);
drive             230 drivers/ide/trm290.c static void trm290_dma_host_set(ide_drive_t *drive, int on)
drive              59 drivers/ide/tx4938ide.c static void tx4938ide_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive              62 drivers/ide/tx4938ide.c 	u8 safe = drive->pio_mode - XFER_PIO_0;
drive              65 drivers/ide/tx4938ide.c 	pair = ide_get_pair_dev(drive);
drive              74 drivers/ide/tx4938ide.c static void tx4938ide_input_data_swap(ide_drive_t *drive, struct ide_cmd *cmd,
drive              77 drivers/ide/tx4938ide.c 	unsigned long port = drive->hwif->io_ports.data_addr;
drive              86 drivers/ide/tx4938ide.c static void tx4938ide_output_data_swap(ide_drive_t *drive, struct ide_cmd *cmd,
drive              89 drivers/ide/tx4938ide.c 	unsigned long port = drive->hwif->io_ports.data_addr;
drive             107 drivers/ide/tx4939ide.c static void tx4939ide_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive             109 drivers/ide/tx4939ide.c 	int is_slave = drive->dn;
drive             111 drivers/ide/tx4939ide.c 	const u8 pio = drive->pio_mode - XFER_PIO_0;
drive             115 drivers/ide/tx4939ide.c 	pair = ide_get_pair_dev(drive);
drive             128 drivers/ide/tx4939ide.c static void tx4939ide_set_dma_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive             131 drivers/ide/tx4939ide.c 	const u8 mode = drive->dma_mode;
drive             138 drivers/ide/tx4939ide.c 	if (drive->dn) {
drive             173 drivers/ide/tx4939ide.c static void tx4939ide_clear_irq(ide_drive_t *drive)
drive             183 drivers/ide/tx4939ide.c 	if (drive->waiting_for_dma)
drive             185 drivers/ide/tx4939ide.c 	hwif = drive->hwif;
drive             200 drivers/ide/tx4939ide.c static void tx4939ide_dma_host_set(ide_drive_t *drive, int on)
drive             202 drivers/ide/tx4939ide.c 	ide_hwif_t *hwif = drive->hwif;
drive             203 drivers/ide/tx4939ide.c 	u8 unit = drive->dn;
drive             234 drivers/ide/tx4939ide.c static int tx4939ide_build_dmatable(ide_drive_t *drive, struct ide_cmd *cmd)
drive             236 drivers/ide/tx4939ide.c 	ide_hwif_t *hwif = drive->hwif;
drive             278 drivers/ide/tx4939ide.c 	printk(KERN_ERR "%s: %s\n", drive->name,
drive             287 drivers/ide/tx4939ide.c static int tx4939ide_dma_setup(ide_drive_t *drive, struct ide_cmd *cmd)
drive             289 drivers/ide/tx4939ide.c 	ide_hwif_t *hwif = drive->hwif;
drive             294 drivers/ide/tx4939ide.c 	if (tx4939ide_build_dmatable(drive, cmd) == 0)
drive             306 drivers/ide/tx4939ide.c 	tx4939ide_writew(SECTOR_SIZE / 2, base, drive->dn ?
drive             314 drivers/ide/tx4939ide.c static int tx4939ide_dma_end(ide_drive_t *drive)
drive             316 drivers/ide/tx4939ide.c 	ide_hwif_t *hwif = drive->hwif;
drive             342 drivers/ide/tx4939ide.c static int tx4939ide_dma_test_irq(ide_drive_t *drive)
drive             344 drivers/ide/tx4939ide.c 	ide_hwif_t *hwif = drive->hwif;
drive             420 drivers/ide/tx4939ide.c static void tx4939ide_tf_load_fixup(ide_drive_t *drive)
drive             422 drivers/ide/tx4939ide.c 	ide_hwif_t *hwif = drive->hwif;
drive             424 drivers/ide/tx4939ide.c 	u16 sysctl = hwif->select_data >> (drive->dn ? 16 : 0);
drive             435 drivers/ide/tx4939ide.c static void tx4939ide_tf_load(ide_drive_t *drive, struct ide_taskfile *tf,
drive             438 drivers/ide/tx4939ide.c 	ide_tf_load(drive, tf, valid);
drive             441 drivers/ide/tx4939ide.c 		tx4939ide_tf_load_fixup(drive);
drive             447 drivers/ide/tx4939ide.c static void tx4939ide_input_data_swap(ide_drive_t *drive, struct ide_cmd *cmd,
drive             450 drivers/ide/tx4939ide.c 	unsigned long port = drive->hwif->io_ports.data_addr;
drive             459 drivers/ide/tx4939ide.c static void tx4939ide_output_data_swap(ide_drive_t *drive, struct ide_cmd *cmd,
drive             462 drivers/ide/tx4939ide.c 	unsigned long port = drive->hwif->io_ports.data_addr;
drive             108 drivers/ide/umc8672.c static void umc_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive             112 drivers/ide/umc8672.c 	const u8 pio = drive->pio_mode - XFER_PIO_0;
drive             115 drivers/ide/umc8672.c 		drive->name, pio, pio_to_umc[pio]);
drive             121 drivers/ide/umc8672.c 		current_speeds[drive->name[2] - 'a'] = pio_to_umc[pio];
drive             175 drivers/ide/via82cxxx.c static void via_set_drive(ide_hwif_t *hwif, ide_drive_t *drive)
drive             177 drivers/ide/via82cxxx.c 	ide_drive_t *peer = ide_get_pair_dev(drive);
drive             183 drivers/ide/via82cxxx.c 	const u8 speed = drive->dma_mode;
drive             195 drivers/ide/via82cxxx.c 	ide_timing_compute(drive, speed, &t, T, UT);
drive             202 drivers/ide/via82cxxx.c 	via_set_speed(hwif, drive->dn, &t);
drive             213 drivers/ide/via82cxxx.c static void via_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
drive             215 drivers/ide/via82cxxx.c 	drive->dma_mode = drive->pio_mode;
drive             216 drivers/ide/via82cxxx.c 	via_set_drive(hwif, drive);
drive              76 drivers/input/keyboard/qt2160.c 	u32 drive, pwmen;
drive              79 drivers/input/keyboard/qt2160.c 		drive = qt2160_read(client, QT2160_CMD_DRIVE_X);
drive              82 drivers/input/keyboard/qt2160.c 			drive |= BIT(led->id);
drive              86 drivers/input/keyboard/qt2160.c 			drive &= ~BIT(led->id);
drive              89 drivers/input/keyboard/qt2160.c 		qt2160_write(client, QT2160_CMD_DRIVE_X, drive);
drive            2405 drivers/media/dvb-frontends/dib7000p.c static int dib7090_host_bus_drive(struct dib7000p_state *state, u8 drive)
drive            2411 drivers/media/dvb-frontends/dib7000p.c 	reg |= (drive << 12) | (drive << 6) | drive;
drive            2416 drivers/media/dvb-frontends/dib7000p.c 	reg |= (drive << 8) | (drive << 2);
drive            2421 drivers/media/dvb-frontends/dib7000p.c 	reg |= (drive << 12) | (drive << 6) | drive;
drive            2426 drivers/media/dvb-frontends/dib7000p.c 	reg |= (drive << 8) | (drive << 2);
drive            2431 drivers/media/dvb-frontends/dib7000p.c 	reg |= (drive << 12) | (drive << 6) | drive;
drive            1344 drivers/media/dvb-frontends/dib8000.c static void dib8096p_host_bus_drive(struct dib8000_state *state, u8 drive)
drive            1348 drivers/media/dvb-frontends/dib8000.c 	drive &= 0x7;
drive            1353 drivers/media/dvb-frontends/dib8000.c 	reg |= (drive<<12) | (drive<<6) | drive;
drive            1358 drivers/media/dvb-frontends/dib8000.c 	reg |= (drive<<8) | (drive<<2);
drive            1364 drivers/media/dvb-frontends/dib8000.c 	reg |= (drive<<12) | (drive<<6) | drive;
drive            1369 drivers/media/dvb-frontends/dib8000.c 	reg |= (drive<<8) | (drive<<2);
drive            1375 drivers/media/dvb-frontends/dib8000.c 	reg |= (drive<<12) | (drive<<6) | drive;
drive             255 drivers/pinctrl/freescale/pinctrl-imx23.c 	.drive = 0x200,
drive             371 drivers/pinctrl/freescale/pinctrl-imx28.c 	.drive = 0x300,
drive             278 drivers/pinctrl/freescale/pinctrl-mxs.c 			reg = d->base + d->soc->regs->drive;
drive              67 drivers/pinctrl/freescale/pinctrl-mxs.h 	u16 drive;
drive             818 drivers/pinctrl/pinctrl-artpec6.c 		int drive;
drive             857 drivers/pinctrl/pinctrl-artpec6.c 			drive = artpec6_pconf_drive_mA_to_field(arg);
drive             858 drivers/pinctrl/pinctrl-artpec6.c 			if (drive < 0) {
drive             866 drivers/pinctrl/pinctrl-artpec6.c 			regval |= (drive << ARTPEC6_PINMUX_DRV_SHIFT);
drive             172 drivers/pinctrl/pinctrl-digicolor.c 	u8 drive;
drive             176 drivers/pinctrl/pinctrl-digicolor.c 	drive = readb_relaxed(pmap->regs + reg_off);
drive             177 drivers/pinctrl/pinctrl-digicolor.c 	drive &= ~BIT(bit_off);
drive             178 drivers/pinctrl/pinctrl-digicolor.c 	writeb_relaxed(drive, pmap->regs + reg_off);
drive             192 drivers/pinctrl/pinctrl-digicolor.c 	u8 drive;
drive             198 drivers/pinctrl/pinctrl-digicolor.c 	drive = readb_relaxed(pmap->regs + reg_off);
drive             199 drivers/pinctrl/pinctrl-digicolor.c 	drive |= BIT(bit_off);
drive             200 drivers/pinctrl/pinctrl-digicolor.c 	writeb_relaxed(drive, pmap->regs + reg_off);
drive             491 drivers/pinctrl/pinctrl-rzn1.c 	u32 pull, drive, l1mux;
drive             501 drivers/pinctrl/pinctrl-rzn1.c 	drive = (l1 >> RZN1_L1_PIN_DRIVE_STRENGTH) & 0x3;
drive             517 drivers/pinctrl/pinctrl-rzn1.c 		arg = reg_drive[drive];
drive             538 drivers/pinctrl/qcom/pinctrl-msm.c 	int drive;
drive             565 drivers/pinctrl/qcom/pinctrl-msm.c 	drive = (ctl_reg >> g->drv_bit) & 7;
drive             575 drivers/pinctrl/qcom/pinctrl-msm.c 	seq_printf(s, " %dmA", msm_regval_to_drive(drive));
drive             168 drivers/pinctrl/stm32/pinctrl-stm32.c 				      u32 drive)
drive             171 drivers/pinctrl/stm32/pinctrl-stm32.c 	bank->pin_backup[offset] |= drive << STM32_GPIO_BKP_TYPE;
drive             811 drivers/pinctrl/stm32/pinctrl-stm32.c 				   unsigned offset, u32 drive)
drive             831 drivers/pinctrl/stm32/pinctrl-stm32.c 	val |= drive << offset;
drive             837 drivers/pinctrl/stm32/pinctrl-stm32.c 	stm32_gpio_backup_driving(bank, offset, drive);
drive            1080 drivers/pinctrl/stm32/pinctrl-stm32.c 	u32 mode, alt, drive, speed, bias;
drive            1112 drivers/pinctrl/stm32/pinctrl-stm32.c 		drive = stm32_pconf_get_driving(bank, offset);
drive            1117 drivers/pinctrl/stm32/pinctrl-stm32.c 			   drive ? "open drain" : "push pull",
drive            1124 drivers/pinctrl/stm32/pinctrl-stm32.c 		drive = stm32_pconf_get_driving(bank, offset);
drive            1127 drivers/pinctrl/stm32/pinctrl-stm32.c 			   drive ? "open drain" : "push pull",
drive             286 drivers/pinctrl/sunxi/pinctrl-sunxi.c 		int drive = sunxi_pctrl_parse_drive_prop(node);
drive             287 drivers/pinctrl/sunxi/pinctrl-sunxi.c 		if (drive < 0) {
drive             288 drivers/pinctrl/sunxi/pinctrl-sunxi.c 			ret = drive;
drive             293 drivers/pinctrl/sunxi/pinctrl-sunxi.c 							  drive);
drive             241 drivers/regulator/wm8350-regulator.c 			   u16 drive)
drive             248 drivers/regulator/wm8350-regulator.c 				 duration | on_ramp | off_ramp | drive);
drive             254 drivers/regulator/wm8350-regulator.c 				 duration | on_ramp | off_ramp | drive);
drive              30 drivers/scsi/gdth_proc.c     int orig_length, drive, wb_mode;
drive              41 drivers/scsi/gdth_proc.c     drive = -1;
drive              49 drivers/scsi/gdth_proc.c             drive = (int)(*buffer-'0');
drive              52 drivers/scsi/gdth_proc.c                 drive = drive*10 + (int)(*buffer-'0');
drive              55 drivers/scsi/gdth_proc.c             printk("GDT: Flushing host drive %d .. ",drive);
drive              61 drivers/scsi/gdth_proc.c                 if (drive != -1 && i != drive)
drive            1067 drivers/scsi/mvsas/mv_94xx.c 			int drive = (i/3) & (4-1); /* drive number on host */
drive            1068 drivers/scsi/mvsas/mv_94xx.c 			int driveshift = drive * 8; /* bit offset of drive */
drive             880 include/linux/ide.h static int get_##name(ide_drive_t *drive) \
drive             882 include/linux/ide.h 	return drive->field; \
drive             886 include/linux/ide.h static int set_##name(ide_drive_t *drive, int arg) \
drive             888 include/linux/ide.h 	drive->field = arg; \
drive             893 include/linux/ide.h static int get_##name(ide_drive_t *drive) \
drive             895 include/linux/ide.h 	return !!(drive->dev_flags & flag); \
drive             899 include/linux/ide.h static int set_##name(ide_drive_t *drive, int arg) \
drive             902 include/linux/ide.h 		drive->dev_flags |= flag; \
drive             904 include/linux/ide.h 		drive->dev_flags &= ~flag; \
drive             993 include/linux/ide.h static inline void ide_proc_unregister_device(ide_drive_t *drive) { ; }
drive             995 include/linux/ide.h static inline void ide_proc_register_driver(ide_drive_t *drive,
drive             997 include/linux/ide.h static inline void ide_proc_unregister_driver(ide_drive_t *drive,
drive            1017 include/linux/ide.h 	if (unlikely(drive->debug_mask & lvl))				\
drive            1128 include/linux/ide.h extern int ide_devset_execute(ide_drive_t *drive,
drive            1134 include/linux/ide.h void ide_tf_readback(ide_drive_t *drive, struct ide_cmd *cmd);
drive            1187 include/linux/ide.h void ide_retry_pc(ide_drive_t *drive);
drive            1189 include/linux/ide.h void ide_prep_sense(ide_drive_t *drive, struct request *rq);
drive            1190 include/linux/ide.h int ide_queue_sense_rq(ide_drive_t *drive, void *special);
drive            1214 include/linux/ide.h extern int taskfile_lib_get_identify(ide_drive_t *drive, u8 *);
drive            1218 include/linux/ide.h extern void ide_stall_queue(ide_drive_t *drive, unsigned long timeout);
drive            1224 include/linux/ide.h extern void ide_requeue_and_plug(ide_drive_t *drive, struct request *rq);
drive            1418 include/linux/ide.h static inline u8 ide_max_dma_mode(ide_drive_t *drive)
drive            1420 include/linux/ide.h 	return ide_find_dma_mode(drive, XFER_UDMA_6);
drive            1448 include/linux/ide.h static inline int config_drive_for_dma(ide_drive_t *drive) { return 0; }
drive            1455 include/linux/ide.h static inline u8 ide_find_dma_mode(ide_drive_t *drive, u8 speed) { return 0; }
drive            1456 include/linux/ide.h static inline u8 ide_max_dma_mode(ide_drive_t *drive) { return 0; }
drive            1457 include/linux/ide.h static inline void ide_dma_off_quietly(ide_drive_t *drive) { ; }
drive            1458 include/linux/ide.h static inline void ide_dma_off(ide_drive_t *drive) { ; }
drive            1459 include/linux/ide.h static inline void ide_dma_on(ide_drive_t *drive) { ; }
drive            1460 include/linux/ide.h static inline void ide_dma_verbose(ide_drive_t *drive) { ; }
drive            1461 include/linux/ide.h static inline int ide_set_dma(ide_drive_t *drive) { return 1; }
drive            1462 include/linux/ide.h static inline void ide_check_dma_crc(ide_drive_t *drive) { ; }
drive            1463 include/linux/ide.h static inline ide_startstop_t ide_dma_intr(ide_drive_t *drive) { return ide_stopped; }
drive            1464 include/linux/ide.h static inline ide_startstop_t ide_dma_timeout_retry(ide_drive_t *drive, int error) { return ide_stopped; }
drive            1466 include/linux/ide.h static inline int ide_dma_prepare(ide_drive_t *drive,
drive            1468 include/linux/ide.h static inline void ide_dma_unmap_sg(ide_drive_t *drive,
drive            1475 include/linux/ide.h extern int ide_acpi_exec_tfs(ide_drive_t *drive);
drive            1484 include/linux/ide.h static inline int ide_acpi_exec_tfs(ide_drive_t *drive) { return 0; }
drive            1569 include/linux/ide.h static inline void ide_set_pio(ide_drive_t *drive, u8 pio) { ; }
drive            1570 include/linux/ide.h static inline int ide_set_xfer_rate(ide_drive_t *drive, u8 rate) { return -1; }
drive            1573 include/linux/ide.h static inline void ide_set_max_pio(ide_drive_t *drive)
drive            1575 include/linux/ide.h 	ide_set_pio(drive, 255);
drive            1594 include/linux/ide.h static inline ide_drive_t *ide_get_pair_dev(ide_drive_t *drive)
drive            1596 include/linux/ide.h 	ide_drive_t *peer = drive->hwif->devices[(drive->dn ^ 1) & 1];
drive            1601 include/linux/ide.h static inline void *ide_get_drivedata(ide_drive_t *drive)
drive            1603 include/linux/ide.h 	return drive->drive_data;
drive            1606 include/linux/ide.h static inline void ide_set_drivedata(ide_drive_t *drive, void *data)
drive            1608 include/linux/ide.h 	drive->drive_data = data;
drive             775 include/linux/libata.h 	struct ata_acpi_drive drive[2];
drive             773 include/linux/mfd/wm8350/pmic.h 			   u16 off_ramp, u16 drive);
drive              96 include/linux/platform_data/si5351.h 	enum si5351_drive_strength drive;