Help with Implementing a custom line discipline driver

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

 



Hello,

I am dealing with serial port hardware setup that requires me to
fiddle with some of the GPIO setup. So what I want to do is create a
new line discipline driver that provides implementation of few ioctl
interfaces. I don't really need to cook, buffer any of the rx/tx data.

So I tried to implement a line discipline that just implements open,
close, ioctl but when I do the following,

int ldisc = N_TESTLDISC;
fd = open(argv[1], O_RDWR | O_NOCTTY);
ioctl(fd,TIOCSETD,&disc);

and then invoke my custom ioctls, they do get invoked fine, however
actual data rx/tx does not happen.

So the question is, Is it possible  to implement line discipline
driver for serial port, that just provides ioctl?

If not what are the must have function that line discipline driver
must implement from struct tty_ldisc?

My tty_ldisc is shown below.

static struct tty_ldisc_ops tty_testldisc_ldisc = {
        .owner          = THIS_MODULE,
        .magic          = TTY_LDISC_MAGIC,
        .name           = DRIVERNAME,
        .open           = n_testldisc_open,
        .close          = n_testldisc_close,
        .ioctl          = n_testldisc_ioctl,
};

Regards,
-Subodh Nijsure
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux