[clug] device driver writing to serial port

Martin Pool mbp at samba.org
Fri Mar 5 01:14:49 GMT 2004


On  4 Mar 2004, <caloykoy_one at pacific.net.ph> wrote:

> guys i'm really sorry if i only got to mail now. i'm caloy, the one
> inquiring about device drivers for my project for the rv-m1 robot
> arm.
>  
> may i ask how a device driver can write to the serial port? my
> device driver needs to access/write data to the serial port, how
> would i go about that?

I guess you need to make a kind of loopback connection where your
"driver" opens the character device provided by the real serial
driver.  There is a kernel-internal function filp_open that does
something similar to open(2), which will give you something you can
read and write.  Grep for that function to see how it is used.

Having one so-called driver open another seems like bad style and I
don't know if it would actually work reliably.

I still think this is a Really Bad Idea.  You could the same work done
in one tenth the time if you just made a userspace daemon.  Do
yourself a favour.

-- 
Martin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.samba.org/archive/linux/attachments/20040305/beadbc61/attachment.bin


More information about the linux mailing list