| 1 |
/*=========================================================================== |
| 2 |
FILE: |
| 3 |
GobiError.h |
| 4 |
|
| 5 |
DESCRIPTION: |
| 6 |
QUALCOMM Gobi Errors |
| 7 |
|
| 8 |
Copyright (c) 2012, Code Aurora Forum. All rights reserved. |
| 9 |
|
| 10 |
Redistribution and use in source and binary forms, with or without |
| 11 |
modification, are permitted provided that the following conditions are met: |
| 12 |
* Redistributions of source code must retain the above copyright |
| 13 |
notice, this list of conditions and the following disclaimer. |
| 14 |
* Redistributions in binary form must reproduce the above copyright |
| 15 |
notice, this list of conditions and the following disclaimer in the |
| 16 |
documentation and/or other materials provided with the distribution. |
| 17 |
* Neither the name of Code Aurora Forum nor |
| 18 |
the names of its contributors may be used to endorse or promote |
| 19 |
products derived from this software without specific prior written |
| 20 |
permission. |
| 21 |
|
| 22 |
|
| 23 |
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| 24 |
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 25 |
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 26 |
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
| 27 |
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 28 |
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 29 |
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 30 |
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
| 31 |
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
| 32 |
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
| 33 |
POSSIBILITY OF SUCH DAMAGE. |
| 34 |
==========================================================================*/ |
| 35 |
|
| 36 |
/*=========================================================================*/ |
| 37 |
// Pragmas |
| 38 |
/*=========================================================================*/ |
| 39 |
#pragma once |
| 40 |
|
| 41 |
//--------------------------------------------------------------------------- |
| 42 |
// Include Files |
| 43 |
//--------------------------------------------------------------------------- |
| 44 |
#include "QMIEnum.h" |
| 45 |
|
| 46 |
//--------------------------------------------------------------------------- |
| 47 |
// Definitions |
| 48 |
//--------------------------------------------------------------------------- |
| 49 |
|
| 50 |
/*=========================================================================*/ |
| 51 |
// eGobiError Enumeration |
| 52 |
// Gobi API Error Enumeration |
| 53 |
/*=========================================================================*/ |
| 54 |
enum eGobiError |
| 55 |
{ |
| 56 |
eGOBI_ERR_ENUM_BEGIN = -1, |
| 57 |
|
| 58 |
eGOBI_ERR_NONE, // 00 Success |
| 59 |
eGOBI_ERR_GENERAL, // 01 General error |
| 60 |
eGOBI_ERR_INTERNAL, // 02 Internal error |
| 61 |
eGOBI_ERR_MEMORY, // 03 Memory error |
| 62 |
eGOBI_ERR_INVALID_ARG, // 04 Invalid argument |
| 63 |
eGOBI_ERR_BUFFER_SZ, // 05 Buffer too small |
| 64 |
eGOBI_ERR_NO_DEVICE, // 06 Unable to detect device |
| 65 |
eGOBI_ERR_INVALID_DEVID, // 07 Invalid device ID |
| 66 |
eGOBI_ERR_NO_CONNECTION, // 08 No connection to device |
| 67 |
eGOBI_ERR_IFACE, // 09 Unable to obtain required interace |
| 68 |
eGOBI_ERR_CONNECT, // 10 Unable to connect to interface |
| 69 |
eGOBI_ERR_REQ_SCHEDULE, // 11 Unable to schedule request |
| 70 |
eGOBI_ERR_REQUEST, // 12 Error sending request |
| 71 |
eGOBI_ERR_RESPONSE, // 13 Error receiving response |
| 72 |
eGOBI_ERR_REQUEST_TO, // 14 Timeout while sending request |
| 73 |
eGOBI_ERR_RESPONSE_TO, // 15 Timeout while receiving response |
| 74 |
eGOBI_ERR_MALFORMED_RSP, // 16 Malformed response received |
| 75 |
eGOBI_ERR_INVALID_RSP, // 17 Invalid/error response received |
| 76 |
eGOBI_ERR_INVALID_FILE, // 18 Invalid file path |
| 77 |
eGOBI_ERR_FILE_OPEN, // 19 Unable to open file |
| 78 |
eGOBI_ERR_FILE_COPY, // 20 Unable to copy file |
| 79 |
eGOBI_ERR_QDL_SCM, // 21 Unable to open service control mgr |
| 80 |
eGOBI_ERR_NO_QDL_SVC, // 22 Unable to detect QDL service |
| 81 |
eGOBI_ERR_NO_QDL_SVC_INFO, // 23 Unable to obtain QDL service info |
| 82 |
eGOBI_ERR_NO_QDL_SVC_PATH, // 24 Unable to locate QSL service |
| 83 |
eGOBI_ERR_QDL_SVC_CFG, // 25 Unable to reconfigure QDL service |
| 84 |
eGOBI_ERR_QDL_SVC_IFACE, // 26 Unable to interface to QDL service |
| 85 |
eGOBI_ERR_OFFLINE, // 27 Unable to set device offline |
| 86 |
eGOBI_ERR_RESET, // 28 Unable to reset device |
| 87 |
eGOBI_ERR_NO_SIGNAL, // 29 No available signal |
| 88 |
eGOBI_ERR_MULTIPLE_DEVICES, // 30 Multiple devices detected |
| 89 |
eGOBI_ERR_DRIVER, // 31 Error interfacing to driver |
| 90 |
eGOBI_ERR_NO_CANCELABLE_OP, // 32 No cancelable operation is pending |
| 91 |
eGOBI_ERR_CANCEL_OP, // 33 Error canceling outstanding operation |
| 92 |
eGOBI_ERR_QDL_CRC, // 34 QDL image data CRC error |
| 93 |
eGOBI_ERR_QDL_PARSING, // 35 QDL image data parsing error |
| 94 |
eGOBI_ERR_QDL_AUTH, // 36 QDL image authentication error |
| 95 |
eGOBI_ERR_QDL_WRITE, // 37 QDL image write error |
| 96 |
eGOBI_ERR_QDL_OPEN_SIZE, // 38 QDL image size error |
| 97 |
eGOBI_ERR_QDL_OPEN_TYPE, // 39 QDL image type error |
| 98 |
eGOBI_ERR_QDL_OPEN_PROT, // 40 QDL memory protection error |
| 99 |
eGOBI_ERR_QDL_OPEN_SKIP, // 41 QDL image not required |
| 100 |
eGOBI_ERR_QDL_ERR_GENERAL, // 42 QDL general error |
| 101 |
eGOBI_ERR_QDL_BAR_MODE, // 43 QDL BAR mode error |
| 102 |
|
| 103 |
eGOBI_ERR_ENUM_END, |
| 104 |
|
| 105 |
// Offset from which mapped QMI error codes start from (see eQMIErrorCode) |
| 106 |
eGOBI_ERR_QMI_OFFSET = 1000, |
| 107 |
}; |
| 108 |
|
| 109 |
/*=========================================================================== |
| 110 |
METHOD: |
| 111 |
IsValid (Inline Method) |
| 112 |
|
| 113 |
DESCRIPTION: |
| 114 |
eGobiError validity check |
| 115 |
|
| 116 |
PARAMETERS: |
| 117 |
ec [ I ] - Enum value being verified |
| 118 |
|
| 119 |
RETURN VALUE: |
| 120 |
bool |
| 121 |
===========================================================================*/ |
| 122 |
inline bool IsValid( eGobiError ec ) |
| 123 |
{ |
| 124 |
bool retVal = false; |
| 125 |
if (ec > eGOBI_ERR_ENUM_BEGIN && ec < eGOBI_ERR_ENUM_END) |
| 126 |
{ |
| 127 |
retVal = true; |
| 128 |
} |
| 129 |
|
| 130 |
if (ec >= eGOBI_ERR_QMI_OFFSET) |
| 131 |
{ |
| 132 |
ULONG tmp = (ULONG)ec - (ULONG)eGOBI_ERR_QMI_OFFSET; |
| 133 |
retVal = ::IsValid( (eQMIErrorCode)tmp ); |
| 134 |
} |
| 135 |
|
| 136 |
return retVal; |
| 137 |
}; |