static int service_irq(struct echoaudio *chip) { int st; /* */ if (get_dsp_register(chip, CHI32_STATUS_REG) & CHI32_STATUS_IRQ) { st = 0; #ifdef ECHOCARD_HAS_MIDI /* */ if (chip->comm_page->midi_input[0]) /* */ st = midi_service_irq(chip); /* */ #endif /* */ chip->comm_page->midi_input[0] = 0; send_vector(chip, DSP_VC_ACK_INT); return st; } return -1; }
/* This is low level part of the interrupt handler. It returns -1 if the IRQ is not ours, or N>=0 if it is, where N is the number of midi data in the input queue. */ static int service_irq(struct echoaudio *chip) { int st; /* Read the DSP status register and see if this DSP generated this interrupt */ if (get_dsp_register(chip, CHI32_STATUS_REG) & CHI32_STATUS_IRQ) { st = 0; #ifdef ECHOCARD_HAS_MIDI /* Get and parse midi data if present */ if (chip->comm_page->midi_input[0]) /* The count is at index 0 */ st = midi_service_irq(chip); /* Returns how many midi bytes we received */ #endif /* Clear the hardware interrupt */ chip->comm_page->midi_input[0] = 0; send_vector(chip, DSP_VC_ACK_INT); return st; } return -1; }