Lines Matching refs:hostdata
39 ioread8(hostdata->io + hostdata->offset + (reg))
41 iowrite8(value, hostdata->io + hostdata->offset + (reg))
118 struct NCR5380_hostdata *hostdata = shost_priv(instance); in g_NCR5380_trigger_irq() local
130 NCR5380_write(SELECT_ENABLE_REG, hostdata->id_mask); in g_NCR5380_trigger_irq()
131 NCR5380_write(OUTPUT_DATA_REG, hostdata->id_mask); in g_NCR5380_trigger_irq()
152 struct NCR5380_hostdata *hostdata = shost_priv(instance); in g_NCR5380_probe_irq() local
235 struct NCR5380_hostdata *hostdata; in generic_NCR5380_init_one() local
320 hostdata = shost_priv(instance); in generic_NCR5380_init_one()
322 hostdata->board = board; in generic_NCR5380_init_one()
323 hostdata->io = iomem; in generic_NCR5380_init_one()
324 hostdata->region_size = region_size; in generic_NCR5380_init_one()
327 hostdata->io_port = base; in generic_NCR5380_init_one()
328 hostdata->io_width = 1; /* 8-bit PDMA by default */ in generic_NCR5380_init_one()
329 hostdata->offset = 0; in generic_NCR5380_init_one()
337 hostdata->io_port += 8; in generic_NCR5380_init_one()
338 hostdata->c400_ctl_status = 0; in generic_NCR5380_init_one()
339 hostdata->c400_blk_cnt = 1; in generic_NCR5380_init_one()
340 hostdata->c400_host_buf = 4; in generic_NCR5380_init_one()
343 hostdata->io_width = 2; /* 16-bit PDMA */ in generic_NCR5380_init_one()
347 hostdata->c400_ctl_status = 9; in generic_NCR5380_init_one()
348 hostdata->c400_blk_cnt = 10; in generic_NCR5380_init_one()
349 hostdata->c400_host_buf = 8; in generic_NCR5380_init_one()
353 hostdata->base = base; in generic_NCR5380_init_one()
354 hostdata->offset = NCR53C400_mem_base; in generic_NCR5380_init_one()
357 hostdata->c400_ctl_status = 0x100; in generic_NCR5380_init_one()
358 hostdata->c400_blk_cnt = 0x101; in generic_NCR5380_init_one()
359 hostdata->c400_host_buf = 0x104; in generic_NCR5380_init_one()
386 NCR5380_write(hostdata->c400_ctl_status, CSR_BASE); in generic_NCR5380_init_one()
469 struct NCR5380_hostdata *hostdata = shost_priv(instance); in generic_NCR5380_release_resources() local
470 void __iomem *iomem = hostdata->io; in generic_NCR5380_release_resources()
471 unsigned long io_port = hostdata->io_port; in generic_NCR5380_release_resources()
472 unsigned long base = hostdata->base; in generic_NCR5380_release_resources()
473 unsigned long region_size = hostdata->region_size; in generic_NCR5380_release_resources()
494 static void wait_for_53c80_access(struct NCR5380_hostdata *hostdata) in wait_for_53c80_access() argument
499 if (hostdata->board == BOARD_DTC3181E) in wait_for_53c80_access()
501 if (NCR5380_read(hostdata->c400_ctl_status) & CSR_53C80_REG) in wait_for_53c80_access()
505 scmd_printk(KERN_ERR, hostdata->connected, in wait_for_53c80_access()
507 NCR5380_write(hostdata->c400_ctl_status, CSR_RESET); in wait_for_53c80_access()
508 NCR5380_write(hostdata->c400_ctl_status, CSR_BASE); in wait_for_53c80_access()
520 static inline int generic_NCR5380_precv(struct NCR5380_hostdata *hostdata, in generic_NCR5380_precv() argument
526 NCR5380_write(hostdata->c400_ctl_status, CSR_BASE | CSR_TRANS_DIR); in generic_NCR5380_precv()
527 NCR5380_write(hostdata->c400_blk_cnt, len / 128); in generic_NCR5380_precv()
532 if (NCR5380_poll_politely(hostdata, hostdata->c400_ctl_status, in generic_NCR5380_precv()
536 if (NCR5380_poll_politely2(hostdata, hostdata->c400_ctl_status, in generic_NCR5380_precv()
538 hostdata->c400_ctl_status, in generic_NCR5380_precv()
541 NCR5380_read(hostdata->c400_ctl_status) & CSR_HOST_BUF_NOT_RDY) in generic_NCR5380_precv()
545 if (hostdata->io_port && hostdata->io_width == 2) in generic_NCR5380_precv()
546 insw(hostdata->io_port + hostdata->c400_host_buf, in generic_NCR5380_precv()
548 else if (hostdata->io_port) in generic_NCR5380_precv()
549 insb(hostdata->io_port + hostdata->c400_host_buf, in generic_NCR5380_precv()
553 hostdata->io + NCR53C400_host_buffer, 128); in generic_NCR5380_precv()
561 NCR5380_write(hostdata->c400_ctl_status, CSR_RESET); in generic_NCR5380_precv()
562 NCR5380_write(hostdata->c400_ctl_status, CSR_BASE); in generic_NCR5380_precv()
564 wait_for_53c80_access(hostdata); in generic_NCR5380_precv()
566 if (residual == 0 && NCR5380_poll_politely(hostdata, BUS_AND_STATUS_REG, in generic_NCR5380_precv()
570 scmd_printk(KERN_ERR, hostdata->connected, "%s: End of DMA timeout\n", in generic_NCR5380_precv()
573 hostdata->pdma_residual = residual; in generic_NCR5380_precv()
587 static inline int generic_NCR5380_psend(struct NCR5380_hostdata *hostdata, in generic_NCR5380_psend() argument
593 NCR5380_write(hostdata->c400_ctl_status, CSR_BASE); in generic_NCR5380_psend()
594 NCR5380_write(hostdata->c400_blk_cnt, len / 128); in generic_NCR5380_psend()
597 if (NCR5380_poll_politely2(hostdata, hostdata->c400_ctl_status, in generic_NCR5380_psend()
599 hostdata->c400_ctl_status, in generic_NCR5380_psend()
602 NCR5380_read(hostdata->c400_ctl_status) & CSR_HOST_BUF_NOT_RDY) { in generic_NCR5380_psend()
611 if (start >= len && NCR5380_read(hostdata->c400_blk_cnt) == 0) in generic_NCR5380_psend()
614 if (NCR5380_read(hostdata->c400_ctl_status) & CSR_GATED_53C80_IRQ) { in generic_NCR5380_psend()
624 if (hostdata->io_port && hostdata->io_width == 2) in generic_NCR5380_psend()
625 outsw(hostdata->io_port + hostdata->c400_host_buf, in generic_NCR5380_psend()
627 else if (hostdata->io_port) in generic_NCR5380_psend()
628 outsb(hostdata->io_port + hostdata->c400_host_buf, in generic_NCR5380_psend()
631 memcpy_toio(hostdata->io + NCR53C400_host_buffer, in generic_NCR5380_psend()
640 NCR5380_write(hostdata->c400_ctl_status, CSR_RESET); in generic_NCR5380_psend()
641 NCR5380_write(hostdata->c400_ctl_status, CSR_BASE); in generic_NCR5380_psend()
643 wait_for_53c80_access(hostdata); in generic_NCR5380_psend()
646 if (NCR5380_poll_politely(hostdata, TARGET_COMMAND_REG, in generic_NCR5380_psend()
649 scmd_printk(KERN_ERR, hostdata->connected, in generic_NCR5380_psend()
652 if (NCR5380_poll_politely(hostdata, BUS_AND_STATUS_REG, in generic_NCR5380_psend()
655 scmd_printk(KERN_ERR, hostdata->connected, "%s: End of DMA timeout\n", in generic_NCR5380_psend()
659 hostdata->pdma_residual = residual; in generic_NCR5380_psend()
664 static int generic_NCR5380_dma_xfer_len(struct NCR5380_hostdata *hostdata, in generic_NCR5380_dma_xfer_len() argument
669 if (hostdata->flags & FLAG_NO_PSEUDO_DMA) in generic_NCR5380_dma_xfer_len()
677 if (hostdata->board == BOARD_DTC3181E && in generic_NCR5380_dma_xfer_len()
684 static int generic_NCR5380_dma_residual(struct NCR5380_hostdata *hostdata) in generic_NCR5380_dma_residual() argument
686 return hostdata->pdma_residual; in generic_NCR5380_dma_residual()