#include <linux/crc-ccitt.h>
#include <linux/bitrev.h>
-//#define GIG_M10x_STUFF_VOICE_DATA
-
/* check if byte must be stuffed/escaped
* I'm not sure which data should be encoded.
* Therefore I will go the hard way and decode every value
}
byte_stuff:
c ^= PPP_TRANS;
-#ifdef CONFIG_GIGASET_DEBUG
if (unlikely(!muststuff(c)))
gig_dbg(DEBUG_HDLC, "byte stuffed: 0x%02x", c);
-#endif
} else if (unlikely(c == PPP_FLAG)) {
if (unlikely(inputstate & INS_skip_frame)) {
- if (!(inputstate & INS_have_data)) { /* 7E 7E */
#ifdef CONFIG_GIGASET_DEBUG
+ if (!(inputstate & INS_have_data)) { /* 7E 7E */
++bcs->emptycount;
-#endif
} else
gig_dbg(DEBUG_HDLC,
"7e----------------------------");
+#endif
/* end of frame */
error = 1;
}
break;
-#ifdef CONFIG_GIGASET_DEBUG
} else if (unlikely(muststuff(c))) {
/* Should not happen. Possible after ZDLE=1<CR><LF>. */
gig_dbg(DEBUG_HDLC, "not byte stuffed: 0x%02x", c);
-#endif
}
/* add character */
inbuf->inputstate &= ~INS_DLE_char;
switch (c) {
case 'X': /*begin of command*/
-#ifdef CONFIG_GIGASET_DEBUG
if (inbuf->inputstate & INS_command)
- dev_err(cs->dev,
+ dev_warn(cs->dev,
"received <DLE> 'X' in command mode\n");
-#endif
inbuf->inputstate |=
INS_command | INS_DLE_command;
break;
case '.': /*end of command*/
-#ifdef CONFIG_GIGASET_DEBUG
if (!(inbuf->inputstate & INS_command))
- dev_err(cs->dev,
+ dev_warn(cs->dev,
"received <DLE> '.' in hdlc mode\n");
-#endif
inbuf->inputstate &= cs->dle ?
~(INS_DLE_command|INS_command)
: ~INS_DLE_command;
{EV_TIMEOUT, 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}},
-#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 */
{RSP_INIT, 0, 0,SEQ_DLE0, 201, 5, {0}, "^SDLE=0\r"},
{RSP_INIT, 0, 0,SEQ_NOCID, 0, 0, {ACT_ABORTCID}},
/* 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_OK, 504,504, -1, 0, 0, {ACT_SDOWN}},
{RSP_ERROR, 501,599, -1, 0, 0, {ACT_FAILSDOWN}},
};
-#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[] =
{
/*{"", RSP_EMPTY, RT_NOTHING},*/
dev_err(cs->dev, "out of memory\n");
++curarg;
}
-#ifdef CONFIG_GIGASET_DEBUG
- if (!event->ptr)
- gig_dbg(DEBUG_CMD, "string==NULL");
- else
- gig_dbg(DEBUG_CMD, "string==%s",
- (char *) event->ptr);
-#endif
+ gig_dbg(DEBUG_CMD, "string==%s",
+ event->ptr ? (char *) event->ptr : "NULL");
break;
case RT_ZCAU:
event->parameter = -1;
++curarg;
} else
event->parameter = -1;
-#ifdef CONFIG_GIGASET_DEBUG
gig_dbg(DEBUG_CMD, "parameter==%d", event->parameter);
-#endif
break;
}
.set_termios = if_set_termios,
.throttle = if_throttle,
.unthrottle = if_unthrottle,
-#if 0
- .break_ctl = serial_break,
-#endif
.tiocmget = if_tiocmget,
.tiocmset = if_tiocmset,
};
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 */
cs->control_state = control_state;