1296177Sjhibbits/* Copyright (c) 2008-2011 Freescale Semiconductor, Inc. 2296177Sjhibbits * All rights reserved. 3296177Sjhibbits * 4296177Sjhibbits * Redistribution and use in source and binary forms, with or without 5296177Sjhibbits * modification, are permitted provided that the following conditions are met: 6296177Sjhibbits * * Redistributions of source code must retain the above copyright 7296177Sjhibbits * notice, this list of conditions and the following disclaimer. 8296177Sjhibbits * * Redistributions in binary form must reproduce the above copyright 9296177Sjhibbits * notice, this list of conditions and the following disclaimer in the 10296177Sjhibbits * documentation and/or other materials provided with the distribution. 11296177Sjhibbits * * Neither the name of Freescale Semiconductor nor the 12296177Sjhibbits * names of its contributors may be used to endorse or promote products 13296177Sjhibbits * derived from this software without specific prior written permission. 14296177Sjhibbits * 15296177Sjhibbits * 16296177Sjhibbits * ALTERNATIVELY, this software may be distributed under the terms of the 17296177Sjhibbits * GNU General Public License ("GPL") as published by the Free Software 18296177Sjhibbits * Foundation, either version 2 of that License or (at your option) any 19296177Sjhibbits * later version. 20296177Sjhibbits * 21296177Sjhibbits * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY 22296177Sjhibbits * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23296177Sjhibbits * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24296177Sjhibbits * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY 25296177Sjhibbits * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26296177Sjhibbits * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27296177Sjhibbits * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28296177Sjhibbits * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29296177Sjhibbits * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30296177Sjhibbits * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31296177Sjhibbits */ 32296177Sjhibbits 33296177Sjhibbits/* 34296177Sjhibbits 35296177Sjhibbits @File error.c 36296177Sjhibbits 37296177Sjhibbits @Description General errors and events reporting utilities. 38296177Sjhibbits*//***************************************************************************/ 39296177Sjhibbits 40296177Sjhibbits#if (defined(DEBUG_ERRORS) && (DEBUG_ERRORS > 0)) 41296177Sjhibbits 42296177Sjhibbitsconst char *dbgLevelStrings[] = 43296177Sjhibbits{ 44296177Sjhibbits "CRITICAL" 45296177Sjhibbits ,"MAJOR" 46296177Sjhibbits ,"MINOR" 47296177Sjhibbits ,"WARNING" 48296177Sjhibbits ,"INFO" 49296177Sjhibbits ,"TRACE" 50296177Sjhibbits}; 51296177Sjhibbits 52296177Sjhibbitsconst char *errTypeStrings[] = 53296177Sjhibbits{ 54296177Sjhibbits "Invalid State" /* E_INVALID_STATE */ 55296177Sjhibbits ,"Invalid Operation" /* E_INVALID_OPERATION */ 56296177Sjhibbits ,"Unsupported Operation" /* E_NOT_SUPPORTED */ 57296177Sjhibbits ,"No Device" /* E_NO_DEVICE */ 58296177Sjhibbits ,"Invalid Handle" /* E_INVALID_HANDLE */ 59296177Sjhibbits ,"Invalid ID" /* E_INVALID_ID */ 60296177Sjhibbits ,"Unexpected NULL Pointer" /* E_NULL_POINTER */ 61296177Sjhibbits ,"Invalid Value" /* E_INVALID_VALUE */ 62296177Sjhibbits ,"Invalid Selection" /* E_INVALID_SELECTION */ 63296177Sjhibbits ,"Invalid Communication Mode" /* E_INVALID_COMM_MODE */ 64296177Sjhibbits ,"Invalid Byte Order" /* E_INVALID_BYTE_ORDER */ 65296177Sjhibbits ,"Invalid Memory Type" /* E_INVALID_MEMORY_TYPE */ 66296177Sjhibbits ,"Invalid Interrupt Queue" /* E_INVALID_INTR_QUEUE */ 67296177Sjhibbits ,"Invalid Priority" /* E_INVALID_PRIORITY */ 68296177Sjhibbits ,"Invalid Clock" /* E_INVALID_CLOCK */ 69296177Sjhibbits ,"Invalid Rate" /* E_INVALID_RATE */ 70296177Sjhibbits ,"Invalid Address" /* E_INVALID_ADDRESS */ 71296177Sjhibbits ,"Invalid Bus" /* E_INVALID_BUS */ 72296177Sjhibbits ,"Conflict In Bus Selection" /* E_BUS_CONFLICT */ 73296177Sjhibbits ,"Conflict In Settings" /* E_CONFLICT */ 74296177Sjhibbits ,"Incorrect Alignment" /* E_NOT_ALIGNED */ 75296177Sjhibbits ,"Value Out Of Range" /* E_NOT_IN_RANGE */ 76296177Sjhibbits ,"Invalid Frame" /* E_INVALID_FRAME */ 77296177Sjhibbits ,"Frame Is Empty" /* E_EMPTY_FRAME */ 78296177Sjhibbits ,"Buffer Is Empty" /* E_EMPTY_BUFFER */ 79296177Sjhibbits ,"Memory Allocation Failed" /* E_NO_MEMORY */ 80296177Sjhibbits ,"Resource Not Found" /* E_NOT_FOUND */ 81296177Sjhibbits ,"Resource Is Unavailable" /* E_NOT_AVAILABLE */ 82296177Sjhibbits ,"Resource Already Exists" /* E_ALREADY_EXISTS */ 83296177Sjhibbits ,"Resource Is Full" /* E_FULL */ 84296177Sjhibbits ,"Resource Is Empty" /* E_EMPTY */ 85296177Sjhibbits ,"Resource Is Busy" /* E_BUSY */ 86296177Sjhibbits ,"Resource Already Free" /* E_ALREADY_FREE */ 87296177Sjhibbits ,"Read Access Failed" /* E_READ_FAILED */ 88296177Sjhibbits ,"Write Access Failed" /* E_WRITE_FAILED */ 89296177Sjhibbits ,"Send Operation Failed" /* E_SEND_FAILED */ 90296177Sjhibbits ,"Receive Operation Failed" /* E_RECEIVE_FAILED */ 91296177Sjhibbits ,"Operation Timed Out" /* E_TIMEOUT */ 92296177Sjhibbits}; 93296177Sjhibbits 94296177Sjhibbits 95296177Sjhibbits#if (defined(REPORT_EVENTS) && (REPORT_EVENTS > 0)) 96296177Sjhibbits 97296177Sjhibbitsconst char *eventStrings[] = 98296177Sjhibbits{ 99296177Sjhibbits "Rx Discard" /* EV_RX_DISCARD */ 100296177Sjhibbits ,"Rx Error" /* EV_RX_ERROR */ 101296177Sjhibbits ,"Tx Error" /* EV_TX_ERROR */ 102296177Sjhibbits ,"No Buffer Objects" /* EV_NO_BUFFERS */ 103296177Sjhibbits ,"No MB-Frame Objects" /* EV_NO_MB_FRAMES */ 104296177Sjhibbits ,"No SB-Frame Objects" /* EV_NO_SB_FRAMES */ 105296177Sjhibbits ,"Tx Queue Is Full" /* EV_TX_QUEUE_FULL */ 106296177Sjhibbits ,"Rx Queue Is Full" /* EV_RX_QUEUE_FULL */ 107296177Sjhibbits ,"Interrupts Queue Is Full" /* EV_INTR_QUEUE_FULL */ 108296177Sjhibbits ,"Data Buffer Is Unavailable" /* EV_NO_DATA_BUFFER */ 109296177Sjhibbits ,"Objects Pool Is Empty" /* EV_OBJ_POOL_EMPTY */ 110296177Sjhibbits ,"Illegal bus access" /* EV_BUS_ERROR */ 111296177Sjhibbits ,"PTP Tx Timestamps Queue Is Full" /* EV_PTP_TXTS_QUEUE_FULL */ 112296177Sjhibbits ,"PTP Rx Timestamps Queue Is Full" /* EV_PTP_RXTS_QUEUE_FULL */ 113296177Sjhibbits}; 114296177Sjhibbits 115296177Sjhibbits#endif /* (defined(REPORT_EVENTS) && (REPORT_EVENTS > 0)) */ 116296177Sjhibbits 117296177Sjhibbits#endif /* (defined(DEBUG_ERRORS) && (DEBUG_ERRORS > 0)) */ 118296177Sjhibbits 119