loc_api_rpc_glue.h revision e14a6c846df2ce4bb1847e4250991f7c52fd793d
1/* Copyright (c) 2011, The Linux Foundation. All rights reserved.
2 *
3 * Redistribution and use in source and binary forms, with or without
4 * modification, are permitted provided that the following conditions are
5 * met:
6 *     * Redistributions of source code must retain the above copyright
7 *       notice, this list of conditions and the following disclaimer.
8 *     * Redistributions in binary form must reproduce the above
9 *       copyright notice, this list of conditions and the following
10 *       disclaimer in the documentation and/or other materials provided
11 *       with the distribution.
12 *     * Neither the name of The Linux Foundation nor the names of its
13 *       contributors may be used to endorse or promote products derived
14 *       from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29#ifndef LOC_API_RPC_GLUE_H
30#define LOC_API_RPC_GLUE_H
31
32/* Include RPC headers */
33#ifdef USE_LOCAL_RPC
34#include "rpc_inc/loc_api_common.h"
35#include "rpc_inc/loc_api.h"
36#include "rpc_inc/loc_api_cb.h"
37#endif
38
39#ifdef USE_QCOM_AUTO_RPC
40#include "loc_api_rpcgen_rpc.h"
41#include "loc_api_rpcgen_common_rpc.h"
42#include "loc_api_rpcgen_cb_rpc.h"
43#endif
44
45/* Boolean */
46/* Other data types in comdef.h are defined in rpc stubs, so fix it here */
47typedef unsigned char boolean;
48#define TRUE 1
49#define FALSE 0
50
51#include "loc_api_fixup.h"
52#include "loc_api_sync_call.h"
53#include <rpc/clnt.h>
54
55#ifdef __cplusplus
56extern "C"
57{
58#endif
59
60extern int loc_api_glue_init(void);
61extern int loc_api_null(void);
62
63typedef int32 (loc_event_cb_f_type)(
64    void*                                 userData,
65    rpc_loc_client_handle_type            loc_handle,             /* handle of the client */
66    rpc_loc_event_mask_type               loc_event,              /* event mask           */
67    const rpc_loc_event_payload_u_type*   loc_event_payload       /* payload              */
68);
69
70typedef void (loc_reset_notif_cb_f_type)(
71    void*                                 userData,
72    CLIENT*                               clnt,
73    enum rpc_reset_event                  event
74);
75
76extern rpc_loc_client_handle_type loc_open(
77    rpc_loc_event_mask_type       event_reg_mask,
78    loc_event_cb_f_type           *event_callback,
79    loc_reset_notif_cb_f_type     *rpc_global_cb,
80    void*                         userData
81);
82
83extern int32 loc_close
84(
85      rpc_loc_client_handle_type handle
86);
87
88extern void loc_clear
89(
90      rpc_loc_client_handle_type handle
91);
92
93extern int32 loc_start_fix
94(
95      rpc_loc_client_handle_type handle
96);
97
98extern int32 loc_stop_fix
99(
100      rpc_loc_client_handle_type handle
101);
102
103extern int32 loc_ioctl
104(
105      rpc_loc_client_handle_type           handle,
106      rpc_loc_ioctl_e_type                 ioctl_type,
107      rpc_loc_ioctl_data_u_type*           ioctl_data
108);
109
110extern int loc_eng_ioctl
111(
112      rpc_loc_client_handle_type           handle,
113      rpc_loc_ioctl_e_type                 ioctl_type,
114      rpc_loc_ioctl_data_u_type*           ioctl_data_ptr,
115      uint32                               timeout_msec,
116      rpc_loc_ioctl_callback_s_type       *cb_data_ptr
117);
118
119#ifdef __cplusplus
120}
121#endif
122
123#endif /* LOC_API_RPC_GLUE_H */
124