#include <linux/platform_device.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <xen/xenbus.h>
#include <xen/xen-front-pgdir-shbuf.h>
#include "xen_snd_front.h"
#include "xen_snd_front_alsa.h"
#include "xen_snd_front_cfg.h"
#include "xen_snd_front_evtchnl.h"
struct xen_snd_front_pcm_stream_info { … };
struct xen_snd_front_pcm_instance_info { … };
struct xen_snd_front_card_info { … };
struct alsa_sndif_sample_format { … };
static const struct alsa_sndif_sample_format ALSA_SNDIF_FORMATS[] = …;
static int to_sndif_format(snd_pcm_format_t format)
{ … }
static u64 to_sndif_formats_mask(u64 alsa_formats)
{ … }
static u64 to_alsa_formats_mask(u64 sndif_formats)
{ … }
static void stream_clear(struct xen_snd_front_pcm_stream_info *stream)
{ … }
static void stream_free(struct xen_snd_front_pcm_stream_info *stream)
{ … }
static struct xen_snd_front_pcm_stream_info *
stream_get(struct snd_pcm_substream *substream)
{ … }
static int alsa_hw_rule(struct snd_pcm_hw_params *params,
struct snd_pcm_hw_rule *rule)
{ … }
static int alsa_open(struct snd_pcm_substream *substream)
{ … }
static int alsa_close(struct snd_pcm_substream *substream)
{ … }
static int shbuf_setup_backstore(struct xen_snd_front_pcm_stream_info *stream,
size_t buffer_sz)
{ … }
static int alsa_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params)
{ … }
static int alsa_hw_free(struct snd_pcm_substream *substream)
{ … }
static int alsa_prepare(struct snd_pcm_substream *substream)
{ … }
static int alsa_trigger(struct snd_pcm_substream *substream, int cmd)
{ … }
void xen_snd_front_alsa_handle_cur_pos(struct xen_snd_front_evtchnl *evtchnl,
u64 pos_bytes)
{ … }
static snd_pcm_uframes_t alsa_pointer(struct snd_pcm_substream *substream)
{ … }
static int alsa_pb_copy(struct snd_pcm_substream *substream,
int channel, unsigned long pos, struct iov_iter *src,
unsigned long count)
{ … }
static int alsa_cap_copy(struct snd_pcm_substream *substream,
int channel, unsigned long pos, struct iov_iter *dst,
unsigned long count)
{ … }
static int alsa_pb_fill_silence(struct snd_pcm_substream *substream,
int channel, unsigned long pos,
unsigned long count)
{ … }
static const struct snd_pcm_ops snd_drv_alsa_playback_ops = …;
static const struct snd_pcm_ops snd_drv_alsa_capture_ops = …;
static int new_pcm_instance(struct xen_snd_front_card_info *card_info,
struct xen_front_cfg_pcm_instance *instance_cfg,
struct xen_snd_front_pcm_instance_info *pcm_instance_info)
{ … }
int xen_snd_front_alsa_init(struct xen_snd_front_info *front_info)
{ … }
void xen_snd_front_alsa_fini(struct xen_snd_front_info *front_info)
{ … }