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()
469 if (ide_lock_host(host, hwif)) in do_ide_request()
472 spin_lock_irq(&hwif->lock); in do_ide_request()
474 if (!ide_lock_port(hwif)) { in do_ide_request()
477 WARN_ON_ONCE(hwif->rq); in do_ide_request()
479 prev_port = hwif->host->cur_port; in do_ide_request()
482 ide_unlock_port(hwif); in do_ide_request()
486 if ((hwif->host->host_flags & IDE_HFLAG_SERIALIZE) && in do_ide_request()
487 hwif != prev_port) { in do_ide_request()
501 hwif->host->cur_port = hwif; in do_ide_request()
503 hwif->cur_dev = drive; in do_ide_request()
506 spin_unlock_irq(&hwif->lock); in do_ide_request()
516 spin_lock_irq(&hwif->lock); in do_ide_request()
519 ide_unlock_port(hwif); in do_ide_request()
540 ide_unlock_port(hwif); in do_ide_request()
545 hwif->rq = rq; in do_ide_request()
547 spin_unlock_irq(&hwif->lock); in do_ide_request()
549 spin_lock_irq(&hwif->lock); in do_ide_request()
552 rq = hwif->rq; in do_ide_request()
553 hwif->rq = NULL; in do_ide_request()
559 spin_unlock_irq(&hwif->lock); in do_ide_request()
566 spin_unlock_irq(&hwif->lock); in do_ide_request()
575 ide_hwif_t *hwif = drive->hwif; in drive_is_ready() local
579 return hwif->dma_ops->dma_test_irq(drive); in drive_is_ready()
581 if (hwif->io_ports.ctl_addr && in drive_is_ready()
582 (hwif->host_flags & IDE_HFLAG_BROKEN_ALTSTATUS) == 0) in drive_is_ready()
583 stat = hwif->tp_ops->read_altstatus(hwif); in drive_is_ready()
586 stat = hwif->tp_ops->read_status(hwif); in drive_is_ready()
612 ide_hwif_t *hwif = from_timer(hwif, t, timer); in ide_timer_expiry() local
620 spin_lock_irqsave(&hwif->lock, flags); in ide_timer_expiry()
622 handler = hwif->handler; in ide_timer_expiry()
624 if (handler == NULL || hwif->req_gen != hwif->req_gen_timer) { in ide_timer_expiry()
632 ide_expiry_t *expiry = hwif->expiry; in ide_timer_expiry()
635 drive = hwif->cur_dev; in ide_timer_expiry()
641 hwif->timer.expires = jiffies + wait; in ide_timer_expiry()
642 hwif->req_gen_timer = hwif->req_gen; in ide_timer_expiry()
643 add_timer(&hwif->timer); in ide_timer_expiry()
644 spin_unlock_irqrestore(&hwif->lock, flags); in ide_timer_expiry()
648 hwif->handler = NULL; in ide_timer_expiry()
649 hwif->expiry = NULL; in ide_timer_expiry()
655 spin_unlock(&hwif->lock); in ide_timer_expiry()
657 disable_irq(hwif->irq); in ide_timer_expiry()
659 if (hwif->polling) { in ide_timer_expiry()
663 hwif->dma_ops->dma_lost_irq(drive); in ide_timer_expiry()
664 if (hwif->port_ops && hwif->port_ops->clear_irq) in ide_timer_expiry()
665 hwif->port_ops->clear_irq(drive); in ide_timer_expiry()
675 hwif->tp_ops->read_status(hwif)); in ide_timer_expiry()
678 spin_lock_irq(&hwif->lock); in ide_timer_expiry()
679 enable_irq(hwif->irq); in ide_timer_expiry()
680 if (startstop == ide_stopped && hwif->polling == 0) { in ide_timer_expiry()
681 rq_in_flight = hwif->rq; in ide_timer_expiry()
682 hwif->rq = NULL; in ide_timer_expiry()
683 ide_unlock_port(hwif); in ide_timer_expiry()
687 spin_unlock_irqrestore(&hwif->lock, flags); in ide_timer_expiry()
690 ide_unlock_host(hwif->host); in ide_timer_expiry()
724 static void unexpected_intr(int irq, ide_hwif_t *hwif) in unexpected_intr() argument
726 u8 stat = hwif->tp_ops->read_status(hwif); in unexpected_intr()
737 hwif->name, stat, count); in unexpected_intr()
769 ide_hwif_t *hwif = (ide_hwif_t *)dev_id; in ide_intr() local
770 struct ide_host *host = hwif->host; in ide_intr()
780 if (hwif != host->cur_port) in ide_intr()
784 spin_lock_irqsave(&hwif->lock, flags); in ide_intr()
786 if (hwif->port_ops && hwif->port_ops->test_irq && in ide_intr()
787 hwif->port_ops->test_irq(hwif) == 0) in ide_intr()
790 handler = hwif->handler; in ide_intr()
792 if (handler == NULL || hwif->polling) { in ide_intr()
810 unexpected_intr(irq, hwif); in ide_intr()
816 (void)hwif->tp_ops->read_status(hwif); in ide_intr()
821 drive = hwif->cur_dev; in ide_intr()
833 hwif->handler = NULL; in ide_intr()
834 hwif->expiry = NULL; in ide_intr()
835 hwif->req_gen++; in ide_intr()
836 del_timer(&hwif->timer); in ide_intr()
837 spin_unlock(&hwif->lock); in ide_intr()
839 if (hwif->port_ops && hwif->port_ops->clear_irq) in ide_intr()
840 hwif->port_ops->clear_irq(drive); in ide_intr()
848 spin_lock_irq(&hwif->lock); in ide_intr()
856 if (startstop == ide_stopped && hwif->polling == 0) { in ide_intr()
857 BUG_ON(hwif->handler); in ide_intr()
858 rq_in_flight = hwif->rq; in ide_intr()
859 hwif->rq = NULL; in ide_intr()
860 ide_unlock_port(hwif); in ide_intr()
865 spin_unlock_irqrestore(&hwif->lock, flags); in ide_intr()
868 ide_unlock_host(hwif->host); in ide_intr()
878 ide_hwif_t *hwif = drive->hwif; in ide_pad_transfer() local
883 hwif->tp_ops->output_data(drive, NULL, buf, min(4, len)); in ide_pad_transfer()
885 hwif->tp_ops->input_data(drive, NULL, buf, min(4, len)); in ide_pad_transfer()