linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/8] gigaset: documentation update
  2009-05-13 22:44 [PATCH 0/8] Gigaset driver bugfixes and cleanups Tilman Schmidt
                   ` (2 preceding siblings ...)
  2009-05-13 22:44 ` [PATCH 2/8] gigaset: fix possible oops in error handling Tilman Schmidt
@ 2009-05-13 22:44 ` Tilman Schmidt
  2009-05-13 22:44 ` [PATCH 4/8] gigaset: skip unnecessary hex formatting Tilman Schmidt
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Tilman Schmidt @ 2009-05-13 22:44 UTC (permalink / raw)
  To: davem, linux-kernel, netdev; +Cc: Hansjoerg Lipp

Mention handling of unregisteted DECT wireless datasets in README.gigaset.

Signed-off-by: Tilman Schmidt <tilman@imap.cc>
---
 Documentation/isdn/README.gigaset |   23 ++++++++++++++++++++++-
 1 files changed, 22 insertions(+), 1 deletions(-)

diff --git a/Documentation/isdn/README.gigaset b/Documentation/isdn/README.gigaset
index 02c0e93..f6e9eaa 100644
--- a/Documentation/isdn/README.gigaset
+++ b/Documentation/isdn/README.gigaset
@@ -192,7 +192,6 @@ GigaSet 307x Device Driver
 
 2.6. M105 Undocumented USB Requests
      ------------------------------
-
      The Gigaset M105 USB data box understands a couple of useful, but
      undocumented USB commands. These requests are not used in normal
      operation (for wireless access to the base), but are needed for access
@@ -204,6 +203,20 @@ GigaSet 307x Device Driver
      M105, try setting that option to "y" via 'make {x,menu}config' and
      recompiling the driver.
 
+2.7. Unregistered Wireless Devices (M101/M105)
+     -----------------------------------------
+     The main purpose of the ser_gigaset and usb_gigaset drivers is to allow
+     the M101 and M105 wireless devices to be used as ISDN devices for ISDN
+     connections through a Gigaset base. Therefore they assume that the device
+     is registered to a DECT base.
+
+     If the M101/M105 device is not registered to a base, initialization of
+     the device fails, and a corresponding error message is logged by the
+     driver. In that situation, a restricted set of functions is available
+     which includes, in particular, those necessary for registering the device
+     to a base or for switching it between Fixed Part and Portable Part
+     modes. For the M105, these commands require the "Support for undocumented
+     USB requests" configuration option (see section 2.6.) to be enabled.
 
 3.   Troubleshooting
      ---------------
@@ -240,6 +253,14 @@ GigaSet 307x Device Driver
         Recompile the usb_gigaset driver with the kernel configuration option
         CONFIG_GIGASET_UNDOCREQ set to 'y'. (see section 2.6.)
 
+     Problem:
+	Messages like this:
+	    usb_gigaset 3-2:1.0: Could not initialize the device.
+	appear in your syslog.
+     Solution:
+	Check whether your M10x wireless device is correctly registered to the
+	Gigaset base. (see section 2.7.)
+
 3.2. Telling the driver to provide more information
      ----------------------------------------------
      Building the driver with the "Gigaset debugging" kernel configuration
-- 
1.6.2.1.214.ge986c


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 5/8] gigaset: remove obsolete references to m10x state table
  2009-05-13 22:44 [PATCH 0/8] Gigaset driver bugfixes and cleanups Tilman Schmidt
  2009-05-13 22:44 ` [PATCH 3/8] gigaset: fix error return code Tilman Schmidt
@ 2009-05-13 22:44 ` Tilman Schmidt
  2009-05-13 22:44 ` [PATCH 2/8] gigaset: fix possible oops in error handling Tilman Schmidt
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Tilman Schmidt @ 2009-05-13 22:44 UTC (permalink / raw)
  To: davem, linux-kernel, netdev; +Cc: Hansjoerg Lipp

The separation of state tables for base and M10x has long been
removed. Clean up remaining traces of it.

Impact: cleanup
Signed-off-by: Tilman Schmidt <tilman@imap.cc>
---
 drivers/isdn/gigaset/common.c   |   10 ++--------
 drivers/isdn/gigaset/ev-layer.c |    4 ++--
 drivers/isdn/gigaset/gigaset.h  |    4 ++--
 3 files changed, 6 insertions(+), 12 deletions(-)

diff --git a/drivers/isdn/gigaset/common.c b/drivers/isdn/gigaset/common.c
index 0048ce9..79c9b0f 100644
--- a/drivers/isdn/gigaset/common.c
+++ b/drivers/isdn/gigaset/common.c
@@ -672,14 +672,8 @@ struct cardstate *gigaset_initcs(struct gigaset_driver *drv, int channels,
 	cs->tty = NULL;
 	cs->tty_dev = NULL;
 	cs->cidmode = cidmode != 0;
-
-	//if(onechannel) { //FIXME
-		cs->tabnocid = gigaset_tab_nocid_m10x;
-		cs->tabcid = gigaset_tab_cid_m10x;
-	//} else {
-	//	cs->tabnocid = gigaset_tab_nocid;
-	//	cs->tabcid = gigaset_tab_cid;
-	//}
+	cs->tabnocid = gigaset_tab_nocid;
+	cs->tabcid = gigaset_tab_cid;
 
 	init_waitqueue_head(&cs->waitqueue);
 	cs->waiting = 0;
diff --git a/drivers/isdn/gigaset/ev-layer.c b/drivers/isdn/gigaset/ev-layer.c
index e582a48..ec51696 100644
--- a/drivers/isdn/gigaset/ev-layer.c
+++ b/drivers/isdn/gigaset/ev-layer.c
@@ -160,7 +160,7 @@
 
 
 // 100: init, 200: dle0, 250:dle1, 300: get cid (dial), 350: "hup" (no cid), 400: hup, 500: reset, 600: dial, 700: ring
-struct reply_t gigaset_tab_nocid_m10x[]= /* with dle mode */
+struct reply_t gigaset_tab_nocid[] =
 {
 	/* resp_code, min_ConState, max_ConState, parameter, new_ConState, timeout, action, command */
 
@@ -280,7 +280,7 @@ struct reply_t gigaset_tab_nocid_m10x[]= /* with dle mode */
 };
 
 // 600: start dialing, 650: dial in progress, 800: connection is up, 700: ring, 400: hup, 750: accepted icall
-struct reply_t gigaset_tab_cid_m10x[] = /* for M10x */
+struct reply_t gigaset_tab_cid[] =
 {
 	/* resp_code, min_ConState, max_ConState, parameter, new_ConState, timeout, action, command */
 
diff --git a/drivers/isdn/gigaset/gigaset.h b/drivers/isdn/gigaset/gigaset.h
index 747178f..d5f0110 100644
--- a/drivers/isdn/gigaset/gigaset.h
+++ b/drivers/isdn/gigaset/gigaset.h
@@ -282,8 +282,8 @@ struct reply_t {
 	char	*command;	/* NULL==none */
 };
 
-extern struct reply_t gigaset_tab_cid_m10x[];
-extern struct reply_t gigaset_tab_nocid_m10x[];
+extern struct reply_t gigaset_tab_cid[];
+extern struct reply_t gigaset_tab_nocid[];
 
 struct inbuf_t {
 	unsigned char		*rcvbuf;	/* usb-gigaset receive buffer */
-- 
1.6.2.1.214.ge986c


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 2/8] gigaset: fix possible oops in error handling
  2009-05-13 22:44 [PATCH 0/8] Gigaset driver bugfixes and cleanups Tilman Schmidt
  2009-05-13 22:44 ` [PATCH 3/8] gigaset: fix error return code Tilman Schmidt
  2009-05-13 22:44 ` [PATCH 5/8] gigaset: remove obsolete references to m10x state table Tilman Schmidt
@ 2009-05-13 22:44 ` Tilman Schmidt
  2009-05-13 22:44 ` [PATCH 1/8] gigaset: documentation update Tilman Schmidt
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Tilman Schmidt @ 2009-05-13 22:44 UTC (permalink / raw)
  To: davem, linux-kernel, netdev; +Cc: Hansjoerg Lipp

Use pr_warning() / pr_err() instead of dev_warn() / dev_err() in two
places where the dev pointer isn't guaranteed to be valid.

Impact: error handling bugfix
Signed-off-by: Tilman Schmidt <tilman@imap.cc>
---
 drivers/isdn/gigaset/interface.c |    3 +--
 drivers/isdn/gigaset/proc.c      |    2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/isdn/gigaset/interface.c b/drivers/isdn/gigaset/interface.c
index 820a309..5a8e259 100644
--- a/drivers/isdn/gigaset/interface.c
+++ b/drivers/isdn/gigaset/interface.c
@@ -599,8 +599,7 @@ void gigaset_if_init(struct cardstate *cs)
 	if (!IS_ERR(cs->tty_dev))
 		dev_set_drvdata(cs->tty_dev, cs);
 	else {
-		dev_warn(cs->dev,
-			 "could not register device to the tty subsystem\n");
+		pr_warning("could not register device to the tty subsystem\n");
 		cs->tty_dev = NULL;
 	}
 	mutex_unlock(&cs->mutex);
diff --git a/drivers/isdn/gigaset/proc.c b/drivers/isdn/gigaset/proc.c
index da6f3ac..9715aad 100644
--- a/drivers/isdn/gigaset/proc.c
+++ b/drivers/isdn/gigaset/proc.c
@@ -79,5 +79,5 @@ void gigaset_init_dev_sysfs(struct cardstate *cs)
 
 	gig_dbg(DEBUG_INIT, "setting up sysfs");
 	if (device_create_file(cs->tty_dev, &dev_attr_cidmode))
-		dev_err(cs->dev, "could not create sysfs attribute\n");
+		pr_err("could not create sysfs attribute\n");
 }
-- 
1.6.2.1.214.ge986c


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 0/8] Gigaset driver bugfixes and cleanups
@ 2009-05-13 22:44 Tilman Schmidt
  2009-05-13 22:44 ` [PATCH 3/8] gigaset: fix error return code Tilman Schmidt
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: Tilman Schmidt @ 2009-05-13 22:44 UTC (permalink / raw)
  To: davem, linux-kernel, netdev; +Cc: Hansjoerg Lipp

Dave,

following are 8 small patches for the Gigaset driver I'd like to get
out from under my feet. Nothing urgent, so if you feel they are
inappropriate for merging that late in the 2.6.30 cycle they can as
well wait for 2.6.31.

Thanks,
Tilman

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 4/8] gigaset: skip unnecessary hex formatting
  2009-05-13 22:44 [PATCH 0/8] Gigaset driver bugfixes and cleanups Tilman Schmidt
                   ` (3 preceding siblings ...)
  2009-05-13 22:44 ` [PATCH 1/8] gigaset: documentation update Tilman Schmidt
@ 2009-05-13 22:44 ` Tilman Schmidt
  2009-05-13 22:44 ` [PATCH 8/8] gigaset: move up Kconfig inclusion point Tilman Schmidt
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Tilman Schmidt @ 2009-05-13 22:44 UTC (permalink / raw)
  To: davem, linux-kernel, netdev; +Cc: Hansjoerg Lipp

Don't generate the hex representation of the payload data if it
isn't actually used afterwards.

Impact: optimization
Signed-off-by: Tilman Schmidt <tilman@imap.cc>
---
 drivers/isdn/gigaset/isocdata.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/isdn/gigaset/isocdata.c b/drivers/isdn/gigaset/isocdata.c
index b171e75..09202a5 100644
--- a/drivers/isdn/gigaset/isocdata.c
+++ b/drivers/isdn/gigaset/isocdata.c
@@ -246,6 +246,10 @@ static inline void dump_bytes(enum debuglevel level, const char *tag,
 	unsigned char c;
 	static char dbgline[3 * 32 + 1];
 	int i = 0;
+
+	if (!(gigaset_debuglevel & level))
+		return;
+
 	while (count-- > 0) {
 		if (i > sizeof(dbgline) - 4) {
 			dbgline[i] = '\0';
-- 
1.6.2.1.214.ge986c


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 3/8] gigaset: fix error return code
  2009-05-13 22:44 [PATCH 0/8] Gigaset driver bugfixes and cleanups Tilman Schmidt
@ 2009-05-13 22:44 ` Tilman Schmidt
  2009-05-13 22:44 ` [PATCH 5/8] gigaset: remove obsolete references to m10x state table Tilman Schmidt
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Tilman Schmidt @ 2009-05-13 22:44 UTC (permalink / raw)
  To: davem, linux-kernel, netdev; +Cc: Hansjoerg Lipp

gigaset_register_to_LL() is expected to print a message and return 0
on failure. Make it do so consistently.

Impact: error handling bugfix
Signed-off-by: Tilman Schmidt <tilman@imap.cc>
---
 drivers/isdn/gigaset/i4l.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/isdn/gigaset/i4l.c b/drivers/isdn/gigaset/i4l.c
index 69a702f..9b22f9c 100644
--- a/drivers/isdn/gigaset/i4l.c
+++ b/drivers/isdn/gigaset/i4l.c
@@ -544,11 +544,11 @@ int gigaset_register_to_LL(struct cardstate *cs, const char *isdnid)
 
 	gig_dbg(DEBUG_ANY, "Register driver capabilities to LL");
 
-	//iif->id[sizeof(iif->id) - 1]=0;
-	//strncpy(iif->id, isdnid, sizeof(iif->id) - 1);
 	if (snprintf(iif->id, sizeof iif->id, "%s_%u", isdnid, cs->minor_index)
-	    >= sizeof iif->id)
-		return -ENOMEM; //FIXME EINVAL/...??
+	    >= sizeof iif->id) {
+		pr_err("ID too long: %s\n", isdnid);
+		return 0;
+	}
 
 	iif->owner = THIS_MODULE;
 	iif->channels = cs->channels;
@@ -568,8 +568,10 @@ int gigaset_register_to_LL(struct cardstate *cs, const char *isdnid)
 	iif->rcvcallb_skb = NULL;		/* Will be set by LL */
 	iif->statcallb = NULL;			/* Will be set by LL */
 
-	if (!register_isdn(iif))
+	if (!register_isdn(iif)) {
+		pr_err("register_isdn failed\n");
 		return 0;
+	}
 
 	cs->myid = iif->channels;		/* Set my device id */
 	return 1;
-- 
1.6.2.1.214.ge986c


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 6/8] gigaset: remove unused structure member rcvbytes
  2009-05-13 22:44 [PATCH 0/8] Gigaset driver bugfixes and cleanups Tilman Schmidt
                   ` (6 preceding siblings ...)
  2009-05-13 22:44 ` [PATCH 7/8] gigaset: remove UNDOCREQ config option Tilman Schmidt
@ 2009-05-13 22:44 ` Tilman Schmidt
  2009-05-18  3:51 ` [PATCH 0/8] Gigaset driver bugfixes and cleanups David Miller
  8 siblings, 0 replies; 10+ messages in thread
From: Tilman Schmidt @ 2009-05-13 22:44 UTC (permalink / raw)
  To: davem, linux-kernel, netdev; +Cc: Hansjoerg Lipp

The B channel data structure member rcvbytes was never set to
anything else but zero, so drop it.

Impact: cleanup
Signed-off-by: Tilman Schmidt <tilman@imap.cc>
---
 drivers/isdn/gigaset/asyncdata.c |    5 ++---
 drivers/isdn/gigaset/common.c    |    2 --
 drivers/isdn/gigaset/gigaset.h   |    1 -
 3 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/isdn/gigaset/asyncdata.c b/drivers/isdn/gigaset/asyncdata.c
index 2a4ce96..234cc5d 100644
--- a/drivers/isdn/gigaset/asyncdata.c
+++ b/drivers/isdn/gigaset/asyncdata.c
@@ -174,9 +174,8 @@ byte_stuff:
 
 				if (unlikely(fcs != PPP_GOODFCS)) {
 					dev_err(cs->dev,
-					    "Packet checksum at %lu failed, "
-					    "packet is corrupted (%u bytes)!\n",
-					    bcs->rcvbytes, skb->len);
+				"Checksum failed, %u bytes corrupted!\n",
+						skb->len);
 					compskb = NULL;
 					gigaset_rcv_error(compskb, cs, bcs);
 					error = 1;
diff --git a/drivers/isdn/gigaset/common.c b/drivers/isdn/gigaset/common.c
index 79c9b0f..e4141bf 100644
--- a/drivers/isdn/gigaset/common.c
+++ b/drivers/isdn/gigaset/common.c
@@ -565,8 +565,6 @@ static struct bc_state *gigaset_initbcs(struct bc_state *bcs,
 	gig_dbg(DEBUG_INIT, "setting up bcs[%d]->at_state", channel);
 	gigaset_at_init(&bcs->at_state, bcs, cs, -1);
 
-	bcs->rcvbytes = 0;
-
 #ifdef CONFIG_GIGASET_DEBUG
 	bcs->emptycount = 0;
 #endif
diff --git a/drivers/isdn/gigaset/gigaset.h b/drivers/isdn/gigaset/gigaset.h
index d5f0110..a2f6125 100644
--- a/drivers/isdn/gigaset/gigaset.h
+++ b/drivers/isdn/gigaset/gigaset.h
@@ -384,7 +384,6 @@ struct bc_state {
 	int trans_up;			/* Counter of packages (upstream) */
 
 	struct at_state_t at_state;
-	unsigned long rcvbytes;
 
 	__u16 fcs;
 	struct sk_buff *skb;
-- 
1.6.2.1.214.ge986c


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 8/8] gigaset: move up Kconfig inclusion point
  2009-05-13 22:44 [PATCH 0/8] Gigaset driver bugfixes and cleanups Tilman Schmidt
                   ` (4 preceding siblings ...)
  2009-05-13 22:44 ` [PATCH 4/8] gigaset: skip unnecessary hex formatting Tilman Schmidt
@ 2009-05-13 22:44 ` Tilman Schmidt
  2009-05-13 22:44 ` [PATCH 7/8] gigaset: remove UNDOCREQ config option Tilman Schmidt
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Tilman Schmidt @ 2009-05-13 22:44 UTC (permalink / raw)
  To: davem, linux-kernel, netdev; +Cc: Hansjoerg Lipp

In preparation for porting to kernel CAPI subsystem, include the
Gigaset driver's Kconfig directly from ISDN's instead of I4L's.

Impact: Kconfig reorganisation, no functional change
Signed-off-by: Tilman Schmidt <tilman@imap.cc>
---
 drivers/isdn/Kconfig         |    2 ++
 drivers/isdn/gigaset/Kconfig |    1 +
 drivers/isdn/i4l/Kconfig     |    2 --
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/isdn/Kconfig b/drivers/isdn/Kconfig
index 3d113c6..02bdca6 100644
--- a/drivers/isdn/Kconfig
+++ b/drivers/isdn/Kconfig
@@ -61,4 +61,6 @@ source "drivers/isdn/hardware/Kconfig"
 
 endif # ISDN_CAPI
 
+source "drivers/isdn/gigaset/Kconfig"
+
 endif # ISDN
diff --git a/drivers/isdn/gigaset/Kconfig b/drivers/isdn/gigaset/Kconfig
index 65ca305..18ab865 100644
--- a/drivers/isdn/gigaset/Kconfig
+++ b/drivers/isdn/gigaset/Kconfig
@@ -1,5 +1,6 @@
 menuconfig ISDN_DRV_GIGASET
 	tristate "Siemens Gigaset support"
+	depends on ISDN_I4L
 	select CRC_CCITT
 	select BITREVERSE
 	help
diff --git a/drivers/isdn/i4l/Kconfig b/drivers/isdn/i4l/Kconfig
index 36778b2..ed3510f 100644
--- a/drivers/isdn/i4l/Kconfig
+++ b/drivers/isdn/i4l/Kconfig
@@ -135,5 +135,3 @@ source "drivers/isdn/act2000/Kconfig"
 source "drivers/isdn/hysdn/Kconfig"
 
 endmenu
-
-source "drivers/isdn/gigaset/Kconfig"
-- 
1.6.2.1.214.ge986c


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 7/8] gigaset: remove UNDOCREQ config option
  2009-05-13 22:44 [PATCH 0/8] Gigaset driver bugfixes and cleanups Tilman Schmidt
                   ` (5 preceding siblings ...)
  2009-05-13 22:44 ` [PATCH 8/8] gigaset: move up Kconfig inclusion point Tilman Schmidt
@ 2009-05-13 22:44 ` Tilman Schmidt
  2009-05-13 22:44 ` [PATCH 6/8] gigaset: remove unused structure member rcvbytes Tilman Schmidt
  2009-05-18  3:51 ` [PATCH 0/8] Gigaset driver bugfixes and cleanups David Miller
  8 siblings, 0 replies; 10+ messages in thread
From: Tilman Schmidt @ 2009-05-13 22:44 UTC (permalink / raw)
  To: davem, linux-kernel, netdev; +Cc: Hansjoerg Lipp

Drop the kernel config option GIGASET_UNDOCREQ, permanently
activating the code it controlled, as there have been no reports
of problems caused by its activation but many problems caused by
it being disabled.
Also fix a few bad comments while we're at it.

Impact: cleanup
Signed-off-by: Tilman Schmidt <tilman@imap.cc>
---
 Documentation/isdn/README.gigaset  |   33 +++----------------
 drivers/isdn/gigaset/Kconfig       |    7 ----
 drivers/isdn/gigaset/usb-gigaset.c |   62 +++++++++++++----------------------
 3 files changed, 28 insertions(+), 74 deletions(-)

diff --git a/Documentation/isdn/README.gigaset b/Documentation/isdn/README.gigaset
index f6e9eaa..f996310 100644
--- a/Documentation/isdn/README.gigaset
+++ b/Documentation/isdn/README.gigaset
@@ -149,10 +149,8 @@ GigaSet 307x Device Driver
      configuration files and chat scripts in the gigaset-VERSION/ppp directory
      in the driver packages from http://sourceforge.net/projects/gigaset307x/.
      Please note that the USB drivers are not able to change the state of the
-     control lines (the M105 driver can be configured to use some undocumented
-     control requests, if you really need the control lines, though). This means
-     you must use "Stupid Mode" if you are using wvdial or you should use the
-     nocrtscts option of pppd.
+     control lines. This means you must use "Stupid Mode" if you are using
+     wvdial or you should use the nocrtscts option of pppd.
      You must also assure that the ppp_async module is loaded with the parameter
      flag_time=0. You can do this e.g. by adding a line like
 
@@ -190,20 +188,7 @@ GigaSet 307x Device Driver
      You can also use /sys/class/tty/ttyGxy/cidmode for changing the CID mode
      setting (ttyGxy is ttyGU0 or ttyGB0).
 
-2.6. M105 Undocumented USB Requests
-     ------------------------------
-     The Gigaset M105 USB data box understands a couple of useful, but
-     undocumented USB commands. These requests are not used in normal
-     operation (for wireless access to the base), but are needed for access
-     to the M105's own configuration mode (registration to the base, baudrate
-     and line format settings, device status queries) via the gigacontr
-     utility. Their use is controlled by the kernel configuration option
-     "Support for undocumented USB requests" (CONFIG_GIGASET_UNDOCREQ). If you
-     encounter error code -ENOTTY when trying to use some features of the
-     M105, try setting that option to "y" via 'make {x,menu}config' and
-     recompiling the driver.
-
-2.7. Unregistered Wireless Devices (M101/M105)
+2.6. Unregistered Wireless Devices (M101/M105)
      -----------------------------------------
      The main purpose of the ser_gigaset and usb_gigaset drivers is to allow
      the M101 and M105 wireless devices to be used as ISDN devices for ISDN
@@ -215,8 +200,7 @@ GigaSet 307x Device Driver
      driver. In that situation, a restricted set of functions is available
      which includes, in particular, those necessary for registering the device
      to a base or for switching it between Fixed Part and Portable Part
-     modes. For the M105, these commands require the "Support for undocumented
-     USB requests" configuration option (see section 2.6.) to be enabled.
+     modes.
 
 3.   Troubleshooting
      ---------------
@@ -247,19 +231,12 @@ GigaSet 307x Device Driver
         Select Unimodem mode for all DECT data adapters. (see section 2.4.)
 
      Problem:
-        You want to configure your USB DECT data adapter (M105) but gigacontr
-        reports an error: "/dev/ttyGU0: Inappropriate ioctl for device".
-     Solution:
-        Recompile the usb_gigaset driver with the kernel configuration option
-        CONFIG_GIGASET_UNDOCREQ set to 'y'. (see section 2.6.)
-
-     Problem:
 	Messages like this:
 	    usb_gigaset 3-2:1.0: Could not initialize the device.
 	appear in your syslog.
      Solution:
 	Check whether your M10x wireless device is correctly registered to the
-	Gigaset base. (see section 2.7.)
+	Gigaset base. (see section 2.6.)
 
 3.2. Telling the driver to provide more information
      ----------------------------------------------
diff --git a/drivers/isdn/gigaset/Kconfig b/drivers/isdn/gigaset/Kconfig
index 9ca889a..65ca305 100644
--- a/drivers/isdn/gigaset/Kconfig
+++ b/drivers/isdn/gigaset/Kconfig
@@ -42,11 +42,4 @@ config GIGASET_DEBUG
 	  This enables debugging code in the Gigaset drivers.
 	  If in doubt, say yes.
 
-config GIGASET_UNDOCREQ
-	bool "Support for undocumented USB requests"
-	help
-	  This enables support for USB requests we only know from
-	  reverse engineering (currently M105 only). If you need
-	  features like configuration mode of M105, say yes.
-
 endif # ISDN_DRV_GIGASET
diff --git a/drivers/isdn/gigaset/usb-gigaset.c b/drivers/isdn/gigaset/usb-gigaset.c
index d783851..4deb1ab 100644
--- a/drivers/isdn/gigaset/usb-gigaset.c
+++ b/drivers/isdn/gigaset/usb-gigaset.c
@@ -153,8 +153,6 @@ static inline unsigned tiocm_to_gigaset(unsigned state)
 	return ((state & TIOCM_DTR) ? 1 : 0) | ((state & TIOCM_RTS) ? 2 : 0);
 }
 
-#ifdef CONFIG_GIGASET_UNDOCREQ
-/* WARNING: EXPERIMENTAL! */
 static int gigaset_set_modem_ctrl(struct cardstate *cs, unsigned old_state,
 				  unsigned new_state)
 {
@@ -176,6 +174,11 @@ static int gigaset_set_modem_ctrl(struct cardstate *cs, unsigned old_state,
 	return 0;
 }
 
+/*
+ * Set M105 configuration value
+ * using undocumented device commands reverse engineered from USB traces
+ * of the Siemens Windows driver
+ */
 static int set_value(struct cardstate *cs, u8 req, u16 val)
 {
 	struct usb_device *udev = cs->hw.usb->udev;
@@ -205,8 +208,10 @@ static int set_value(struct cardstate *cs, u8 req, u16 val)
 	return r < 0 ? r : (r2 < 0 ? r2 : 0);
 }
 
-/* WARNING: HIGHLY EXPERIMENTAL! */
-// don't use this in an interrupt/BH
+/*
+ * set the baud rate on the internal serial adapter
+ * using the undocumented parameter setting command
+ */
 static int gigaset_baud_rate(struct cardstate *cs, unsigned cflag)
 {
 	u16 val;
@@ -237,8 +242,10 @@ static int gigaset_baud_rate(struct cardstate *cs, unsigned cflag)
 	return set_value(cs, 1, val);
 }
 
-/* WARNING: HIGHLY EXPERIMENTAL! */
-// don't use this in an interrupt/BH
+/*
+ * set the line format on the internal serial adapter
+ * using the undocumented parameter setting command
+ */
 static int gigaset_set_line_ctrl(struct cardstate *cs, unsigned cflag)
 {
 	u16 val = 0;
@@ -274,24 +281,6 @@ static int gigaset_set_line_ctrl(struct cardstate *cs, unsigned cflag)
 	return set_value(cs, 3, val);
 }
 
-#else
-static int gigaset_set_modem_ctrl(struct cardstate *cs, unsigned old_state,
-				  unsigned new_state)
-{
-	return -ENOTTY;
-}
-
-static int gigaset_set_line_ctrl(struct cardstate *cs, unsigned cflag)
-{
-	return -ENOTTY;
-}
-
-static int gigaset_baud_rate(struct cardstate *cs, unsigned cflag)
-{
-	return -ENOTTY;
-}
-#endif
-
 
  /*================================================================================================================*/
 static int gigaset_init_bchannel(struct bc_state *bcs)
@@ -362,10 +351,8 @@ static void gigaset_modem_fill(unsigned long data)
 	} while (again);
 }
 
-/**
- *	gigaset_read_int_callback
- *
- *	It is called if the data was received from the device.
+/*
+ * Interrupt Input URB completion routine
  */
 static void gigaset_read_int_callback(struct urb *urb)
 {
@@ -567,18 +554,19 @@ static int gigaset_chars_in_buffer(struct cardstate *cs)
 	return cs->cmdbytes;
 }
 
+/*
+ * set the break characters on the internal serial adapter
+ * using undocumented device commands reverse engineered from USB traces
+ * of the Siemens Windows driver
+ */
 static int gigaset_brkchars(struct cardstate *cs, const unsigned char buf[6])
 {
-#ifdef CONFIG_GIGASET_UNDOCREQ
 	struct usb_device *udev = cs->hw.usb->udev;
 
 	gigaset_dbg_buffer(DEBUG_USBREQ, "brkchars", 6, buf);
 	memcpy(cs->hw.usb->bchars, buf, 6);
 	return usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0x19, 0x41,
 			       0, 0, &buf, 6, 2000);
-#else
-	return -ENOTTY;
-#endif
 }
 
 static int gigaset_freebcshw(struct bc_state *bcs)
@@ -625,7 +613,6 @@ static int gigaset_initcshw(struct cardstate *cs)
 	ucs->bchars[5] = 0x13;
 	ucs->bulk_out_buffer = NULL;
 	ucs->bulk_out_urb = NULL;
-	//ucs->urb_cmd_out = NULL;
 	ucs->read_urb = NULL;
 	tasklet_init(&cs->write_tasklet,
 		     &gigaset_modem_fill, (unsigned long) cs);
@@ -742,7 +729,7 @@ static int gigaset_probe(struct usb_interface *interface,
 	cs->dev = &interface->dev;
 
 	/* save address of controller structure */
-	usb_set_intfdata(interface, cs); // dev_set_drvdata(&interface->dev, cs);
+	usb_set_intfdata(interface, cs);
 
 	endpoint = &hostif->endpoint[0].desc;
 
@@ -921,8 +908,7 @@ static const struct gigaset_ops ops = {
 	gigaset_m10x_input,
 };
 
-/**
- *	usb_gigaset_init
+/*
  * This function is called while kernel-module is loaded
  */
 static int __init usb_gigaset_init(void)
@@ -952,9 +938,7 @@ error:
 	return -1;
 }
 
-
-/**
- *	usb_gigaset_exit
+/*
  * This function is called while unloading the kernel-module
  */
 static void __exit usb_gigaset_exit(void)
-- 
1.6.2.1.214.ge986c


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/8] Gigaset driver bugfixes and cleanups
  2009-05-13 22:44 [PATCH 0/8] Gigaset driver bugfixes and cleanups Tilman Schmidt
                   ` (7 preceding siblings ...)
  2009-05-13 22:44 ` [PATCH 6/8] gigaset: remove unused structure member rcvbytes Tilman Schmidt
@ 2009-05-18  3:51 ` David Miller
  8 siblings, 0 replies; 10+ messages in thread
From: David Miller @ 2009-05-18  3:51 UTC (permalink / raw)
  To: tilman; +Cc: linux-kernel, netdev, hjlipp

From: Tilman Schmidt <tilman@imap.cc>
Date: Thu, 14 May 2009 00:44:17 +0200 (CEST)

> following are 8 small patches for the Gigaset driver I'd like to get
> out from under my feet. Nothing urgent, so if you feel they are
> inappropriate for merging that late in the 2.6.30 cycle they can as
> well wait for 2.6.31.

All applied to net-next-2.6, thanks!

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2009-05-18  3:51 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-13 22:44 [PATCH 0/8] Gigaset driver bugfixes and cleanups Tilman Schmidt
2009-05-13 22:44 ` [PATCH 3/8] gigaset: fix error return code Tilman Schmidt
2009-05-13 22:44 ` [PATCH 5/8] gigaset: remove obsolete references to m10x state table Tilman Schmidt
2009-05-13 22:44 ` [PATCH 2/8] gigaset: fix possible oops in error handling Tilman Schmidt
2009-05-13 22:44 ` [PATCH 1/8] gigaset: documentation update Tilman Schmidt
2009-05-13 22:44 ` [PATCH 4/8] gigaset: skip unnecessary hex formatting Tilman Schmidt
2009-05-13 22:44 ` [PATCH 8/8] gigaset: move up Kconfig inclusion point Tilman Schmidt
2009-05-13 22:44 ` [PATCH 7/8] gigaset: remove UNDOCREQ config option Tilman Schmidt
2009-05-13 22:44 ` [PATCH 6/8] gigaset: remove unused structure member rcvbytes Tilman Schmidt
2009-05-18  3:51 ` [PATCH 0/8] Gigaset driver bugfixes and cleanups David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).