Lines Matching refs:dev
50 struct aac_dev *dev = dev_id; in aac_rx_intr() local
53 intstat = rx_readb(dev, MUnit.OISR); in aac_rx_intr()
59 mask = ~(rx_readb(dev, MUnit.OIMR)); in aac_rx_intr()
63 bellbits = rx_readl(dev, OutboundDoorbellReg); in aac_rx_intr()
65 aac_printf(dev, le32_to_cpu(rx_readl (dev, IndexRegs.Mailbox[5]))); in aac_rx_intr()
66 rx_writel(dev, MUnit.ODR,DoorBellPrintfReady); in aac_rx_intr()
67 rx_writel(dev, InboundDoorbellReg,DoorBellPrintfDone); in aac_rx_intr()
70 aac_command_normal(&dev->queues->queue[HostNormCmdQueue]); in aac_rx_intr()
71 rx_writel(dev, MUnit.ODR, DoorBellAdapterNormCmdReady); in aac_rx_intr()
74 aac_response_normal(&dev->queues->queue[HostNormRespQueue]); in aac_rx_intr()
75 rx_writel(dev, MUnit.ODR,DoorBellAdapterNormRespReady); in aac_rx_intr()
78 rx_writel(dev, MUnit.ODR, DoorBellAdapterNormCmdNotFull); in aac_rx_intr()
81 rx_writel(dev, MUnit.ODR, DoorBellAdapterNormCmdNotFull); in aac_rx_intr()
82 rx_writel(dev, MUnit.ODR, DoorBellAdapterNormRespNotFull); in aac_rx_intr()
95 static void aac_rx_enable_interrupt(struct aac_dev * dev, u32 event) in aac_rx_enable_interrupt() argument
100 dev->irq_mask &= ~(OUTBOUNDDOORBELL_1); in aac_rx_enable_interrupt()
104 dev->irq_mask &= ~(OUTBOUNDDOORBELL_2); in aac_rx_enable_interrupt()
108 dev->irq_mask &= ~(OUTBOUNDDOORBELL_3); in aac_rx_enable_interrupt()
112 dev->irq_mask &= ~(OUTBOUNDDOORBELL_4); in aac_rx_enable_interrupt()
125 static void aac_rx_disable_interrupt(struct aac_dev *dev, u32 event) in aac_rx_disable_interrupt() argument
130 dev->irq_mask |= (OUTBOUNDDOORBELL_1); in aac_rx_disable_interrupt()
134 dev->irq_mask |= (OUTBOUNDDOORBELL_2); in aac_rx_disable_interrupt()
138 dev->irq_mask |= (OUTBOUNDDOORBELL_3); in aac_rx_disable_interrupt()
142 dev->irq_mask |= (OUTBOUNDDOORBELL_4); in aac_rx_disable_interrupt()
158 static int rx_sync_cmd(struct aac_dev *dev, u32 command, u32 p1, u32 *status) in rx_sync_cmd() argument
165 rx_writel(dev, InboundMailbox0, cpu_to_le32(command)); in rx_sync_cmd()
169 rx_writel(dev, InboundMailbox1, cpu_to_le32(p1)); in rx_sync_cmd()
170 rx_writel(dev, InboundMailbox2, 0); in rx_sync_cmd()
171 rx_writel(dev, InboundMailbox3, 0); in rx_sync_cmd()
172 rx_writel(dev, InboundMailbox4, 0); in rx_sync_cmd()
176 rx_writel(dev, OutboundDoorbellReg, OUTBOUNDDOORBELL_0); in rx_sync_cmd()
180 rx_writeb(dev, MUnit.OIMR, rx_readb(dev, MUnit.OIMR) | 0x04); in rx_sync_cmd()
185 rx_readb (dev, MUnit.OIMR); in rx_sync_cmd()
189 rx_writel(dev, InboundDoorbellReg, INBOUNDDOORBELL_0); in rx_sync_cmd()
203 if (rx_readl(dev, OutboundDoorbellReg) & OUTBOUNDDOORBELL_0) { in rx_sync_cmd()
207 rx_writel(dev, OutboundDoorbellReg, OUTBOUNDDOORBELL_0); in rx_sync_cmd()
221 rx_writeb(dev, MUnit.OIMR, rx_readl(dev, MUnit.OIMR) & 0xfb); in rx_sync_cmd()
227 *status = le32_to_cpu(rx_readl(dev, IndexRegs.Mailbox[0])); in rx_sync_cmd()
231 rx_writel(dev, OutboundDoorbellReg, OUTBOUNDDOORBELL_0); in rx_sync_cmd()
235 rx_writeb(dev, MUnit.OIMR, rx_readl(dev, MUnit.OIMR) & 0xfb); in rx_sync_cmd()
247 static void aac_rx_interrupt_adapter(struct aac_dev *dev) in aac_rx_interrupt_adapter() argument
250 rx_sync_cmd(dev, BREAKPOINT_REQUEST, 0, &ret); in aac_rx_interrupt_adapter()
262 static void aac_rx_notify_adapter(struct aac_dev *dev, u32 event) in aac_rx_notify_adapter() argument
267 rx_writel(dev, MUnit.IDR,INBOUNDDOORBELL_1); in aac_rx_notify_adapter()
270 rx_writel(dev, MUnit.IDR,INBOUNDDOORBELL_4); in aac_rx_notify_adapter()
273 rx_writel(dev, MUnit.IDR,INBOUNDDOORBELL_2); in aac_rx_notify_adapter()
276 rx_writel(dev, MUnit.IDR,INBOUNDDOORBELL_3); in aac_rx_notify_adapter()
282 rx_writel(dev, MUnit.IDR,INBOUNDDOORBELL_6); in aac_rx_notify_adapter()
285 rx_writel(dev, MUnit.IDR,INBOUNDDOORBELL_5); in aac_rx_notify_adapter()
300 static void aac_rx_start_adapter(struct aac_dev *dev) in aac_rx_start_adapter() argument
305 init = dev->init; in aac_rx_start_adapter()
311 …dev->irq_mask = (DoorBellPrintfReady | OUTBOUNDDOORBELL_1 | OUTBOUNDDOORBELL_2 | OUTBOUNDDOORBELL_… in aac_rx_start_adapter()
316 rx_writeb(dev, MUnit.OIMR, 0xff); in aac_rx_start_adapter()
317 rx_writel(dev, MUnit.ODR, 0xffffffff); in aac_rx_start_adapter()
319 rx_writeb(dev, MUnit.OIMR, 0xfb); in aac_rx_start_adapter()
322 rx_sync_cmd(dev, INIT_STRUCT_BASE_ADDRESS, (u32)(ulong)dev->init_pa, &status); in aac_rx_start_adapter()
335 int aac_rx_init(struct aac_dev *dev, unsigned long num) in aac_rx_init() argument
342 dev->devnum = num; in aac_rx_init()
343 instance = dev->id; in aac_rx_init()
344 name = dev->name; in aac_rx_init()
349 …if((dev->regs.rx = (struct rx_registers *)ioremap((unsigned long)dev->scsi_host_ptr->base, 8192))=… in aac_rx_init()
357 if (rx_readl(dev, IndexRegs.Mailbox[7]) & SELF_TEST_FAILED) { in aac_rx_init()
358 printk(KERN_ERR "%s%d: adapter self-test failed.\n", dev->name, instance); in aac_rx_init()
364 if (rx_readl(dev, IndexRegs.Mailbox[7]) & KERNEL_PANIC) { in aac_rx_init()
365 printk(KERN_ERR "%s%d: adapter kernel panic'd.\n", dev->name, instance); in aac_rx_init()
372 while (!(rx_readl(dev, IndexRegs.Mailbox[7]) & KERNEL_UP_AND_RUNNING)) in aac_rx_init()
376 status = rx_readl(dev, IndexRegs.Mailbox[7]) >> 16; in aac_rx_init()
377 …printk(KERN_ERR "%s%d: adapter kernel failed to start, init status = %ld.\n", dev->name, instance,… in aac_rx_init()
383 …if (request_irq(dev->scsi_host_ptr->irq, aac_rx_intr, SA_SHIRQ|SA_INTERRUPT, "aacraid", (void *)de… in aac_rx_init()
391 dev->a_ops.adapter_interrupt = aac_rx_interrupt_adapter; in aac_rx_init()
392 dev->a_ops.adapter_enable_int = aac_rx_enable_interrupt; in aac_rx_init()
393 dev->a_ops.adapter_disable_int = aac_rx_disable_interrupt; in aac_rx_init()
394 dev->a_ops.adapter_notify = aac_rx_notify_adapter; in aac_rx_init()
395 dev->a_ops.adapter_sync_cmd = rx_sync_cmd; in aac_rx_init()
397 if (aac_init_adapter(dev) == NULL) in aac_rx_init()
402 dev->thread_pid = kernel_thread((int (*)(void *))aac_command_thread, dev, 0); in aac_rx_init()
403 if(dev->thread_pid < 0) in aac_rx_init()
412 aac_rx_start_adapter(dev); in aac_rx_init()