Unable to hit my serial port interrupt routine
Hi there;
Im trying to write a program to intercept the PPS signal from my Motorola GPS
receiver (Oncore).
This the initialisation of my module
int __init hguts_init(void)
{
int result;
result = check_region(COM1_BASE,8);
if (result<0) printk("<1>short: can't get I/O address \n");
else request_region(COM1_BASE, 8,"hgserial");
result = register_chrdev(254, "hgserial", &hgserial_fops);
if (result < 0) {
printk(KERN_WARNING "hgserial: can t get major %d\n",254);
return result;
}
result = request_irq(IRQ_COM1, myserial_interrupt, SA_INTERRUPT, "myserial", NULL);
if (result) {
printk("<1>hgserial: can t get assigned irq %i\n", 3*2);
} else {
outb(0x00,COM1_BASE+1); /*Disable Interrupt on COM1*/
outb(0x08,COM1_BASE+3); /* Tur non DLAB */
outb(0x00,COM1_BASE); /*Set baud rate I tried differnet */
outb(0x0C,COM1_BASE+1); /* baud rate*/
outb(0x00,COM1_BASE+3); /* Turn off DLAB */
outb(0x01,COM1_BASE+1); /* Set up the interrupt register */
udelay(5);
}
return 0;
}
And this is my handler routine (Nothins special)
void myserial_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{
printk("<1> Im the intr \n");
}
After I will load the module I could reserve the IRQ 4
[root@bedoule ntp-4.1.80-rc1]# cat /proc/interrupts
CPU0
0: 1065580 XT-PIC timer
1: 22469 XT-PIC keyboard
2: 0 XT-PIC cascade
4: 129 XT-PIC myserial
9: 0 XT-PIC usb-uhci
11: 8832 XT-PIC eth0
12: 142647 XT-PIC PS/2 Mouse
14: 68778 XT-PIC ide0
15: 132412 XT-PIC ide1
NMI: 0
ERR: 0
Please If you have any idea, Im stuck and I have to fix this probleme ASAP.
Last edited by hguts; 07-14-2003 at 05:28 PM.
|