Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 368734
b: refs/heads/master
c: 167bfa7
h: refs/heads/master
v: v3
  • Loading branch information
Andy Shevchenko authored and David S. Miller committed Mar 27, 2013
1 parent 0f246bb commit 8a29595
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 52 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: 5a048e3b59fb4211b7978f78217878071c344379
refs/heads/master: 167bfa71844a7a7415da0fa8c75e672f3bd438c8
53 changes: 2 additions & 51 deletions trunk/drivers/net/ppp/ppp_synctty.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,64 +105,15 @@ static const struct ppp_channel_ops sync_ops = {
};

/*
* Utility procedures to print a buffer in hex/ascii
* Utility procedure to print a buffer in hex/ascii
*/
static void
ppp_print_hex (register __u8 * out, const __u8 * in, int count)
{
register __u8 next_ch;
static const char hex[] = "0123456789ABCDEF";

while (count-- > 0) {
next_ch = *in++;
*out++ = hex[(next_ch >> 4) & 0x0F];
*out++ = hex[next_ch & 0x0F];
++out;
}
}

static void
ppp_print_char (register __u8 * out, const __u8 * in, int count)
{
register __u8 next_ch;

while (count-- > 0) {
next_ch = *in++;

if (next_ch < 0x20 || next_ch > 0x7e)
*out++ = '.';
else {
*out++ = next_ch;
if (next_ch == '%') /* printk/syslogd has a bug !! */
*out++ = '%';
}
}
*out = '\0';
}

static void
ppp_print_buffer (const char *name, const __u8 *buf, int count)
{
__u8 line[44];

if (name != NULL)
printk(KERN_DEBUG "ppp_synctty: %s, count = %d\n", name, count);

while (count > 8) {
memset (line, 32, 44);
ppp_print_hex (line, buf, 8);
ppp_print_char (&line[8 * 3], buf, 8);
printk(KERN_DEBUG "%s\n", line);
count -= 8;
buf += 8;
}

if (count > 0) {
memset (line, 32, 44);
ppp_print_hex (line, buf, count);
ppp_print_char (&line[8 * 3], buf, count);
printk(KERN_DEBUG "%s\n", line);
}
print_hex_dump_bytes("", DUMP_PREFIX_NONE, buf, count);
}


Expand Down

0 comments on commit 8a29595

Please sign in to comment.