📄 lcm_dbg.c
字号:
if( pDebugMsg->ulPara1 == pDebugMsg->ulPara2 || LOCAL_PROCESSOR_ID != pDebugMsg->ulPara1 ) { break; } pTestMsg = aos_msg_alloc( MPE_LCM, sizeof(LCM_EFFICIENT_MSG_S) ); if( NULL == pTestMsg ) { aos_printf( MPE_LCM, "allocate fail" ); break; } lcm_eff_test_finished = 0; msg.srcProcessorId = pDebugMsg->ulPara1; msg.srcMpe = MPE_LCM; msg.dstProcessorId = pDebugMsg->ulPara2; msg.dstMpe = MPE_LCM; msg.ulSize = sizeof(LCM_EFFICIENT_MSG_S); msg.msgPrio = MSG_PRIO_NORMAL; msg.pvMsgBuf = (VOID*)pTestMsg; pTestMsg->prim = LCM_EFFICIENT_TEST; aos_time_get_ms( &high, &pTestMsg->s_time ); pTestMsg->count = pDebugMsg->ulPara3; if( 10 == cmd ) { pTestMsg->sub_prim = LCM_UI_FRAME_TEST; } else { pTestMsg->sub_prim = LCM_I_FRAME_TEST; } pTestMsg->prim = AOS_HTONS(pTestMsg->prim); pTestMsg->sub_prim = AOS_HTONS(pTestMsg->sub_prim); pTestMsg->s_time = AOS_HTONL(pTestMsg->s_time); pTestMsg->count = AOS_HTONL(pTestMsg->count); if( 10 == cmd ) { aos_msg_trysend(&msg); } else { aos_msg_send(&msg); } } break; case 12: lcm_eff_test_finished = 1; aos_printf( MPE_LCM, "finish lcm efficient test" ); break; #if(CONFIG_BOARD_EIA == TRUE || CONFIG_BOARD_GMPU == TRUE ) case 20: drv_eia_debug_msg( pDebugMsg->ulPara1, pDebugMsg->ulPara2 ); break;#endif case 0: default: { S8 *q921_err_str[16]= { "S Frame F=1","DM F=1","UA F=1 C","UA F=1 D","DM F=0", "PEER SABME", "SABME N200","DISC N200","ENQUIRE N200", "N(R)","RX FRMR","UNKNOWN","I FIELD","SIZE","N201", "I RESENT" }; aos_printf( MPE_LCM, "LCM debuger help" ); aos_printf( MPE_LCM, "cmd 2 0 to show LCM debuger help" ); aos_printf( MPE_LCM, "cmd 2 1 drvtype dltype to set drvtype and dltype" ); aos_printf( MPE_LCM, "cmd 2 2 portno to show link status" ); aos_printf( MPE_LCM, "cmd 2 3 portno [0,1,2,4,8] to set print flag,0:all,1:mngt,2:l2msg,4:l3msg,8:error" ); aos_printf( MPE_LCM, "cmd 2 4 portno [0,1,2,4,8] to clear print flag,0:all,1:mngt,2:l2msg,4:l3msg,8:error" ); aos_printf( MPE_LCM, "cmd 2 10 srcporcid dstporcid count to start lcm UI Frame efficient test " ); aos_printf( MPE_LCM, "cmd 2 11 srcporcid dstporcid count to start lcm I Frame efficient test " ); aos_printf( MPE_LCM, "cmd 2 12 to finish lcm efficient test " ); aos_printf( MPE_LCM, "cmd 2 20 xx,xx to eia drv debug cmd" ); aos_printf( MPE_LCM, "drvtype:0--HDLC,1--ETHERNET,2--UDP4EIA" ); aos_printf( MPE_LCM, "dltype :0--PSTN,1--BCC,2--CONTROL,3--LINKC,4--PROTECT1,5--PROTECT2,6--ISDN,7--DEVMNGT" ); for( i = 0; i < LCM_PRIM_BUTT; i++ ) { aos_printf( MPE_LCM, "L3 prim[%2d]=%s", i, PRIM_STRING(i) ); } for( i = 0; i <= ('P'-'A'); i++ ) { aos_printf( MPE_LCM, "q921 error code,%c indicate %s", i+'A',q921_err_str[i] ); } } break; }}VOID lcm_test_proc( LCM_EFFICIENT_MSG_S *selfp, U32 srcProcId ){ MSG_S msg; LCM_EFFICIENT_MSG_S *pTestMsg; U32 high,low, send_ui_mode; AOS_ASSERT( NULL != selfp ); selfp->prim = AOS_NTOHS(selfp->prim); selfp->sub_prim = AOS_NTOHS(selfp->sub_prim); selfp->s_time = AOS_NTOHL(selfp->s_time); selfp->count = AOS_NTOHL(selfp->count); switch( selfp->prim ) { case LCM_EFFICIENT_TEST_ACK: aos_time_get_ms( &high, &low ); aos_printf( MPE_LCM, "lcm tx&rx between processor %d & %d needs %u ms", LOCAL_PROCESSOR_ID, srcProcId, low-selfp->s_time ); selfp->count--; if( !selfp->count || lcm_eff_test_finished ) { break; } case LCM_EFFICIENT_TEST: pTestMsg = aos_msg_alloc( MPE_LCM, sizeof(LCM_EFFICIENT_MSG_S) ); if( NULL == pTestMsg ) { aos_printf( MPE_LCM, "allocate fail" ); break; } msg.srcProcessorId = LOCAL_PROCESSOR_ID; msg.srcMpe = MPE_LCM; msg.dstProcessorId = srcProcId; msg.dstMpe = MPE_LCM; msg.ulSize = sizeof(LCM_EFFICIENT_MSG_S); msg.msgPrio = MSG_PRIO_NORMAL; msg.pvMsgBuf = (VOID*)pTestMsg; if( LCM_EFFICIENT_TEST == selfp->prim ) { pTestMsg->prim = LCM_EFFICIENT_TEST_ACK; pTestMsg->s_time = selfp->s_time; } else { pTestMsg->prim = LCM_EFFICIENT_TEST; aos_time_get_ms( &high, &pTestMsg->s_time ); } pTestMsg->sub_prim = selfp->sub_prim; pTestMsg->count = selfp->count; send_ui_mode = LCM_UI_FRAME_TEST == selfp->sub_prim ? 1 : 0; pTestMsg->prim = AOS_HTONS(pTestMsg->prim); pTestMsg->sub_prim = AOS_HTONS(pTestMsg->sub_prim); pTestMsg->s_time = AOS_HTONL(pTestMsg->s_time); pTestMsg->count = AOS_HTONL(pTestMsg->count); if( send_ui_mode ) { aos_msg_trysend(&msg); } else { aos_msg_send(&msg); } break; default: break; } }VOID print_frame( L2_LINK_S *linkp, U32 cmd, Q921_FRAME_S *framep ){ U32 phy_type; U32 port_no; AOS_ASSERT( NULL != linkp && NULL != framep ); phy_type = linkp->phy_type; port_no = linkp->phy_port_no; if( IS_U_FRAME(framep) ) { if( LCM_PRINT_L2_MSG(linkp) ) { aos_printf( MPE_LCM, "q921<-:q921_phy_data_ind, phy=%s,portno=%d,dl=%s status=%s," "U frame ,cmd=%s, sapi=%d, tei=%d, c/r=%d,p/f=%d", PHY_STRING(phy_type), port_no, DL_STRING(linkp->link_type), STATUS_STRING(linkp->status), cmd_string(cmd), framep->frm.u_frame.sapi, framep->frm.u_frame.tei, framep->frm.u_frame.c_r, framep->frm.u_frame.p_f ); } } else if( IS_S_FRAME(framep) ) { if( LCM_PRINT_L2_MSG(linkp) ) { aos_printf( MPE_LCM, "q921<-:q921_phy_data_ind, phy=%s,portno=%d,dl=%s status=%s," "S frame ,cmd=%s, sapi=%d, tei=%d, c/r=%d,p/f=%d, n_r=%d", PHY_STRING(phy_type), port_no, DL_STRING(linkp->link_type), STATUS_STRING(linkp->status), cmd_string(cmd), framep->frm.s_frame.sapi, framep->frm.s_frame.tei, framep->frm.s_frame.c_r, framep->frm.s_frame.p_f, framep->frm.s_frame.n_r ); } } else if( IS_I_FRAME(framep) ) { if( LCM_PRINT_L3_MSG(linkp) ) { aos_printf( MPE_LCM, "q921<-:q921_phy_data_ind, phy=%s,portno=%d,dl=%s status=%s," "I frame ,cmd=%s, sapi=%d, tei=%d, c/r=%d,p/f=%d, n_r=%d,n_s=%d", PHY_STRING(phy_type), port_no, DL_STRING(linkp->link_type), STATUS_STRING(linkp->status), cmd_string(cmd), framep->frm.i_frame.sapi, framep->frm.i_frame.tei, framep->frm.i_frame.c_r, framep->frm.i_frame.p_f, framep->frm.i_frame.n_r, framep->frm.i_frame.n_s ); } } else { if( LCM_PRINT_ERROR_IND(linkp) ) { aos_printf( MPE_LCM, "q921<-:q921_phy_data_ind, phy=%s,portno=%d,dl=%s status=%s," "Wrong frame ,cmd=%s, sapi=%d, tei=%d, c/r=%d", PHY_STRING(phy_type), port_no, DL_STRING(linkp->link_type), STATUS_STRING(linkp->status), cmd_string(cmd), framep->frm.i_frame.sapi, framep->frm.i_frame.tei, framep->frm.i_frame.c_r ); } } }#ifdef __cplusplus}#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -