-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
yaml --- r: 227894 b: refs/heads/master c: 2564a14 h: refs/heads/master v: v3
- Loading branch information
Stephen Hemminger
committed
Oct 30, 2010
1 parent
d9ebc79
commit 93136ce
Showing
4 changed files
with
62 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- | ||
refs/heads/master: 047a5f2b503d0ba17704c9714b296cbf06ec087e | ||
refs/heads/master: 2564a148d5326f1d36202e497b3dd0a17422c636 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,40 @@ | ||
#include "headers.h" | ||
|
||
static UINT current_debug_level=BCM_SCREAM; | ||
|
||
int bcm_print_buffer( UINT debug_level, const char *function_name, | ||
char *file_name, int line_number, unsigned char *buffer, int bufferlen, enum _BASE_TYPE base) | ||
void bcm_print_buffer(UINT debug_level, const char *function_name, | ||
const char *file_name, int line_number, | ||
const unsigned char *buffer, int bufferlen, | ||
BASE_TYPE base) | ||
{ | ||
int i; | ||
static const char * const buff_dump_base[] = { | ||
"DEC", "HEX", "OCT", "BIN" | ||
}; | ||
if(debug_level>=current_debug_level) | ||
{ | ||
int i=0; | ||
printk("\n%s:%s:%d:Buffer dump of size 0x%x in the %s:\n", file_name, function_name, line_number, bufferlen, buff_dump_base[1]); | ||
for(;i<bufferlen;i++) | ||
{ | ||
if(i && !(i%16) ) | ||
printk("\n"); | ||
switch(base) | ||
{ | ||
case BCM_BASE_TYPE_DEC: | ||
printk("%03d ", buffer[i]); | ||
break; | ||
case BCM_BASE_TYPE_OCT: | ||
printk("%0x03o ", buffer[i]); | ||
break; | ||
case BCM_BASE_TYPE_BIN: | ||
printk("%02x ", buffer[i]); | ||
break; | ||
case BCM_BASE_TYPE_HEX: | ||
default: | ||
printk("%02X ", buffer[i]); | ||
break; | ||
} | ||
|
||
if(debug_level < BCM_SCREAM) | ||
return; | ||
|
||
printk("\n" KERN_DEBUG "%s:%s:%d:Buffer dump of size 0x%x in the %s:\n", | ||
file_name, function_name, line_number, bufferlen, buff_dump_base[1]); | ||
|
||
for(i = 0; i < bufferlen;i++) { | ||
if(i && !(i%16) ) | ||
printk("\n"); | ||
switch(base) { | ||
case BCM_BASE_TYPE_DEC: | ||
printk("%03d ", buffer[i]); | ||
break; | ||
case BCM_BASE_TYPE_OCT: | ||
printk("%0x03o ", buffer[i]); | ||
break; | ||
case BCM_BASE_TYPE_BIN: | ||
printk("%02x ", buffer[i]); | ||
break; | ||
case BCM_BASE_TYPE_HEX: | ||
default: | ||
printk("%02X ", buffer[i]); | ||
break; | ||
} | ||
printk("\n"); | ||
} | ||
return 0; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters