summaryrefslogtreecommitdiffstats
path: root/sound/xen/xen_snd_front_shbuf.h
blob: d28e97c47b2c5f4ad4c216386288e888689ef624 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/* SPDX-License-Identifier: GPL-2.0 OR MIT */

/*
 * Xen para-virtual sound device
 *
 * Copyright (C) 2016-2018 EPAM Systems Inc.
 *
 * Author: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
 */

#ifndef __XEN_SND_FRONT_SHBUF_H
#define __XEN_SND_FRONT_SHBUF_H

#include <xen/grant_table.h>

#include "xen_snd_front_evtchnl.h"

struct xen_snd_front_shbuf {
	int num_grefs;
	grant_ref_t *grefs;
	u8 *directory;
	u8 *buffer;
	size_t buffer_sz;
};

grant_ref_t xen_snd_front_shbuf_get_dir_start(struct xen_snd_front_shbuf *buf);

int xen_snd_front_shbuf_alloc(struct xenbus_device *xb_dev,
			      struct xen_snd_front_shbuf *buf,
			      unsigned int buffer_sz);

void xen_snd_front_shbuf_clear(struct xen_snd_front_shbuf *buf);

void xen_snd_front_shbuf_free(struct xen_snd_front_shbuf *buf);

#endif /* __XEN_SND_FRONT_SHBUF_H */