1/*
2* Copyright (c) 2012 Broadcom Europe Ltd
3Redistribution and use in source and binary forms, with or without
4modification, are permitted provided that the following conditions are met:
5 * Redistributions of source code must retain the above copyright
6 notice, this list of conditions and the following disclaimer.
7 * Redistributions in binary form must reproduce the above copyright
8 notice, this list of conditions and the following disclaimer in the
9 documentation and/or other materials provided with the distribution.
10 * Neither the name of the copyright holder nor the
11 names of its contributors may be used to endorse or promote products
12 derived from this software without specific prior written permission.
13
14THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
18DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24*/
25
26/*
27 * Common definitions for services
28 */
29
30#ifndef _VC_SERVICE_COMMON_DEFS_H_
31#define _VC_SERVICE_COMMON_DEFS_H_
32#include "vcinclude/common.h"
33//Map VCHI return value to internal error code
34//VCHI return +1 for retry so we will map it to -2 to allow
35//servers to use positive values to indicate alternative return values
36typedef enum {
37 VC_SERVICE_VCHI_SUCCESS = 0,
38 VC_SERVICE_VCHI_VCHIQ_ERROR = -1,
39 VC_SERVUCE_VCHI_RETRY = -2,
40 VC_SERVICE_VCHI_UNKNOWN_ERROR = -3
41} VC_SERVICE_VCHI_STATUS_T;
42
43extern VC_SERVICE_VCHI_STATUS_T vchi2service_status(int32_t x);
44extern const char* vchi2service_status_string(VC_SERVICE_VCHI_STATUS_T status);
45
46#endif //#ifndef _VC_SERVICE_COMMON_DEFS_H_
47