Skip to contentSkip to conversation

Backport of USB speedtouch driver to 2.4

PATCH Applied Duncan Sands 2 participants 4 messages Apr 4, 2003 – Apr 10, 2003

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Backport of USB speedtouch driver to 2.4

Since the 2.5 crc library hasn't been backported
to the 2.4 tree yet, I included a crc routine in
the speedcrc files.

CREDITS                      |    8 
Documentation/Configure.help |   11 
MAINTAINERS                  |    8 
drivers/usb/Config.in        |    1 
drivers/usb/Makefile         |    5 
drivers/usb/speedcrc.c       |  124 +++
drivers/usb/speedcrc.h       |   28 
drivers/usb/speedtouch.c     | 1412 +++++++++++++++++++++++++++++++++++++++++++
8 files changed, 1597 insertions(+)
CREDITS +8 -0
diff -Nru a/CREDITS b/CREDITS
@@ -2667,6 +2667,14 @@
 E: [email protected]
 D: Dosemu
 
+N: Duncan Sands
+E: [email protected]
+W: http://topo.math.u-psud.fr/~sands
+D: Alcatel SpeedTouch USB driver
+S: 69 rue Dunois
+S: 75013 Paris
+S: France
+
 N: Hannu Savolainen
 E: [email protected]
 D: Maintainer of the sound drivers until 2.1.x days.
Documentation/Configure.help +11 -0
diff -Nru a/Documentation/Configure.help b/Documentation/Configure.help
@@ -14857,6 +14857,17 @@
   The module will be called dsbr100.o. If you want to compile it as a
   module, say M here and read <file:Documentation/modules.txt>.
 
+Alcatel Speedtouch USB support
+CONFIG_USB_SPEEDTOUCH
+  Say Y here if you have an Alcatel SpeedTouch USB or SpeedTouch 330
+  modem.  In order to use your modem you will need to install some user
+  space tools, see <http://www.linux-usb.org/SpeedTouch/> for details.
+
+  This code is also available as a module ( = code which can be
+  inserted in and removed from the running kernel whenever you want).
+  The module will be called speedtch.o. If you want to compile it as
+  a module, say M here and read <file:Documentation/modules.txt>.
+
 Always do synchronous disk IO for UBD
 CONFIG_BLK_DEV_UBD_SYNC
   The User-Mode Linux port includes a driver called UBD which will let
MAINTAINERS +8 -0
diff -Nru a/MAINTAINERS b/MAINTAINERS
@@ -206,6 +206,14 @@
 L:	[email protected]
 S:	Maintained
 
+ALCATEL SPEEDTOUCH USB DRIVER
+P:	Duncan Sands
+M:	[email protected]
+L:	[email protected]
+L:	[email protected]
+W:	http://www.linux-usb.org/SpeedTouch/
+S:	Maintained
+
 ALTERA EPXA1/EPXA10 DEVELOPMENT BOARD PORT
 P:	Clive Davies
 M:	[email protected]
drivers/usb/Config.in +1 -0
diff -Nru a/drivers/usb/Config.in b/drivers/usb/Config.in
@@ -105,5 +105,6 @@
    dep_tristate '  Texas Instruments Graph Link USB (aka SilverLink) cable support' CONFIG_USB_TIGL $CONFIG_USB
    dep_tristate '  Tieman Voyager USB Braille display support (EXPERIMENTAL)' CONFIG_USB_BRLVGER $CONFIG_USB $CONFIG_EXPERIMENTAL
    dep_tristate '  USB LCD device support' CONFIG_USB_LCD $CONFIG_USB
+   dep_tristate '  Alcatel Speedtouch USB support' CONFIG_USB_SPEEDTOUCH $CONFIG_ATM $CONFIG_USB
 fi
 endmenu
drivers/usb/Makefile +5 -0
diff -Nru a/drivers/usb/Makefile b/drivers/usb/Makefile
@@ -19,6 +19,7 @@
 hid-objs		:= hid-core.o
 pwc-objs		:= pwc-if.o pwc-misc.o pwc-ctrl.o pwc-uncompress.o
 auerswald-objs		:= auerbuf.o auerchain.o auerchar.o auermain.o
+speedtch-objs		:= speedcrc.o speedtouch.o
 
 # Optional parts of multipart objects.
 
@@ -117,6 +118,7 @@
 obj-$(CONFIG_USB_AUERSWALD)	+= auerswald.o
 obj-$(CONFIG_USB_BRLVGER)	+= brlvger.o
 obj-$(CONFIG_USB_LCD)		+= usblcd.o
+obj-$(CONFIG_USB_SPEEDTOUCH)	+= speedtch.o
 
 # Object files in subdirectories
 mod-subdirs	:= serial host
@@ -147,3 +149,6 @@
 
 auerswald.o: $(auerswald-objs)
 	$(LD) -r -o $@ $(auerswald-objs)
+
+speedtch.o: $(speedtch-objs)
+	$(LD) -r -o $@ $(speedtch-objs)
drivers/usb/speedcrc.c new file +124 -0

124 lines not on this page · raw message

drivers/usb/speedcrc.h new file +28 -0
diff -Nru a/drivers/usb/speedcrc.h b/drivers/usb/speedcrc.h
@@ -0,0 +1,28 @@
+#ifndef _SPEEDCRC_H_
+#define _SPEEDCRC_H_
+
+/******************************************************************************
+ *  speedcrc.h  --  CRC library for use with speedtouch.
+ *
+ *  Copyright (C) 2000, Johan Verrept
+ *
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License as published by the Free
+ *  Software Foundation; either version 2 of the License, or (at your option)
+ *  any later version.
+ *
+ *  This program is distributed in the hope that it will be useful, but WITHOUT
+ *  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ *  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ *  more details.
+ *
+ *  You should have received a copy of the GNU General Public License along with
+ *  this program; if not, write to the Free Software Foundation, Inc., 59
+ *  Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *
+ ******************************************************************************/
+
+unsigned long spdcrc32 (char *mem, int len, unsigned initial);
+#define crc32_be(crc, mem, len) spdcrc32(mem, len, crc);
+
+#endif				/* _SPEEDCRC_H_ */
drivers/usb/speedtouch.c new file +1412 -0

1,412 lines not on this page · raw message

Applied
#1 lore raw
Quoted 3 lines · Duncan Sands

Since the 2.5 crc library hasn't been backported
to the 2.4 tree yet, I included a crc routine in
the speedcrc files.

Applied to my 2.4 tree, but I will hold off sending it to Marcelo until 2.4.21 comes out.

thanks,

greg k-h

#2 lore raw

PATCH 1/1 USB speedtouch (2.4): move MOD_INC_USE_COUNT

 speedtouch.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
drivers/usb/speedtouch.c +4 -2
diff -Nru a/drivers/usb/speedtouch.c b/drivers/usb/speedtouch.c
@@ -938,15 +938,19 @@
 		return -EAGAIN;
 	}
 
+	MOD_INC_USE_COUNT;
+
 	down (&instance->serialize); /* vs self, udsl_atm_close */
 
 	if (udsl_find_vcc (instance, vpi, vci)) {
 		up (&instance->serialize);
+		MOD_DEC_USE_COUNT;
 		return -EADDRINUSE;
 	}
 
 	if (!(new = kmalloc (sizeof (struct udsl_vcc_data), GFP_KERNEL))) {
 		up (&instance->serialize);
+		MOD_DEC_USE_COUNT;
 		return -ENOMEM;
 	}
 
@@ -975,8 +979,6 @@
 	udsl_fire_receivers (instance);
 
 	dbg ("udsl_atm_open successful");
-
-	MOD_INC_USE_COUNT;
 
 	return 0;
 }
Applied
#3 lore raw

Re: [PATCH] USB speedtouch (2.4): move MOD_INC_USE_COUNT

Applied, thanks.

greg k-h