Lines Matching refs:hostdata

38 #define NCR5380_read(reg)           in_8(hostdata->io + ((reg) << 4))
39 #define NCR5380_write(reg, value) out_8(hostdata->io + ((reg) << 4), value)
272 static inline void write_ctrl_reg(struct NCR5380_hostdata *hostdata, u32 value) in write_ctrl_reg() argument
274 out_be32(hostdata->io + (CTRL_REG << 4), value); in write_ctrl_reg()
277 static inline int macscsi_pread(struct NCR5380_hostdata *hostdata, in macscsi_pread() argument
280 u8 __iomem *s = hostdata->pdma_io + (INPUT_DATA_REG << 4); in macscsi_pread()
284 hostdata->pdma_residual = len; in macscsi_pread()
286 while (!NCR5380_poll_politely(hostdata, BUS_AND_STATUS_REG, in macscsi_pread()
292 write_ctrl_reg(hostdata, CTRL_HANDSHAKE_MODE | in macscsi_pread()
295 bytes = mac_pdma_recv(s, d, min(hostdata->pdma_residual, 512)); in macscsi_pread()
299 hostdata->pdma_residual -= bytes; in macscsi_pread()
302 if (hostdata->pdma_residual == 0) in macscsi_pread()
305 if (NCR5380_poll_politely2(hostdata, STATUS_REG, SR_REQ, SR_REQ, in macscsi_pread()
308 scmd_printk(KERN_DEBUG, hostdata->connected, in macscsi_pread()
319 dsprintk(NDEBUG_PSEUDO_DMA, hostdata->host, in macscsi_pread()
321 NCR5380_dprint(NDEBUG_PSEUDO_DMA, hostdata->host); in macscsi_pread()
326 scmd_printk(KERN_ERR, hostdata->connected, in macscsi_pread()
328 NCR5380_dprint(NDEBUG_PSEUDO_DMA, hostdata->host); in macscsi_pread()
332 write_ctrl_reg(hostdata, CTRL_INTERRUPTS_ENABLE); in macscsi_pread()
336 static inline int macscsi_pwrite(struct NCR5380_hostdata *hostdata, in macscsi_pwrite() argument
340 u8 __iomem *d = hostdata->pdma_io + (OUTPUT_DATA_REG << 4); in macscsi_pwrite()
343 hostdata->pdma_residual = len; in macscsi_pwrite()
345 while (!NCR5380_poll_politely(hostdata, BUS_AND_STATUS_REG, in macscsi_pwrite()
351 write_ctrl_reg(hostdata, CTRL_HANDSHAKE_MODE | in macscsi_pwrite()
354 bytes = mac_pdma_send(s, d, min(hostdata->pdma_residual, 512)); in macscsi_pwrite()
358 hostdata->pdma_residual -= bytes; in macscsi_pwrite()
361 if (hostdata->pdma_residual == 0) { in macscsi_pwrite()
362 if (NCR5380_poll_politely(hostdata, TARGET_COMMAND_REG, in macscsi_pwrite()
366 scmd_printk(KERN_ERR, hostdata->connected, in macscsi_pwrite()
373 if (NCR5380_poll_politely2(hostdata, STATUS_REG, SR_REQ, SR_REQ, in macscsi_pwrite()
376 scmd_printk(KERN_DEBUG, hostdata->connected, in macscsi_pwrite()
387 dsprintk(NDEBUG_PSEUDO_DMA, hostdata->host, in macscsi_pwrite()
389 NCR5380_dprint(NDEBUG_PSEUDO_DMA, hostdata->host); in macscsi_pwrite()
394 scmd_printk(KERN_ERR, hostdata->connected, in macscsi_pwrite()
396 NCR5380_dprint(NDEBUG_PSEUDO_DMA, hostdata->host); in macscsi_pwrite()
400 write_ctrl_reg(hostdata, CTRL_INTERRUPTS_ENABLE); in macscsi_pwrite()
404 static int macscsi_dma_xfer_len(struct NCR5380_hostdata *hostdata, in macscsi_dma_xfer_len() argument
407 if (hostdata->flags & FLAG_NO_PSEUDO_DMA || in macscsi_dma_xfer_len()
414 static int macscsi_dma_residual(struct NCR5380_hostdata *hostdata) in macscsi_dma_residual() argument
416 return hostdata->pdma_residual; in macscsi_dma_residual()
444 struct NCR5380_hostdata *hostdata; in mac_scsi_probe() local
482 hostdata = shost_priv(instance); in mac_scsi_probe()
483 hostdata->base = pio_mem->start; in mac_scsi_probe()
484 hostdata->io = (u8 __iomem *)pio_mem->start; in mac_scsi_probe()
487 hostdata->pdma_io = (u8 __iomem *)pdma_mem->start; in mac_scsi_probe()