aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/gigaset
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/isdn/gigaset')
-rw-r--r--drivers/isdn/gigaset/Kconfig8
-rw-r--r--drivers/isdn/gigaset/asyncdata.c5
-rw-r--r--drivers/isdn/gigaset/common.c12
-rw-r--r--drivers/isdn/gigaset/ev-layer.c4
-rw-r--r--drivers/isdn/gigaset/gigaset.h5
-rw-r--r--drivers/isdn/gigaset/i4l.c12
-rw-r--r--drivers/isdn/gigaset/interface.c3
-rw-r--r--drivers/isdn/gigaset/isocdata.c4
-rw-r--r--drivers/isdn/gigaset/proc.c2
-rw-r--r--drivers/isdn/gigaset/usb-gigaset.c62
10 files changed, 45 insertions, 72 deletions
diff --git a/drivers/isdn/gigaset/Kconfig b/drivers/isdn/gigaset/Kconfig
index 9ca889adf120..18ab8652aa57 100644
--- a/drivers/isdn/gigaset/Kconfig
+++ b/drivers/isdn/gigaset/Kconfig
@@ -1,5 +1,6 @@
1menuconfig ISDN_DRV_GIGASET 1menuconfig ISDN_DRV_GIGASET
2 tristate "Siemens Gigaset support" 2 tristate "Siemens Gigaset support"
3 depends on ISDN_I4L
3 select CRC_CCITT 4 select CRC_CCITT
4 select BITREVERSE 5 select BITREVERSE
5 help 6 help
@@ -42,11 +43,4 @@ config GIGASET_DEBUG
42 This enables debugging code in the Gigaset drivers. 43 This enables debugging code in the Gigaset drivers.
43 If in doubt, say yes. 44 If in doubt, say yes.
44 45
45config GIGASET_UNDOCREQ
46 bool "Support for undocumented USB requests"
47 help
48 This enables support for USB requests we only know from
49 reverse engineering (currently M105 only). If you need
50 features like configuration mode of M105, say yes.
51
52endif # ISDN_DRV_GIGASET 46endif # ISDN_DRV_GIGASET
diff --git a/drivers/isdn/gigaset/asyncdata.c b/drivers/isdn/gigaset/asyncdata.c
index 2a4ce96f04bd..234cc5d53312 100644
--- a/drivers/isdn/gigaset/asyncdata.c
+++ b/drivers/isdn/gigaset/asyncdata.c
@@ -174,9 +174,8 @@ byte_stuff:
174 174
175 if (unlikely(fcs != PPP_GOODFCS)) { 175 if (unlikely(fcs != PPP_GOODFCS)) {
176 dev_err(cs->dev, 176 dev_err(cs->dev,
177 "Packet checksum at %lu failed, " 177 "Checksum failed, %u bytes corrupted!\n",
178 "packet is corrupted (%u bytes)!\n", 178 skb->len);
179 bcs->rcvbytes, skb->len);
180 compskb = NULL; 179 compskb = NULL;
181 gigaset_rcv_error(compskb, cs, bcs); 180 gigaset_rcv_error(compskb, cs, bcs);
182 error = 1; 181 error = 1;
diff --git a/drivers/isdn/gigaset/common.c b/drivers/isdn/gigaset/common.c
index 0048ce98bfa8..e4141bf8b2f3 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,
565 gig_dbg(DEBUG_INIT, "setting up bcs[%d]->at_state", channel); 565 gig_dbg(DEBUG_INIT, "setting up bcs[%d]->at_state", channel);
566 gigaset_at_init(&bcs->at_state, bcs, cs, -1); 566 gigaset_at_init(&bcs->at_state, bcs, cs, -1);
567 567
568 bcs->rcvbytes = 0;
569
570#ifdef CONFIG_GIGASET_DEBUG 568#ifdef CONFIG_GIGASET_DEBUG
571 bcs->emptycount = 0; 569 bcs->emptycount = 0;
572#endif 570#endif
@@ -672,14 +670,8 @@ struct cardstate *gigaset_initcs(struct gigaset_driver *drv, int channels,
672 cs->tty = NULL; 670 cs->tty = NULL;
673 cs->tty_dev = NULL; 671 cs->tty_dev = NULL;
674 cs->cidmode = cidmode != 0; 672 cs->cidmode = cidmode != 0;
675 673 cs->tabnocid = gigaset_tab_nocid;
676 //if(onechannel) { //FIXME 674 cs->tabcid = gigaset_tab_cid;
677 cs->tabnocid = gigaset_tab_nocid_m10x;
678 cs->tabcid = gigaset_tab_cid_m10x;
679 //} else {
680 // cs->tabnocid = gigaset_tab_nocid;
681 // cs->tabcid = gigaset_tab_cid;
682 //}
683 675
684 init_waitqueue_head(&cs->waitqueue); 676 init_waitqueue_head(&cs->waitqueue);
685 cs->waiting = 0; 677 cs->waiting = 0;
diff --git a/drivers/isdn/gigaset/ev-layer.c b/drivers/isdn/gigaset/ev-layer.c
index e582a4887bc1..ec5169604a6a 100644
--- a/drivers/isdn/gigaset/ev-layer.c
+++ b/drivers/isdn/gigaset/ev-layer.c
@@ -160,7 +160,7 @@
160 160
161 161
162// 100: init, 200: dle0, 250:dle1, 300: get cid (dial), 350: "hup" (no cid), 400: hup, 500: reset, 600: dial, 700: ring 162// 100: init, 200: dle0, 250:dle1, 300: get cid (dial), 350: "hup" (no cid), 400: hup, 500: reset, 600: dial, 700: ring
163struct reply_t gigaset_tab_nocid_m10x[]= /* with dle mode */ 163struct reply_t gigaset_tab_nocid[] =
164{ 164{
165 /* resp_code, min_ConState, max_ConState, parameter, new_ConState, timeout, action, command */ 165 /* resp_code, min_ConState, max_ConState, parameter, new_ConState, timeout, action, command */
166 166
@@ -280,7 +280,7 @@ struct reply_t gigaset_tab_nocid_m10x[]= /* with dle mode */
280}; 280};
281 281
282// 600: start dialing, 650: dial in progress, 800: connection is up, 700: ring, 400: hup, 750: accepted icall 282// 600: start dialing, 650: dial in progress, 800: connection is up, 700: ring, 400: hup, 750: accepted icall
283struct reply_t gigaset_tab_cid_m10x[] = /* for M10x */ 283struct reply_t gigaset_tab_cid[] =
284{ 284{
285 /* resp_code, min_ConState, max_ConState, parameter, new_ConState, timeout, action, command */ 285 /* resp_code, min_ConState, max_ConState, parameter, new_ConState, timeout, action, command */
286 286
diff --git a/drivers/isdn/gigaset/gigaset.h b/drivers/isdn/gigaset/gigaset.h
index 747178f03d2c..a2f6125739eb 100644
--- a/drivers/isdn/gigaset/gigaset.h
+++ b/drivers/isdn/gigaset/gigaset.h
@@ -282,8 +282,8 @@ struct reply_t {
282 char *command; /* NULL==none */ 282 char *command; /* NULL==none */
283}; 283};
284 284
285extern struct reply_t gigaset_tab_cid_m10x[]; 285extern struct reply_t gigaset_tab_cid[];
286extern struct reply_t gigaset_tab_nocid_m10x[]; 286extern struct reply_t gigaset_tab_nocid[];
287 287
288struct inbuf_t { 288struct inbuf_t {
289 unsigned char *rcvbuf; /* usb-gigaset receive buffer */ 289 unsigned char *rcvbuf; /* usb-gigaset receive buffer */
@@ -384,7 +384,6 @@ struct bc_state {
384 int trans_up; /* Counter of packages (upstream) */ 384 int trans_up; /* Counter of packages (upstream) */
385 385
386 struct at_state_t at_state; 386 struct at_state_t at_state;
387 unsigned long rcvbytes;
388 387
389 __u16 fcs; 388 __u16 fcs;
390 struct sk_buff *skb; 389 struct sk_buff *skb;
diff --git a/drivers/isdn/gigaset/i4l.c b/drivers/isdn/gigaset/i4l.c
index 69a702f0db93..9b22f9cf2f33 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)
544 544
545 gig_dbg(DEBUG_ANY, "Register driver capabilities to LL"); 545 gig_dbg(DEBUG_ANY, "Register driver capabilities to LL");
546 546
547 //iif->id[sizeof(iif->id) - 1]=0;
548 //strncpy(iif->id, isdnid, sizeof(iif->id) - 1);
549 if (snprintf(iif->id, sizeof iif->id, "%s_%u", isdnid, cs->minor_index) 547 if (snprintf(iif->id, sizeof iif->id, "%s_%u", isdnid, cs->minor_index)
550 >= sizeof iif->id) 548 >= sizeof iif->id) {
551 return -ENOMEM; //FIXME EINVAL/...?? 549 pr_err("ID too long: %s\n", isdnid);
550 return 0;
551 }
552 552
553 iif->owner = THIS_MODULE; 553 iif->owner = THIS_MODULE;
554 iif->channels = cs->channels; 554 iif->channels = cs->channels;
@@ -568,8 +568,10 @@ int gigaset_register_to_LL(struct cardstate *cs, const char *isdnid)
568 iif->rcvcallb_skb = NULL; /* Will be set by LL */ 568 iif->rcvcallb_skb = NULL; /* Will be set by LL */
569 iif->statcallb = NULL; /* Will be set by LL */ 569 iif->statcallb = NULL; /* Will be set by LL */
570 570
571 if (!register_isdn(iif)) 571 if (!register_isdn(iif)) {
572 pr_err("register_isdn failed\n");
572 return 0; 573 return 0;
574 }
573 575
574 cs->myid = iif->channels; /* Set my device id */ 576 cs->myid = iif->channels; /* Set my device id */
575 return 1; 577 return 1;
diff --git a/drivers/isdn/gigaset/interface.c b/drivers/isdn/gigaset/interface.c
index 820a30923fee..1ebfcab74662 100644
--- a/drivers/isdn/gigaset/interface.c
+++ b/drivers/isdn/gigaset/interface.c
@@ -599,8 +599,7 @@ void gigaset_if_init(struct cardstate *cs)
599 if (!IS_ERR(cs->tty_dev)) 599 if (!IS_ERR(cs->tty_dev))
600 dev_set_drvdata(cs->tty_dev, cs); 600 dev_set_drvdata(cs->tty_dev, cs);
601 else { 601 else {
602 dev_warn(cs->dev, 602 pr_warning("could not register device to the tty subsystem\n");
603 "could not register device to the tty subsystem\n");
604 cs->tty_dev = NULL; 603 cs->tty_dev = NULL;
605 } 604 }
606 mutex_unlock(&cs->mutex); 605 mutex_unlock(&cs->mutex);
diff --git a/drivers/isdn/gigaset/isocdata.c b/drivers/isdn/gigaset/isocdata.c
index b171e75cb52e..09202a5a3444 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,
246 unsigned char c; 246 unsigned char c;
247 static char dbgline[3 * 32 + 1]; 247 static char dbgline[3 * 32 + 1];
248 int i = 0; 248 int i = 0;
249
250 if (!(gigaset_debuglevel & level))
251 return;
252
249 while (count-- > 0) { 253 while (count-- > 0) {
250 if (i > sizeof(dbgline) - 4) { 254 if (i > sizeof(dbgline) - 4) {
251 dbgline[i] = '\0'; 255 dbgline[i] = '\0';
diff --git a/drivers/isdn/gigaset/proc.c b/drivers/isdn/gigaset/proc.c
index da6f3acf9fd0..9715aad9c3f0 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)
79 79
80 gig_dbg(DEBUG_INIT, "setting up sysfs"); 80 gig_dbg(DEBUG_INIT, "setting up sysfs");
81 if (device_create_file(cs->tty_dev, &dev_attr_cidmode)) 81 if (device_create_file(cs->tty_dev, &dev_attr_cidmode))
82 dev_err(cs->dev, "could not create sysfs attribute\n"); 82 pr_err("could not create sysfs attribute\n");
83} 83}
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)