From: Florian Fainelli <ffainelli@freebox.fr>
To: "Greg Kroah-Hartman" <gregkh@suse.de>
Cc: lkml <linux-kernel@vger.kernel.org>, Maxime Bizon <mbizon@freebox.fr>
Subject: [PATCH] TTY: export NR_LDISC and N_* line discipline numbers to user-space
Date: Tue, 24 May 2011 10:43:03 +0200 [thread overview]
Message-ID: <201105241043.03347.ffainelli@freebox.fr> (raw)
From: Florian Fainelli <ffainelli@freebox.fr>
Since commit (4564f9e5: consolidate line discipline number definitions)
the patch moved all line discipline number from a per-architecture termios.h
to a shared one: tty.h. However, prior to this consolidation work, the
line discipline numbers were outside of an ifdef __KERNEL__/endif block
so these numbers used to be exported to user-space.
Since such numbers are kernel ABI anyway, and tty.h is already included
for user- space header processing, just move these relevant defines
outside of the ifdef __KERNEL__/endif block in include/linux/tty.h.
CC: Maxime Bizon <mbizon@freebox.fr>
Signed-off-by: Florian Fainelli <ffainelli@freebox.fr>
---
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 9f469c7..272dc9a 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -5,24 +5,6 @@
* 'tty.h' defines some structures used by tty_io.c and some defines.
*/
-#ifdef __KERNEL__
-#include <linux/fs.h>
-#include <linux/major.h>
-#include <linux/termios.h>
-#include <linux/workqueue.h>
-#include <linux/tty_driver.h>
-#include <linux/tty_ldisc.h>
-#include <linux/mutex.h>
-
-#include <asm/system.h>
-
-
-/*
- * (Note: the *_driver.minor_start values 1, 64, 128, 192 are
- * hardcoded at present.)
- */
-#define NR_UNIX98_PTY_DEFAULT 4096 /* Default maximum for Unix98 ptys */
-#define NR_UNIX98_PTY_MAX (1 << MINORBITS) /* Absolute limit */
#define NR_LDISCS 30
/* line disciplines */
@@ -51,6 +33,25 @@
#define N_GSM0710 21 /* GSM 0710 Mux */
#define N_TI_WL 22 /* for TI's WL BT, FM, GPS combo chips */
+#ifdef __KERNEL__
+#include <linux/fs.h>
+#include <linux/major.h>
+#include <linux/termios.h>
+#include <linux/workqueue.h>
+#include <linux/tty_driver.h>
+#include <linux/tty_ldisc.h>
+#include <linux/mutex.h>
+
+#include <asm/system.h>
+
+
+/*
+ * (Note: the *_driver.minor_start values 1, 64, 128, 192 are
+ * hardcoded at present.)
+ */
+#define NR_UNIX98_PTY_DEFAULT 4096 /* Default maximum for Unix98 ptys */
+#define NR_UNIX98_PTY_MAX (1 << MINORBITS) /* Absolute limit */
+
/*
* This character is the same as _POSIX_VDISABLE: it cannot be used as
* a c_cc[] character, but indicates that a particular special character
--
1.7.4.1
next reply other threads:[~2011-05-24 8:38 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-24 8:43 Florian Fainelli [this message]
2011-05-24 12:40 ` [PATCH] TTY: export NR_LDISC and N_* line discipline numbers to user-space Greg KH
2011-05-24 13:17 ` Florian Fainelli
2011-05-24 13:33 ` Greg KH
2011-05-24 13:45 ` Florian Fainelli
2011-05-24 14:09 ` Tilman Schmidt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201105241043.03347.ffainelli@freebox.fr \
--to=ffainelli@freebox.fr \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mbizon@freebox.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox