Lines Matching refs:hwif
86 const struct ide_tp_ops *tp_ops = drive->hwif->tp_ops; in ide_complete_cmd()
127 ide_hwif_t *hwif = drive->hwif; in ide_complete_rq() local
128 struct request *rq = hwif->rq; in ide_complete_rq()
140 hwif->rq = NULL; in ide_complete_rq()
235 ide_hwif_t *hwif = drive->hwif; in ide_map_sg() local
236 struct scatterlist *sg = hwif->sg_table; in ide_map_sg()
322 drive->hwif->name, (unsigned long) rq); in start_request()
337 drive->hwif->tp_ops->dev_select(drive); in start_request()
406 static inline int ide_lock_port(ide_hwif_t *hwif) in ide_lock_port() argument
408 if (hwif->busy) in ide_lock_port()
411 hwif->busy = 1; in ide_lock_port()
416 static inline void ide_unlock_port(ide_hwif_t *hwif) in ide_unlock_port() argument
418 hwif->busy = 0; in ide_unlock_port()
421 static inline int ide_lock_host(struct ide_host *host, ide_hwif_t *hwif) in ide_lock_host() argument
429 host->get_lock(ide_intr, hwif); in ide_lock_host()
459 ide_hwif_t *hwif = drive->hwif; in ide_issue_rq() local
460 struct ide_host *host = hwif->host; in ide_issue_rq()
471 if (ide_lock_host(host, hwif)) in ide_issue_rq()
474 spin_lock_irq(&hwif->lock); in ide_issue_rq()
476 if (!ide_lock_port(hwif)) { in ide_issue_rq()
479 WARN_ON_ONCE(hwif->rq); in ide_issue_rq()
481 prev_port = hwif->host->cur_port; in ide_issue_rq()
484 ide_unlock_port(hwif); in ide_issue_rq()
488 if ((hwif->host->host_flags & IDE_HFLAG_SERIALIZE) && in ide_issue_rq()
489 hwif != prev_port) { in ide_issue_rq()
503 hwif->host->cur_port = hwif; in ide_issue_rq()
505 hwif->cur_dev = drive; in ide_issue_rq()
525 ide_unlock_port(hwif); in ide_issue_rq()
530 hwif->rq = rq; in ide_issue_rq()
532 spin_unlock_irq(&hwif->lock); in ide_issue_rq()
534 spin_lock_irq(&hwif->lock); in ide_issue_rq()
537 rq = hwif->rq; in ide_issue_rq()
538 hwif->rq = NULL; in ide_issue_rq()
541 ide_unlock_port(hwif); in ide_issue_rq()
548 spin_unlock_irq(&hwif->lock); in ide_issue_rq()
556 spin_unlock_irq(&hwif->lock); in ide_issue_rq()
569 ide_hwif_t *hwif = drive->hwif; in ide_queue_rq() local
571 spin_lock_irq(&hwif->lock); in ide_queue_rq()
573 spin_unlock_irq(&hwif->lock); in ide_queue_rq()
576 spin_unlock_irq(&hwif->lock); in ide_queue_rq()
584 ide_hwif_t *hwif = drive->hwif; in drive_is_ready() local
588 return hwif->dma_ops->dma_test_irq(drive); in drive_is_ready()
590 if (hwif->io_ports.ctl_addr && in drive_is_ready()
591 (hwif->host_flags & IDE_HFLAG_BROKEN_ALTSTATUS) == 0) in drive_is_ready()
592 stat = hwif->tp_ops->read_altstatus(hwif); in drive_is_ready()
595 stat = hwif->tp_ops->read_status(hwif); in drive_is_ready()
621 ide_hwif_t *hwif = from_timer(hwif, t, timer); in ide_timer_expiry() local
629 spin_lock_irqsave(&hwif->lock, flags); in ide_timer_expiry()
631 handler = hwif->handler; in ide_timer_expiry()
633 if (handler == NULL || hwif->req_gen != hwif->req_gen_timer) { in ide_timer_expiry()
641 ide_expiry_t *expiry = hwif->expiry; in ide_timer_expiry()
644 drive = hwif->cur_dev; in ide_timer_expiry()
650 hwif->timer.expires = jiffies + wait; in ide_timer_expiry()
651 hwif->req_gen_timer = hwif->req_gen; in ide_timer_expiry()
652 add_timer(&hwif->timer); in ide_timer_expiry()
653 spin_unlock_irqrestore(&hwif->lock, flags); in ide_timer_expiry()
657 hwif->handler = NULL; in ide_timer_expiry()
658 hwif->expiry = NULL; in ide_timer_expiry()
664 spin_unlock(&hwif->lock); in ide_timer_expiry()
666 disable_irq(hwif->irq); in ide_timer_expiry()
668 if (hwif->polling) { in ide_timer_expiry()
672 hwif->dma_ops->dma_lost_irq(drive); in ide_timer_expiry()
673 if (hwif->port_ops && hwif->port_ops->clear_irq) in ide_timer_expiry()
674 hwif->port_ops->clear_irq(drive); in ide_timer_expiry()
684 hwif->tp_ops->read_status(hwif)); in ide_timer_expiry()
687 spin_lock_irq(&hwif->lock); in ide_timer_expiry()
688 enable_irq(hwif->irq); in ide_timer_expiry()
689 if (startstop == ide_stopped && hwif->polling == 0) { in ide_timer_expiry()
690 rq_in_flight = hwif->rq; in ide_timer_expiry()
691 hwif->rq = NULL; in ide_timer_expiry()
692 ide_unlock_port(hwif); in ide_timer_expiry()
696 spin_unlock_irqrestore(&hwif->lock, flags); in ide_timer_expiry()
699 ide_unlock_host(hwif->host); in ide_timer_expiry()
733 static void unexpected_intr(int irq, ide_hwif_t *hwif) in unexpected_intr() argument
735 u8 stat = hwif->tp_ops->read_status(hwif); in unexpected_intr()
746 hwif->name, stat, count); in unexpected_intr()
778 ide_hwif_t *hwif = (ide_hwif_t *)dev_id; in ide_intr() local
779 struct ide_host *host = hwif->host; in ide_intr()
789 if (hwif != host->cur_port) in ide_intr()
793 spin_lock_irqsave(&hwif->lock, flags); in ide_intr()
795 if (hwif->port_ops && hwif->port_ops->test_irq && in ide_intr()
796 hwif->port_ops->test_irq(hwif) == 0) in ide_intr()
799 handler = hwif->handler; in ide_intr()
801 if (handler == NULL || hwif->polling) { in ide_intr()
819 unexpected_intr(irq, hwif); in ide_intr()
825 (void)hwif->tp_ops->read_status(hwif); in ide_intr()
830 drive = hwif->cur_dev; in ide_intr()
842 hwif->handler = NULL; in ide_intr()
843 hwif->expiry = NULL; in ide_intr()
844 hwif->req_gen++; in ide_intr()
845 del_timer(&hwif->timer); in ide_intr()
846 spin_unlock(&hwif->lock); in ide_intr()
848 if (hwif->port_ops && hwif->port_ops->clear_irq) in ide_intr()
849 hwif->port_ops->clear_irq(drive); in ide_intr()
857 spin_lock_irq(&hwif->lock); in ide_intr()
865 if (startstop == ide_stopped && hwif->polling == 0) { in ide_intr()
866 BUG_ON(hwif->handler); in ide_intr()
867 rq_in_flight = hwif->rq; in ide_intr()
868 hwif->rq = NULL; in ide_intr()
869 ide_unlock_port(hwif); in ide_intr()
874 spin_unlock_irqrestore(&hwif->lock, flags); in ide_intr()
877 ide_unlock_host(hwif->host); in ide_intr()
887 ide_hwif_t *hwif = drive->hwif; in ide_pad_transfer() local
892 hwif->tp_ops->output_data(drive, NULL, buf, min(4, len)); in ide_pad_transfer()
894 hwif->tp_ops->input_data(drive, NULL, buf, min(4, len)); in ide_pad_transfer()