X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=drivers%2Fisdn%2Fgigaset%2Fisocdata.c;h=8c0eb522dab14336d8c7140660146375bff03ad0;hb=92ba0ee2770ed4954e3f8ba412ef2f37e5519477;hp=8667daaa1a82e74eb74af3704ea4021e283c50e6;hpb=f7a014af2d76a96e5af51b64f954328b700fa62f;p=firefly-linux-kernel-4.4.55.git diff --git a/drivers/isdn/gigaset/isocdata.c b/drivers/isdn/gigaset/isocdata.c index 8667daaa1a82..8c0eb522dab1 100644 --- a/drivers/isdn/gigaset/isocdata.c +++ b/drivers/isdn/gigaset/isocdata.c @@ -14,6 +14,7 @@ #include "gigaset.h" #include +#include /* access methods for isowbuf_t */ /* ============================ */ @@ -487,7 +488,7 @@ static inline int trans_buildframe(struct isowbuf_t *iwb, gig_dbg(DEBUG_STREAM, "put %d bytes", count); write = atomic_read(&iwb->write); do { - c = gigaset_invtab[*in++]; + c = bitrev8(*in++); iwb->data[write++] = c; write %= BAS_OUTBUFSIZE; } while (--count > 0); @@ -876,7 +877,7 @@ static inline void trans_receive(unsigned char *src, unsigned count, while (count > 0) { dst = skb_put(skb, count < dobytes ? count : dobytes); while (count > 0 && dobytes > 0) { - *dst++ = gigaset_invtab[*src++]; + *dst++ = bitrev8(*src++); count--; dobytes--; } @@ -920,6 +921,8 @@ static void cmd_loop(unsigned char *src, int numbytes, struct inbuf_t *inbuf) /* end of line */ gig_dbg(DEBUG_TRANSCMD, "%s: End of Command (%d Bytes)", __func__, cbytes); + if (cbytes >= MAX_RESP_SIZE - 1) + dev_warn(cs->dev, "response too large\n"); cs->cbytes = cbytes; gigaset_handle_modem_response(cs); cbytes = 0; @@ -928,8 +931,6 @@ static void cmd_loop(unsigned char *src, int numbytes, struct inbuf_t *inbuf) /* advance in line buffer, checking for overflow */ if (cbytes < MAX_RESP_SIZE - 1) cbytes++; - else - dev_warn(cs->dev, "response too large\n"); } }