27 Jul, 2018
1 commit
-
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 integerSigned-off-by: Takashi Iwai
31 May, 2018
1 commit
-
We want the loop to exit when "to" is set to zero, but in the current
code it's set to -1. Also I tweaked the indenting so it doesn't look
like we're passing "--to" to xenbus_read_unsigned().Fixes: cc3196ae197c ("ALSA: xen-front: Introduce Xen para-virtualized sound frontend driver")
Signed-off-by: Dan Carpenter
Reviewed-by: Oleksandr Andrushchenko
Signed-off-by: Takashi Iwai
30 May, 2018
1 commit
-
kfree() doesn't accept error pointers so I've set "str" to NULL on these
paths.Fixes: fd3b36045c2c ("ALSA: xen-front: Read sound driver configuration from Xen store")
Signed-off-by: Dan Carpenter
Reviewed-by: Oleksandr Andrushchenko
Signed-off-by: Takashi Iwai
29 May, 2018
1 commit
-
gcc-8 warns that pcm_instance->name is not necessarily terminated correctly
if the input is more than 80 characters long or lacks a termination byte
itself:In function 'strncpy',
inlined from 'cfg_device' at sound/xen/xen_snd_front_cfg.c:399:3,
inlined from 'xen_snd_front_cfg_card' at sound/xen/xen_snd_front_cfg.c:509:9:
include/linux/string.h:254:9: error: '__builtin_strncpy' specified bound 80 equals destination size [-Werror=stringop-truncation]
return __builtin_strncpy(p, q, size);Using strlcpy() instead of strncpy() makes this a bit safer.
Fixes: fd3b36045c2c ("ALSA: xen-front: Read sound driver configuration from Xen store")
Signed-off-by: Arnd Bergmann
Reviewed-by: Oleksandr Andrushchenko
Signed-off-by: Takashi Iwai
28 May, 2018
2 commits
-
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
Reviewed-by: Takashi Sakamoto
Signed-off-by: Takashi Iwai -
The error for a -ve value in ret is redundant as all previous
assignments to ret have an associated -ve check and hence it
is impossible for ret to be less that zero at the point of the
check. Remove this redundant error check.Detected by CoveritScan, CID#1469407 ("Logically Dead code")
Signed-off-by: Colin Ian King
Reviewed-by: Takashi Sakamoto
Signed-off-by: Takashi Iwai
16 May, 2018
5 commits
-
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 disconnectInitialize 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 statesImplement 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
Signed-off-by: Takashi Iwai -
Implement shared buffer handling according to the
para-virtualized sound device protocol at xen/interface/io/sndif.h:
- manage buffer memory
- handle granted references
- handle page directories[ Fixed missing linux/kernel.h inclusion -- tiwai ]
Signed-off-by: Oleksandr Andrushchenko
Signed-off-by: Takashi Iwai -
Handle Xen event channels:
- create for all configured streams and publish
corresponding ring references and event channels in Xen store,
so backend can connect
- implement event channels interrupt handlers
- create and destroy event channels with respect to Xen bus stateSigned-off-by: Oleksandr Andrushchenko
Signed-off-by: Takashi Iwai -
Read configuration values from Xen store according
to xen/interface/io/sndif.h protocol:
- introduce configuration structures for different
components, e.g. sound card, device, stream
- read PCM HW parameters, e.g rate, format etc.
- detect stream type (capture/playback)
- read device and card parametersSigned-off-by: Oleksandr Andrushchenko
Signed-off-by: Takashi Iwai -
Introduce skeleton of the para-virtualized Xen sound
frontend driver.Initial handling for Xen bus states: implement
Xen bus state machine for the frontend driver according to
the state diagram and recovery flow from sound para-virtualized
protocol: xen/interface/io/sndif.h.Signed-off-by: Oleksandr Andrushchenko
Reviewed-by: Juergen Gross
Signed-off-by: Takashi Iwai