Lines Matching refs:hwif

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