Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7fde4d779b83898851959f837c9b26fe07ee91c9
Commit:     7fde4d779b83898851959f837c9b26fe07ee91c9
Parent:     00409bb045887ec5e7b9e351bc080c38ab6bfd33
Author:     Matthias Goebl <[EMAIL PROTECTED]>
AuthorDate: Fri Jan 4 03:45:28 2008 -0800
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Fri Jan 4 03:55:44 2008 -0800

    [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 <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 drivers/isdn/i4l/isdn_common.c |    3 +++
 drivers/isdn/i4l/isdn_tty.c    |    2 ++
 2 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/isdn/i4l/isdn_common.c b/drivers/isdn/i4l/isdn_common.c
index d695295..9cef6fc 100644
--- a/drivers/isdn/i4l/isdn_common.c
+++ b/drivers/isdn/i4l/isdn_common.c
@@ -914,6 +914,9 @@ isdn_readbchan_tty(int di, int channel, struct tty_struct 
*tty, int cisco_hack)
                        dflag = 0;
                        count_pull = count_put = 0;
                        while ((count_pull < skb->len) && (len > 0)) {
+                               /* push every character but the last to the tty 
buffer directly */
+                               if ( count_put )
+                                       tty_insert_flip_char(tty, last, 
TTY_NORMAL);
                                len--;
                                if (dev->drv[di]->DLEflag & DLEmask) {
                                        last = DLE;
diff --git a/drivers/isdn/i4l/isdn_tty.c b/drivers/isdn/i4l/isdn_tty.c
index 24679a3..9cb6e50 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)
                                                                
tty_insert_flip_char(tty, DLE, 0);
                                                        
tty_insert_flip_char(tty, *dp++, 0);
                                                }
+                                               if (*dp == DLE)
+                                                       
tty_insert_flip_char(tty, DLE, 0);
                                                last = *dp;
                                        } else {
 #endif
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to