Lines Matching refs:hostdata
39 ioread8(hostdata->io + hostdata->offset + (reg))
41 iowrite8(value, hostdata->io + hostdata->offset + (reg))
117 struct NCR5380_hostdata *hostdata = shost_priv(instance); in g_NCR5380_trigger_irq() local
129 NCR5380_write(SELECT_ENABLE_REG, hostdata->id_mask); in g_NCR5380_trigger_irq()
130 NCR5380_write(OUTPUT_DATA_REG, hostdata->id_mask); in g_NCR5380_trigger_irq()
151 struct NCR5380_hostdata *hostdata = shost_priv(instance); in g_NCR5380_probe_irq() local
234 struct NCR5380_hostdata *hostdata; in generic_NCR5380_init_one() local
319 hostdata = shost_priv(instance); in generic_NCR5380_init_one()
321 hostdata->board = board; in generic_NCR5380_init_one()
322 hostdata->io = iomem; in generic_NCR5380_init_one()
323 hostdata->region_size = region_size; in generic_NCR5380_init_one()
326 hostdata->io_port = base; in generic_NCR5380_init_one()
327 hostdata->io_width = 1; /* 8-bit PDMA by default */ in generic_NCR5380_init_one()
328 hostdata->offset = 0; in generic_NCR5380_init_one()
336 hostdata->io_port += 8; in generic_NCR5380_init_one()
337 hostdata->c400_ctl_status = 0; in generic_NCR5380_init_one()
338 hostdata->c400_blk_cnt = 1; in generic_NCR5380_init_one()
339 hostdata->c400_host_buf = 4; in generic_NCR5380_init_one()
342 hostdata->io_width = 2; /* 16-bit PDMA */ in generic_NCR5380_init_one()
346 hostdata->c400_ctl_status = 9; in generic_NCR5380_init_one()
347 hostdata->c400_blk_cnt = 10; in generic_NCR5380_init_one()
348 hostdata->c400_host_buf = 8; in generic_NCR5380_init_one()
352 hostdata->base = base; in generic_NCR5380_init_one()
353 hostdata->offset = NCR53C400_mem_base; in generic_NCR5380_init_one()
356 hostdata->c400_ctl_status = 0x100; in generic_NCR5380_init_one()
357 hostdata->c400_blk_cnt = 0x101; in generic_NCR5380_init_one()
358 hostdata->c400_host_buf = 0x104; in generic_NCR5380_init_one()
385 NCR5380_write(hostdata->c400_ctl_status, CSR_BASE); in generic_NCR5380_init_one()
468 struct NCR5380_hostdata *hostdata = shost_priv(instance); in generic_NCR5380_release_resources() local
469 void __iomem *iomem = hostdata->io; in generic_NCR5380_release_resources()
470 unsigned long io_port = hostdata->io_port; in generic_NCR5380_release_resources()
471 unsigned long base = hostdata->base; in generic_NCR5380_release_resources()
472 unsigned long region_size = hostdata->region_size; in generic_NCR5380_release_resources()
493 static void wait_for_53c80_access(struct NCR5380_hostdata *hostdata) in wait_for_53c80_access() argument
498 if (hostdata->board == BOARD_DTC3181E) in wait_for_53c80_access()
500 if (NCR5380_read(hostdata->c400_ctl_status) & CSR_53C80_REG) in wait_for_53c80_access()
504 scmd_printk(KERN_ERR, hostdata->connected, in wait_for_53c80_access()
506 NCR5380_write(hostdata->c400_ctl_status, CSR_RESET); in wait_for_53c80_access()
507 NCR5380_write(hostdata->c400_ctl_status, CSR_BASE); in wait_for_53c80_access()
519 static inline int generic_NCR5380_precv(struct NCR5380_hostdata *hostdata, in generic_NCR5380_precv() argument
525 NCR5380_write(hostdata->c400_ctl_status, CSR_BASE | CSR_TRANS_DIR); in generic_NCR5380_precv()
526 NCR5380_write(hostdata->c400_blk_cnt, len / 128); in generic_NCR5380_precv()
531 if (NCR5380_poll_politely(hostdata, hostdata->c400_ctl_status, in generic_NCR5380_precv()
535 if (NCR5380_poll_politely2(hostdata, hostdata->c400_ctl_status, in generic_NCR5380_precv()
537 hostdata->c400_ctl_status, in generic_NCR5380_precv()
540 NCR5380_read(hostdata->c400_ctl_status) & CSR_HOST_BUF_NOT_RDY) in generic_NCR5380_precv()
544 if (hostdata->io_port && hostdata->io_width == 2) in generic_NCR5380_precv()
545 insw(hostdata->io_port + hostdata->c400_host_buf, in generic_NCR5380_precv()
547 else if (hostdata->io_port) in generic_NCR5380_precv()
548 insb(hostdata->io_port + hostdata->c400_host_buf, in generic_NCR5380_precv()
552 hostdata->io + NCR53C400_host_buffer, 128); in generic_NCR5380_precv()
560 NCR5380_write(hostdata->c400_ctl_status, CSR_RESET); in generic_NCR5380_precv()
561 NCR5380_write(hostdata->c400_ctl_status, CSR_BASE); in generic_NCR5380_precv()
563 wait_for_53c80_access(hostdata); in generic_NCR5380_precv()
565 if (residual == 0 && NCR5380_poll_politely(hostdata, BUS_AND_STATUS_REG, in generic_NCR5380_precv()
569 scmd_printk(KERN_ERR, hostdata->connected, "%s: End of DMA timeout\n", in generic_NCR5380_precv()
572 hostdata->pdma_residual = residual; in generic_NCR5380_precv()
586 static inline int generic_NCR5380_psend(struct NCR5380_hostdata *hostdata, in generic_NCR5380_psend() argument
592 NCR5380_write(hostdata->c400_ctl_status, CSR_BASE); in generic_NCR5380_psend()
593 NCR5380_write(hostdata->c400_blk_cnt, len / 128); in generic_NCR5380_psend()
596 if (NCR5380_poll_politely2(hostdata, hostdata->c400_ctl_status, in generic_NCR5380_psend()
598 hostdata->c400_ctl_status, in generic_NCR5380_psend()
601 NCR5380_read(hostdata->c400_ctl_status) & CSR_HOST_BUF_NOT_RDY) { in generic_NCR5380_psend()
610 if (start >= len && NCR5380_read(hostdata->c400_blk_cnt) == 0) in generic_NCR5380_psend()
613 if (NCR5380_read(hostdata->c400_ctl_status) & CSR_GATED_53C80_IRQ) { in generic_NCR5380_psend()
623 if (hostdata->io_port && hostdata->io_width == 2) in generic_NCR5380_psend()
624 outsw(hostdata->io_port + hostdata->c400_host_buf, in generic_NCR5380_psend()
626 else if (hostdata->io_port) in generic_NCR5380_psend()
627 outsb(hostdata->io_port + hostdata->c400_host_buf, in generic_NCR5380_psend()
630 memcpy_toio(hostdata->io + NCR53C400_host_buffer, in generic_NCR5380_psend()
639 NCR5380_write(hostdata->c400_ctl_status, CSR_RESET); in generic_NCR5380_psend()
640 NCR5380_write(hostdata->c400_ctl_status, CSR_BASE); in generic_NCR5380_psend()
642 wait_for_53c80_access(hostdata); in generic_NCR5380_psend()
645 if (NCR5380_poll_politely(hostdata, TARGET_COMMAND_REG, in generic_NCR5380_psend()
648 scmd_printk(KERN_ERR, hostdata->connected, in generic_NCR5380_psend()
651 if (NCR5380_poll_politely(hostdata, BUS_AND_STATUS_REG, in generic_NCR5380_psend()
654 scmd_printk(KERN_ERR, hostdata->connected, "%s: End of DMA timeout\n", in generic_NCR5380_psend()
658 hostdata->pdma_residual = residual; in generic_NCR5380_psend()
663 static int generic_NCR5380_dma_xfer_len(struct NCR5380_hostdata *hostdata, in generic_NCR5380_dma_xfer_len() argument
668 if (hostdata->flags & FLAG_NO_PSEUDO_DMA) in generic_NCR5380_dma_xfer_len()
676 if (hostdata->board == BOARD_DTC3181E && in generic_NCR5380_dma_xfer_len()
683 static int generic_NCR5380_dma_residual(struct NCR5380_hostdata *hostdata) in generic_NCR5380_dma_residual() argument
685 return hostdata->pdma_residual; in generic_NCR5380_dma_residual()