1/* 2 * Copyright (c) 2012, The Linux Foundation. All rights reserved. 3 * Permission to use, copy, modify, and/or distribute this software for 4 * any purpose with or without fee is hereby granted, provided that the 5 * above copyright notice and this permission notice appear in all copies. 6 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 7 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 8 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 9 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 10 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 11 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT 12 * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 13 */ 14 15 16 17#ifndef _SW_ERROR_H 18#define _SW_ERROR_H 19 20#ifdef __cplusplus 21extern "C" { 22#endif /* __cplusplus */ 23 24 typedef enum { 25 SW_OK = 0, /* Operation succeeded */ 26 SW_FAIL = -1, /* Operation failed */ 27 SW_BAD_VALUE = -2, /* Illegal value */ 28 SW_OUT_OF_RANGE = -3, /* Value is out of range */ 29 SW_BAD_PARAM = -4, /* Illegal parameter(s) */ 30 SW_BAD_PTR = -5, /* Illegal pointer value */ 31 SW_BAD_LEN = -6, /* Wrong length */ 32 SW_BAD_STATE = -7, /* Wrong state of state machine */ 33 SW_READ_ERROR = -8, /* Read operation failed */ 34 SW_WRITE_ERROR = -9, /* Write operation failed */ 35 SW_CREATE_ERROR = -10, /* Fail in creating an entry */ 36 SW_DELETE_ERROR = -11, /* Fail in deleteing an entry */ 37 SW_NOT_FOUND = -12, /* Entry not found */ 38 SW_NO_CHANGE = -13, /* The parameter(s) is the same */ 39 SW_NO_MORE = -14, /* No more entry found */ 40 SW_NO_SUCH = -15, /* No such entry */ 41 SW_ALREADY_EXIST = -16, /* Tried to create existing entry */ 42 SW_FULL = -17, /* Table is full */ 43 SW_EMPTY = -18, /* Table is empty */ 44 SW_NOT_SUPPORTED = -19, /* This request is not support */ 45 SW_NOT_IMPLEMENTED = -20, /* This request is not implemented */ 46 SW_NOT_INITIALIZED = -21, /* The item is not initialized */ 47 SW_BUSY = -22, /* Operation is still running */ 48 SW_TIMEOUT = -23, /* Operation Time Out */ 49 SW_DISABLE = -24, /* Operation is disabled */ 50 SW_NO_RESOURCE = -25, /* Resource not available (memory ...) */ 51 SW_INIT_ERROR = -26, /* Error occured while INIT process */ 52 SW_NOT_READY = -27, /* The other side is not ready yet */ 53 SW_OUT_OF_MEM = -28, /* Cpu memory allocation failed. */ 54 SW_ABORTED = -29 /* Operation has been aborted. */ 55 } sw_error_t; 56 57#ifdef __cplusplus 58} 59#endif /* __cplusplus */ 60 61#endif /* _SW_ERROR_H */ 62 63