Line discipline

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

 



I am making a module that have to register a Line discipline. But i cant
fugure out what to name it(what number do it get). When i look at the files
mentiond below, i can't see how to introduce a new line discipline witout
changing the kernel itself.

linux/tty.h
	#define NR_LDISCS		16

asm/termios.h
	/* line disciplines */
	#define N_TTY           0
	#define N_SLIP          1
	#define N_MOUSE         2
	#define N_PPP           3
	#define N_STRIP         4
	#define N_AX25          5
	#define N_X25           6       /* X.25 async */
	#define N_6PACK         7
	#define N_MASC          8       /* Reserved for Mobitex module
<kaz@cafe.net> */
	#define N_R3964         9       /* Reserved for Simatic R3964 module
*/
	#define N_PROFIBUS_FDL  10      /* Reserved for Profibus
<Dave@mvhi.com> */
	#define N_IRDA          11      /* Linux IR -
http://irda.sourceforge.net/ */
	#define N_SMSBLOCK      12      /* SMS block mode - for talking to
GSM data card
	#define N_HDLC          13      /* synchronous HDLC */
	#define N_SYNC_PPP      14      /* synchronous PPP */
	#define N_HCI           15  /* Bluetooth HCI UART */

/* here I asume i want to write #define N_MYDISC	16 */


drivers/char/tty_io.c
	int tty_register_ldisc(int disc, struct tty_ldisc *new_ldisc)
	{
        if (disc < N_TTY || disc >= NR_LDISCS)
                return -EINVAL;

        if (new_ldisc) {
                ldiscs[disc] = *new_ldisc;
                ldiscs[disc].flags |= LDISC_FLAG_DEFINED;
                ldiscs[disc].num = disc;
        } else
                memset(&ldiscs[disc], 0, sizeof(struct tty_ldisc));

        return 0;
	}


-- 
Martin Hansen
Student at SDU Sønderborg. www.sdu.dk
Writing final project at Danfoss drives. www.danfossdrives.com

Tlf: 74 88 54 62

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux