/*--------------------------------------------------------------------*/ DLL_EXPORT void mpc_display_rrh_and_pdu( DEVBLK* pDEVBLK, MPC_TH* pMPC_TH, MPC_RRH* pMPC_RRH, BYTE bDir, int iLimit ) { MPC_PH* pMPC_PH; U16 uNumPH; U16 uOffPH; int iForPH; int iDone; U32 uLenData; U32 uOffData; BYTE* pData; /* Display the MPC_RRH.*/ FETCH_HW( uOffPH, pMPC_RRH->offph ); mpc_display_stuff( pDEVBLK, "RRH", (BYTE*)pMPC_RRH, uOffPH, bDir ); /* Display the MPC_PH(s). */ FETCH_HW( uNumPH, pMPC_RRH->numph ); pMPC_PH = (MPC_PH*)((BYTE*)pMPC_RRH + uOffPH); for( iForPH = 1; iForPH <= uNumPH; iForPH++ ) { mpc_display_stuff( pDEVBLK, "PH", (BYTE*)pMPC_PH, SIZE_PH, bDir ); pMPC_PH = (MPC_PH*)((BYTE*)pMPC_PH + SIZE_PH); } /* Display the data referenced by the MPC_PH(s). */ /* if limit is negative or a silly number, don't display the */ /* data. If limit is zero, display all of the data, otherwise */ /* limit the length of the data displayed. */ iDone = 0; if( iLimit >= 0 && iLimit <= 65535 ) { pMPC_PH = (MPC_PH*)((BYTE*)pMPC_RRH + uOffPH); for( iForPH = 1; iForPH <= uNumPH; iForPH++ ) { FETCH_F3( uLenData, pMPC_PH->lendata ); FETCH_FW( uOffData, pMPC_PH->offdata ); pData = (BYTE*)pMPC_TH + uOffData; if( iLimit > 0 ) { if( iDone >= iLimit ) break; if( (int)uLenData > ( iLimit - iDone ) ) uLenData = ( iLimit - iDone ); iDone =+ uLenData; } mpc_display_stuff( pDEVBLK, "PDU", pData, uLenData, bDir ); pMPC_PH = (MPC_PH*)((BYTE*)pMPC_PH + SIZE_PH); } } return; } /* End function mpc_display_rrh_and_pdu() */
/*--------------------------------------------------------------------*/ DLL_EXPORT void mpc_display_osa_iear( DEVBLK* pDEVBLK, MPC_IEAR* pMPC_IEAR, BYTE bDir ) { /* Display MPC_IEAR. */ mpc_display_stuff( pDEVBLK, "IEAR", (BYTE*)pMPC_IEAR, sizeof(MPC_IEAR), bDir ); return; } /* End function mpc_display_osa_iear() */
/*--------------------------------------------------------------------*/ DLL_EXPORT void mpc_display_ph( DEVBLK* pDEVBLK, MPC_PH* pMPC_PH, BYTE bDir ) { // Display the MPC_PH. mpc_display_stuff( pDEVBLK, "PH", (BYTE*)pMPC_PH, SIZE_PH, bDir ); return; } /* End function mpc_display_ph() */
/*--------------------------------------------------------------------*/ DLL_EXPORT void mpc_display_osa_iea( DEVBLK* pDEVBLK, MPC_IEA* pMPC_IEA, BYTE bDir, int iSize ) { /* Display MPC_IEA. */ mpc_display_stuff( pDEVBLK, "IEA", (BYTE*)pMPC_IEA, iSize, bDir ); return; } /* End function mpc_display_osa_iea() */
/*--------------------------------------------------------------------*/ DLL_EXPORT void mpc_display_rrh( DEVBLK* pDEVBLK, MPC_RRH* pMPC_RRH, BYTE bDir ) { U16 uOffPH; // Display the MPC_RRH. FETCH_HW( uOffPH, pMPC_RRH->offph ); mpc_display_stuff( pDEVBLK, "RRH", (BYTE*)pMPC_RRH, uOffPH, bDir ); return; } /* End function mpc_display_rrh() */
/*--------------------------------------------------------------------*/ DLL_EXPORT void mpc_display_th( DEVBLK* pDEVBLK, MPC_TH* pMPC_TH, BYTE bDir ) { U32 uOffRRH; // Display the MPC_TH. FETCH_FW( uOffRRH, pMPC_TH->offrrh ); mpc_display_stuff( pDEVBLK, "TH", (BYTE*)pMPC_TH, uOffRRH, bDir ); return; } /* End function mpc_display_th() */
/*--------------------------------------------------------------------*/ DLL_EXPORT void mpc_display_rrh_and_ipa( DEVBLK* pDEVBLK, MPC_TH* pMPC_TH, MPC_RRH* pMPC_RRH, BYTE bDir ) { MPC_PH* pMPC_PH; MPC_IPA* pMPC_IPA; BYTE* pMPC_IPA_CMD; U32 uOffData; U32 uLenData; U16 uOffPH; int iLenIPA; int iLenCmd; // Display the MPC_RRH. FETCH_HW( uOffPH, pMPC_RRH->offph ); mpc_display_stuff( pDEVBLK, "RRH", (BYTE*)pMPC_RRH, uOffPH, bDir ); // Point to and display the MPC_PH. pMPC_PH = (MPC_PH*)((BYTE*)pMPC_RRH + uOffPH); mpc_display_stuff( pDEVBLK, "PH", (BYTE*)pMPC_PH, SIZE_PH, bDir ); /* Point to and display the MPC_IPA (and commands, if any). */ FETCH_F3( uLenData, pMPC_PH->lendata ); FETCH_FW( uOffData, pMPC_PH->offdata ); if( uLenData > sizeof(MPC_IPA) ) { iLenIPA = sizeof(MPC_IPA); iLenCmd = uLenData - sizeof(MPC_IPA); } else { iLenIPA = uLenData; iLenCmd = 0; } pMPC_IPA = (MPC_IPA*)((BYTE*)pMPC_TH + uOffData); mpc_display_stuff( pDEVBLK, "IPA", (BYTE*)pMPC_IPA, iLenIPA, bDir ); if( iLenCmd ) { pMPC_IPA_CMD = (BYTE*)pMPC_IPA + iLenIPA; mpc_display_stuff( pDEVBLK, "Cmd", (BYTE*)pMPC_IPA_CMD, iLenCmd, bDir ); } return; } /* End function mpc_display_rrh_and_ipa() */
/* followed by a single MPC_PIX. */ DLL_EXPORT void mpc_display_rrh_and_pix( DEVBLK* pDEVBLK, MPC_TH* pMPC_TH, MPC_RRH* pMPC_RRH, BYTE bDir ) { MPC_PH* pMPC_PH; MPC_PIX* pMPC_PIX; U32 uOffData; U32 uLenData; U16 uOffPH; // Display the MPC_RRH. FETCH_HW( uOffPH, pMPC_RRH->offph ); mpc_display_stuff( pDEVBLK, "RRH", (BYTE*)pMPC_RRH, uOffPH, bDir ); // Point to and display the MPC_PH. pMPC_PH = (MPC_PH*)((BYTE*)pMPC_RRH + uOffPH); mpc_display_stuff( pDEVBLK, "PH", (BYTE*)pMPC_PH, SIZE_PH, bDir ); // Point to and display the MPC_PIX. FETCH_F3( uLenData, pMPC_PH->lendata ); FETCH_FW( uOffData, pMPC_PH->offdata ); pMPC_PIX = (MPC_PIX*)((BYTE*)pMPC_TH + uOffData); mpc_display_stuff( pDEVBLK, "PIX", (BYTE*)pMPC_PIX, uLenData, bDir ); return; } /* End function mpc_display_rrh_and_pix() */
/* is followed by up to four MPC_PUSs. */ DLL_EXPORT void mpc_display_rrh_and_puk( DEVBLK* pDEVBLK, MPC_TH* pMPC_TH, MPC_RRH* pMPC_RRH, BYTE bDir ) { MPC_PH* pMPC_PH; MPC_PUK* pMPC_PUK; MPC_PUS* pMPC_PUS; int iTotLenPUS; U32 uOffData; U16 uTotLenPUS; U16 uLenPUS; U16 uLenPUK; U16 uOffPH; // Display the MPC_RRH. FETCH_HW( uOffPH, pMPC_RRH->offph ); mpc_display_stuff( pDEVBLK, "RRH", (BYTE*)pMPC_RRH, uOffPH, bDir ); // Point to and display the MPC_PH. pMPC_PH = (MPC_PH*)((BYTE*)pMPC_RRH + uOffPH); mpc_display_stuff( pDEVBLK, "PH", (BYTE*)pMPC_PH, SIZE_PH, bDir ); // Get the length of and point to the data referenced by the // MPC_PH. The data contain a MPC_PUK and one or more MPC_PUSs. FETCH_FW( uOffData, pMPC_PH->offdata ); pMPC_PUK = (MPC_PUK*)((BYTE*)pMPC_TH + uOffData); // Display the MPC_PUK. FETCH_HW( uLenPUK, pMPC_PUK->length ); mpc_display_stuff( pDEVBLK, "PUK", (BYTE*)pMPC_PUK, uLenPUK, bDir ); // Get the total length of the following MPC_PUSs, then point to // the first MPC_PUS. FETCH_HW( uTotLenPUS, pMPC_PUK->lenpus ); iTotLenPUS = uTotLenPUS; pMPC_PUS = (MPC_PUS*)((BYTE*)pMPC_PUK + uLenPUK); // Display all of the MPC_PUSs. while( iTotLenPUS > 0 ) { // Ensure there are at least the first 4-bytes of the MPC_PUS. if( iTotLenPUS < 4 ) { mpc_display_stuff( pDEVBLK, "???", (BYTE*)pMPC_PUS, iTotLenPUS, bDir ); break; } // Get the length of the MPC_PUS. FETCH_HW( uLenPUS, pMPC_PUS->length ); if( uLenPUS == 0 ) /* Better safe than sorry */ { mpc_display_stuff( pDEVBLK, "???", (BYTE*)pMPC_PUS, iTotLenPUS, bDir ); break; } // Ensure there is the whole of the MPC_PUS. if( iTotLenPUS < uLenPUS ) { mpc_display_stuff( pDEVBLK, "???", (BYTE*)pMPC_PUS, iTotLenPUS, bDir ); break; } // Display the MPC_PUS. mpc_display_stuff( pDEVBLK, "PUS", (BYTE*)pMPC_PUS, uLenPUS, bDir ); // Point to the next MPC_PUS pMPC_PUS = (MPC_PUS*)((BYTE*)pMPC_PUS + uLenPUS); iTotLenPUS -= uLenPUS; } return; } /* End function mpc_display_rrh_and_puk() */