init_completion(&instance->msg_avail_comp);
}
- status = vchi_queue_kernel_message(instance->service_handle,
- m, sizeof(*m));
+ status = vchiq_queue_kernel_message(instance->service_handle,
+ m, sizeof(*m));
if (status) {
dev_err(instance->dev,
"vchi message queue failed: %d, msg=%d\n",
while (count > 0) {
int bytes = min(instance->max_packet, count);
- status = vchi_queue_kernel_message(instance->service_handle,
- src, bytes);
+ status = vchiq_queue_kernel_message(instance->service_handle,
+ src, bytes);
src += bytes;
count -= bytes;
}
// Routine to decrement ref count on a named service
extern int32_t vchi_service_release(unsigned handle);
-/* Routine to send a message from kernel memory across a service */
-extern int vchi_queue_kernel_message(unsigned handle, void *data,
- unsigned int size);
-
// 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.
return status;
}
-enum vchiq_status vchiq_queue_kernel_message(unsigned int handle, void *context,
- size_t size)
+int vchiq_queue_kernel_message(unsigned handle, void *data, unsigned size)
{
- return vchiq_queue_message(handle, memcpy_copy_callback, context, size);
+ enum vchiq_status status;
+
+ while (1) {
+ status = vchiq_queue_message(handle, memcpy_copy_callback,
+ data, size);
+
+ /*
+ * vchiq_queue_message() may return VCHIQ_RETRY, so we need to
+ * implement a retry mechanism since this function is supposed
+ * to block until queued
+ */
+ if (status != VCHIQ_RETRY)
+ break;
+
+ msleep(1);
+ }
+
+ return status;
}
+EXPORT_SYMBOL(vchiq_queue_kernel_message);
void
vchiq_release_message(unsigned int handle,
extern enum vchiq_status vchiq_close_service(unsigned int service);
extern enum vchiq_status vchiq_use_service(unsigned int service);
extern enum vchiq_status vchiq_release_service(unsigned int service);
-extern enum vchiq_status vchiq_queue_kernel_message(unsigned int handle,
- void *context, size_t size);
+extern int vchiq_queue_kernel_message(unsigned handle, void *data,
+ unsigned size);
extern void vchiq_msg_queue_push(unsigned handle, struct vchiq_header *header);
extern void vchiq_release_message(unsigned int service,
struct vchiq_header *header);
#include "../vchi/vchi.h"
#include "vchiq.h"
-int vchi_queue_kernel_message(unsigned handle, void *data, unsigned int size)
-{
- enum vchiq_status status;
-
- while (1) {
- status = vchiq_queue_kernel_message(handle, data, size);
-
- /*
- * vchiq_queue_message() may return VCHIQ_RETRY, so we need to
- * implement a retry mechanism since this function is supposed
- * to block until queued
- */
- if (status != VCHIQ_RETRY)
- break;
-
- msleep(1);
- }
-
- return status;
-}
-EXPORT_SYMBOL(vchi_queue_kernel_message);
-
/***********************************************************
* Name: vchi_held_msg_release
*
vchi_service_use(instance->service_handle);
- ret = vchi_queue_kernel_message(instance->service_handle,
- &m,
- sizeof(struct mmal_msg_header) +
- sizeof(m.u.buffer_from_host));
+ ret = vchiq_queue_kernel_message(instance->service_handle, &m,
+ sizeof(struct mmal_msg_header) +
+ sizeof(m.u.buffer_from_host));
vchi_service_release(instance->service_handle);
vchi_service_use(instance->service_handle);
- ret = vchi_queue_kernel_message(instance->service_handle,
- msg,
- sizeof(struct mmal_msg_header) +
- payload_len);
+ ret = vchiq_queue_kernel_message(instance->service_handle, msg,
+ sizeof(struct mmal_msg_header) +
+ payload_len);
vchi_service_release(instance->service_handle);