Subject: [Patch] Make ltmodem work together with other serial modules
From: Christoph Rohland <cr@sap.com>
Date: 23 Feb 2001 11:39:00 +0100
23 Feb 2001 11:39:00 +0100
Hi there,

The following patch against the resulting serial-lt-2.4.c makes it
work with my pcmcia modem. Without this the serial_cs module will
register at the ltmodem module and screw up wildly.

Greetings
		Christoph



--- ltmodem-5.78e/serial-lt-2.4.c	Fri Feb 23 10:03:05 2001
+++ ltmodem-5.78e.cr/serial-lt-2.4.c	Fri Feb 23 10:03:12 2001
@@ -151,7 +151,7 @@
 #undef CONFIG_SERIAL_CONSOLE
 #endif
 
-#define CONFIG_SERIAL_RSA
+// #define CONFIG_SERIAL_RSA
 
 #define RS_STROBE_TIME (10*HZ)
 #define RS_ISR_PASS_LIMIT 256
@@ -272,7 +272,12 @@
 
 static DECLARE_TASK_QUEUE(tq_serial);
 
+#ifndef LUCENT_MODEM
 static struct tty_driver serial_driver, callout_driver;
+#else
+static struct tty_driver serial_driver;
+#endif
+
 static int serial_refcount;
 
 static struct timer_list serial_timer;
@@ -342,13 +347,7 @@
 #if defined(CONFIG_SERIAL_RSA) && defined(MODULE)
 
 #define PORT_RSA_MAX 4
-static int probe_rsa[PORT_RSA_MAX];
-static int force_rsa[PORT_RSA_MAX];
 
-MODULE_PARM(probe_rsa, "1-" __MODULE_STRING(PORT_RSA_MAX) "i");
-MODULE_PARM_DESC(probe_rsa, "Probe I/O ports for RSA");
-MODULE_PARM(force_rsa, "1-" __MODULE_STRING(PORT_RSA_MAX) "i");
-MODULE_PARM_DESC(force_rsa, "Force I/O ports for RSA");
 #endif /* CONFIG_SERIAL_RSA  */
 
 #ifdef LUCENT_MODEM
@@ -3964,21 +3963,18 @@
 #endif
 }
 
+#ifndef LUCENT_MODEM
 int register_serial(struct serial_struct *req);
 void unregister_serial(int line);
 
-#ifndef LUCENT_MODEM
 #if (LINUX_VERSION_CODE > 0x20100)
 EXPORT_SYMBOL(register_serial);
 EXPORT_SYMBOL(unregister_serial);
-#else
-static struct symbol_table serial_syms = {
-#include <linux/symtab_begin.h>
-	X(register_serial),
-	X(unregister_serial),
-#include <linux/symtab_end.h>
-};
 #endif
+#else 
+
+static int register_ltserial(struct serial_struct *req);
+
 #endif /* LUCENT_MODEM */
 
 
@@ -4136,7 +4132,7 @@
 		printk("Setup PCI/PNP port: port %x, irq %d, type %d\n",
 		       serial_req.port, serial_req.irq, serial_req.io_type);
 #endif
-		line = register_serial(&serial_req);
+		line = register_ltserial(&serial_req);
 		if (line < 0)
 			break;
 		rs_table[line].baud_base = base_baud;
@@ -5425,7 +5421,7 @@
 		    && (state->flags & ASYNC_AUTO_IRQ)
 		    && (state->port != 0))
 			state->irq = detect_uart_irq(state);
-		printk(KERN_INFO "ttyS%02d%s at 0x%04lx (irq = %d) is a %s\n",
+		printk(KERN_INFO "ttyLT%02d%s at 0x%04lx (irq = %d) is a %s\n",
 		       state->line + SERIAL_DEV_OFFSET,
 		       (state->flags & ASYNC_FOURPORT) ? " FourPort" : "",
 		       state->port, state->irq,
@@ -5465,7 +5461,7 @@
  *	On success the port is ready to use and the line number is returned.
  */
  
-int register_serial(struct serial_struct *req)
+static int register_ltserial(struct serial_struct *req)
 {
 	int i;
 	unsigned long flags;
@@ -5518,7 +5514,7 @@
 	autoconfig(state);
 	if (state->type == PORT_UNKNOWN) {
 		restore_flags(flags);
-		printk("register_serial(): autoconfig failed\n");
+		printk("register_ltserial(): autoconfig failed\n");
 		return -1;
 	}
 	restore_flags(flags);
@@ -5526,7 +5522,7 @@
 	if ((state->flags & ASYNC_AUTO_IRQ) && CONFIGURED_SERIAL_PORT(state))
 		state->irq = detect_uart_irq(state);
 
-       printk(KERN_INFO "ttyS%02d at %s 0x%04lx (irq = %d) is a %s\n",
+       printk(KERN_INFO "ttyLT%02d at %s 0x%04lx (irq = %d) is a %s\n",
 	      state->line + SERIAL_DEV_OFFSET,
 	      state->iomem_base ? "iomem" : "port",
 	      state->iomem_base ? (unsigned long)state->iomem_base :
@@ -5540,6 +5536,7 @@
 	return state->line + SERIAL_DEV_OFFSET;
 }
 
+#ifndef LUCENT_MODEM
 /**
  *	unregister_serial - deconfigure a 16x50 serial port
  *	@line: line to deconfigure
@@ -5568,6 +5565,7 @@
 			     callout_driver.minor_start + state->line);
 	restore_flags(flags);
 }
+#endif
 
 static void __exit rs_fini(void) 
 {