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, *last_sg = NULL; in ide_map_sg()
325 drive->hwif->name, (unsigned long) rq); in start_request()
340 drive->hwif->tp_ops->dev_select(drive); in start_request()
409 static inline int ide_lock_port(ide_hwif_t *hwif) in ide_lock_port() argument
411 if (hwif->busy) in ide_lock_port()
414 hwif->busy = 1; in ide_lock_port()
419 static inline void ide_unlock_port(ide_hwif_t *hwif) in ide_unlock_port() argument
421 hwif->busy = 0; in ide_unlock_port()
424 static inline int ide_lock_host(struct ide_host *host, ide_hwif_t *hwif) in ide_lock_host() argument
432 host->get_lock(ide_intr, hwif); in ide_lock_host()
462 ide_hwif_t *hwif = drive->hwif; in ide_issue_rq() local
463 struct ide_host *host = hwif->host; in ide_issue_rq()
474 if (ide_lock_host(host, hwif)) in ide_issue_rq()
477 spin_lock_irq(&hwif->lock); in ide_issue_rq()
479 if (!ide_lock_port(hwif)) { in ide_issue_rq()
482 WARN_ON_ONCE(hwif->rq); in ide_issue_rq()
484 prev_port = hwif->host->cur_port; in ide_issue_rq()
487 ide_unlock_port(hwif); in ide_issue_rq()
491 if ((hwif->host->host_flags & IDE_HFLAG_SERIALIZE) && in ide_issue_rq()
492 hwif != prev_port) { in ide_issue_rq()
506 hwif->host->cur_port = hwif; in ide_issue_rq()
508 hwif->cur_dev = drive; in ide_issue_rq()
523 ide_unlock_port(hwif); in ide_issue_rq()
528 hwif->rq = rq; in ide_issue_rq()
530 spin_unlock_irq(&hwif->lock); in ide_issue_rq()
532 spin_lock_irq(&hwif->lock); in ide_issue_rq()
535 rq = hwif->rq; in ide_issue_rq()
536 hwif->rq = NULL; in ide_issue_rq()
539 ide_unlock_port(hwif); in ide_issue_rq()
546 spin_unlock_irq(&hwif->lock); in ide_issue_rq()
554 spin_unlock_irq(&hwif->lock); in ide_issue_rq()
567 ide_hwif_t *hwif = drive->hwif; in ide_queue_rq() local
569 spin_lock_irq(&hwif->lock); in ide_queue_rq()
571 spin_unlock_irq(&hwif->lock); in ide_queue_rq()
574 spin_unlock_irq(&hwif->lock); in ide_queue_rq()
582 ide_hwif_t *hwif = drive->hwif; in drive_is_ready() local
586 return hwif->dma_ops->dma_test_irq(drive); in drive_is_ready()
588 if (hwif->io_ports.ctl_addr && in drive_is_ready()
589 (hwif->host_flags & IDE_HFLAG_BROKEN_ALTSTATUS) == 0) in drive_is_ready()
590 stat = hwif->tp_ops->read_altstatus(hwif); in drive_is_ready()
593 stat = hwif->tp_ops->read_status(hwif); in drive_is_ready()
619 ide_hwif_t *hwif = from_timer(hwif, t, timer); in ide_timer_expiry() local
627 spin_lock_irqsave(&hwif->lock, flags); in ide_timer_expiry()
629 handler = hwif->handler; in ide_timer_expiry()
631 if (handler == NULL || hwif->req_gen != hwif->req_gen_timer) { in ide_timer_expiry()
639 ide_expiry_t *expiry = hwif->expiry; in ide_timer_expiry()
642 drive = hwif->cur_dev; in ide_timer_expiry()
648 hwif->timer.expires = jiffies + wait; in ide_timer_expiry()
649 hwif->req_gen_timer = hwif->req_gen; in ide_timer_expiry()
650 add_timer(&hwif->timer); in ide_timer_expiry()
651 spin_unlock_irqrestore(&hwif->lock, flags); in ide_timer_expiry()
655 hwif->handler = NULL; in ide_timer_expiry()
656 hwif->expiry = NULL; in ide_timer_expiry()
662 spin_unlock(&hwif->lock); in ide_timer_expiry()
664 disable_irq(hwif->irq); in ide_timer_expiry()
666 if (hwif->polling) { in ide_timer_expiry()
670 hwif->dma_ops->dma_lost_irq(drive); in ide_timer_expiry()
671 if (hwif->port_ops && hwif->port_ops->clear_irq) in ide_timer_expiry()
672 hwif->port_ops->clear_irq(drive); in ide_timer_expiry()
682 hwif->tp_ops->read_status(hwif)); in ide_timer_expiry()
685 spin_lock_irq(&hwif->lock); in ide_timer_expiry()
686 enable_irq(hwif->irq); in ide_timer_expiry()
687 if (startstop == ide_stopped && hwif->polling == 0) { in ide_timer_expiry()
688 rq_in_flight = hwif->rq; in ide_timer_expiry()
689 hwif->rq = NULL; in ide_timer_expiry()
690 ide_unlock_port(hwif); in ide_timer_expiry()
694 spin_unlock_irqrestore(&hwif->lock, flags); in ide_timer_expiry()
697 ide_unlock_host(hwif->host); in ide_timer_expiry()
731 static void unexpected_intr(int irq, ide_hwif_t *hwif) in unexpected_intr() argument
733 u8 stat = hwif->tp_ops->read_status(hwif); in unexpected_intr()
744 hwif->name, stat, count); in unexpected_intr()
776 ide_hwif_t *hwif = (ide_hwif_t *)dev_id; in ide_intr() local
777 struct ide_host *host = hwif->host; in ide_intr()
787 if (hwif != host->cur_port) in ide_intr()
791 spin_lock_irqsave(&hwif->lock, flags); in ide_intr()
793 if (hwif->port_ops && hwif->port_ops->test_irq && in ide_intr()
794 hwif->port_ops->test_irq(hwif) == 0) in ide_intr()
797 handler = hwif->handler; in ide_intr()
799 if (handler == NULL || hwif->polling) { in ide_intr()
817 unexpected_intr(irq, hwif); in ide_intr()
823 (void)hwif->tp_ops->read_status(hwif); in ide_intr()
828 drive = hwif->cur_dev; in ide_intr()
840 hwif->handler = NULL; in ide_intr()
841 hwif->expiry = NULL; in ide_intr()
842 hwif->req_gen++; in ide_intr()
843 del_timer(&hwif->timer); in ide_intr()
844 spin_unlock(&hwif->lock); in ide_intr()
846 if (hwif->port_ops && hwif->port_ops->clear_irq) in ide_intr()
847 hwif->port_ops->clear_irq(drive); in ide_intr()
855 spin_lock_irq(&hwif->lock); in ide_intr()
863 if (startstop == ide_stopped && hwif->polling == 0) { in ide_intr()
864 BUG_ON(hwif->handler); in ide_intr()
865 rq_in_flight = hwif->rq; in ide_intr()
866 hwif->rq = NULL; in ide_intr()
867 ide_unlock_port(hwif); in ide_intr()
872 spin_unlock_irqrestore(&hwif->lock, flags); in ide_intr()
875 ide_unlock_host(hwif->host); in ide_intr()
885 ide_hwif_t *hwif = drive->hwif; in ide_pad_transfer() local
890 hwif->tp_ops->output_data(drive, NULL, buf, min(4, len)); in ide_pad_transfer()
892 hwif->tp_ops->input_data(drive, NULL, buf, min(4, len)); in ide_pad_transfer()