Re: send data to serial port from kernel code

[ Available lists | Index of freebsd-hackers | Month of Mar 2005 | Week of 8 Mar 2005 | Raw email | View thread | Wrap long lines | Reply | Tag ]
From
Stephan Uphoff <ups@tree.com>
Date
8 Mar 2005 23:25:37
Subject
Re: send data to serial port from kernel code
Message-ID
1110324334.29804.7913.camel@palm

In reply to
References to

[ Hide this part ]
On Tue, 2005-03-08 at 17:49, Jerry Toung wrote:
> Because all my IP traffic is directed to kernel module I wrote. It appends
> some headers after the IP header and when it's done with the specific
> processing, the packet can now be sent.
> At that point I used to make a call to the ethernet output routine
> (*ifp->if_start)() and all is well.
>
> Today I have a new requirement. I need to send those packets to the first
> serial port from the kernel module.
>
> Still looking for inputs.
> Thank you

Is it still a legal IP package when you are done with it?

Is the framing on the serial protocol specified or can you roll your
own?

I really would recommend layering/tunneling your protocol on/with PPP to
avoid re-inventing the wheel - but if this does not work for you take a
look at NG_TTY(4)

> On Tuesday 08 March 2005 02:26 pm, Stephan Uphoff wrote:
> > On Tue, 2005-03-08 at 17:04, Jerry Toung wrote:
> > > Good afternoon list,
> > > I am looking for a way to write data to the serial interface (/dev/cuaa0)
> > > from a kernel module and also read /dev/ttyd0 still from that same kernel
> > > module. Any pointers to doing that will be great.
> > >
> > > I want on exchange IP traffic from FreeBSD to another host with different
> > > OS via serial cable (null modem). So instead of making a call the NIC
> > > driver, I want to use the serial port as may physical layer.
> > > Any other ideas for doing this is welcome as well.
> > >
> > > I know the basics of serial programming from a regular C application:
> > >
> > > #include <termios.h>
> > >
> > > fd = open("/dev/cuaa0", O_RDWR|O_NDELAY)
> > > tcsetattr and tcgetattr
> > > etc etc.
> > >
> > >
> > > but that's not what I am looking for.
> > >
> > > Thank you.
> > > Jerry
> >
> > What is wrong with just using PPP ?
> >
> > Stephan


Elapsed time: 0.148 seconds