staging: vchi: Get rid of vchi_bulk_queue_transmit()
[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 send a message from kernel memory across a service */
41 extern int vchi_queue_kernel_message(unsigned handle, void *data,
42                                      unsigned int size);
43
44 // Routine to look at a message in place.
45 // The message is dequeued, so the caller is left holding it; the descriptor is
46 // filled in and must be released when the user has finished with the message.
47 struct vchiq_header *vchi_msg_hold(unsigned handle);
48
49 /*******************************************************************************
50  * Global service support API - operations on held messages
51  * and message iterators
52  ******************************************************************************/
53
54 // Routine to release a held message after it has been processed
55 extern int32_t vchi_held_msg_release(unsigned handle, struct vchiq_header *message);
56
57 /******************************************************************************
58  * Configuration plumbing
59  *****************************************************************************/
60
61 #endif /* VCHI_H_ */
62
63 /****************************** End of file **********************************/