staging: vchi: Move vchi_queue_kernel_message() into vchiq
[linux-2.6-microblaze.git] / drivers / staging / vc04_services / interface / vchi / vchi.h
1 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
2 /* Copyright (c) 2010-2012 Broadcom. All rights reserved. */
3
4 #ifndef VCHI_H_
5 #define VCHI_H_
6
7 /******************************************************************************
8  * Global funcs - implementation is specific to which side you are on
9  * (local / remote)
10  *****************************************************************************/
11
12 // Routine used to initialise the vchi on both local + remote connections
13 extern int32_t vchi_initialise(struct vchiq_instance **instance);
14
15 extern int32_t vchi_connect(struct vchiq_instance *instance);
16
17 //When this is called, ensure that all services have no data pending.
18 //Bulk transfers can remain 'queued'
19 extern int32_t vchi_disconnect(struct vchiq_instance *instance);
20
21 /******************************************************************************
22  * Global service API
23  *****************************************************************************/
24 // Routine to open a named service
25 extern int vchi_service_open(struct vchiq_instance *instance,
26                             struct vchiq_service_params *params,
27                             unsigned *handle);
28
29 extern int32_t vchi_get_peer_version(unsigned handle, short *peer_version);
30
31 // Routine to close a named service
32 extern int32_t vchi_service_close(unsigned handle);
33
34 // Routine to increment ref count on a named service
35 extern int32_t vchi_service_use(unsigned handle);
36
37 // Routine to decrement ref count on a named service
38 extern int32_t vchi_service_release(unsigned handle);
39
40 // Routine to look at a message in place.
41 // The message is dequeued, so the caller is left holding it; the descriptor is
42 // filled in and must be released when the user has finished with the message.
43 struct vchiq_header *vchi_msg_hold(unsigned handle);
44
45 /*******************************************************************************
46  * Global service support API - operations on held messages
47  * and message iterators
48  ******************************************************************************/
49
50 // Routine to release a held message after it has been processed
51 extern int32_t vchi_held_msg_release(unsigned handle, struct vchiq_header *message);
52
53 /******************************************************************************
54  * Configuration plumbing
55  *****************************************************************************/
56
57 #endif /* VCHI_H_ */
58
59 /****************************** End of file **********************************/