aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/staging/vc04_services/interface/vchi/vchi.h
diff options
context:
space:
mode:
authorNicolas Saenz Julienne <nsaenzjulienne@suse.de>2020-06-29 17:09:10 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-07-01 15:47:04 +0200
commit5a8e22e3d319ddae77c9fcce31ebc40577a32c6a (patch)
tree56edecb11000ba86d3afb1f8e74cd025b8122afa /drivers/staging/vc04_services/interface/vchi/vchi.h
parentstaging: vchi: Get rid of struct vchi_instance_handle (diff)
downloadwireguard-linux-5a8e22e3d319ddae77c9fcce31ebc40577a32c6a.tar.xz
wireguard-linux-5a8e22e3d319ddae77c9fcce31ebc40577a32c6a.zip
staging: vchi: Unify struct shim_service and struct vchi_service_handle
The idea behind struct vchi_service_handle is to create an opaque handle to struct shim_service. This can be achieved by doing a forward declaration of struct shim_service, which will avoid unwarranted casts and pointer play. Ultimately as a rename is due all over the vchi user space, rename struct shim_service into struvt vchi_service, which is more consistent with the rest of the exposed API. Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Link: https://lore.kernel.org/r/20200629150945.10720-13-nsaenzjulienne@suse.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/vc04_services/interface/vchi/vchi.h')
-rw-r--r--drivers/staging/vc04_services/interface/vchi/vchi.h27
1 files changed, 12 insertions, 15 deletions
diff --git a/drivers/staging/vc04_services/interface/vchi/vchi.h b/drivers/staging/vc04_services/interface/vchi/vchi.h
index 6b73d8fb394a..ff302e6b8b1b 100644
--- a/drivers/staging/vc04_services/interface/vchi/vchi.h
+++ b/drivers/staging/vc04_services/interface/vchi/vchi.h
@@ -53,7 +53,7 @@ struct service_creation {
struct vchiq_instance;
// Opaque handle for a server or client
-struct vchi_service_handle;
+struct vchi_service;
/******************************************************************************
* Global funcs - implementation is specific to which side you are on
@@ -75,30 +75,27 @@ extern int32_t vchi_disconnect(struct vchiq_instance *instance);
// Routine to open a named service
extern int32_t vchi_service_open(struct vchiq_instance *instance,
struct service_creation *setup,
- struct vchi_service_handle **handle);
+ struct vchi_service **service);
-extern int32_t vchi_get_peer_version(const struct vchi_service_handle *handle,
+extern int32_t vchi_get_peer_version(struct vchi_service *service,
short *peer_version);
// Routine to close a named service
-extern int32_t vchi_service_close(const struct vchi_service_handle *handle);
+extern int32_t vchi_service_close(struct vchi_service *service);
// Routine to increment ref count on a named service
-extern int32_t vchi_service_use(const struct vchi_service_handle *handle);
+extern int32_t vchi_service_use(struct vchi_service *service);
// Routine to decrement ref count on a named service
-extern int32_t vchi_service_release(const struct vchi_service_handle *handle);
+extern int32_t vchi_service_release(struct vchi_service *service);
/* Routine to send a message from kernel memory across a service */
-extern int
-vchi_queue_kernel_message(struct vchi_service_handle *handle,
- void *data,
- unsigned int size);
+extern int vchi_queue_kernel_message(struct vchi_service *service, void *data,
+ unsigned int size);
// Routine to receive a msg from a service
// Dequeue is equivalent to hold, copy into client buffer, release
-extern int32_t vchi_msg_dequeue(struct vchi_service_handle *handle,
- void *data,
+extern int32_t vchi_msg_dequeue(struct vchi_service *service, void *data,
uint32_t max_data_size_to_read,
uint32_t *actual_msg_size,
enum vchi_flags flags);
@@ -106,7 +103,7 @@ extern int32_t vchi_msg_dequeue(struct vchi_service_handle *handle,
// Routine to look at a message in place.
// The message is dequeued, so the caller is left holding it; the descriptor is
// filled in and must be released when the user has finished with the message.
-extern int32_t vchi_msg_hold(struct vchi_service_handle *handle,
+extern int32_t vchi_msg_hold(struct vchi_service *service,
void **data, // } may be NULL, as info can be
uint32_t *msg_size, // } obtained from HELD_MSG_T
enum vchi_flags flags,
@@ -125,14 +122,14 @@ extern int32_t vchi_held_msg_release(struct vchi_held_msg *message);
*****************************************************************************/
// Routine to prepare interface for a transfer from the other side
-extern int32_t vchi_bulk_queue_receive(struct vchi_service_handle *handle,
+extern int32_t vchi_bulk_queue_receive(struct vchi_service *service,
void *data_dst,
uint32_t data_size,
enum vchi_flags flags,
void *transfer_handle);
// Routine to queue up data ready for transfer to the other (once they have signalled they are ready)
-extern int32_t vchi_bulk_queue_transmit(struct vchi_service_handle *handle,
+extern int32_t vchi_bulk_queue_transmit(struct vchi_service *service,
const void *data_src,
uint32_t data_size,
enum vchi_flags flags,