Lines Matching refs:fd
123 static inline void fdomain_make_bus_idle(struct fdomain *fd) in fdomain_make_bus_idle() argument
125 outb(0, fd->base + REG_BCTL); in fdomain_make_bus_idle()
126 outb(0, fd->base + REG_MCTL); in fdomain_make_bus_idle()
127 if (fd->chip == tmc18c50 || fd->chip == tmc18c30) in fdomain_make_bus_idle()
130 fd->base + REG_ACTL); in fdomain_make_bus_idle()
132 outb(ACTL_RESET | PARITY_MASK, fd->base + REG_ACTL); in fdomain_make_bus_idle()
186 struct fdomain *fd = shost_priv(sh); in fdomain_select() local
188 outb(BCTL_BUSEN | BCTL_SEL, fd->base + REG_BCTL); in fdomain_select()
189 outb(BIT(sh->this_id) | BIT(target), fd->base + REG_SCSI_DATA_NOACK); in fdomain_select()
192 outb(PARITY_MASK, fd->base + REG_ACTL); in fdomain_select()
197 status = inb(fd->base + REG_BSTAT); in fdomain_select()
201 outb(BCTL_BUSEN, fd->base + REG_BCTL); in fdomain_select()
206 fdomain_make_bus_idle(fd); in fdomain_select()
210 static void fdomain_finish_cmd(struct fdomain *fd) in fdomain_finish_cmd() argument
212 outb(0, fd->base + REG_ICTL); in fdomain_finish_cmd()
213 fdomain_make_bus_idle(fd); in fdomain_finish_cmd()
214 scsi_done(fd->cur_cmd); in fdomain_finish_cmd()
215 fd->cur_cmd = NULL; in fdomain_finish_cmd()
220 struct fdomain *fd = shost_priv(cmd->device->host); in fdomain_read_data() local
224 while ((len = inw(fd->base + REG_FIFO_COUNT)) > 0) { in fdomain_read_data()
230 *ptr++ = inb(fd->base + REG_FIFO); in fdomain_read_data()
232 insw(fd->base + REG_FIFO, ptr, len >> 1); in fdomain_read_data()
240 struct fdomain *fd = shost_priv(cmd->device->host); in fdomain_write_data() local
242 int FIFO_Size = fd->chip == tmc18c30 ? 0x800 : 0x2000; in fdomain_write_data()
246 while ((len = FIFO_Size - inw(fd->base + REG_FIFO_COUNT)) > 512) { in fdomain_write_data()
257 outb(*ptr++, fd->base + REG_FIFO); in fdomain_write_data()
259 outsw(fd->base + REG_FIFO, ptr, len >> 1); in fdomain_write_data()
267 struct fdomain *fd = container_of(work, struct fdomain, work); in fdomain_work() local
268 struct Scsi_Host *sh = container_of((void *)fd, struct Scsi_Host, in fdomain_work()
270 struct scsi_cmnd *cmd = fd->cur_cmd; in fdomain_work()
279 status = inb(fd->base + REG_ASTAT); in fdomain_work()
282 fdomain_finish_cmd(fd); in fdomain_work()
287 outb(ICTL_SEL | FIFO_COUNT, fd->base + REG_ICTL); in fdomain_work()
288 outb(BCTL_BUSEN | BCTL_SEL, fd->base + REG_BCTL); in fdomain_work()
290 fd->base + REG_SCSI_DATA_NOACK); in fdomain_work()
292 outb(ACTL_IRQEN | PARITY_MASK, fd->base + REG_ACTL); in fdomain_work()
295 status = inb(fd->base + REG_BSTAT); in fdomain_work()
300 fdomain_finish_cmd(fd); in fdomain_work()
304 outb(ACTL_IRQEN | PARITY_MASK, fd->base + REG_ACTL); in fdomain_work()
307 outb(ICTL_FIFO | ICTL_REQ | FIFO_COUNT, fd->base + REG_ICTL); in fdomain_work()
308 outb(BCTL_BUSEN, fd->base + REG_BCTL); in fdomain_work()
313 status = inb(fd->base + REG_BSTAT); in fdomain_work()
319 fd->base + REG_SCSI_DATA); in fdomain_work()
322 if (fd->chip != tmc1800 && !scsi_pointer->have_data_in) { in fdomain_work()
325 PARITY_MASK, fd->base + REG_ACTL); in fdomain_work()
329 if (fd->chip != tmc1800 && !scsi_pointer->have_data_in) { in fdomain_work()
332 fd->base + REG_ACTL); in fdomain_work()
336 scsi_pointer->Status = inb(fd->base + REG_SCSI_DATA); in fdomain_work()
339 outb(MESSAGE_REJECT, fd->base + REG_SCSI_DATA); in fdomain_work()
342 scsi_pointer->Message = inb(fd->base + REG_SCSI_DATA); in fdomain_work()
349 if (fd->chip == tmc1800 && !scsi_pointer->have_data_in && in fdomain_work()
354 PARITY_MASK, fd->base + REG_ACTL); in fdomain_work()
358 fd->base + REG_ACTL); in fdomain_work()
372 fdomain_finish_cmd(fd); in fdomain_work()
376 fd->base + REG_ICTL); in fdomain_work()
377 outb(0, fd->base + REG_BCTL); in fdomain_work()
380 fd->base + REG_ICTL); in fdomain_work()
388 struct fdomain *fd = dev_id; in fdomain_irq() local
391 if ((inb(fd->base + REG_ASTAT) & ASTAT_IRQ) == 0) in fdomain_irq()
394 outb(0, fd->base + REG_ICTL); in fdomain_irq()
397 if (!fd->cur_cmd) /* Spurious interrupt */ in fdomain_irq()
400 schedule_work(&fd->work); in fdomain_irq()
408 struct fdomain *fd = shost_priv(cmd->device->host); in fdomain_queue() local
420 fd->cur_cmd = cmd; in fdomain_queue()
422 fdomain_make_bus_idle(fd); in fdomain_queue()
425 outb(0, fd->base + REG_ICTL); in fdomain_queue()
426 outb(0, fd->base + REG_BCTL); /* Disable data drivers */ in fdomain_queue()
428 outb(BIT(cmd->device->host->this_id), fd->base + REG_SCSI_DATA_NOACK); in fdomain_queue()
429 outb(ICTL_ARB, fd->base + REG_ICTL); in fdomain_queue()
431 outb(ACTL_ARB | ACTL_IRQEN | PARITY_MASK, fd->base + REG_ACTL); in fdomain_queue()
441 struct fdomain *fd = shost_priv(sh); in fdomain_abort() local
444 if (!fd->cur_cmd) in fdomain_abort()
449 fdomain_make_bus_idle(fd); in fdomain_abort()
450 fdomain_scsi_pointer(fd->cur_cmd)->phase |= aborted; in fdomain_abort()
453 set_host_byte(fd->cur_cmd, DID_ABORT); in fdomain_abort()
454 fdomain_finish_cmd(fd); in fdomain_abort()
462 struct fdomain *fd = shost_priv(sh); in fdomain_host_reset() local
466 fdomain_reset(fd->base); in fdomain_host_reset()
518 struct fdomain *fd; in fdomain_create() local
550 fd = shost_priv(sh); in fdomain_create()
551 fd->base = base; in fdomain_create()
552 fd->chip = chip; in fdomain_create()
553 INIT_WORK(&fd->work, fdomain_work); in fdomain_create()
558 if (request_irq(irq, fdomain_irq, irq_flags, "fdomain", fd)) in fdomain_create()
573 free_irq(irq, fd); in fdomain_create()
582 struct fdomain *fd = shost_priv(sh); in fdomain_destroy() local
584 cancel_work_sync(&fd->work); in fdomain_destroy()
587 free_irq(sh->irq, fd); in fdomain_destroy()
596 struct fdomain *fd = shost_priv(dev_get_drvdata(dev)); in fdomain_resume() local
598 fdomain_reset(fd->base); in fdomain_resume()