aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorAlan Cox <alan@linux.intel.com>2010-09-16 13:21:24 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-10-22 13:20:04 -0400
commitd281da7ff6f70efca0553c288bb883e8605b3862 (patch)
treeee6a46b33070159af51c07643cf99186f1ef3e03 /include/linux
parent68707539df1e9d12435e5d54ffedc7ded50fcd01 (diff)
tty: Make tiocgicount a handler
Dan Rosenberg noted that various drivers return the struct with uncleared fields. Instead of spending forever trying to stomp all the drivers that get it wrong (and every new driver) do the job in one place. This first patch adds the needed operations and hooks them up, including the needed USB midlayer and serial core plumbing. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/tty_driver.h9
-rw-r--r--include/linux/usb/serial.h2
2 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/tty_driver.h b/include/linux/tty_driver.h
index b08677982525..db2d227694da 100644
--- a/include/linux/tty_driver.h
+++ b/include/linux/tty_driver.h
@@ -224,6 +224,12 @@
224 * unless the tty also has a valid tty->termiox pointer. 224 * unless the tty also has a valid tty->termiox pointer.
225 * 225 *
226 * Optional: Called under the termios lock 226 * Optional: Called under the termios lock
227 *
228 * int (*get_icount)(struct tty_struct *tty, struct serial_icounter *icount);
229 *
230 * Called when the device receives a TIOCGICOUNT ioctl. Passed a kernel
231 * structure to complete. This method is optional and will only be called
232 * if provided (otherwise EINVAL will be returned).
227 */ 233 */
228 234
229#include <linux/fs.h> 235#include <linux/fs.h>
@@ -232,6 +238,7 @@
232 238
233struct tty_struct; 239struct tty_struct;
234struct tty_driver; 240struct tty_driver;
241struct serial_icounter_struct;
235 242
236struct tty_operations { 243struct tty_operations {
237 struct tty_struct * (*lookup)(struct tty_driver *driver, 244 struct tty_struct * (*lookup)(struct tty_driver *driver,
@@ -268,6 +275,8 @@ struct tty_operations {
268 unsigned int set, unsigned int clear); 275 unsigned int set, unsigned int clear);
269 int (*resize)(struct tty_struct *tty, struct winsize *ws); 276 int (*resize)(struct tty_struct *tty, struct winsize *ws);
270 int (*set_termiox)(struct tty_struct *tty, struct termiox *tnew); 277 int (*set_termiox)(struct tty_struct *tty, struct termiox *tnew);
278 int (*get_icount)(struct tty_struct *tty,
279 struct serial_icounter_struct *icount);
271#ifdef CONFIG_CONSOLE_POLL 280#ifdef CONFIG_CONSOLE_POLL
272 int (*poll_init)(struct tty_driver *driver, int line, char *options); 281 int (*poll_init)(struct tty_driver *driver, int line, char *options);
273 int (*poll_get_char)(struct tty_driver *driver, int line); 282 int (*poll_get_char)(struct tty_driver *driver, int line);
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h
index 55675b1efb28..16d682f4f7c3 100644
--- a/include/linux/usb/serial.h
+++ b/include/linux/usb/serial.h
@@ -271,6 +271,8 @@ struct usb_serial_driver {
271 int (*tiocmget)(struct tty_struct *tty, struct file *file); 271 int (*tiocmget)(struct tty_struct *tty, struct file *file);
272 int (*tiocmset)(struct tty_struct *tty, struct file *file, 272 int (*tiocmset)(struct tty_struct *tty, struct file *file,
273 unsigned int set, unsigned int clear); 273 unsigned int set, unsigned int clear);
274 int (*get_icount)(struct tty_struct *tty,
275 struct serial_icounter_struct *icount);
274 /* Called by the tty layer for port level work. There may or may not 276 /* Called by the tty layer for port level work. There may or may not
275 be an attached tty at this point */ 277 be an attached tty at this point */
276 void (*dtr_rts)(struct usb_serial_port *port, int on); 278 void (*dtr_rts)(struct usb_serial_port *port, int on);