Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 25565
b: refs/heads/master
c: 0137150
h: refs/heads/master
i:
  25563: 37c81af
v: v3
  • Loading branch information
Tilman Schmidt authored and Linus Torvalds committed Apr 11, 2006
1 parent d8f79d3 commit 4c0c80e
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 34 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 714e8236e5ea9d39169761c546274ceb7eeb765f
refs/heads/master: 01371500b245ae63f542d74140a3d8ccb74d0318
2 changes: 1 addition & 1 deletion trunk/drivers/isdn/gigaset/asyncdata.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ static inline int lock_loop(unsigned char *src, int numbytes,
struct cardstate *cs = inbuf->cs;

gigaset_dbg_buffer(DEBUG_LOCKCMD, "received response",
numbytes, src, 0);
numbytes, src);
gigaset_if_receive(cs, src, numbytes);

return numbytes;
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/isdn/gigaset/bas-gigaset.c
Original file line number Diff line number Diff line change
Expand Up @@ -1756,7 +1756,7 @@ static int gigaset_write_cmd(struct cardstate *cs,

gigaset_dbg_buffer(atomic_read(&cs->mstate) != MS_LOCKED ?
DEBUG_TRANSCMD : DEBUG_LOCKCMD,
"CMD Transmit", len, buf, 0);
"CMD Transmit", len, buf);

if (unlikely(!atomic_read(&cs->connected))) {
err("%s: disconnected", __func__);
Expand Down
30 changes: 7 additions & 23 deletions trunk/drivers/isdn/gigaset/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,50 +79,34 @@ __u8 gigaset_invtab[256] = {
EXPORT_SYMBOL_GPL(gigaset_invtab);

void gigaset_dbg_buffer(enum debuglevel level, const unsigned char *msg,
size_t len, const unsigned char *buf, int from_user)
size_t len, const unsigned char *buf)
{
unsigned char outbuf[80];
unsigned char inbuf[80 - 1];
unsigned char c;
size_t numin;
const unsigned char *in;
size_t space = sizeof outbuf - 1;
unsigned char *out = outbuf;
size_t numin = len;

if (!from_user) {
in = buf;
numin = len;
} else {
numin = len < sizeof inbuf ? len : sizeof inbuf;
in = inbuf;
if (copy_from_user(inbuf, (const unsigned char __user *) buf,
numin)) {
gig_dbg(level, "%s (%u bytes) - copy_from_user failed",
msg, (unsigned) len);
return;
}
}

while (numin-- > 0) {
while (numin--) {
c = *buf++;
if (c == '~' || c == '^' || c == '\\') {
if (space-- <= 0)
if (!space--)
break;
*out++ = '\\';
}
if (c & 0x80) {
if (space-- <= 0)
if (!space--)
break;
*out++ = '~';
c ^= 0x80;
}
if (c < 0x20 || c == 0x7f) {
if (space-- <= 0)
if (!space--)
break;
*out++ = '^';
c ^= 0x40;
}
if (space-- <= 0)
if (!space--)
break;
*out++ = c;
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/isdn/gigaset/gigaset.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ enum debuglevel { /* up to 24 bits (atomic_t) */
#endif

void gigaset_dbg_buffer(enum debuglevel level, const unsigned char *msg,
size_t len, const unsigned char *buf, int from_user);
size_t len, const unsigned char *buf);

/* connection state */
#define ZSAU_NONE 0
Expand Down
7 changes: 4 additions & 3 deletions trunk/drivers/isdn/gigaset/interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,6 @@ static int if_ioctl(struct tty_struct *tty, struct file *file,
break;
case GIGASET_BRKCHARS:
//FIXME test if MS_LOCKED
gigaset_dbg_buffer(DEBUG_IF, "GIGASET_BRKCHARS",
6, (const unsigned char *) arg, 1);
if (!atomic_read(&cs->connected)) {
gig_dbg(DEBUG_ANY,
"can't communicate with unplugged device");
Expand All @@ -257,8 +255,11 @@ static int if_ioctl(struct tty_struct *tty, struct file *file,
retval = copy_from_user(&buf,
(const unsigned char __user *) arg, 6)
? -EFAULT : 0;
if (retval >= 0)
if (retval >= 0) {
gigaset_dbg_buffer(DEBUG_IF, "GIGASET_BRKCHARS",
6, (const unsigned char *) arg);
retval = cs->ops->brkchars(cs, buf);
}
break;
case GIGASET_VERSION:
retval = copy_from_user(version,
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/isdn/gigaset/isocdata.c
Original file line number Diff line number Diff line change
Expand Up @@ -957,11 +957,11 @@ void gigaset_isoc_input(struct inbuf_t *inbuf)

if (atomic_read(&cs->mstate) == MS_LOCKED) {
gigaset_dbg_buffer(DEBUG_LOCKCMD, "received response",
numbytes, src, 0);
numbytes, src);
gigaset_if_receive(inbuf->cs, src, numbytes);
} else {
gigaset_dbg_buffer(DEBUG_CMD, "received response",
numbytes, src, 0);
numbytes, src);
cmd_loop(src, numbytes, inbuf);
}

Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/isdn/gigaset/usb-gigaset.c
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ static int gigaset_write_cmd(struct cardstate *cs, const unsigned char *buf,

gigaset_dbg_buffer(atomic_read(&cs->mstate) != MS_LOCKED ?
DEBUG_TRANSCMD : DEBUG_LOCKCMD,
"CMD Transmit", len, buf, 0);
"CMD Transmit", len, buf);

if (!atomic_read(&cs->connected)) {
err("%s: not connected", __func__);
Expand Down Expand Up @@ -559,7 +559,7 @@ static int gigaset_brkchars(struct cardstate *cs, const unsigned char buf[6])
#ifdef CONFIG_GIGASET_UNDOCREQ
struct usb_device *udev = cs->hw.usb->udev;

gigaset_dbg_buffer(DEBUG_USBREQ, "brkchars", 6, buf, 0);
gigaset_dbg_buffer(DEBUG_USBREQ, "brkchars", 6, buf);
memcpy(cs->hw.usb->bchars, buf, 6);
return usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0x19, 0x41,
0, 0, &buf, 6, 2000);
Expand Down

0 comments on commit 4c0c80e

Please sign in to comment.