diff options
author | Matthias Goebl <matthias.goebl@goebl.net> | 2008-01-04 06:45:28 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-04 06:55:44 -0500 |
commit | 7fde4d779b83898851959f837c9b26fe07ee91c9 (patch) | |
tree | 233dd7a7d9b1bc1ca344cc2c78a5bd2dde4f6f40 /drivers/isdn/i4l/isdn_tty.c | |
parent | 00409bb045887ec5e7b9e351bc080c38ab6bfd33 (diff) |
[ISDN]: i4l: Fix DLE handling for i4l-audio
The DLE handling in i4l-audio seems to be broken.
It produces spurious DLEs so asterisk 1.2.24 with chan_modem_i4l
gets irritated, the error message is:
"chan_modem_i4l.c:450 i4l_read: Value of escape is ^ (17)".
-> There shouldn't be a DLE-^.
If a spurious DLE-ETX occurs, the audio connection even dies.
I use a "AVM Fritz!PCI" isdn card.
I found two issues that only appear if ISDN_AUDIO_SKB_DLECOUNT(skb) > 0:
- The loop in isdn_tty.c:isdn_tty_try_read() doesn't escape a DLE if it's
the last character.
- The loop in isdn_common.c:isdn_readbchan_tty() doesn't copy its characters,
it only remembers the last one ("last = *p;").
Compare it with the loop in isdn_common.c:isdn_readbchan(), that *does*
copy them ("*cp++ = *p;") correctly.
The special handling of the "last" character made it more difficult.
I compared it to linux-2.4.19: There was no "last"-handling and both loops
did escape and copy all characters correctly.
Signed-off-by: Matthias Goebl <matthias.goebl@goebl.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/isdn/i4l/isdn_tty.c')
-rw-r--r-- | drivers/isdn/i4l/isdn_tty.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/isdn/i4l/isdn_tty.c b/drivers/isdn/i4l/isdn_tty.c index 24679a3f5596..9cb6e5021adb 100644 --- a/drivers/isdn/i4l/isdn_tty.c +++ b/drivers/isdn/i4l/isdn_tty.c | |||
@@ -85,6 +85,8 @@ isdn_tty_try_read(modem_info * info, struct sk_buff *skb) | |||
85 | tty_insert_flip_char(tty, DLE, 0); | 85 | tty_insert_flip_char(tty, DLE, 0); |
86 | tty_insert_flip_char(tty, *dp++, 0); | 86 | tty_insert_flip_char(tty, *dp++, 0); |
87 | } | 87 | } |
88 | if (*dp == DLE) | ||
89 | tty_insert_flip_char(tty, DLE, 0); | ||
88 | last = *dp; | 90 | last = *dp; |
89 | } else { | 91 | } else { |
90 | #endif | 92 | #endif |