aboutsummaryrefslogtreecommitdiffstats
path: root/sound/xen/xen_snd_front_alsa.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2019-12-11ALSA: xen: Drop superfluous ioctl PCM opsTakashi Iwai1-2/+0
PCM core deals the empty ioctl field now as default(*). Let's kill the redundant lines. (*) commit fc033cbf6fb7 ("ALSA: pcm: Allow NULL ioctl ops") Link: https://lore.kernel.org/r/20191210061145.24641-24-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-06-28ALSA: xen-front: fix unintention integer overflow on left shiftsColin Ian King1-2/+2
Shifting the integer value 1 is evaluated using 32-bit arithmetic and then used in an expression that expects a 64-bit value, so there is potentially an integer overflow. Fix this by using the BIT_ULL macro to perform the shift. [ Note: as of the time being, no actual integer overflow hits because all values are less than 32bit, not including the extended 3-byte or DSD formats. But this is the right fix for future usage, of course. -- tiwai ] Addresses-Coverity: ("Unintentional integer overflow") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-04-04ALSA: xen-front: Do not use stream buffer size before it is setOleksandr Andrushchenko1-1/+1
This fixes the regression introduced while moving to Xen shared buffer implementation. Fixes: 58f9d806d16a ("ALSA: xen-front: Use Xen common shared buffer implementation") Reviewed-by: Juergen Gross <jgross@suse.com> Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com> Cc: <stable@vger.kernel.org> # v5.0+ Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-12-18ALSA: xen-front: Use Xen common shared buffer implementationOleksandr Andrushchenko1-25/+77
Use page directory based shared buffer implementation now available as common code for Xen frontend drivers. Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com> Reviewed-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
2018-09-20ALSA: xen-front: Refine indentations and constify snd_pcm_opsNick Simonov1-23/+23
snd_pcm_ops are not supposed to change. So mark the non-const structs as const. Also, refine indentation to ncrease readability. Signed-off-by: Nick Simonov <nicksimonovv@gmail.com> Reviewed-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-07-27ALSA: xen: Use standard pcm_format_to_bits() for ALSA format bitsTakashi Iwai1-2/+2
The open codes with the bit shift in xen_snd_front_alsa.c give sparse warnings as the PCM format type is with __bitwise. There is already a standard macro to get the format bits, so let's use it instead. This fixes sparse warnings like: sound/xen/xen_snd_front_alsa.c:191:47: warning: restricted snd_pcm_format_t degrades to integer Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-28ALSA: xen-front: fix unsigned error check on return from to_sndif_formatColin Ian King1-3/+4
The negative error return from the call to to_sndif_format is being assigned to an unsigned 8 bit integer and hence the check for a negative value is always going to be false. Fix this by using ret as the error return and hence the negative error can be detected and assign the u8 sndif_format to ret if there is no error. Detected by CoverityScan, CID#1469385 ("Unsigned compared against 0") Signed-off-by: Colin Ian King <colin.king@canonical.com> Reviewed-by: Takashi Sakamoto <o-takashi@sakamoccchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-16ALSA: xen-front: Implement ALSA virtual sound driverOleksandr Andrushchenko1-0/+821
Implement essential initialization of the sound driver: - introduce required data structures - handle driver registration - handle sound card registration - register sound driver on backend connection - remove sound driver on backend disconnect Initialize virtual sound card with streams according to the Xen store configuration. Implement ALSA driver operations including: - manage frontend/backend shared buffers - manage Xen bus event channel states Implement requests from front to back for ALSA PCM operations. - report ALSA period elapsed event: handle XENSND_EVT_CUR_POS notifications from the backend when stream position advances during playback/capture. The event carries a value of how many octets were played/captured at the time of the event. - implement explicit stream parameter negotiation between backend and frontend: handle XENSND_OP_HW_PARAM_QUERY request to read/update configuration space for the parameter given: request passes desired parameter interval and the response to this request returns min/max interval for the parameter to be used. Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>