I am trying to write a device driver for an AX5411 DA&C board, and I am
experiencing difficulties with the interrupt handler.
I program the board counters in Mode 2 (Rate generator mode)and the
board itself to generate an interrupt each time the counters fully
decrement. After boot up, when the module is loaded, the interrupt
handler seems to work ok, and at the right rate. However after removing
and re-inserting the module, the interrupt handler is not being called.
This appears as though I have not `reset' things sufficiently when
removing the module. I am using an IRQ level 5, although I've also tried
others (2-7) and it doesn't make any difference. There also doesn't
appear to be any problem with the return values of the "irq" functions.
The code is listed below!
I would greatly appreciate any assistance with this, and hope that the
I've missed something obvious (certainly possible!!).
Thanks in advance
Ray Eaton
#---- module code ---------------
unsigned int int_handler(unsigned int irq, struct pt_regs *regs);
int init_module(void)
{
int int_status;
int io_status;
int_status = rtl_request_irq(5, int_handler);
if (int_status != 0)
rtl_printf("Interrupt request error: %d\n",int_status);
/* setup io for 1hz ( 1M/(2000*500) ) and A/D channel 0 */
request_region(IO_BASE, 16, "ax5411");
io_status = setup_io(2000,500,0);
rtl_hard_enable_irq(5);
return 0;
}
void cleanup_module(void)
{
int int_stat;
int_stat = rtl_free_irq(5);
release_region(IO_BASE,16);
}
unsigned int int_handler(unsigned int irq, struct pt_regs *regs)
{
/* reset interrupts on card */
outb(0, IO_BASE+8);
rtl_printf("debug: inside interrupt handler\n");
/* included, but is this necessary ?*/
rtl_hard_enable_irq(5);
return 0;
}
--------------------------------------------------------------------
Ray Eaton
School of Electrical Engineering and Telecommunications
The University of New South Wales
UNSW SYDNEY 2052
Australia
Ph: +61 2 9385 6963 Fax: +61 2 9385 5993
E-Mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/