diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2013-04-25 15:52:48 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2013-04-25 15:52:48 -0600 |
commit | bbf5ee648636273bf194f5e9a8004ea45d4cb009 (patch) | |
tree | 369cb9cd255683303cb8df3bdf008a75393d5f23 /nuttx/drivers | |
parent | 561c54964b2c99b1709fa79ee98aea31e7d7d449 (diff) | |
download | nuttx-bbf5ee648636273bf194f5e9a8004ea45d4cb009.tar.gz nuttx-bbf5ee648636273bf194f5e9a8004ea45d4cb009.tar.bz2 nuttx-bbf5ee648636273bf194f5e9a8004ea45d4cb009.zip |
Useless TIOCSERGSTRUCT logic in most serial drivers is not compiled unless CONFIG_DEBUG and CONFIG_SERIAL_TIOCSERGSTRUCT are defined
Diffstat (limited to 'nuttx/drivers')
-rw-r--r-- | nuttx/drivers/serial/Kconfig | 14 | ||||
-rw-r--r-- | nuttx/drivers/serial/uart_16550.c | 4 |
2 files changed, 16 insertions, 2 deletions
diff --git a/nuttx/drivers/serial/Kconfig b/nuttx/drivers/serial/Kconfig index ff81ae559..d512784a4 100644 --- a/nuttx/drivers/serial/Kconfig +++ b/nuttx/drivers/serial/Kconfig @@ -336,7 +336,7 @@ config STANDARD_SERIAL ---help--- Enable the standard, upper-half serial driver used by most MCU serial peripherals. -config CONFIG_SERIAL_NPOLLWAITERS +config SERIAL_NPOLLWAITERS int "Number of poll threads" default 2 depends on !DISABLE_POLL && STANDARD_SERIAL @@ -344,6 +344,18 @@ config CONFIG_SERIAL_NPOLLWAITERS Maximum number of threads than can be waiting for POLL events. Default: 2 +config SERIAL_TIOCSERGSTRUCT + bool "Support TIOCSERGSTRUCT" + default n + depends on DEBUG && (MCU_SERIAL || 16550_UART) + ---help--- + As a debug option, many serial bottom half drivers support the TIOCSERGSTRUCT + that allows you to get the internal drvier data structure. By default, this + IOCTL is not supported in order to reduce footprint. But if (1) the driver + supports the TIOCSERGSTRUCT ioctl, and (2) this option is selected, then + support for the TIOCSERGSTRUCT will be enabled. + + # # U[S]ARTn_XYZ settings for MCU serial drivers # diff --git a/nuttx/drivers/serial/uart_16550.c b/nuttx/drivers/serial/uart_16550.c index fbd810426..ac025bcfa 100644 --- a/nuttx/drivers/serial/uart_16550.c +++ b/nuttx/drivers/serial/uart_16550.c @@ -2,7 +2,7 @@ * drivers/serial/uart_16550.c * Serial driver for 16550 UART * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2011, 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without @@ -865,6 +865,7 @@ static int u16550_ioctl(struct file *filep, int cmd, unsigned long arg) switch (cmd) { +#ifdef CONFIG_SERIAL_TIOCSERGSTRUCT case TIOCSERGSTRUCT: { struct u16550_s *user = (struct u16550_s*)arg; @@ -879,6 +880,7 @@ static int u16550_ioctl(struct file *filep, int cmd, unsigned long arg) } } break; +#endif case TIOCSBRK: /* BSD compatibility: Turn break on, unconditionally */ { |