[patch] ltmodem-2.6-alk-8 update for 2.6.22.1

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



First, let me preface this by saying the martian driver
does not work for me.  It segfaults immediately upon
executing /usr/sbin/martian_modem.  It has something to do with
the symbol munging (ltmdmobj.o) and cross-compilation
(building for uclibc via buildroot for an embedded
soekris box). It crashes before main() is called.

Because of this, it was much easier for me to just port
the ltmodem driver to 2.6.22.1.  I am posting this
patch in the hopes that someone else may benefit from
it.  One thing to note about the patch as well is
that I changed the /dev name to ttySLTM instead of ttyLTM
because it does not require a udev rule update to get
the proper permissions set, and many serial port
finding routines only look for /dev/ttyS* devices.

Attached is the patch, I've confirmed the modem works
on a soekris net5501 machine with pci id 11c1:044c
00:0e.0 Communication controller: Agere Systems LT WinModem (rev 02)

-Brad


diff -ruN ltmodem-2.6-alk-8.orig/Makefile ltmodem-2.6-alk-8/Makefile
--- ltmodem-2.6-alk-8.orig/Makefile	2005-01-24 19:05:59.000000000 -0500
+++ ltmodem-2.6-alk-8/Makefile	2007-08-29 16:55:17.000000000 -0400
@@ -21,8 +21,10 @@
 
 EXTRA_LDFLAGS := -d
 
+MSRC_DIR = $(shell pwd)
+
 module:
-	make -C $(KERNEL_DIR) SUBDIRS=$(PWD) modules
+	make -C $(KERNEL_DIR) SUBDIRS=$(MSRC_DIR) modules
 
 $(obj)/ltmdmobj.o:
 	cp $(src)/ltmdmobj.o $(obj)/ltmdmobj.o
diff -ruN ltmodem-2.6-alk-8.orig/Module.symvers ltmodem-2.6-alk-8/Module.symvers
--- ltmodem-2.6-alk-8.orig/Module.symvers	1969-12-31 19:00:00.000000000 -0500
+++ ltmodem-2.6-alk-8/Module.symvers	2007-08-29 17:07:01.000000000 -0400
@@ -0,0 +1 @@
+0xd0536968	lt_get_modem_interface	/home/brad/buildroot/build_i586/ltmodem-2.6-alk-8/ltmodem	EXPORT_SYMBOL
diff -ruN ltmodem-2.6-alk-8.orig/lt_modem.c ltmodem-2.6-alk-8/lt_modem.c
--- ltmodem-2.6-alk-8.orig/lt_modem.c	2005-12-11 20:18:55.000000000 -0500
+++ ltmodem-2.6-alk-8/lt_modem.c	2007-08-29 17:03:50.000000000 -0400
@@ -120,14 +120,21 @@
 static int vendor_id = 0;
 static int device_id = 0;
 
-MODULE_PARM(vendor_id, "i");
+module_param(vendor_id, int, 0);
+module_param(device_id, int, 0);
+
 MODULE_PARM_DESC(vendor_id, "Vendor ID of the Lucent Modem e.g. vendor_id=0x11c1");
-MODULE_PARM(device_id, "i");
 MODULE_PARM_DESC(device_id, "Device ID of the Lucent Modem e.g. device_id=0x0440");
 
 static int Forced[4] = {-1,-1,-1,0};
 
-MODULE_PARM(Forced, "4i");
+static int Forced_set(const char *val, struct kernel_param *kp)
+{
+	get_options((char *)val, 4, (int *)Forced);
+	return 0;
+}
+module_param_call(Forced, Forced_set, NULL, NULL, 0);
+
 MODULE_PARM_DESC(Forced, "Forced Irq,BaseAddress,ComAddress[,NoDetect] of the Lucent Modem e.g. Forced=3,0x130,0x2f8");
 
 static
diff -ruN ltmodem-2.6-alk-8.orig/serial.c ltmodem-2.6-alk-8/serial.c
--- ltmodem-2.6-alk-8.orig/serial.c	2005-12-11 20:07:17.000000000 -0500
+++ ltmodem-2.6-alk-8/serial.c	2007-08-29 17:27:04.000000000 -0400
@@ -99,7 +99,7 @@
 */
 
 #include <linux/version.h>
-#include <linux/config.h>
+/* #include <linux/config.h> */
 #include <linux/module.h>
 #include <linux/tty.h>
 #include <linux/ioport.h>
@@ -729,11 +729,9 @@
 	.owner			= THIS_MODULE,
 	.driver_name		= "ltserial",
 #ifdef LT_USE_OLD_NAMES
-	.devfs_name		= "tts/LT",
-	.dev_name		= "ttyLT",
+	.dev_name		= "ttySLT",
 #else
-	.devfs_name		= "tts/LTM",
-	.dev_name		= "ttyLTM",
+	.dev_name		= "ttySLTM",
 #endif
 	.major			= 62,
 	.minor			= 64,

[Index of Archives]     [Linux Media Development]     [Asterisk]     [DCCP]     [Netdev]     [X.org]     [Xfree86]     [Fedora Women]     [Linux USB]

  Powered by Linux