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

How to access serial ports inside kernel



Hi,
I want to write a Video4Linux module for a radio device (Gemtek Wizard Radio) 
connected to computer through serial port.
I have look inside Linux kernel (tty_io.c, tty.h, etc...) but I haven't found 
any exported useful function.
The only function seems useful for me is inside file <drivers/char/tty_io.c> 
and is get_tty_driver() but is not exported so I can't use it!!
Is there a function similar that give me access to serial ports??

I would like to use a code like this (for the autodetection of Wizard Radio):

for (int = 0; i<NUM_SERIAL_PORT; i++)
{
   struct tty_driver* drv = get_serial_port(i);

   /* Access to serial port to see if a Wizard Radio is connected. */
   drv->write(something);
   drv->read(something);
	
   ....
   ....
}
 
-
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/
IRC Channel:   irc.openprojects.net / #kernelnewbies
Web Page:      http://www.surriel.com/kernelnewbies.shtml