problem with a Printer module.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hi all ,
         
            i had written a module for my
printer.After i set the 4th bit of the control port to
high. i.e outb(CONTROL_PORT,0X10);

i get interrupts generated from the printer every
second (or so)(is this normal ??) . And it shows in
cat /proc/interrupts also against my device name.

The handler is being called every second. I'am able to
get the status of the printer properly from the
handler after doing > (from within the handler)

void parallel_handler(int i,void *data,struct pt_regs
*p)
{
unsigned char byte ;
byte = inportb(STATUS_PORT);; /* #define'd to OX379 */
.....
....
}
and now i check the 4th bit of the var byte to
ascertain wether it is online or not.This works fine.
Any pointers as to how to get started understanding
and working with the parallel port would be gr8.

Can pt_regs in th call back be used to know why the
interrupt was generated ( a wild guess) i saw that the
members of pt_reg (in irq.h ) are all register
equivalents .

thanks for your time.

cheers,
Amith

PS: i HAD #define'd  DATA_PORT 0X378
          and        STATUS_PORT 0X379
          and        CONTROL_PORT 0X37A     


__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux