Lines Matching refs:hwif
76 const struct ide_tp_ops *tp_ops = drive->hwif->tp_ops; in ide_complete_cmd()
117 ide_hwif_t *hwif = drive->hwif; in ide_complete_rq() local
118 struct request *rq = hwif->rq; in ide_complete_rq()
130 hwif->rq = NULL; in ide_complete_rq()
225 ide_hwif_t *hwif = drive->hwif; in ide_map_sg() local
226 struct scatterlist *sg = hwif->sg_table; in ide_map_sg()
314 drive->hwif->name, (unsigned long) rq); in start_request()
326 drive->hwif->tp_ops->dev_select(drive); in start_request()
395 static inline int ide_lock_port(ide_hwif_t *hwif) in ide_lock_port() argument
397 if (hwif->busy) in ide_lock_port()
400 hwif->busy = 1; in ide_lock_port()
405 static inline void ide_unlock_port(ide_hwif_t *hwif) in ide_unlock_port() argument
407 hwif->busy = 0; in ide_unlock_port()
410 static inline int ide_lock_host(struct ide_host *host, ide_hwif_t *hwif) in ide_lock_host() argument
418 host->get_lock(ide_intr, hwif); in ide_lock_host()
459 ide_hwif_t *hwif = drive->hwif; in do_ide_request() local
460 struct ide_host *host = hwif->host; in do_ide_request()
470 if (ide_lock_host(host, hwif)) in do_ide_request()
473 spin_lock_irq(&hwif->lock); in do_ide_request()
475 if (!ide_lock_port(hwif)) { in do_ide_request()
478 WARN_ON_ONCE(hwif->rq); in do_ide_request()
480 prev_port = hwif->host->cur_port; in do_ide_request()
486 ide_unlock_port(hwif); in do_ide_request()
490 if ((hwif->host->host_flags & IDE_HFLAG_SERIALIZE) && in do_ide_request()
491 hwif != prev_port) { in do_ide_request()
505 hwif->host->cur_port = hwif; in do_ide_request()
507 hwif->cur_dev = drive; in do_ide_request()
510 spin_unlock_irq(&hwif->lock); in do_ide_request()
520 spin_lock_irq(&hwif->lock); in do_ide_request()
523 ide_unlock_port(hwif); in do_ide_request()
544 ide_unlock_port(hwif); in do_ide_request()
548 hwif->rq = rq; in do_ide_request()
550 spin_unlock_irq(&hwif->lock); in do_ide_request()
552 spin_lock_irq(&hwif->lock); in do_ide_request()
555 rq = hwif->rq; in do_ide_request()
556 hwif->rq = NULL; in do_ide_request()
562 spin_unlock_irq(&hwif->lock); in do_ide_request()
569 spin_unlock_irq(&hwif->lock); in do_ide_request()
578 ide_hwif_t *hwif = drive->hwif; in drive_is_ready() local
582 return hwif->dma_ops->dma_test_irq(drive); in drive_is_ready()
584 if (hwif->io_ports.ctl_addr && in drive_is_ready()
585 (hwif->host_flags & IDE_HFLAG_BROKEN_ALTSTATUS) == 0) in drive_is_ready()
586 stat = hwif->tp_ops->read_altstatus(hwif); in drive_is_ready()
589 stat = hwif->tp_ops->read_status(hwif); in drive_is_ready()
615 ide_hwif_t *hwif = (ide_hwif_t *)data; in ide_timer_expiry() local
623 spin_lock_irqsave(&hwif->lock, flags); in ide_timer_expiry()
625 handler = hwif->handler; in ide_timer_expiry()
627 if (handler == NULL || hwif->req_gen != hwif->req_gen_timer) { in ide_timer_expiry()
635 ide_expiry_t *expiry = hwif->expiry; in ide_timer_expiry()
638 drive = hwif->cur_dev; in ide_timer_expiry()
644 hwif->timer.expires = jiffies + wait; in ide_timer_expiry()
645 hwif->req_gen_timer = hwif->req_gen; in ide_timer_expiry()
646 add_timer(&hwif->timer); in ide_timer_expiry()
647 spin_unlock_irqrestore(&hwif->lock, flags); in ide_timer_expiry()
651 hwif->handler = NULL; in ide_timer_expiry()
652 hwif->expiry = NULL; in ide_timer_expiry()
658 spin_unlock(&hwif->lock); in ide_timer_expiry()
660 disable_irq(hwif->irq); in ide_timer_expiry()
663 if (hwif->polling) { in ide_timer_expiry()
667 hwif->dma_ops->dma_lost_irq(drive); in ide_timer_expiry()
668 if (hwif->port_ops && hwif->port_ops->clear_irq) in ide_timer_expiry()
669 hwif->port_ops->clear_irq(drive); in ide_timer_expiry()
679 hwif->tp_ops->read_status(hwif)); in ide_timer_expiry()
681 spin_lock_irq(&hwif->lock); in ide_timer_expiry()
682 enable_irq(hwif->irq); in ide_timer_expiry()
683 if (startstop == ide_stopped && hwif->polling == 0) { in ide_timer_expiry()
684 rq_in_flight = hwif->rq; in ide_timer_expiry()
685 hwif->rq = NULL; in ide_timer_expiry()
686 ide_unlock_port(hwif); in ide_timer_expiry()
690 spin_unlock_irqrestore(&hwif->lock, flags); in ide_timer_expiry()
693 ide_unlock_host(hwif->host); in ide_timer_expiry()
727 static void unexpected_intr(int irq, ide_hwif_t *hwif) in unexpected_intr() argument
729 u8 stat = hwif->tp_ops->read_status(hwif); in unexpected_intr()
740 hwif->name, stat, count); in unexpected_intr()
772 ide_hwif_t *hwif = (ide_hwif_t *)dev_id; in ide_intr() local
773 struct ide_host *host = hwif->host; in ide_intr()
783 if (hwif != host->cur_port) in ide_intr()
787 spin_lock_irqsave(&hwif->lock, flags); in ide_intr()
789 if (hwif->port_ops && hwif->port_ops->test_irq && in ide_intr()
790 hwif->port_ops->test_irq(hwif) == 0) in ide_intr()
793 handler = hwif->handler; in ide_intr()
795 if (handler == NULL || hwif->polling) { in ide_intr()
813 unexpected_intr(irq, hwif); in ide_intr()
819 (void)hwif->tp_ops->read_status(hwif); in ide_intr()
824 drive = hwif->cur_dev; in ide_intr()
836 hwif->handler = NULL; in ide_intr()
837 hwif->expiry = NULL; in ide_intr()
838 hwif->req_gen++; in ide_intr()
839 del_timer(&hwif->timer); in ide_intr()
840 spin_unlock(&hwif->lock); in ide_intr()
842 if (hwif->port_ops && hwif->port_ops->clear_irq) in ide_intr()
843 hwif->port_ops->clear_irq(drive); in ide_intr()
851 spin_lock_irq(&hwif->lock); in ide_intr()
859 if (startstop == ide_stopped && hwif->polling == 0) { in ide_intr()
860 BUG_ON(hwif->handler); in ide_intr()
861 rq_in_flight = hwif->rq; in ide_intr()
862 hwif->rq = NULL; in ide_intr()
863 ide_unlock_port(hwif); in ide_intr()
868 spin_unlock_irqrestore(&hwif->lock, flags); in ide_intr()
871 ide_unlock_host(hwif->host); in ide_intr()
881 ide_hwif_t *hwif = drive->hwif; in ide_pad_transfer() local
886 hwif->tp_ops->output_data(drive, NULL, buf, min(4, len)); in ide_pad_transfer()
888 hwif->tp_ops->input_data(drive, NULL, buf, min(4, len)); in ide_pad_transfer()