sr: session: Realloc correct array for pollfds in _sr_session_source_remove

Commit 7149ad7c ("sr: session: Keep a global pollfd array") contained a small
copy paste error. This patch fixes it.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
sr: demodevice: Make read channel non-blocking

Both pipe channels are currently configured as blocking. We read from the pipe
in receive_data. Since the channel is configured as blocking we'll block in
receive_data until all data has been received. receive_data will be called from
the mainloop, so as consequence the mainloop will be blocked until the demo
device has finished sampling. This is not so much of a problem if we are
sampling in blocking mode (using sr_session_run()) and the demo device is the
only device in the session, but it will fail badly for all other configurations
(e.g. multiple devices or async sampling).

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
sr: session: Moves sources to session struct

The sources really belong to the session, so move them into the session struct.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
sr: fix conditional build for ezusb and serial helpers
sr: Drop mastech-va18b, code will be in genericdmm.
srd: Performance improvements for various PDs.

Ignore/skip identical samples in most (low-level) PDs, as we're usually
(but not necessarily always) only interested in pin changes.

This yields a significant performance improvement for the PDs.

The mechanism was already used in the 'i2s', 'jtag', and 'lpc' PDs, but not
yet in all supported low-level decoders. The following PDs now also use
this mechanism: 'dcf77', 'i2c', 'spi', 'uart', and 'usb_signalling'.

Thanks Lars-Peter Clausen <lars@metafoo.de> for bringing this to our
attention.
srd: Drop 'usb' PD, replaced by two others.

The new 'usb_signalling' and the 'usb_protocol' PD which stacks on top
of it, replace the old 'usb' decoder.
sr: session: Close a device when it is removed from a session

A device is opened when it is added to a session, in the same fashion it should
be closed again when it is removed from a session.

Also remove all still attached devices from a session when the session is
destroyed.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
sr: session: Do not cleanup the driver state in sr_session_stop()

By cleaning up the driver state all devices will become inaccessible, which
means that is neither possible to query any information from it (like sample
rate) and it is also not possible to restart data acquisition.

sr_session_save() tries to query the sample rate from the device, as a result
calling sr_session_save() after calling sr_session_stop() - which is for example
done by sigrok-cli - will cause a segfault. This patch resolves the issue.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
sr: session: Deprecate sr_session_halt()

sr_session_halt() in its current state is kind of useless and even dangerous.
All it will do is mark the session as not running, but wont signal the devices
to stop to capture data. This is not so much of a problem with the blocking
sr_session_run(), but once there is support for asynchronous data acquisition by
attaching the session sources to the applications mainloop sr_session_halt()
basically becomes a no-op. sr_session_stop() already does what needs to be done,
marking the session as not running and signal the devices to stop acquisition,
so make sr_session_halt() an alias for sr_session_stop() and deprecate its
usage.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
cli: Use sr_session_stop() instead of sr_session_halt()

Use sr_session_stop() instead of the deprecated sr_session_halt().

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
gtk: Use sr_session_stop() instead of sr_session_halt()

Use sr_session_stop() instead of the deprecated sr_session_halt().

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
qt: Use sr_session_stop() instead of sr_session_halt()

Use sr_session_stop() instead of the deprecated sr_session_halt().

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
sr: Add sr_strerror() and sr_strerror_name().
sr: la8: Drop useless cast.
qt: Fix a segfault.

Add missing 'static' for the header field to fix a segfault.
qt: Partial fix for sample acquisition and display.
sr: la8: Support for newer USB VID/PID of the device.

Thanks to Jerry Jacobs for the patch!
onewire: preparations for protocol separation between link and network layers
onewire: placing protocol layers into separate directories