Clean up serial config [2.2.9 patch]

Keith Owens (kaos@ocs.com.au)
Sat, 12 Jun 1999 23:13:18 +1000


serial.c internally overrides some CONFIG_ options before calling
asm/serial.h. Other sources do not do this override and use the values
from autoconf when including asm/serial.h. This mismatch causes
asm/serial.h to give different results in different sources.

AFAICT, it does not cause a problem right now, the only other kernel
user of asm/serial.h is synclink.c and it does not appear to be
affected by the mismatch. However if somebody has their own code that
includes asm/serial.h then it could be causing problems. At best this
fiddling is confusing, at worst it is a potential bug just waiting to
bite somebody.

This patch moves the CONFIG_ fiddling up into Config.in so autoconf
becomes the master, everybody uses the options as entered by the user.
It also renames CONFIG_SERIAL_NOPAUSE_IO to SERIAL_NOPAUSE_IO (not a
config option) and removes the vestiges of CONFIG_SERIAL_NOPAUSE_IO
from sources where it is no longer used.

Index: linux-2.2.9/drivers/sbus/char/su.c
--- linux-2.2.9/drivers/sbus/char/su.c Wed, 24 Mar 1999 10:22:04 +1100 keith (linux-2.2/U/17_su.c 1.2 644)
+++ linux/drivers/sbus/char/su.c Sat, 12 Jun 1999 21:52:17 +1000 keith (linux-2.2/U/17_su.c 1.2 644)
@@ -12,7 +12,6 @@
* Configuration section.
*/
#define SERIAL_PARANOIA_CHECK
-#define CONFIG_SERIAL_NOPAUSE_IO /* Unused on sparc */
#define SERIAL_DO_RESTART

/* Set of debugging defines */
Index: linux-2.2.9/drivers/char/Config.in
--- linux-2.2.9/drivers/char/Config.in Wed, 12 May 1999 17:22:01 +1000 keith (linux-2.2/h/b/1_Config.in 1.1.1.4 644)
+++ linux/drivers/char/Config.in Sat, 12 Jun 1999 21:50:20 +1000 keith (linux-2.2/h/b/1_Config.in 1.1.1.4 644)
@@ -14,11 +14,19 @@
fi
bool 'Extended dumb serial driver options' CONFIG_SERIAL_EXTENDED
if [ "$CONFIG_SERIAL_EXTENDED" = "y" ]; then
- bool ' Support more than 4 serial ports' CONFIG_SERIAL_MANY_PORTS
- bool ' Support for sharing serial interrupts' CONFIG_SERIAL_SHARE_IRQ
- bool ' Autodetect IRQ on standard ports (unsafe)' CONFIG_SERIAL_DETECT_IRQ
bool ' Support special multiport boards' CONFIG_SERIAL_MULTIPORT
bool ' Support the Bell Technologies HUB6 card' CONFIG_HUB6
+ if [ "$CONFIG_HUB6" != "n" ]; then
+ define_bool CONFIG_SERIAL_MANY_PORTS "y"
+ else
+ bool ' Support more than 4 serial ports' CONFIG_SERIAL_MANY_PORTS
+ fi
+ if [ "$CONFIG_SERIAL_MULTIPORT" != "n" -o "$CONFIG_HUB6" != "n" ]; then
+ define_bool CONFIG_SERIAL_SHARE_IRQ "y"
+ else
+ bool ' Support for sharing serial interrupts' CONFIG_SERIAL_SHARE_IRQ
+ fi
+ bool ' Autodetect IRQ on standard ports (unsafe)' CONFIG_SERIAL_DETECT_IRQ
fi
bool 'Non-standard serial port support' CONFIG_SERIAL_NONSTANDARD
if [ "$CONFIG_SERIAL_NONSTANDARD" = "y" ]; then
Index: linux-2.2.9/drivers/char/serial.c
--- linux-2.2.9/drivers/char/serial.c Wed, 24 Mar 1999 10:22:04 +1100 keith (linux-2.2/h/b/20_serial.c 1.2 644)
+++ linux/drivers/char/serial.c Sat, 12 Jun 1999 21:42:54 +1000 keith (linux-2.2/h/b/20_serial.c 1.2 644)
@@ -63,36 +63,9 @@
*/

#undef SERIAL_PARANOIA_CHECK
-#define CONFIG_SERIAL_NOPAUSE_IO
+#define SERIAL_NOPAUSE_IO
#define SERIAL_DO_RESTART

-#if 0
-/* Normally these defines are controlled by the autoconf.h */
-
-#define CONFIG_SERIAL_MANY_PORTS
-#define CONFIG_SERIAL_SHARE_IRQ
-#define CONFIG_SERIAL_DETECT_IRQ
-#define CONFIG_SERIAL_MULTIPORT
-#define CONFIG_HUB6
-#endif
-
-/* Sanity checks */
-
-#ifdef CONFIG_SERIAL_MULTIPORT
-#ifndef CONFIG_SERIAL_SHARE_IRQ
-#define CONFIG_SERIAL_SHARE_IRQ
-#endif
-#endif
-
-#ifdef CONFIG_HUB6
-#ifndef CONFIG_SERIAL_MANY_PORTS
-#define CONFIG_SERIAL_MANY_PORTS
-#endif
-#ifndef CONFIG_SERIAL_SHARE_IRQ
-#define CONFIG_SERIAL_SHARE_IRQ
-#endif
-#endif
-
/* Set of debugging defines */

#undef SERIAL_DEBUG_INTR
@@ -267,7 +240,7 @@
return inb_p(info->port+1);
} else
#endif
-#ifdef CONFIG_SERIAL_NOPAUSE_IO
+#ifdef SERIAL_NOPAUSE_IO
return inb(info->port + offset);
#else
return inb_p(info->port + offset);
@@ -294,7 +267,7 @@
outb_p(value, info->port+1);
} else
#endif
-#ifdef CONFIG_SERIAL_NOPAUSE_IO
+#ifdef SERIAL_NOPAUSE_IO
outb(value, info->port+offset);
#else
outb_p(value, info->port+offset);
Index: linux-2.2.9/arch/ppc/8xx_io/uart.c
--- linux-2.2.9/arch/ppc/8xx_io/uart.c Fri, 05 Feb 1999 09:47:48 +1100 keith (linux-2.2/v/b/31_uart.c 1.1 644)
+++ linux/arch/ppc/8xx_io/uart.c Sat, 12 Jun 1999 22:38:01 +1000 keith (linux-2.2/v/b/31_uart.c 1.1 644)
@@ -72,7 +72,6 @@
* Serial driver configuration section. Here are the various options:
*/
#define SERIAL_PARANOIA_CHECK
-#define CONFIG_SERIAL_NOPAUSE_IO
#define SERIAL_DO_RESTART

/* Set of debugging defines */
Index: linux-2.2.9/Documentation/Configure.help
--- linux-2.2.9/Documentation/Configure.help Wed, 12 May 1999 17:22:01 +1000 keith (linux-2.2/I/b/39_Configure. 1.2.1.3.1.3 644)
+++ linux/Documentation/Configure.help Sat, 12 Jun 1999 22:01:35 +1000 keith (linux-2.2/I/b/39_Configure. 1.2.1.3.1.3 644)
@@ -1328,11 +1328,16 @@
say N here to save some memory. You can also say Y if you have an
"intelligent" multiport card such as Cyclades, Digiboards, etc.

+ This option is automatically set if you select HUB6.
+
Support for sharing serial interrupts
CONFIG_SERIAL_SHARE_IRQ
Some serial boards have hardware support which allows multiple dumb
- serial ports on the same board to share a single IRQ. To enable
- support for this in the serial driver, say Y here.
+ serial ports on the same board to share a single IRQ. Multi function
+ PCMCIA cards (e.g. Ethernet + modem) must share a single IRQ. To
+ enable support for this in the serial driver, say Y here.
+
+ This option is automatically set if you select HUB6 or MULTIPORT.

Auto detect IRQ on standard ports (unsafe)
CONFIG_SERIAL_DETECT_IRQ
@@ -1351,6 +1356,8 @@
servicing. Say Y here to enable the serial driver to take advantage
of those special I/O ports.

+ Selecting this option automatically sets SHARE_IRQ.
+
SGI Zilog85C30 serial support
CONFIG_SGI_SERIAL
If you want to use your SGI's built-in serial ports under Linux,
@@ -1367,6 +1374,8 @@
CONFIG_HUB6
Say Y here to enable support in the dumb serial driver to support
the HUB6 card.
+
+ Setting this option automatically sets SHARE_IRQ and MANY_PORTS.

PCI support
CONFIG_PCI

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/