public inbox for linux-serial@vger.kernel.org
 help / color / mirror / Atom feed
* How to use serial ports from a kernel module.
@ 2008-01-26 19:19 ian
  2008-01-26 20:41 ` Guennadi Liakhovetski
  0 siblings, 1 reply; 4+ messages in thread
From: ian @ 2008-01-26 19:19 UTC (permalink / raw)
  To: linux-serial

Hi guys,

I'd like to use one of the serial ports on my embedded device from a
module (so I can write an input driver for the buttonpad on my PDA).

I need to be able to set the data type to 8O1 and set the port speed,
and send and receive data.

Whats the proper way to do this? Ideally I'd want to prevent userspace
being able to use the port which has the keypad connected, but not touch
the other two ports.

Thanks,

-Ian


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How to use serial ports from a kernel module.
  2008-01-26 19:19 How to use serial ports from a kernel module ian
@ 2008-01-26 20:41 ` Guennadi Liakhovetski
  2008-01-26 22:30   ` ian
  0 siblings, 1 reply; 4+ messages in thread
From: Guennadi Liakhovetski @ 2008-01-26 20:41 UTC (permalink / raw)
  To: ian; +Cc: linux-serial

On Sat, 26 Jan 2008, ian wrote:

> I'd like to use one of the serial ports on my embedded device from a
> module (so I can write an input driver for the buttonpad on my PDA).
> 
> I need to be able to set the data type to 8O1 and set the port speed,
> and send and receive data.
> 
> Whats the proper way to do this? Ideally I'd want to prevent userspace
> being able to use the port which has the keypad connected, but not touch
> the other two ports.

You need to write a line discipline... have a look here: 
http://www.linux.it/~rubini/docs/serial/serial.html

Thanks
Guennadi
---
Guennadi Liakhovetski

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How to use serial ports from a kernel module.
  2008-01-26 20:41 ` Guennadi Liakhovetski
@ 2008-01-26 22:30   ` ian
  2008-01-26 22:37     ` Guennadi Liakhovetski
  0 siblings, 1 reply; 4+ messages in thread
From: ian @ 2008-01-26 22:30 UTC (permalink / raw)
  To: Guennadi Liakhovetski; +Cc: linux-serial


On Sat, 2008-01-26 at 21:41 +0100, Guennadi Liakhovetski wrote:

> You need to write a line discipline... have a look here: 
> http://www.linux.it/~rubini/docs/serial/serial.html

Hi,

Thanks for the reply!

What I cant see from that is how one can avoid touching userspace at all
- as far as I can see, only userspace can actually attach a line
discipline to a serial port. I'd like to have this happen in the kernel
so that I dont need some program sitting idly opening the serial device
the whole time.

Thanks,

-Ian!


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How to use serial ports from a kernel module.
  2008-01-26 22:30   ` ian
@ 2008-01-26 22:37     ` Guennadi Liakhovetski
  0 siblings, 0 replies; 4+ messages in thread
From: Guennadi Liakhovetski @ 2008-01-26 22:37 UTC (permalink / raw)
  To: ian; +Cc: linux-serial

On Sat, 26 Jan 2008, ian wrote:

> 
> On Sat, 2008-01-26 at 21:41 +0100, Guennadi Liakhovetski wrote:
> 
> > You need to write a line discipline... have a look here: 
> > http://www.linux.it/~rubini/docs/serial/serial.html
> 
> Hi,
> 
> Thanks for the reply!
> 
> What I cant see from that is how one can avoid touching userspace at all
> - as far as I can see, only userspace can actually attach a line
> discipline to a serial port. I'd like to have this happen in the kernel
> so that I dont need some program sitting idly opening the serial device
> the whole time.

Right, you need a user-space daemon for that. In your original post you 
only said

> > Ideally I'd want to prevent userspace being able to use the port which 
> > has the keypad connected, but not touch the other two ports.

which I understood as "I want to lock this port, and leave the rest 
untouched" and not as "avoid touching userspace at all". I don't think 
you can do it without a user-space programme.

Thanks
Guennadi
---
Guennadi Liakhovetski

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-01-26 22:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-26 19:19 How to use serial ports from a kernel module ian
2008-01-26 20:41 ` Guennadi Liakhovetski
2008-01-26 22:30   ` ian
2008-01-26 22:37     ` Guennadi Liakhovetski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox