Skip to content

Commit 3772c9c

Browse files
committed
bcm2708 vchiq driver
Signed-off-by: popcornmix <[email protected]> vchiq: create_pagelist copes with vmalloc memory Signed-off-by: Daniel Stone <[email protected]> vchiq: fix the shim message release Signed-off-by: Daniel Stone <[email protected]> vchiq: export additional symbols Signed-off-by: Daniel Stone <[email protected]> VCHIQ: Make service closure fully synchronous (drv) This is one half of a two-part patch, the other half of which is to the vchiq_lib user library. With these patches, calls to vchiq_close_service and vchiq_remove_service won't return until any associated callbacks have been delivered to the callback thread. VCHIQ: Add per-service tracing The new service option VCHIQ_SERVICE_OPTION_TRACE is a boolean that toggles tracing for the specified service. This commit also introduces vchi_service_set_option and the associated option VCHI_SERVICE_OPTION_TRACE. vchiq: Make the synchronous-CLOSE logic more tolerant vchiq: Move logging control into debugfs vchiq: Take care of a corner case tickled by VCSM Closing a connection that isn't fully open requires care, since one side does not know the other side's port number. Code was present to handle the case where a CLOSE is sent immediately after an OPEN, i.e. before the OPENACK has been received, but this was incorrectly being used when an OPEN from a client using port 0 was rejected. (In the observed failure, the host was attempting to use the VCSM service, which isn't present in the 'cutdown' firmware. The failure was intermittent because sometimes the keepalive service would grab port 0.) This case can be distinguished because the client's remoteport will still be VCHIQ_PORT_FREE, and the srvstate will be OPENING. Either condition is sufficient to differentiate it from the special case described above. vchiq: Avoid high load when blocked and unkillable vchiq: Include SIGSTOP and SIGCONT in list of signals not-masked by vchiq to allow gdb to work vchiq_arm: Complete support for SYNCHRONOUS mode vchiq: Remove inline from suspend/resume vchiq: Allocation does not need to be atomic vchiq: Fix wrong condition check The log level is checked from within the log call. Remove the check in the call. Signed-off-by: Pranith Kumar <[email protected]> BCM270x: Add vchiq device to platform file and Device Tree Prepare to turn the vchiq module into a driver. Signed-off-by: Noralf Trønnes <[email protected]> bcm2708: vchiq: Add Device Tree support Turn vchiq into a driver and stop hardcoding resources. Use devm_* functions in probe path to simplify cleanup. A global variable is used to hold the register address. This is done to keep this patch as small as possible. Also make available on ARCH_BCM2835. Based on work by Lubomir Rintel. Signed-off-by: Noralf Trønnes <[email protected]> vchiq: Change logging level for inbound data vchiq_arm: Two cacheing fixes 1) Make fragment size vary with cache line size Without this patch, non-cache-line-aligned transfers may corrupt (or be corrupted by) adjacent data structures. Both ARM and VC need to be updated to enable this feature. This is ensured by having the loader apply a new DT parameter - cache-line-size. The existence of this parameter guarantees that the kernel is capable, and the parameter will only be modified from the safe default if the loader is capable. 2) Flush/invalidate vmalloc'd memory, and invalidate after reads vchiq: fix NULL pointer dereference when closing driver The following code run as root will cause a null pointer dereference oops: int fd = open("/dev/vc-cma", O_RDONLY); if (fd < 0) err(1, "open failed"); (void)close(fd); [ 1704.877721] Unable to handle kernel NULL pointer dereference at virtual address 00000000 [ 1704.877725] pgd = b899c000 [ 1704.877736] [00000000] *pgd=37fab831, *pte=00000000, *ppte=00000000 [ 1704.877748] Internal error: Oops: 817 [#1] PREEMPT SMP ARM [ 1704.877765] Modules linked in: evdev i2c_bcm2708 uio_pdrv_genirq uio [ 1704.877774] CPU: 2 PID: 3656 Comm: stress-ng-fstat Not tainted 3.19.1-12-generic-bcm2709 #12-Ubuntu [ 1704.877777] Hardware name: BCM2709 [ 1704.877783] task: b8ab9b00 ti: b7e68000 task.ti: b7e68000 [ 1704.877798] PC is at __down_interruptible+0x50/0xec [ 1704.877806] LR is at down_interruptible+0x5c/0x68 [ 1704.877813] pc : [<80630ee8>] lr : [<800704b0>] psr: 60080093 sp : b7e69e50 ip : b7e69e88 fp : b7e69e84 [ 1704.877817] r10: b88123c8 r9 : 00000010 r8 : 00000001 [ 1704.877822] r7 : b8ab9b00 r6 : 7fffffff r5 : 80a1cc34 r4 : 80a1cc34 [ 1704.877826] r3 : b7e69e50 r2 : 00000000 r1 : 00000000 r0 : 80a1cc34 [ 1704.877833] Flags: nZCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment user [ 1704.877838] Control: 10c5387d Table: 3899c06a DAC: 00000015 [ 1704.877843] Process do-oops (pid: 3656, stack limit = 0xb7e68238) [ 1704.877848] Stack: (0xb7e69e50 to 0xb7e6a000) [ 1704.877856] 9e40: 80a1cc3c 00000000 00000010 b88123c8 [ 1704.877865] 9e60: b7e69e84 80a1cc34 fff9fee9 ffffffff b7e68000 00000009 b7e69ea4 b7e69e88 [ 1704.877874] 9e80: 800704b0 80630ea fff9fee9 60080013 80a1cc28 fff9fee9 b7e69edc b7e69ea8 [ 1704.877884] 9ea0: 8040f558 80070460 fff9fee9 ffffffff 00000000 00000000 00000009 80a1cb7c [ 1704.877893] 9ec0: 00000000 80a1cb7c 00000000 00000010 b7e69ef4 b7e69ee0 803e1ba4 8040f514 [ 1704.877902] 9ee0: 00000e48 80a1cb7c b7e69f14 b7e69ef8 803e1c9c 803e1b74 b88123c0 b92acb18 [ 1704.877911] 9f00: b8812790 b8d815d8 b7e69f24 b7e69f18 803e2250 803e1bc8 b7e69f5c b7e69f28 [ 1704.877921] 9f20: 80167bac 803e222c 00000000 00000000 b7e69f54 b8ab9ffc 00000000 8098c794 [ 1704.877930] 9f40: b8ab9b00 8000efc4 b7e68000 00000000 b7e69f6c b7e69f60 80167d6c 80167b28 [ 1704.877939] 9f60: b7e69f8c b7e69f70 80047d38 80167d60 b7e68000 b7e68010 8000efc4 b7e69fb0 [ 1704.877949] 9f80: b7e69fac b7e69f90 80012820 80047c84 01155490 011549a8 00000001 00000006 [ 1704.877957] 9fa0: 00000000 b7e69fb0 8000ee5c 80012790 00000000 353d8c0f 7efc4308 00000000 [ 1704.877966] 9fc0: 01155490 011549a8 00000001 00000006 00000000 00000000 76cf3ba0 00000003 [ 1704.877975] 9fe0: 00000000 7efc42e4 0002272f 76e2ed66 60080030 00000003 00000000 00000000 [ 1704.877998] [<80630ee8>] (__down_interruptible) from [<800704b0>] (down_interruptible+0x5c/0x68) [ 1704.878015] [<800704b0>] (down_interruptible) from [<8040f558>] (vchiu_queue_push+0x50/0xd8) [ 1704.878032] [<8040f558>] (vchiu_queue_push) from [<803e1ba4>] (send_worker_msg+0x3c/0x54) [ 1704.878045] [<803e1ba4>] (send_worker_msg) from [<803e1c9c>] (vc_cma_set_reserve+0xe0/0x1c4) [ 1704.878057] [<803e1c9c>] (vc_cma_set_reserve) from [<803e2250>] (vc_cma_release+0x30/0x38) [ 1704.878069] [<803e2250>] (vc_cma_release) from [<80167bac>] (__fput+0x90/0x1e0) [ 1704.878082] [<80167bac>] (__fput) from [<80167d6c>] (____fput+0x18/0x1c) [ 1704.878094] [<80167d6c>] (____fput) from [<80047d38>] (task_work_run+0xc0/0xf8) [ 1704.878109] [<80047d38>] (task_work_run) from [<80012820>] (do_work_pending+0x9c/0xc4) [ 1704.878123] [<80012820>] (do_work_pending) from [<8000ee5c>] (work_pending+0xc/0x20) [ 1704.878133] Code: e50b1034 e3a01000 e50b2030 e580300c (e5823000) ..the fix is to ensure that we have actually initialized the queue before we attempt to push any items onto it. This occurs if we do an open() followed by a close() without any activity in between. Signed-off-by: Colin Ian King <[email protected]> vchiq_arm: Sort out the vmalloc case See: #1055 vchiq: hack: Add include depecated dma include file vchiq_arm: Tweak the logging output Signed-off-by: Phil Elwell <[email protected]> vchiq_arm: Access the dequeue_pending flag locked Reading through this code looking for another problem (now found in userland) the use of dequeue_pending outside a lock didn't seem safe. Signed-off-by: Phil Elwell <[email protected]> vchiq_arm: Service callbacks must not fail Service callbacks are not allowed to return an error. The internal callback that delivers events and messages to user tasks does not enqueue them if the service is closing, but this is not an error and should not be reported as such. Signed-off-by: Phil Elwell <[email protected]> vchiq_arm: do not use page_cache_release(page) macro (#1403) This macro is gone since 1fa64f1. Signed-off-by: Slawomir Stepien <[email protected]> vchiq: Upate to match get_user_pages prototype vchiq_arm: Add completion records under the mutex An issue was observed when flushing openmax components which generate a large number of messages returning buffers to host. We occasionally found a duplicate message from 16 messages prior, resulting in a buffer returned twice. While only one thread adds completions, without the mutex you don't get the protection of the automatic memory barrier you get with synchronisation objects. Signed-off-by: Phil Elwell <[email protected]>
1 parent 79fb21f commit 3772c9c

37 files changed

+12836
-0
lines changed

arch/arm/mach-bcm2708/include/mach/platform.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@
7878
#define ARMCTRL_IC_BASE (ARM_BASE + 0x200) /* ARM interrupt controller */
7979
#define ARMCTRL_TIMER0_1_BASE (ARM_BASE + 0x400) /* Timer 0 and 1 */
8080
#define ARMCTRL_0_SBM_BASE (ARM_BASE + 0x800) /* User 0 (ARM)'s Semaphores Doorbells and Mailboxes */
81+
#define ARMCTRL_0_BELL_BASE (ARMCTRL_0_SBM_BASE + 0x40) /* User 0 (ARM)'s Doorbell */
82+
#define ARMCTRL_0_MAIL0_BASE (ARMCTRL_0_SBM_BASE + 0x80) /* User 0 (ARM)'s Mailbox 0 */
8183

8284
/*
8385
* Watchdog

arch/arm/mach-bcm2709/include/mach/platform.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@
7878
#define ARMCTRL_IC_BASE (ARM_BASE + 0x200) /* ARM interrupt controller */
7979
#define ARMCTRL_TIMER0_1_BASE (ARM_BASE + 0x400) /* Timer 0 and 1 */
8080
#define ARMCTRL_0_SBM_BASE (ARM_BASE + 0x800) /* User 0 (ARM)'s Semaphores Doorbells and Mailboxes */
81+
#define ARMCTRL_0_BELL_BASE (ARMCTRL_0_SBM_BASE + 0x40) /* User 0 (ARM)'s Doorbell */
82+
#define ARMCTRL_0_MAIL0_BASE (ARMCTRL_0_SBM_BASE + 0x80) /* User 0 (ARM)'s Mailbox 0 */
8183

8284
/*
8385
* Watchdog

drivers/misc/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -802,6 +802,7 @@ source "drivers/misc/lis3lv02d/Kconfig"
802802
source "drivers/misc/altera-stapl/Kconfig"
803803
source "drivers/misc/mei/Kconfig"
804804
source "drivers/misc/vmw_vmci/Kconfig"
805+
source "drivers/misc/vc04_services/Kconfig"
805806
source "drivers/misc/mic/Kconfig"
806807
source "drivers/misc/genwqe/Kconfig"
807808
source "drivers/misc/echo/Kconfig"

drivers/misc/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ obj-$(CONFIG_INTEL_MEI) += mei/
5050
obj-$(CONFIG_VMWARE_VMCI) += vmw_vmci/
5151
obj-$(CONFIG_LATTICE_ECP3_CONFIG) += lattice-ecp3-config.o
5252
obj-$(CONFIG_SRAM) += sram.o
53+
obj-$(CONFIG_BCM2708_VCHIQ) += vc04_services/
5354
obj-y += mic/
5455
obj-$(CONFIG_GENWQE) += genwqe/
5556
obj-$(CONFIG_ECHO) += echo/

drivers/misc/vc04_services/Kconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
config BCM2708_VCHIQ
2+
tristate "Videocore VCHIQ"
3+
depends on RASPBERRYPI_FIRMWARE
4+
default y
5+
help
6+
Kernel to VideoCore communication interface for the
7+
BCM2708 family of products.
8+
Defaults to Y when the Broadcom Videocore services
9+
are included in the build, N otherwise.

drivers/misc/vc04_services/Makefile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
obj-$(CONFIG_BCM2708_VCHIQ) += vchiq.o
2+
3+
vchiq-objs := \
4+
interface/vchiq_arm/vchiq_core.o \
5+
interface/vchiq_arm/vchiq_arm.o \
6+
interface/vchiq_arm/vchiq_kern_lib.o \
7+
interface/vchiq_arm/vchiq_2835_arm.o \
8+
interface/vchiq_arm/vchiq_debugfs.o \
9+
interface/vchiq_arm/vchiq_shim.o \
10+
interface/vchiq_arm/vchiq_util.o \
11+
interface/vchiq_arm/vchiq_connected.o \
12+
13+
ccflags-y += -DVCOS_VERIFY_BKPTS=1 -Idrivers/misc/vc04_services -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000
14+

drivers/misc/vc04_services/interface/vchi/connections/connection.h

Lines changed: 328 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 204 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,204 @@
1+
/**
2+
* Copyright (c) 2010-2012 Broadcom. All rights reserved.
3+
*
4+
* Redistribution and use in source and binary forms, with or without
5+
* modification, are permitted provided that the following conditions
6+
* are met:
7+
* 1. Redistributions of source code must retain the above copyright
8+
* notice, this list of conditions, and the following disclaimer,
9+
* without modification.
10+
* 2. Redistributions in binary form must reproduce the above copyright
11+
* notice, this list of conditions and the following disclaimer in the
12+
* documentation and/or other materials provided with the distribution.
13+
* 3. The names of the above-listed copyright holders may not be used
14+
* to endorse or promote products derived from this software without
15+
* specific prior written permission.
16+
*
17+
* ALTERNATIVELY, this software may be distributed under the terms of the
18+
* GNU General Public License ("GPL") version 2, as published by the Free
19+
* Software Foundation.
20+
*
21+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
22+
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
23+
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
24+
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
25+
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
26+
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
27+
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
28+
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29+
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30+
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
31+
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32+
*/
33+
34+
#ifndef _VCHI_MESSAGE_H_
35+
#define _VCHI_MESSAGE_H_
36+
37+
#include <linux/kernel.h>
38+
#include <linux/types.h>
39+
#include <linux/semaphore.h>
40+
41+
#include "interface/vchi/vchi_cfg_internal.h"
42+
#include "interface/vchi/vchi_common.h"
43+
44+
45+
typedef enum message_event_type {
46+
MESSAGE_EVENT_NONE,
47+
MESSAGE_EVENT_NOP,
48+
MESSAGE_EVENT_MESSAGE,
49+
MESSAGE_EVENT_SLOT_COMPLETE,
50+
MESSAGE_EVENT_RX_BULK_PAUSED,
51+
MESSAGE_EVENT_RX_BULK_COMPLETE,
52+
MESSAGE_EVENT_TX_COMPLETE,
53+
MESSAGE_EVENT_MSG_DISCARDED
54+
} MESSAGE_EVENT_TYPE_T;
55+
56+
typedef enum vchi_msg_flags
57+
{
58+
VCHI_MSG_FLAGS_NONE = 0x0,
59+
VCHI_MSG_FLAGS_TERMINATE_DMA = 0x1
60+
} VCHI_MSG_FLAGS_T;
61+
62+
typedef enum message_tx_channel
63+
{
64+
MESSAGE_TX_CHANNEL_MESSAGE = 0,
65+
MESSAGE_TX_CHANNEL_BULK = 1 // drivers may provide multiple bulk channels, from 1 upwards
66+
} MESSAGE_TX_CHANNEL_T;
67+
68+
// Macros used for cycling through bulk channels
69+
#define MESSAGE_TX_CHANNEL_BULK_PREV(c) (MESSAGE_TX_CHANNEL_BULK+((c)-MESSAGE_TX_CHANNEL_BULK+VCHI_MAX_BULK_TX_CHANNELS_PER_CONNECTION-1)%VCHI_MAX_BULK_TX_CHANNELS_PER_CONNECTION)
70+
#define MESSAGE_TX_CHANNEL_BULK_NEXT(c) (MESSAGE_TX_CHANNEL_BULK+((c)-MESSAGE_TX_CHANNEL_BULK+1)%VCHI_MAX_BULK_TX_CHANNELS_PER_CONNECTION)
71+
72+
typedef enum message_rx_channel
73+
{
74+
MESSAGE_RX_CHANNEL_MESSAGE = 0,
75+
MESSAGE_RX_CHANNEL_BULK = 1 // drivers may provide multiple bulk channels, from 1 upwards
76+
} MESSAGE_RX_CHANNEL_T;
77+
78+
// Message receive slot information
79+
typedef struct rx_msg_slot_info {
80+
81+
struct rx_msg_slot_info *next;
82+
//struct slot_info *prev;
83+
#if !defined VCHI_COARSE_LOCKING
84+
struct semaphore sem;
85+
#endif
86+
87+
uint8_t *addr; // base address of slot
88+
uint32_t len; // length of slot in bytes
89+
90+
uint32_t write_ptr; // hardware causes this to advance
91+
uint32_t read_ptr; // this module does the reading
92+
int active; // is this slot in the hardware dma fifo?
93+
uint32_t msgs_parsed; // count how many messages are in this slot
94+
uint32_t msgs_released; // how many messages have been released
95+
void *state; // connection state information
96+
uint8_t ref_count[VCHI_MAX_SERVICES_PER_CONNECTION]; // reference count for slots held by services
97+
} RX_MSG_SLOTINFO_T;
98+
99+
// The message driver no longer needs to know about the fields of RX_BULK_SLOTINFO_T - sort this out.
100+
// In particular, it mustn't use addr and len - they're the client buffer, but the message
101+
// driver will be tasked with sending the aligned core section.
102+
typedef struct rx_bulk_slotinfo_t {
103+
struct rx_bulk_slotinfo_t *next;
104+
105+
struct semaphore *blocking;
106+
107+
// needed by DMA
108+
void *addr;
109+
uint32_t len;
110+
111+
// needed for the callback
112+
void *service;
113+
void *handle;
114+
VCHI_FLAGS_T flags;
115+
} RX_BULK_SLOTINFO_T;
116+
117+
118+
/* ----------------------------------------------------------------------
119+
* each connection driver will have a pool of the following struct.
120+
*
121+
* the pool will be managed by vchi_qman_*
122+
* this means there will be multiple queues (single linked lists)
123+
* a given struct message_info will be on exactly one of these queues
124+
* at any one time
125+
* -------------------------------------------------------------------- */
126+
typedef struct rx_message_info {
127+
128+
struct message_info *next;
129+
//struct message_info *prev;
130+
131+
uint8_t *addr;
132+
uint32_t len;
133+
RX_MSG_SLOTINFO_T *slot; // points to whichever slot contains this message
134+
uint32_t tx_timestamp;
135+
uint32_t rx_timestamp;
136+
137+
} RX_MESSAGE_INFO_T;
138+
139+
typedef struct {
140+
MESSAGE_EVENT_TYPE_T type;
141+
142+
struct {
143+
// for messages
144+
void *addr; // address of message
145+
uint16_t slot_delta; // whether this message indicated slot delta
146+
uint32_t len; // length of message
147+
RX_MSG_SLOTINFO_T *slot; // slot this message is in
148+
int32_t service; // service id this message is destined for
149+
uint32_t tx_timestamp; // timestamp from the header
150+
uint32_t rx_timestamp; // timestamp when we parsed it
151+
} message;
152+
153+
// FIXME: cleanup slot reporting...
154+
RX_MSG_SLOTINFO_T *rx_msg;
155+
RX_BULK_SLOTINFO_T *rx_bulk;
156+
void *tx_handle;
157+
MESSAGE_TX_CHANNEL_T tx_channel;
158+
159+
} MESSAGE_EVENT_T;
160+
161+
162+
// callbacks
163+
typedef void VCHI_MESSAGE_DRIVER_EVENT_CALLBACK_T( void *state );
164+
165+
typedef struct {
166+
VCHI_MESSAGE_DRIVER_EVENT_CALLBACK_T *event_callback;
167+
} VCHI_MESSAGE_DRIVER_OPEN_T;
168+
169+
170+
// handle to this instance of message driver (as returned by ->open)
171+
typedef struct opaque_mhandle_t *VCHI_MDRIVER_HANDLE_T;
172+
173+
struct opaque_vchi_message_driver_t {
174+
VCHI_MDRIVER_HANDLE_T *(*open)( VCHI_MESSAGE_DRIVER_OPEN_T *params, void *state );
175+
int32_t (*suspending)( VCHI_MDRIVER_HANDLE_T *handle );
176+
int32_t (*resumed)( VCHI_MDRIVER_HANDLE_T *handle );
177+
int32_t (*power_control)( VCHI_MDRIVER_HANDLE_T *handle, MESSAGE_TX_CHANNEL_T, int32_t enable );
178+
int32_t (*add_msg_rx_slot)( VCHI_MDRIVER_HANDLE_T *handle, RX_MSG_SLOTINFO_T *slot ); // rx message
179+
int32_t (*add_bulk_rx)( VCHI_MDRIVER_HANDLE_T *handle, void *data, uint32_t len, RX_BULK_SLOTINFO_T *slot ); // rx data (bulk)
180+
int32_t (*send)( VCHI_MDRIVER_HANDLE_T *handle, MESSAGE_TX_CHANNEL_T channel, const void *data, uint32_t len, VCHI_MSG_FLAGS_T flags, void *send_handle ); // tx (message & bulk)
181+
void (*next_event)( VCHI_MDRIVER_HANDLE_T *handle, MESSAGE_EVENT_T *event ); // get the next event from message_driver
182+
int32_t (*enable)( VCHI_MDRIVER_HANDLE_T *handle );
183+
int32_t (*form_message)( VCHI_MDRIVER_HANDLE_T *handle, int32_t service_id, VCHI_MSG_VECTOR_T *vector, uint32_t count, void
184+
*address, uint32_t length_avail, uint32_t max_total_length, int32_t pad_to_fill, int32_t allow_partial );
185+
186+
int32_t (*update_message)( VCHI_MDRIVER_HANDLE_T *handle, void *dest, int16_t *slot_count );
187+
int32_t (*buffer_aligned)( VCHI_MDRIVER_HANDLE_T *handle, int tx, int uncached, const void *address, const uint32_t length );
188+
void * (*allocate_buffer)( VCHI_MDRIVER_HANDLE_T *handle, uint32_t *length );
189+
void (*free_buffer)( VCHI_MDRIVER_HANDLE_T *handle, void *address );
190+
int (*rx_slot_size)( VCHI_MDRIVER_HANDLE_T *handle, int msg_size );
191+
int (*tx_slot_size)( VCHI_MDRIVER_HANDLE_T *handle, int msg_size );
192+
193+
int32_t (*tx_supports_terminate)( const VCHI_MDRIVER_HANDLE_T *handle, MESSAGE_TX_CHANNEL_T channel );
194+
uint32_t (*tx_bulk_chunk_size)( const VCHI_MDRIVER_HANDLE_T *handle, MESSAGE_TX_CHANNEL_T channel );
195+
int (*tx_alignment)( const VCHI_MDRIVER_HANDLE_T *handle, MESSAGE_TX_CHANNEL_T channel );
196+
int (*rx_alignment)( const VCHI_MDRIVER_HANDLE_T *handle, MESSAGE_RX_CHANNEL_T channel );
197+
void (*form_bulk_aux)( VCHI_MDRIVER_HANDLE_T *handle, MESSAGE_TX_CHANNEL_T channel, const void *data, uint32_t len, uint32_t chunk_size, const void **aux_data, int32_t *aux_len );
198+
void (*debug)( VCHI_MDRIVER_HANDLE_T *handle );
199+
};
200+
201+
202+
#endif // _VCHI_MESSAGE_H_
203+
204+
/****************************** End of file ***********************************/

0 commit comments

Comments
 (0)