log: normalize generic NCP dispatch messages
This commit is contained in:
23
src/nwconn.c
23
src/nwconn.c
@@ -341,21 +341,24 @@ static void pr_debug_request()
|
||||
case 0x57 : ufunc = (int) *(requestdata); break;
|
||||
default : break;
|
||||
} /* switch */
|
||||
XDPRINTF((1, 0, "NCP REQUEST: func=0x%02x, ufunc=0x%02x, seq:%03d, task:%02d",
|
||||
XDPRINTF((1, 0, "DBUG NCP REQUEST func=%d ufunc=%d seq=%03d task=%02d fn=0x%02x sub=0x%02x",
|
||||
(int)ncprequest->function, ufunc,
|
||||
(int)ncprequest->sequence,
|
||||
(int)ncprequest->task));
|
||||
(int)ncprequest->task,
|
||||
(int)ncprequest->function, ufunc));
|
||||
} else {
|
||||
XDPRINTF((1, 0, "Got NCP:type:0x%x, seq:%d, task:%d, func=0x%x",
|
||||
XDPRINTF((1, 0, "DBUG NCP REQUEST type=%d seq=%d task=%d func=%d type_hex=0x%x fn=0x%02x",
|
||||
ncp_type,
|
||||
(int)ncprequest->sequence,
|
||||
(int)ncprequest->task,
|
||||
(int)ncprequest->function,
|
||||
ncp_type,
|
||||
(int)ncprequest->function));
|
||||
}
|
||||
if (requestlen > 0){
|
||||
int j = requestlen;
|
||||
uint8 *p=requestdata;
|
||||
XDPRINTF((0, 2, "len %d, DATA:", j));
|
||||
XDPRINTF((0, 2, "DBUG NCP REQUEST_DATA len=%d data=", j));
|
||||
while (j--) {
|
||||
int c = *p++;
|
||||
if (c > 32 && c < 127) XDPRINTF((0, 3,",\'%c\'", (char) c));
|
||||
@@ -5457,7 +5460,7 @@ static int handle_ncp_serv(void)
|
||||
(void) nw_init_connect();
|
||||
last_sequence = -9999;
|
||||
} else {
|
||||
XDPRINTF((1,0, "WRONG TYPE:0x%x", ncp_type));
|
||||
XDPRINTF((1,0, "WARN NCP WRONGTYPE type=%d type_hex=0x%x result=0xfb", ncp_type, ncp_type));
|
||||
completition = 0xfb;
|
||||
}
|
||||
|
||||
@@ -5472,15 +5475,15 @@ static int handle_ncp_serv(void)
|
||||
subfunc = requestdata[0];
|
||||
|
||||
if (subfunc > -1)
|
||||
XDPRINTF((0,0, "UNKNOWN FUNCTION or TYPE: type=0x%x func=0x%x ufunc=0x%x",
|
||||
ncp_type, function, subfunc));
|
||||
XDPRINTF((0,0, "INFO NCP UNKNOWN type=%d func=%d ufunc=%d type_hex=0x%x fn=0x%02x sub=0x%02x result=0xfb",
|
||||
ncp_type, function, subfunc, ncp_type, function, subfunc));
|
||||
else
|
||||
XDPRINTF((0,0, "UNKNOWN FUNCTION or TYPE: type=0x%x func=0x%x",
|
||||
ncp_type, function));
|
||||
XDPRINTF((0,0, "INFO NCP UNKNOWN type=%d func=%d type_hex=0x%x fn=0x%02x result=0xfb",
|
||||
ncp_type, function, ncp_type, function));
|
||||
} else if (data_len){
|
||||
int j = data_len;
|
||||
uint8 *p = responsedata;
|
||||
XDPRINTF((0,2, "RSPONSE: len %d, DATA:", data_len));
|
||||
XDPRINTF((0,2, "DBUG NCP RESPONSE_DATA len=%d data=", data_len));
|
||||
while (j--) {
|
||||
int c = *p++;
|
||||
if (c > 32 && c < 127) XDPRINTF((0,3,",\'%c\'", (char) c));
|
||||
|
||||
Reference in New Issue
Block a user