unsigned int *data)
{
struct apci1500_private *devpriv = dev->private;
- unsigned int ui_Status;
int i_RegValue;
int i_Constant;
devpriv->tsk_Current = current;
- outl(0x0, devpriv->i_IobaseAmcc + 0x38);
+ outl(0x0, devpriv->amcc + AMCC_OP_REG_INTCSR);
if (data[0] == 1) {
i_Constant = 0xC0;
} else {
z8536_write(dev, 0xd0, APCI1500_RW_MASTER_INTERRUPT_CONTROL);
/* Enables the PCI interrupt */
- outl(0x3000, devpriv->i_IobaseAmcc + 0x38);
- ui_Status = inl(devpriv->i_IobaseAmcc + 0x10);
- ui_Status = inl(devpriv->i_IobaseAmcc + 0x38);
- outl(0x23000, devpriv->i_IobaseAmcc + 0x38);
+ outl(0x2000 | INTCSR_INBOX_FULL_INT,
+ devpriv->amcc + AMCC_OP_REG_INTCSR);
+ inl(devpriv->amcc + AMCC_OP_REG_IMB1);
+ inl(devpriv->amcc + AMCC_OP_REG_INTCSR);
+ outl(INTCSR_INBOX_INTR_STATUS | 0x2000 | INTCSR_INBOX_FULL_INT,
+ devpriv->amcc + AMCC_OP_REG_INTCSR);
return insn->n;
}
struct comedi_device *dev = d;
struct apci1500_private *devpriv = dev->private;
- unsigned int ui_InterruptStatus = 0;
+ unsigned int status;
int i_RegValue = 0;
/* Clear the interrupt mask */
i_InterruptMask = 0;
/* Read the board interrupt status */
- ui_InterruptStatus = inl(devpriv->i_IobaseAmcc + 0x38);
+ status = inl(devpriv->amcc + AMCC_OP_REG_INTCSR);
/* Test if board generated a interrupt */
- if ((ui_InterruptStatus & 0x800000) == 0x800000) {
+ if (status & INTCSR_INTR_ASSERTED) {
/* Disable all Interrupt */
/* Selects the master interrupt control register */
/* Disables the main interrupt on the board */
if (i_RegValue) {
/* Disable the interrupt */
/* Selects the command and status register of port B */
- outl(0x0, devpriv->i_IobaseAmcc + 0x38);
+ outl(0x0, devpriv->amcc + AMCC_OP_REG_INTCSR);
if (i_RegValue & 0x80) {
i_InterruptMask =
#include "comedi_fc.h"
#include "amcc_s5933.h"
+/*
+ * PCI Bar 0 Register map (devpriv->amcc)
+ * see amcc_s5933.h for register and bit defines
+ */
+
/*
* PCI Bar 1 Register map (dev->iobase)
*/
#define APCI1500_Z8536_CTRL_REG 0x03
struct apci1500_private {
- int i_IobaseAmcc;
+ unsigned long amcc;
int i_IobaseAddon;
unsigned char b_OutputMemoryStatus;
struct task_struct *tsk_Current;
return ret;
dev->iobase = pci_resource_start(pcidev, 1);
- devpriv->i_IobaseAmcc = pci_resource_start(pcidev, 0);
+ devpriv->amcc = pci_resource_start(pcidev, 0);
devpriv->i_IobaseAddon = pci_resource_start(pcidev, 2);
if (pcidev->irq > 0) {