~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/sound/xen/xen_snd_front_evtchnl.h

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 OR MIT */
  2 
  3 /*
  4  * Xen para-virtual sound device
  5  *
  6  * Copyright (C) 2016-2018 EPAM Systems Inc.
  7  *
  8  * Author: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
  9  */
 10 
 11 #ifndef __XEN_SND_FRONT_EVTCHNL_H
 12 #define __XEN_SND_FRONT_EVTCHNL_H
 13 
 14 #include <xen/interface/io/sndif.h>
 15 
 16 struct xen_snd_front_info;
 17 
 18 /* Timeout in ms to wait for backend to respond. */
 19 #define VSND_WAIT_BACK_MS       3000
 20 
 21 enum xen_snd_front_evtchnl_state {
 22         EVTCHNL_STATE_DISCONNECTED,
 23         EVTCHNL_STATE_CONNECTED,
 24 };
 25 
 26 enum xen_snd_front_evtchnl_type {
 27         EVTCHNL_TYPE_REQ,
 28         EVTCHNL_TYPE_EVT,
 29 };
 30 
 31 struct xen_snd_front_evtchnl {
 32         struct xen_snd_front_info *front_info;
 33         int gref;
 34         int port;
 35         int irq;
 36         int index;
 37         /* State of the event channel. */
 38         enum xen_snd_front_evtchnl_state state;
 39         enum xen_snd_front_evtchnl_type type;
 40         /* Either response id or incoming event id. */
 41         u16 evt_id;
 42         /* Next request id or next expected event id. */
 43         u16 evt_next_id;
 44         /* Shared ring access lock. */
 45         struct mutex ring_io_lock;
 46         union {
 47                 struct {
 48                         struct xen_sndif_front_ring ring;
 49                         struct completion completion;
 50                         /* Serializer for backend IO: request/response. */
 51                         struct mutex req_io_lock;
 52 
 53                         /* Latest response status. */
 54                         int resp_status;
 55                         union {
 56                                 struct xensnd_query_hw_param hw_param;
 57                         } resp;
 58                 } req;
 59                 struct {
 60                         struct xensnd_event_page *page;
 61                         /* This is needed to handle XENSND_EVT_CUR_POS event. */
 62                         struct snd_pcm_substream *substream;
 63                 } evt;
 64         } u;
 65 };
 66 
 67 struct xen_snd_front_evtchnl_pair {
 68         struct xen_snd_front_evtchnl req;
 69         struct xen_snd_front_evtchnl evt;
 70 };
 71 
 72 int xen_snd_front_evtchnl_create_all(struct xen_snd_front_info *front_info,
 73                                      int num_streams);
 74 
 75 void xen_snd_front_evtchnl_free_all(struct xen_snd_front_info *front_info);
 76 
 77 int xen_snd_front_evtchnl_publish_all(struct xen_snd_front_info *front_info);
 78 
 79 void xen_snd_front_evtchnl_flush(struct xen_snd_front_evtchnl *evtchnl);
 80 
 81 void xen_snd_front_evtchnl_pair_set_connected(struct xen_snd_front_evtchnl_pair *evt_pair,
 82                                               bool is_connected);
 83 
 84 void xen_snd_front_evtchnl_pair_clear(struct xen_snd_front_evtchnl_pair *evt_pair);
 85 
 86 #endif /* __XEN_SND_FRONT_EVTCHNL_H */
 87 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php