Lines Matching refs:esp
49 #define esp_read8(REG) mac_esp_read8(esp, REG)
50 #define esp_write8(VAL, REG) mac_esp_write8(esp, VAL, REG)
53 struct esp *esp; member
57 static struct esp *esp_chips[2];
60 #define MAC_ESP_GET_PRIV(esp) ((struct mac_esp_priv *) \ argument
61 dev_get_drvdata((esp)->dev))
63 static inline void mac_esp_write8(struct esp *esp, u8 val, unsigned long reg) in mac_esp_write8() argument
65 nubus_writeb(val, esp->regs + reg * 16); in mac_esp_write8()
68 static inline u8 mac_esp_read8(struct esp *esp, unsigned long reg) in mac_esp_read8() argument
70 return nubus_readb(esp->regs + reg * 16); in mac_esp_read8()
73 static void mac_esp_reset_dma(struct esp *esp) in mac_esp_reset_dma() argument
78 static void mac_esp_dma_drain(struct esp *esp) in mac_esp_dma_drain() argument
83 static void mac_esp_dma_invalidate(struct esp *esp) in mac_esp_dma_invalidate() argument
88 static int mac_esp_dma_error(struct esp *esp) in mac_esp_dma_error() argument
90 return esp->send_cmd_error; in mac_esp_dma_error()
93 static inline int mac_esp_wait_for_empty_fifo(struct esp *esp) in mac_esp_wait_for_empty_fifo() argument
109 esp->send_cmd_error = 1; in mac_esp_wait_for_empty_fifo()
113 static inline int mac_esp_wait_for_dreq(struct esp *esp) in mac_esp_wait_for_dreq() argument
115 struct mac_esp_priv *mep = MAC_ESP_GET_PRIV(esp); in mac_esp_wait_for_dreq()
135 esp->send_cmd_error = 1; in mac_esp_wait_for_dreq()
197 static void mac_esp_send_pdma_cmd(struct esp *esp, u32 addr, u32 esp_count, in mac_esp_send_pdma_cmd() argument
200 struct mac_esp_priv *mep = MAC_ESP_GET_PRIV(esp); in mac_esp_send_pdma_cmd()
202 esp->send_cmd_error = 0; in mac_esp_send_pdma_cmd()
205 scsi_esp_cmd(esp, ESP_CMD_FLUSH); in mac_esp_send_pdma_cmd()
210 scsi_esp_cmd(esp, cmd); in mac_esp_send_pdma_cmd()
218 if (mac_esp_wait_for_dreq(esp)) in mac_esp_send_pdma_cmd()
230 if (mac_esp_wait_for_empty_fifo(esp)) in mac_esp_send_pdma_cmd()
240 static int mac_esp_irq_pending(struct esp *esp) in mac_esp_irq_pending() argument
247 static u32 mac_esp_dma_length_limit(struct esp *esp, u32 dma_addr, u32 dma_len) in mac_esp_dma_length_limit() argument
294 struct esp *esp; in esp_mac_probe() local
304 host = scsi_host_alloc(tpnt, sizeof(struct esp)); in esp_mac_probe()
312 esp = shost_priv(host); in esp_mac_probe()
314 esp->host = host; in esp_mac_probe()
315 esp->dev = &dev->dev; in esp_mac_probe()
317 esp->command_block = kzalloc(16, GFP_KERNEL); in esp_mac_probe()
318 if (!esp->command_block) in esp_mac_probe()
320 esp->command_block_dma = (dma_addr_t)esp->command_block; in esp_mac_probe()
322 esp->scsi_id = 7; in esp_mac_probe()
323 host->this_id = esp->scsi_id; in esp_mac_probe()
324 esp->scsi_id_mask = 1 << esp->scsi_id; in esp_mac_probe()
329 mep->esp = esp; in esp_mac_probe()
334 esp->cfreq = 16500000; in esp_mac_probe()
335 esp->regs = (void __iomem *)MAC_ESP_REGS_QUADRA; in esp_mac_probe()
336 mep->pdma_io = esp->regs + MAC_ESP_PDMA_IO_OFFSET; in esp_mac_probe()
340 esp->cfreq = 25000000; in esp_mac_probe()
341 esp->regs = (void __iomem *)(MAC_ESP_REGS_QUADRA2 + in esp_mac_probe()
343 mep->pdma_io = esp->regs + MAC_ESP_PDMA_IO_OFFSET; in esp_mac_probe()
352 esp->cfreq = 25000000; in esp_mac_probe()
353 esp->regs = (void __iomem *)MAC_ESP_REGS_QUADRA3; in esp_mac_probe()
358 esp->fifo_reg = esp->regs + ESP_FDATA * 16; in esp_mac_probe()
360 esp->ops = &mac_esp_ops; in esp_mac_probe()
361 esp->flags = ESP_FLAG_NO_DMA_MAP; in esp_mac_probe()
366 esp->flags |= ESP_FLAG_DISABLE_SYNC; in esp_mac_probe()
383 esp_chips[dev->id] = esp; in esp_mac_probe()
386 err = scsi_esp_register(esp); in esp_mac_probe()
403 kfree(esp->command_block); in esp_mac_probe()
413 struct esp *esp = mep->esp; in esp_mac_remove() local
414 unsigned int irq = esp->host->irq; in esp_mac_remove()
416 scsi_esp_unregister(esp); in esp_mac_remove()
428 kfree(esp->command_block); in esp_mac_remove()
430 scsi_host_put(esp->host); in esp_mac_remove()