LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices

Reply
 
Search this Thread
Old 11-17-2010, 04:26 PM   #16
mopskuh
LQ Newbie
 
Registered: Nov 2010
Posts: 1

Rep: Reputation: 0

A few days later,

same story ;-) Like Craftonix I have run following code as module:

Code:
#include <linux/module.h>
#include <linux/interrupt.h>
#include <asm/io.h>

#define BASEPORT 0x378
static unsigned long devid;
int cntr;

static irqreturn_t handler(int irq, void *data)
{
	cntr++;
	printk("parint: >>> Interrupt PARALLEL PORT INT %d HANDLED\n", cntr);
	return IRQ_HANDLED;
}

int xinit_module(void)
{
	int ret;
	ret = request_irq(7, handler,  SA_INTERRUPT   , "parallelport", (void *)&devid);
	if (ret)	{ printk ("parint: error requesting irq 7: returned %d\n", ret); }
	outb_p(0x10, BASEPORT + 2); 

	printk("parint: Generating Interrupt now on all output pins (intr/ACK = pin 10)\n");
	//generate interrupt
	outb_p(0, BASEPORT);
	outb_p(255, BASEPORT);
	outb_p(0, BASEPORT);
	printk("parint: Interrupt generated. You should see the handler-message\n");
	return 0;
}

void xcleanup_module(void)
{
	disable_irq(7);
	free_irq(7, (void *)&devid);
}

module_init(xinit_module);
module_exit(xcleanup_module);
MODULE_LICENSE("GPL");
Everything seems to work fine at the beginning, including all module startup messages in dmesg. But if I try to run the handler, nothing hapens. To do so I have connected pin 10 and 9 from lpt.

In /proc/interrupt i can see that "parallelport" is bind to irq 7.

It would be very nice if someone can help.
 
  


Reply

Tags
insmod, interrupt, irq, parallel, port, rmmod


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Parallel port problem in 9.3 jolphil Suse/Novell 2 12-06-2005 06:28 PM
Parallel port problem longnam Linux - Hardware 1 03-31-2005 05:13 AM
parallel port handler interrupt tincho Programming 1 10-01-2003 06:34 PM
Serial Port Driver- Interrupt Invoking Problem sinux Linux - Software 0 03-07-2003 04:47 PM
Parallel port interrupt trondsol Programming 6 05-16-2002 09:15 AM


All times are GMT -5. The time now is 05:16 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration