speedtch speedtch.c,1.44,1.45

Duncan Sands duncan at infradead.org
Thu Apr 14 12:05:13 EDT 2005


Update of /home/cvs/speedtch
In directory phoenix.infradead.org:/tmp/cvs-serv4971

Modified Files:
	speedtch.c 
Log Message:
Add a parameter for choosing the altsetting on interface 1.  usb_set_interface
will catch any out of range parameters.  Made all the parameters writable, since
that may be useful for someone with several modems, and having them change
asynchronously is no problem.  Removed a bunch of unused header files while I was
there and re-ordered the others alphabetically.


Index: speedtch.c
===================================================================
RCS file: /home/cvs/speedtch/speedtch.c,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -r1.44 -r1.45
--- speedtch.c	14 Apr 2005 13:48:00 -0000	1.44
+++ speedtch.c	14 Apr 2005 16:05:10 -0000	1.45
@@ -21,26 +21,19 @@
  *
  ******************************************************************************/
 
-#include <linux/module.h>
-#include <linux/moduleparam.h>
+#include <asm/page.h>
+#include <linux/device.h>
+#include <linux/errno.h>
 #include <linux/gfp.h>
+#include <linux/firmware.h>
 #include <linux/kernel.h>
-#include <linux/sched.h>
-#include <linux/timer.h>
-#include <linux/errno.h>
-#include <linux/proc_fs.h>
-#include <linux/slab.h>
-#include <linux/wait.h>
-#include <linux/list.h>
-#include <asm/processor.h>
-#include <asm/uaccess.h>
-#include <linux/smp_lock.h>
-#include <linux/interrupt.h>
-#include <linux/atm.h>
-#include <linux/atmdev.h>
-#include <linux/crc32.h>
 #include <linux/init.h>
-#include <linux/firmware.h>
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/slab.h>
+#include <linux/stat.h>
+#include <linux/timer.h>
+#include <linux/workqueue.h>
 
 #include "usbatm.h"
 
@@ -67,14 +60,28 @@
 #define SIZE_e		1
 #define SIZE_f		1
 
-static int dl_512_first = 0;
-static int sw_buffering = 0;
-
-module_param(dl_512_first, bool, 0444);
-MODULE_PARM_DESC(dl_512_first, "Read 512 bytes before sending firmware");
-
-module_param(sw_buffering, bool, 0444);
-MODULE_PARM_DESC(sw_buffering, "Enable software buffering");
+#define SPEEDTCH_DEFAULT_ALTSETTING	1
+#define SPEEDTCH_DEFAULT_DL_512_FIRST	0
+#define SPEEDTCH_DEFAULT_SW_BUFFERING	0
+
+static int altsetting = SPEEDTCH_DEFAULT_ALTSETTING;
+static int dl_512_first = SPEEDTCH_DEFAULT_DL_512_FIRST;
+static int sw_buffering = SPEEDTCH_DEFAULT_SW_BUFFERING;
+
+module_param(altsetting, int, S_IRUGO | S_IWUSR);
+MODULE_PARM_DESC(altsetting,
+		 "Alternative setting for data interface (default: "
+		 __MODULE_STRING(SPEEDTCH_DEFAULT_ALTSETTING) ")");
+
+module_param(dl_512_first, bool, S_IRUGO | S_IWUSR);
+MODULE_PARM_DESC(dl_512_first,
+		 "Read 512 bytes before sending firmware (default: "
+		 __MODULE_STRING(SPEEDTCH_DEFAULT_DL_512_FIRST) ")");
+
+module_param(sw_buffering, bool, S_IRUGO | S_IWUSR);
+MODULE_PARM_DESC(sw_buffering,
+		 "Enable software buffering (default: "
+		 __MODULE_STRING(SPEEDTCH_DEFAULT_SW_BUFFERING) ")");
 
 #define UDSL_IOCTL_LINE_UP		1
 #define UDSL_IOCTL_LINE_DOWN		2
@@ -550,7 +557,7 @@
 
 	atm_dbg(usbatm, "%s entered\n", __func__);
 
-	if ((ret = usb_set_interface(usb_dev, 1, 1)) < 0) { //QQ I hear that some old modems need altsetting 2 here
+	if ((ret = usb_set_interface(usb_dev, 1, altsetting)) < 0) {
 		atm_dbg(usbatm, "%s: usb_set_interface returned %d!\n", __func__, ret);
 		return ret;
 	}




More information about the Usbatm-commits mailing list