aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTilman Schmidt <tilman@imap.cc>2008-12-26 04:22:03 -0500
committerDavid S. Miller <davem@davemloft.net>2008-12-26 04:22:03 -0500
commit236b87c29953a87a6817e96e311b0efd00e95dc7 (patch)
treea2715c6cec5fd21f410f1428eaf4dbc7ba7056d2
parentc8770dcabd6a615b155c25dc4d57251d3e7f151c (diff)
gigaset: ifdef cleanup
Remove unnecessary #ifdef-s and #if-0-ed code sections. Signed-off-by: Tilman Schmidt <tilman@imap.cc> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/isdn/gigaset/asyncdata.c18
-rw-r--r--drivers/isdn/gigaset/ev-layer.c42
-rw-r--r--drivers/isdn/gigaset/interface.c26
-rw-r--r--drivers/isdn/gigaset/isocdata.c2
4 files changed, 6 insertions, 82 deletions
diff --git a/drivers/isdn/gigaset/asyncdata.c b/drivers/isdn/gigaset/asyncdata.c
index c2bd97d29273..2a4ce96f04bd 100644
--- a/drivers/isdn/gigaset/asyncdata.c
+++ b/drivers/isdn/gigaset/asyncdata.c
@@ -17,8 +17,6 @@
17#include <linux/crc-ccitt.h> 17#include <linux/crc-ccitt.h>
18#include <linux/bitrev.h> 18#include <linux/bitrev.h>
19 19
20//#define GIG_M10x_STUFF_VOICE_DATA
21
22/* check if byte must be stuffed/escaped 20/* check if byte must be stuffed/escaped
23 * I'm not sure which data should be encoded. 21 * I'm not sure which data should be encoded.
24 * Therefore I will go the hard way and decode every value 22 * Therefore I will go the hard way and decode every value
@@ -147,19 +145,17 @@ static inline int hdlc_loop(unsigned char c, unsigned char *src, int numbytes,
147 } 145 }
148byte_stuff: 146byte_stuff:
149 c ^= PPP_TRANS; 147 c ^= PPP_TRANS;
150#ifdef CONFIG_GIGASET_DEBUG
151 if (unlikely(!muststuff(c))) 148 if (unlikely(!muststuff(c)))
152 gig_dbg(DEBUG_HDLC, "byte stuffed: 0x%02x", c); 149 gig_dbg(DEBUG_HDLC, "byte stuffed: 0x%02x", c);
153#endif
154 } else if (unlikely(c == PPP_FLAG)) { 150 } else if (unlikely(c == PPP_FLAG)) {
155 if (unlikely(inputstate & INS_skip_frame)) { 151 if (unlikely(inputstate & INS_skip_frame)) {
156 if (!(inputstate & INS_have_data)) { /* 7E 7E */
157#ifdef CONFIG_GIGASET_DEBUG 152#ifdef CONFIG_GIGASET_DEBUG
153 if (!(inputstate & INS_have_data)) { /* 7E 7E */
158 ++bcs->emptycount; 154 ++bcs->emptycount;
159#endif
160 } else 155 } else
161 gig_dbg(DEBUG_HDLC, 156 gig_dbg(DEBUG_HDLC,
162 "7e----------------------------"); 157 "7e----------------------------");
158#endif
163 159
164 /* end of frame */ 160 /* end of frame */
165 error = 1; 161 error = 1;
@@ -226,11 +222,9 @@ byte_stuff:
226 } 222 }
227 223
228 break; 224 break;
229#ifdef CONFIG_GIGASET_DEBUG
230 } else if (unlikely(muststuff(c))) { 225 } else if (unlikely(muststuff(c))) {
231 /* Should not happen. Possible after ZDLE=1<CR><LF>. */ 226 /* Should not happen. Possible after ZDLE=1<CR><LF>. */
232 gig_dbg(DEBUG_HDLC, "not byte stuffed: 0x%02x", c); 227 gig_dbg(DEBUG_HDLC, "not byte stuffed: 0x%02x", c);
233#endif
234 } 228 }
235 229
236 /* add character */ 230 /* add character */
@@ -394,20 +388,16 @@ void gigaset_m10x_input(struct inbuf_t *inbuf)
394 inbuf->inputstate &= ~INS_DLE_char; 388 inbuf->inputstate &= ~INS_DLE_char;
395 switch (c) { 389 switch (c) {
396 case 'X': /*begin of command*/ 390 case 'X': /*begin of command*/
397#ifdef CONFIG_GIGASET_DEBUG
398 if (inbuf->inputstate & INS_command) 391 if (inbuf->inputstate & INS_command)
399 dev_err(cs->dev, 392 dev_warn(cs->dev,
400 "received <DLE> 'X' in command mode\n"); 393 "received <DLE> 'X' in command mode\n");
401#endif
402 inbuf->inputstate |= 394 inbuf->inputstate |=
403 INS_command | INS_DLE_command; 395 INS_command | INS_DLE_command;
404 break; 396 break;
405 case '.': /*end of command*/ 397 case '.': /*end of command*/
406#ifdef CONFIG_GIGASET_DEBUG
407 if (!(inbuf->inputstate & INS_command)) 398 if (!(inbuf->inputstate & INS_command))
408 dev_err(cs->dev, 399 dev_warn(cs->dev,
409 "received <DLE> '.' in hdlc mode\n"); 400 "received <DLE> '.' in hdlc mode\n");
410#endif
411 inbuf->inputstate &= cs->dle ? 401 inbuf->inputstate &= cs->dle ?
412 ~(INS_DLE_command|INS_command) 402 ~(INS_DLE_command|INS_command)
413 : ~INS_DLE_command; 403 : ~INS_DLE_command;
diff --git a/drivers/isdn/gigaset/ev-layer.c b/drivers/isdn/gigaset/ev-layer.c
index 5cbf64d850ee..e582a4887bc1 100644
--- a/drivers/isdn/gigaset/ev-layer.c
+++ b/drivers/isdn/gigaset/ev-layer.c
@@ -203,15 +203,6 @@ struct reply_t gigaset_tab_nocid_m10x[]= /* with dle mode */
203 {EV_TIMEOUT, 120,121, -1, 0, 0, {ACT_FAILVER, ACT_INIT}}, 203 {EV_TIMEOUT, 120,121, -1, 0, 0, {ACT_FAILVER, ACT_INIT}},
204 {RSP_ERROR, 120,121, -1, 0, 0, {ACT_FAILVER, ACT_INIT}}, 204 {RSP_ERROR, 120,121, -1, 0, 0, {ACT_FAILVER, ACT_INIT}},
205 {RSP_OK, 121,121, -1, 0, 0, {ACT_GOTVER, ACT_INIT}}, 205 {RSP_OK, 121,121, -1, 0, 0, {ACT_GOTVER, ACT_INIT}},
206#if 0
207 {EV_TIMEOUT, 120,121, -1, 130, 5, {ACT_FAILVER}, "^SGCI=1\r"},
208 {RSP_ERROR, 120,121, -1, 130, 5, {ACT_FAILVER}, "^SGCI=1\r"},
209 {RSP_OK, 121,121, -1, 130, 5, {ACT_GOTVER}, "^SGCI=1\r"},
210
211 {RSP_OK, 130,130, -1, 0, 0, {ACT_INIT}},
212 {RSP_ERROR, 130,130, -1, 0, 0, {ACT_FAILINIT}},
213 {EV_TIMEOUT, 130,130, -1, 0, 0, {ACT_FAILINIT}},
214#endif
215 206
216 /* leave dle mode */ 207 /* leave dle mode */
217 {RSP_INIT, 0, 0,SEQ_DLE0, 201, 5, {0}, "^SDLE=0\r"}, 208 {RSP_INIT, 0, 0,SEQ_DLE0, 201, 5, {0}, "^SDLE=0\r"},
@@ -260,10 +251,6 @@ struct reply_t gigaset_tab_nocid_m10x[]= /* with dle mode */
260 {RSP_INIT, 0, 0,SEQ_NOCID, 0, 0, {ACT_ABORTCID}}, 251 {RSP_INIT, 0, 0,SEQ_NOCID, 0, 0, {ACT_ABORTCID}},
261 252
262 /* reset */ 253 /* reset */
263#if 0
264 {RSP_INIT, 0, 0,SEQ_SHUTDOWN, 503, 5, {0}, "^SGCI=0\r"},
265 {RSP_OK, 503,503, -1, 504, 5, {0}, "Z\r"},
266#endif
267 {RSP_INIT, 0, 0,SEQ_SHUTDOWN, 504, 5, {0}, "Z\r"}, 254 {RSP_INIT, 0, 0,SEQ_SHUTDOWN, 504, 5, {0}, "Z\r"},
268 {RSP_OK, 504,504, -1, 0, 0, {ACT_SDOWN}}, 255 {RSP_OK, 504,504, -1, 0, 0, {ACT_SDOWN}},
269 {RSP_ERROR, 501,599, -1, 0, 0, {ACT_FAILSDOWN}}, 256 {RSP_ERROR, 501,599, -1, 0, 0, {ACT_FAILSDOWN}},
@@ -391,24 +378,6 @@ struct reply_t gigaset_tab_cid_m10x[] = /* for M10x */
391}; 378};
392 379
393 380
394#if 0
395static struct reply_t tab_nocid[]= /* no dle mode */ //FIXME
396{
397 /* resp_code, min_ConState, max_ConState, parameter, new_ConState, timeout, action, command */
398
399 {RSP_ANY, -1, -1, -1, -1,-1, ACT_WARN, NULL},
400 {RSP_LAST,0,0,0,0,0,0}
401};
402
403static struct reply_t tab_cid[] = /* no dle mode */ //FIXME
404{
405 /* resp_code, min_ConState, max_ConState, parameter, new_ConState, timeout, action, command */
406
407 {RSP_ANY, -1, -1, -1, -1,-1, ACT_WARN, NULL},
408 {RSP_LAST,0,0,0,0,0,0}
409};
410#endif
411
412static const struct resp_type_t resp_type[] = 381static const struct resp_type_t resp_type[] =
413{ 382{
414 /*{"", RSP_EMPTY, RT_NOTHING},*/ 383 /*{"", RSP_EMPTY, RT_NOTHING},*/
@@ -665,13 +634,8 @@ void gigaset_handle_modem_response(struct cardstate *cs)
665 dev_err(cs->dev, "out of memory\n"); 634 dev_err(cs->dev, "out of memory\n");
666 ++curarg; 635 ++curarg;
667 } 636 }
668#ifdef CONFIG_GIGASET_DEBUG 637 gig_dbg(DEBUG_CMD, "string==%s",
669 if (!event->ptr) 638 event->ptr ? (char *) event->ptr : "NULL");
670 gig_dbg(DEBUG_CMD, "string==NULL");
671 else
672 gig_dbg(DEBUG_CMD, "string==%s",
673 (char *) event->ptr);
674#endif
675 break; 639 break;
676 case RT_ZCAU: 640 case RT_ZCAU:
677 event->parameter = -1; 641 event->parameter = -1;
@@ -697,9 +661,7 @@ void gigaset_handle_modem_response(struct cardstate *cs)
697 ++curarg; 661 ++curarg;
698 } else 662 } else
699 event->parameter = -1; 663 event->parameter = -1;
700#ifdef CONFIG_GIGASET_DEBUG
701 gig_dbg(DEBUG_CMD, "parameter==%d", event->parameter); 664 gig_dbg(DEBUG_CMD, "parameter==%d", event->parameter);
702#endif
703 break; 665 break;
704 } 666 }
705 667
diff --git a/drivers/isdn/gigaset/interface.c b/drivers/isdn/gigaset/interface.c
index 94fa84b2c4e7..311e7ca0fb01 100644
--- a/drivers/isdn/gigaset/interface.c
+++ b/drivers/isdn/gigaset/interface.c
@@ -143,9 +143,6 @@ static const struct tty_operations if_ops = {
143 .set_termios = if_set_termios, 143 .set_termios = if_set_termios,
144 .throttle = if_throttle, 144 .throttle = if_throttle,
145 .unthrottle = if_unthrottle, 145 .unthrottle = if_unthrottle,
146#if 0
147 .break_ctl = serial_break,
148#endif
149 .tiocmget = if_tiocmget, 146 .tiocmget = if_tiocmget,
150 .tiocmset = if_tiocmset, 147 .tiocmset = if_tiocmset,
151}; 148};
@@ -565,29 +562,6 @@ static void if_set_termios(struct tty_struct *tty, struct ktermios *old)
565 562
566 cs->ops->set_line_ctrl(cs, cflag); 563 cs->ops->set_line_ctrl(cs, cflag);
567 564
568#if 0
569 //FIXME this hangs M101 [ts 2005-03-09]
570 //FIXME do we need this?
571 /*
572 * Set flow control: well, I do not really now how to handle DTR/RTS.
573 * Just do what we have seen with SniffUSB on Win98.
574 */
575 /* Drop DTR/RTS if no flow control otherwise assert */
576 gig_dbg(DEBUG_IF, "%u: control_state %x",
577 cs->minor_index, control_state);
578 new_state = control_state;
579 if ((iflag & IXOFF) || (iflag & IXON) || (cflag & CRTSCTS))
580 new_state |= TIOCM_DTR | TIOCM_RTS;
581 else
582 new_state &= ~(TIOCM_DTR | TIOCM_RTS);
583 if (new_state != control_state) {
584 gig_dbg(DEBUG_IF, "%u: new_state %x",
585 cs->minor_index, new_state);
586 gigaset_set_modem_ctrl(cs, control_state, new_state);
587 control_state = new_state;
588 }
589#endif
590
591 /* save off the modified port settings */ 565 /* save off the modified port settings */
592 cs->control_state = control_state; 566 cs->control_state = control_state;
593 567
diff --git a/drivers/isdn/gigaset/isocdata.c b/drivers/isdn/gigaset/isocdata.c
index 4b8b58503854..b171e75cb52e 100644
--- a/drivers/isdn/gigaset/isocdata.c
+++ b/drivers/isdn/gigaset/isocdata.c
@@ -88,11 +88,9 @@ static inline int isowbuf_startwrite(struct isowbuf_t *iwb)
88 __func__); 88 __func__);
89 return 0; 89 return 0;
90 } 90 }
91#ifdef CONFIG_GIGASET_DEBUG
92 gig_dbg(DEBUG_ISO, 91 gig_dbg(DEBUG_ISO,
93 "%s: acquired iso write semaphore, data[write]=%02x, nbits=%d", 92 "%s: acquired iso write semaphore, data[write]=%02x, nbits=%d",
94 __func__, iwb->data[iwb->write], iwb->wbits); 93 __func__, iwb->data[iwb->write], iwb->wbits);
95#endif
96 return 1; 94 return 1;
97} 95}
98 96