Skip to contentSkip to conversation

set the number of serial ports

PATCH New Jun Sun 1 participant 1 message Aug 22, 2001

Subsystems (2)
lore
Share & tools
lore

Jun Sun

author
#0 lore raw

PATCH 1/1 set the number of serial ports

Who is maintaining serial.c file? I sent this email to Ted Tso a while back and did not get any replies. Here is another try.

Jun

This attempts to solve two problmes:

1. reserves rs_table size even without any SERIAL_PORT_DFNS. This is necessary for machines that must detect serial ports at run-time. It is also a better way to use early_serial_setup() to set up serial ports, especially serial.h is *really* getting crowded for RISC arches.

2. When CONFIG_SERIAL_MANY_PORTS is defined, we will 64 rs_table entries (under MIPS and other arches). We can save up to 11K with some more reasonable CONFIG_NUM_SERIAL_PORTS value.

Jun
08/22/2001

drivers/char/Config.in renamed from drivers/char/Config.in.orig +1 -0
diff -Nru linux/drivers/char/Config.in.orig linux/drivers/char/Config.in
@@ -11,6 +11,7 @@
 tristate 'Standard/generic (8250/16550 and compatible UARTs) serial support' CONFIG_SERIAL
 if [ "$CONFIG_SERIAL" = "y" ]; then
    bool '  Support for console on serial port' CONFIG_SERIAL_CONSOLE
+   int '   Number of serial ports (0 for system default)' CONFIG_SERIAL_NUM_PORTS  0
    if [ "$CONFIG_ARCH_ACORN" = "y" ]; then
       tristate '   Atomwide serial port support' CONFIG_ATOMWIDE_SERIAL
       tristate '   Dual serial port support' CONFIG_DUALSP_SERIAL
drivers/char/serial.c renamed from drivers/char/serial.c.orig +8 -0
diff -Nru linux/drivers/char/serial.c.orig linux/drivers/char/serial.c
@@ -321,6 +321,14 @@
 MODULE_PARM_DESC(force_rsa, "Force I/O ports for RSA");
 #endif /* CONFIG_SERIAL_RSA  */
 
+/* 
+ * [jsun] We horner the CONFIG_SERIAL_NUM_PORTS variable
+ */
+#if (CONFIG_SERIAL_NUM_PORTS != 0)
+#undef RS_TABLE_SIZE
+#define RS_TABLE_SIZE	CONFIG_SERIAL_NUM_PORTS
+#endif
+
 static struct serial_state rs_table[RS_TABLE_SIZE] = {
 	SERIAL_PORT_DFNS	/* Defined in serial.h */
 };