aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/gigaset
diff options
context:
space:
mode:
authorTilman Schmidt <tilman@imap.cc>2009-05-13 08:44:18 -0400
committerDavid S. Miller <davem@davemloft.net>2009-05-17 23:51:27 -0400
commitb88bd95655c7bc059606529e01467594978d7b72 (patch)
treef5669760db7d97186d1c59b5bcf2b57f1bca5b56 /drivers/isdn/gigaset
parent5a1888ea994bf6b28179255a376e83dfa53c81c5 (diff)
gigaset: remove UNDOCREQ config option
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> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/isdn/gigaset')
-rw-r--r--drivers/isdn/gigaset/Kconfig7
-rw-r--r--drivers/isdn/gigaset/usb-gigaset.c62
2 files changed, 23 insertions, 46 deletions
diff --git a/drivers/isdn/gigaset/Kconfig b/drivers/isdn/gigaset/Kconfig
index 754b90d412e4..18ab8652aa57 100644
--- a/drivers/isdn/gigaset/Kconfig
+++ b/drivers/isdn/gigaset/Kconfig
@@ -43,11 +43,4 @@ config GIGASET_DEBUG
43 This enables debugging code in the Gigaset drivers. 43 This enables debugging code in the Gigaset drivers.
44 If in doubt, say yes. 44 If in doubt, say yes.
45 45
46config GIGASET_UNDOCREQ
47 bool "Support for undocumented USB requests"
48 help
49 This enables support for USB requests we only know from
50 reverse engineering (currently M105 only). If you need
51 features like configuration mode of M105, say yes.
52
53endif # ISDN_DRV_GIGASET 46endif # ISDN_DRV_GIGASET
diff --git a/drivers/isdn/gigaset/usb-gigaset.c b/drivers/isdn/gigaset/usb-gigaset.c
index d78385166099..4deb1ab0dbf8 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)
153 return ((state & TIOCM_DTR) ? 1 : 0) | ((state & TIOCM_RTS) ? 2 : 0); 153 return ((state & TIOCM_DTR) ? 1 : 0) | ((state & TIOCM_RTS) ? 2 : 0);
154} 154}
155 155
156#ifdef CONFIG_GIGASET_UNDOCREQ
157/* WARNING: EXPERIMENTAL! */
158static int gigaset_set_modem_ctrl(struct cardstate *cs, unsigned old_state, 156static int gigaset_set_modem_ctrl(struct cardstate *cs, unsigned old_state,
159 unsigned new_state) 157 unsigned new_state)
160{ 158{
@@ -176,6 +174,11 @@ static int gigaset_set_modem_ctrl(struct cardstate *cs, unsigned old_state,
176 return 0; 174 return 0;
177} 175}
178 176
177/*
178 * Set M105 configuration value
179 * using undocumented device commands reverse engineered from USB traces
180 * of the Siemens Windows driver
181 */
179static int set_value(struct cardstate *cs, u8 req, u16 val) 182static int set_value(struct cardstate *cs, u8 req, u16 val)
180{ 183{
181 struct usb_device *udev = cs->hw.usb->udev; 184 struct usb_device *udev = cs->hw.usb->udev;
@@ -205,8 +208,10 @@ static int set_value(struct cardstate *cs, u8 req, u16 val)
205 return r < 0 ? r : (r2 < 0 ? r2 : 0); 208 return r < 0 ? r : (r2 < 0 ? r2 : 0);
206} 209}
207 210
208/* WARNING: HIGHLY EXPERIMENTAL! */ 211/*
209// don't use this in an interrupt/BH 212 * set the baud rate on the internal serial adapter
213 * using the undocumented parameter setting command
214 */
210static int gigaset_baud_rate(struct cardstate *cs, unsigned cflag) 215static int gigaset_baud_rate(struct cardstate *cs, unsigned cflag)
211{ 216{
212 u16 val; 217 u16 val;
@@ -237,8 +242,10 @@ static int gigaset_baud_rate(struct cardstate *cs, unsigned cflag)
237 return set_value(cs, 1, val); 242 return set_value(cs, 1, val);
238} 243}
239 244
240/* WARNING: HIGHLY EXPERIMENTAL! */ 245/*
241// don't use this in an interrupt/BH 246 * set the line format on the internal serial adapter
247 * using the undocumented parameter setting command
248 */
242static int gigaset_set_line_ctrl(struct cardstate *cs, unsigned cflag) 249static int gigaset_set_line_ctrl(struct cardstate *cs, unsigned cflag)
243{ 250{
244 u16 val = 0; 251 u16 val = 0;
@@ -274,24 +281,6 @@ static int gigaset_set_line_ctrl(struct cardstate *cs, unsigned cflag)
274 return set_value(cs, 3, val); 281 return set_value(cs, 3, val);
275} 282}
276 283
277#else
278static int gigaset_set_modem_ctrl(struct cardstate *cs, unsigned old_state,
279 unsigned new_state)
280{
281 return -ENOTTY;
282}
283
284static int gigaset_set_line_ctrl(struct cardstate *cs, unsigned cflag)
285{
286 return -ENOTTY;
287}
288
289static int gigaset_baud_rate(struct cardstate *cs, unsigned cflag)
290{
291 return -ENOTTY;
292}
293#endif
294
295 284
296 /*================================================================================================================*/ 285 /*================================================================================================================*/
297static int gigaset_init_bchannel(struct bc_state *bcs) 286static int gigaset_init_bchannel(struct bc_state *bcs)
@@ -362,10 +351,8 @@ static void gigaset_modem_fill(unsigned long data)
362 } while (again); 351 } while (again);
363} 352}
364 353
365/** 354/*
366 * gigaset_read_int_callback 355 * Interrupt Input URB completion routine
367 *
368 * It is called if the data was received from the device.
369 */ 356 */
370static void gigaset_read_int_callback(struct urb *urb) 357static void gigaset_read_int_callback(struct urb *urb)
371{ 358{
@@ -567,18 +554,19 @@ static int gigaset_chars_in_buffer(struct cardstate *cs)
567 return cs->cmdbytes; 554 return cs->cmdbytes;
568} 555}
569 556
557/*
558 * set the break characters on the internal serial adapter
559 * using undocumented device commands reverse engineered from USB traces
560 * of the Siemens Windows driver
561 */
570static int gigaset_brkchars(struct cardstate *cs, const unsigned char buf[6]) 562static int gigaset_brkchars(struct cardstate *cs, const unsigned char buf[6])
571{ 563{
572#ifdef CONFIG_GIGASET_UNDOCREQ
573 struct usb_device *udev = cs->hw.usb->udev; 564 struct usb_device *udev = cs->hw.usb->udev;
574 565
575 gigaset_dbg_buffer(DEBUG_USBREQ, "brkchars", 6, buf); 566 gigaset_dbg_buffer(DEBUG_USBREQ, "brkchars", 6, buf);
576 memcpy(cs->hw.usb->bchars, buf, 6); 567 memcpy(cs->hw.usb->bchars, buf, 6);
577 return usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0x19, 0x41, 568 return usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0x19, 0x41,
578 0, 0, &buf, 6, 2000); 569 0, 0, &buf, 6, 2000);
579#else
580 return -ENOTTY;
581#endif
582} 570}
583 571
584static int gigaset_freebcshw(struct bc_state *bcs) 572static int gigaset_freebcshw(struct bc_state *bcs)
@@ -625,7 +613,6 @@ static int gigaset_initcshw(struct cardstate *cs)
625 ucs->bchars[5] = 0x13; 613 ucs->bchars[5] = 0x13;
626 ucs->bulk_out_buffer = NULL; 614 ucs->bulk_out_buffer = NULL;
627 ucs->bulk_out_urb = NULL; 615 ucs->bulk_out_urb = NULL;
628 //ucs->urb_cmd_out = NULL;
629 ucs->read_urb = NULL; 616 ucs->read_urb = NULL;
630 tasklet_init(&cs->write_tasklet, 617 tasklet_init(&cs->write_tasklet,
631 &gigaset_modem_fill, (unsigned long) cs); 618 &gigaset_modem_fill, (unsigned long) cs);
@@ -742,7 +729,7 @@ static int gigaset_probe(struct usb_interface *interface,
742 cs->dev = &interface->dev; 729 cs->dev = &interface->dev;
743 730
744 /* save address of controller structure */ 731 /* save address of controller structure */
745 usb_set_intfdata(interface, cs); // dev_set_drvdata(&interface->dev, cs); 732 usb_set_intfdata(interface, cs);
746 733
747 endpoint = &hostif->endpoint[0].desc; 734 endpoint = &hostif->endpoint[0].desc;
748 735
@@ -921,8 +908,7 @@ static const struct gigaset_ops ops = {
921 gigaset_m10x_input, 908 gigaset_m10x_input,
922}; 909};
923 910
924/** 911/*
925 * usb_gigaset_init
926 * This function is called while kernel-module is loaded 912 * This function is called while kernel-module is loaded
927 */ 913 */
928static int __init usb_gigaset_init(void) 914static int __init usb_gigaset_init(void)
@@ -952,9 +938,7 @@ error:
952 return -1; 938 return -1;
953} 939}
954 940
955 941/*
956/**
957 * usb_gigaset_exit
958 * This function is called while unloading the kernel-module 942 * This function is called while unloading the kernel-module
959 */ 943 */
960static void __exit usb_gigaset_exit(void) 944static void __exit usb_gigaset_exit(void)