Lines Matching refs:hostdata
38 ioread8(hostdata->io + hostdata->offset + (reg))
40 iowrite8(value, hostdata->io + hostdata->offset + (reg))
116 struct NCR5380_hostdata *hostdata = shost_priv(instance); in g_NCR5380_trigger_irq() local
128 NCR5380_write(SELECT_ENABLE_REG, hostdata->id_mask); in g_NCR5380_trigger_irq()
129 NCR5380_write(OUTPUT_DATA_REG, hostdata->id_mask); in g_NCR5380_trigger_irq()
150 struct NCR5380_hostdata *hostdata = shost_priv(instance); in g_NCR5380_probe_irq() local
233 struct NCR5380_hostdata *hostdata; in generic_NCR5380_init_one() local
318 hostdata = shost_priv(instance); in generic_NCR5380_init_one()
320 hostdata->board = board; in generic_NCR5380_init_one()
321 hostdata->io = iomem; in generic_NCR5380_init_one()
322 hostdata->region_size = region_size; in generic_NCR5380_init_one()
325 hostdata->io_port = base; in generic_NCR5380_init_one()
326 hostdata->io_width = 1; /* 8-bit PDMA by default */ in generic_NCR5380_init_one()
327 hostdata->offset = 0; in generic_NCR5380_init_one()
335 hostdata->io_port += 8; in generic_NCR5380_init_one()
336 hostdata->c400_ctl_status = 0; in generic_NCR5380_init_one()
337 hostdata->c400_blk_cnt = 1; in generic_NCR5380_init_one()
338 hostdata->c400_host_buf = 4; in generic_NCR5380_init_one()
341 hostdata->io_width = 2; /* 16-bit PDMA */ in generic_NCR5380_init_one()
345 hostdata->c400_ctl_status = 9; in generic_NCR5380_init_one()
346 hostdata->c400_blk_cnt = 10; in generic_NCR5380_init_one()
347 hostdata->c400_host_buf = 8; in generic_NCR5380_init_one()
351 hostdata->base = base; in generic_NCR5380_init_one()
352 hostdata->offset = NCR53C400_mem_base; in generic_NCR5380_init_one()
355 hostdata->c400_ctl_status = 0x100; in generic_NCR5380_init_one()
356 hostdata->c400_blk_cnt = 0x101; in generic_NCR5380_init_one()
357 hostdata->c400_host_buf = 0x104; in generic_NCR5380_init_one()
384 NCR5380_write(hostdata->c400_ctl_status, CSR_BASE); in generic_NCR5380_init_one()
467 struct NCR5380_hostdata *hostdata = shost_priv(instance); in generic_NCR5380_release_resources() local
468 void __iomem *iomem = hostdata->io; in generic_NCR5380_release_resources()
469 unsigned long io_port = hostdata->io_port; in generic_NCR5380_release_resources()
470 unsigned long base = hostdata->base; in generic_NCR5380_release_resources()
471 unsigned long region_size = hostdata->region_size; in generic_NCR5380_release_resources()
492 static void wait_for_53c80_access(struct NCR5380_hostdata *hostdata) in wait_for_53c80_access() argument
497 if (hostdata->board == BOARD_DTC3181E) in wait_for_53c80_access()
499 if (NCR5380_read(hostdata->c400_ctl_status) & CSR_53C80_REG) in wait_for_53c80_access()
503 scmd_printk(KERN_ERR, hostdata->connected, in wait_for_53c80_access()
505 NCR5380_write(hostdata->c400_ctl_status, CSR_RESET); in wait_for_53c80_access()
506 NCR5380_write(hostdata->c400_ctl_status, CSR_BASE); in wait_for_53c80_access()
518 static inline int generic_NCR5380_precv(struct NCR5380_hostdata *hostdata, in generic_NCR5380_precv() argument
524 NCR5380_write(hostdata->c400_ctl_status, CSR_BASE | CSR_TRANS_DIR); in generic_NCR5380_precv()
525 NCR5380_write(hostdata->c400_blk_cnt, len / 128); in generic_NCR5380_precv()
530 if (NCR5380_poll_politely(hostdata, hostdata->c400_ctl_status, in generic_NCR5380_precv()
534 if (NCR5380_poll_politely2(hostdata, hostdata->c400_ctl_status, in generic_NCR5380_precv()
536 hostdata->c400_ctl_status, in generic_NCR5380_precv()
539 NCR5380_read(hostdata->c400_ctl_status) & CSR_HOST_BUF_NOT_RDY) in generic_NCR5380_precv()
543 if (hostdata->io_port && hostdata->io_width == 2) in generic_NCR5380_precv()
544 insw(hostdata->io_port + hostdata->c400_host_buf, in generic_NCR5380_precv()
546 else if (hostdata->io_port) in generic_NCR5380_precv()
547 insb(hostdata->io_port + hostdata->c400_host_buf, in generic_NCR5380_precv()
551 hostdata->io + NCR53C400_host_buffer, 128); in generic_NCR5380_precv()
559 NCR5380_write(hostdata->c400_ctl_status, CSR_RESET); in generic_NCR5380_precv()
560 NCR5380_write(hostdata->c400_ctl_status, CSR_BASE); in generic_NCR5380_precv()
562 wait_for_53c80_access(hostdata); in generic_NCR5380_precv()
564 if (residual == 0 && NCR5380_poll_politely(hostdata, BUS_AND_STATUS_REG, in generic_NCR5380_precv()
568 scmd_printk(KERN_ERR, hostdata->connected, "%s: End of DMA timeout\n", in generic_NCR5380_precv()
571 hostdata->pdma_residual = residual; in generic_NCR5380_precv()
585 static inline int generic_NCR5380_psend(struct NCR5380_hostdata *hostdata, in generic_NCR5380_psend() argument
591 NCR5380_write(hostdata->c400_ctl_status, CSR_BASE); in generic_NCR5380_psend()
592 NCR5380_write(hostdata->c400_blk_cnt, len / 128); in generic_NCR5380_psend()
595 if (NCR5380_poll_politely2(hostdata, hostdata->c400_ctl_status, in generic_NCR5380_psend()
597 hostdata->c400_ctl_status, in generic_NCR5380_psend()
600 NCR5380_read(hostdata->c400_ctl_status) & CSR_HOST_BUF_NOT_RDY) { in generic_NCR5380_psend()
609 if (start >= len && NCR5380_read(hostdata->c400_blk_cnt) == 0) in generic_NCR5380_psend()
612 if (NCR5380_read(hostdata->c400_ctl_status) & CSR_GATED_53C80_IRQ) { in generic_NCR5380_psend()
622 if (hostdata->io_port && hostdata->io_width == 2) in generic_NCR5380_psend()
623 outsw(hostdata->io_port + hostdata->c400_host_buf, in generic_NCR5380_psend()
625 else if (hostdata->io_port) in generic_NCR5380_psend()
626 outsb(hostdata->io_port + hostdata->c400_host_buf, in generic_NCR5380_psend()
629 memcpy_toio(hostdata->io + NCR53C400_host_buffer, in generic_NCR5380_psend()
638 NCR5380_write(hostdata->c400_ctl_status, CSR_RESET); in generic_NCR5380_psend()
639 NCR5380_write(hostdata->c400_ctl_status, CSR_BASE); in generic_NCR5380_psend()
641 wait_for_53c80_access(hostdata); in generic_NCR5380_psend()
644 if (NCR5380_poll_politely(hostdata, TARGET_COMMAND_REG, in generic_NCR5380_psend()
647 scmd_printk(KERN_ERR, hostdata->connected, in generic_NCR5380_psend()
650 if (NCR5380_poll_politely(hostdata, BUS_AND_STATUS_REG, in generic_NCR5380_psend()
653 scmd_printk(KERN_ERR, hostdata->connected, "%s: End of DMA timeout\n", in generic_NCR5380_psend()
657 hostdata->pdma_residual = residual; in generic_NCR5380_psend()
662 static int generic_NCR5380_dma_xfer_len(struct NCR5380_hostdata *hostdata, in generic_NCR5380_dma_xfer_len() argument
667 if (hostdata->flags & FLAG_NO_PSEUDO_DMA) in generic_NCR5380_dma_xfer_len()
675 if (hostdata->board == BOARD_DTC3181E && in generic_NCR5380_dma_xfer_len()
682 static int generic_NCR5380_dma_residual(struct NCR5380_hostdata *hostdata) in generic_NCR5380_dma_residual() argument
684 return hostdata->pdma_residual; in generic_NCR5380_dma_residual()