Commit 236b87c2 authored by Tilman Schmidt's avatar Tilman Schmidt Committed by David S. Miller

gigaset: ifdef cleanup

Remove unnecessary #ifdef-s and #if-0-ed code sections.
Signed-off-by: default avatarTilman Schmidt <tilman@imap.cc>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c8770dca
...@@ -17,8 +17,6 @@ ...@@ -17,8 +17,6 @@
#include <linux/crc-ccitt.h> #include <linux/crc-ccitt.h>
#include <linux/bitrev.h> #include <linux/bitrev.h>
//#define GIG_M10x_STUFF_VOICE_DATA
/* check if byte must be stuffed/escaped /* check if byte must be stuffed/escaped
* I'm not sure which data should be encoded. * I'm not sure which data should be encoded.
* Therefore I will go the hard way and decode every value * 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,19 +145,17 @@ static inline int hdlc_loop(unsigned char c, unsigned char *src, int numbytes,
} }
byte_stuff: byte_stuff:
c ^= PPP_TRANS; c ^= PPP_TRANS;
#ifdef CONFIG_GIGASET_DEBUG
if (unlikely(!muststuff(c))) if (unlikely(!muststuff(c)))
gig_dbg(DEBUG_HDLC, "byte stuffed: 0x%02x", c); gig_dbg(DEBUG_HDLC, "byte stuffed: 0x%02x", c);
#endif
} else if (unlikely(c == PPP_FLAG)) { } else if (unlikely(c == PPP_FLAG)) {
if (unlikely(inputstate & INS_skip_frame)) { if (unlikely(inputstate & INS_skip_frame)) {
if (!(inputstate & INS_have_data)) { /* 7E 7E */
#ifdef CONFIG_GIGASET_DEBUG #ifdef CONFIG_GIGASET_DEBUG
if (!(inputstate & INS_have_data)) { /* 7E 7E */
++bcs->emptycount; ++bcs->emptycount;
#endif
} else } else
gig_dbg(DEBUG_HDLC, gig_dbg(DEBUG_HDLC,
"7e----------------------------"); "7e----------------------------");
#endif
/* end of frame */ /* end of frame */
error = 1; error = 1;
...@@ -226,11 +222,9 @@ byte_stuff: ...@@ -226,11 +222,9 @@ byte_stuff:
} }
break; break;
#ifdef CONFIG_GIGASET_DEBUG
} else if (unlikely(muststuff(c))) { } else if (unlikely(muststuff(c))) {
/* Should not happen. Possible after ZDLE=1<CR><LF>. */ /* Should not happen. Possible after ZDLE=1<CR><LF>. */
gig_dbg(DEBUG_HDLC, "not byte stuffed: 0x%02x", c); gig_dbg(DEBUG_HDLC, "not byte stuffed: 0x%02x", c);
#endif
} }
/* add character */ /* add character */
...@@ -394,20 +388,16 @@ void gigaset_m10x_input(struct inbuf_t *inbuf) ...@@ -394,20 +388,16 @@ void gigaset_m10x_input(struct inbuf_t *inbuf)
inbuf->inputstate &= ~INS_DLE_char; inbuf->inputstate &= ~INS_DLE_char;
switch (c) { switch (c) {
case 'X': /*begin of command*/ case 'X': /*begin of command*/
#ifdef CONFIG_GIGASET_DEBUG
if (inbuf->inputstate & INS_command) if (inbuf->inputstate & INS_command)
dev_err(cs->dev, dev_warn(cs->dev,
"received <DLE> 'X' in command mode\n"); "received <DLE> 'X' in command mode\n");
#endif
inbuf->inputstate |= inbuf->inputstate |=
INS_command | INS_DLE_command; INS_command | INS_DLE_command;
break; break;
case '.': /*end of command*/ case '.': /*end of command*/
#ifdef CONFIG_GIGASET_DEBUG
if (!(inbuf->inputstate & INS_command)) if (!(inbuf->inputstate & INS_command))
dev_err(cs->dev, dev_warn(cs->dev,
"received <DLE> '.' in hdlc mode\n"); "received <DLE> '.' in hdlc mode\n");
#endif
inbuf->inputstate &= cs->dle ? inbuf->inputstate &= cs->dle ?
~(INS_DLE_command|INS_command) ~(INS_DLE_command|INS_command)
: ~INS_DLE_command; : ~INS_DLE_command;
......
...@@ -203,15 +203,6 @@ struct reply_t gigaset_tab_nocid_m10x[]= /* with dle mode */ ...@@ -203,15 +203,6 @@ struct reply_t gigaset_tab_nocid_m10x[]= /* with dle mode */
{EV_TIMEOUT, 120,121, -1, 0, 0, {ACT_FAILVER, ACT_INIT}}, {EV_TIMEOUT, 120,121, -1, 0, 0, {ACT_FAILVER, ACT_INIT}},
{RSP_ERROR, 120,121, -1, 0, 0, {ACT_FAILVER, ACT_INIT}}, {RSP_ERROR, 120,121, -1, 0, 0, {ACT_FAILVER, ACT_INIT}},
{RSP_OK, 121,121, -1, 0, 0, {ACT_GOTVER, ACT_INIT}}, {RSP_OK, 121,121, -1, 0, 0, {ACT_GOTVER, ACT_INIT}},
#if 0
{EV_TIMEOUT, 120,121, -1, 130, 5, {ACT_FAILVER}, "^SGCI=1\r"},
{RSP_ERROR, 120,121, -1, 130, 5, {ACT_FAILVER}, "^SGCI=1\r"},
{RSP_OK, 121,121, -1, 130, 5, {ACT_GOTVER}, "^SGCI=1\r"},
{RSP_OK, 130,130, -1, 0, 0, {ACT_INIT}},
{RSP_ERROR, 130,130, -1, 0, 0, {ACT_FAILINIT}},
{EV_TIMEOUT, 130,130, -1, 0, 0, {ACT_FAILINIT}},
#endif
/* leave dle mode */ /* leave dle mode */
{RSP_INIT, 0, 0,SEQ_DLE0, 201, 5, {0}, "^SDLE=0\r"}, {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,10 +251,6 @@ struct reply_t gigaset_tab_nocid_m10x[]= /* with dle mode */
{RSP_INIT, 0, 0,SEQ_NOCID, 0, 0, {ACT_ABORTCID}}, {RSP_INIT, 0, 0,SEQ_NOCID, 0, 0, {ACT_ABORTCID}},
/* reset */ /* reset */
#if 0
{RSP_INIT, 0, 0,SEQ_SHUTDOWN, 503, 5, {0}, "^SGCI=0\r"},
{RSP_OK, 503,503, -1, 504, 5, {0}, "Z\r"},
#endif
{RSP_INIT, 0, 0,SEQ_SHUTDOWN, 504, 5, {0}, "Z\r"}, {RSP_INIT, 0, 0,SEQ_SHUTDOWN, 504, 5, {0}, "Z\r"},
{RSP_OK, 504,504, -1, 0, 0, {ACT_SDOWN}}, {RSP_OK, 504,504, -1, 0, 0, {ACT_SDOWN}},
{RSP_ERROR, 501,599, -1, 0, 0, {ACT_FAILSDOWN}}, {RSP_ERROR, 501,599, -1, 0, 0, {ACT_FAILSDOWN}},
...@@ -391,24 +378,6 @@ struct reply_t gigaset_tab_cid_m10x[] = /* for M10x */ ...@@ -391,24 +378,6 @@ struct reply_t gigaset_tab_cid_m10x[] = /* for M10x */
}; };
#if 0
static struct reply_t tab_nocid[]= /* no dle mode */ //FIXME
{
/* resp_code, min_ConState, max_ConState, parameter, new_ConState, timeout, action, command */
{RSP_ANY, -1, -1, -1, -1,-1, ACT_WARN, NULL},
{RSP_LAST,0,0,0,0,0,0}
};
static struct reply_t tab_cid[] = /* no dle mode */ //FIXME
{
/* resp_code, min_ConState, max_ConState, parameter, new_ConState, timeout, action, command */
{RSP_ANY, -1, -1, -1, -1,-1, ACT_WARN, NULL},
{RSP_LAST,0,0,0,0,0,0}
};
#endif
static const struct resp_type_t resp_type[] = static const struct resp_type_t resp_type[] =
{ {
/*{"", RSP_EMPTY, RT_NOTHING},*/ /*{"", RSP_EMPTY, RT_NOTHING},*/
...@@ -665,13 +634,8 @@ void gigaset_handle_modem_response(struct cardstate *cs) ...@@ -665,13 +634,8 @@ void gigaset_handle_modem_response(struct cardstate *cs)
dev_err(cs->dev, "out of memory\n"); dev_err(cs->dev, "out of memory\n");
++curarg; ++curarg;
} }
#ifdef CONFIG_GIGASET_DEBUG
if (!event->ptr)
gig_dbg(DEBUG_CMD, "string==NULL");
else
gig_dbg(DEBUG_CMD, "string==%s", gig_dbg(DEBUG_CMD, "string==%s",
(char *) event->ptr); event->ptr ? (char *) event->ptr : "NULL");
#endif
break; break;
case RT_ZCAU: case RT_ZCAU:
event->parameter = -1; event->parameter = -1;
...@@ -697,9 +661,7 @@ void gigaset_handle_modem_response(struct cardstate *cs) ...@@ -697,9 +661,7 @@ void gigaset_handle_modem_response(struct cardstate *cs)
++curarg; ++curarg;
} else } else
event->parameter = -1; event->parameter = -1;
#ifdef CONFIG_GIGASET_DEBUG
gig_dbg(DEBUG_CMD, "parameter==%d", event->parameter); gig_dbg(DEBUG_CMD, "parameter==%d", event->parameter);
#endif
break; break;
} }
......
...@@ -143,9 +143,6 @@ static const struct tty_operations if_ops = { ...@@ -143,9 +143,6 @@ static const struct tty_operations if_ops = {
.set_termios = if_set_termios, .set_termios = if_set_termios,
.throttle = if_throttle, .throttle = if_throttle,
.unthrottle = if_unthrottle, .unthrottle = if_unthrottle,
#if 0
.break_ctl = serial_break,
#endif
.tiocmget = if_tiocmget, .tiocmget = if_tiocmget,
.tiocmset = if_tiocmset, .tiocmset = if_tiocmset,
}; };
...@@ -565,29 +562,6 @@ static void if_set_termios(struct tty_struct *tty, struct ktermios *old) ...@@ -565,29 +562,6 @@ static void if_set_termios(struct tty_struct *tty, struct ktermios *old)
cs->ops->set_line_ctrl(cs, cflag); cs->ops->set_line_ctrl(cs, cflag);
#if 0
//FIXME this hangs M101 [ts 2005-03-09]
//FIXME do we need this?
/*
* Set flow control: well, I do not really now how to handle DTR/RTS.
* Just do what we have seen with SniffUSB on Win98.
*/
/* Drop DTR/RTS if no flow control otherwise assert */
gig_dbg(DEBUG_IF, "%u: control_state %x",
cs->minor_index, control_state);
new_state = control_state;
if ((iflag & IXOFF) || (iflag & IXON) || (cflag & CRTSCTS))
new_state |= TIOCM_DTR | TIOCM_RTS;
else
new_state &= ~(TIOCM_DTR | TIOCM_RTS);
if (new_state != control_state) {
gig_dbg(DEBUG_IF, "%u: new_state %x",
cs->minor_index, new_state);
gigaset_set_modem_ctrl(cs, control_state, new_state);
control_state = new_state;
}
#endif
/* save off the modified port settings */ /* save off the modified port settings */
cs->control_state = control_state; cs->control_state = control_state;
......
...@@ -88,11 +88,9 @@ static inline int isowbuf_startwrite(struct isowbuf_t *iwb) ...@@ -88,11 +88,9 @@ static inline int isowbuf_startwrite(struct isowbuf_t *iwb)
__func__); __func__);
return 0; return 0;
} }
#ifdef CONFIG_GIGASET_DEBUG
gig_dbg(DEBUG_ISO, gig_dbg(DEBUG_ISO,
"%s: acquired iso write semaphore, data[write]=%02x, nbits=%d", "%s: acquired iso write semaphore, data[write]=%02x, nbits=%d",
__func__, iwb->data[iwb->write], iwb->wbits); __func__, iwb->data[iwb->write], iwb->wbits);
#endif
return 1; return 1;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment