/* DAC960_PD_InterruptHandler handles hardware interrupts from DAC960 PD Series Controllers.  */
static irqreturn_t DAC960_PD_InterruptHandler(int IRQ_Channel, void *DeviceIdentifier)
/* DAC960_PD_InterruptHandler handles hardware interrupts from DAC960 PD Series Controllers.  */
static irqreturn_t DAC960_PD_InterruptHandler(int IRQ_Channel, void *DeviceIdentifier)
{
  DAC960_Controller_T *Controller = DeviceIdentifier;
  void __iomem *ControllerBaseAddress = Controller->BaseAddress;
  unsigned long flags;
  spin_lock_irqsave(&Controller->queue_lock, flags);
  while (DAC960_PD_StatusAvailableP(ControllerBaseAddress))
    {
      DAC960_V1_CommandIdentifier_T CommandIdentifier =
	DAC960_PD_ReadStatusCommandIdentifier(ControllerBaseAddress);
      DAC960_Command_T *Command = Controller->Commands[CommandIdentifier-1];
      Command->V1.CommandStatus =
	DAC960_PD_ReadStatusRegister(ControllerBaseAddress);
      DAC960_PD_AcknowledgeInterrupt(ControllerBaseAddress);
      DAC960_PD_AcknowledgeStatus(ControllerBaseAddress);
      DAC960_V1_ProcessCompletedCommand(Command);
    }
  DAC960_ProcessRequest(Controller);
  spin_unlock_irqrestore(&Controller->queue_lock, flags);
  return IRQ_HANDLED;
}