Module Name: src Committed By: martin Date: Sun Oct 19 15:22:00 UTC 2014
Modified Files: src/sys/arch/arm/broadcom [netbsd-7]: bcm2835_vcaudio.c src/sys/external/bsd/vchiq/dist/interface/vchiq_arm [netbsd-7]: vchiq_shim.c Log Message: Pull up following revision(s) (requested by skrll in ticket #151): sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_shim.c: revision 1.5 sys/arch/arm/broadcom/bcm2835_vcaudio.c: revision 1.4 sys/arch/arm/broadcom/bcm2835_vcaudio.c: revision 1.5 sys/arch/arm/broadcom/bcm2835_vcaudio.c: revision 1.6 sys/arch/arm/broadcom/bcm2835_vcaudio.c: revision 1.7 use a fixed frequency (48kHz) and configure the audio server at attach time, instead of at the beginning of playback improved playback error handling, and get rid of junk+silence insertion at the beginning of playback expose vchi_get_peer_version capture peer version; if less than 2, bail out as bulk mode is not supported. report the peer version with "audioctl version" Some improvements that make playback mostly reliable for me - the final piece of the jigaw is probably in vchiq: - prefill vchiq with a number (currently 2) blocks of audio before starting - use a kthread as workqueue isn't suited to our usage. - don't drain on stopping as for some reason it leaves data behind. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.3.4.1 src/sys/arch/arm/broadcom/bcm2835_vcaudio.c cvs rdiff -u -r1.4 -r1.4.2.1 \ src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_shim.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/arm/broadcom/bcm2835_vcaudio.c diff -u src/sys/arch/arm/broadcom/bcm2835_vcaudio.c:1.3 src/sys/arch/arm/broadcom/bcm2835_vcaudio.c:1.3.4.1 --- src/sys/arch/arm/broadcom/bcm2835_vcaudio.c:1.3 Mon May 5 08:13:31 2014 +++ src/sys/arch/arm/broadcom/bcm2835_vcaudio.c Sun Oct 19 15:22:00 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: bcm2835_vcaudio.c,v 1.3 2014/05/05 08:13:31 skrll Exp $ */ +/* $NetBSD: bcm2835_vcaudio.c,v 1.3.4.1 2014/10/19 15:22:00 martin Exp $ */ /*- * Copyright (c) 2013 Jared D. McNeill <jmcne...@invisible.ca> @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: bcm2835_vcaudio.c,v 1.3 2014/05/05 08:13:31 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bcm2835_vcaudio.c,v 1.3.4.1 2014/10/19 15:22:00 martin Exp $"); #include <sys/param.h> #include <sys/types.h> @@ -40,7 +40,6 @@ __KERNEL_RCSID(0, "$NetBSD: bcm2835_vcau #include <sys/conf.h> #include <sys/bus.h> #include <sys/kmem.h> -#include <sys/workqueue.h> #include <sys/audioio.h> #include <dev/audio_if.h> @@ -68,16 +67,33 @@ enum vcaudio_dest { VCAUDIO_DEST_HDMI = 2, }; -struct vcaudio_work { - struct work vw_wk; -}; + +/* + * Standard message size is 4000 bytes and VCHIQ can accept 16 messages. + * + * 4000 bytes of 16bit 48kHz stereo is approximately 21ms. + * + * We get complete messages at ~10ms intervals. + * + * Setting blocksize to 2 x 4000 means that we send approx 42ms of audio. We + * prefill by two blocks before starting audio meaning we have 83ms of latency. + */ + +#define VCAUDIO_MSGSIZE 4000 +#define VCAUDIO_NUMMSGS 2 +#define VCAUDIO_BLOCKSIZE (VCAUDIO_MSGSIZE * VCAUDIO_NUMMSGS) +#define VCAUDIO_BUFFERSIZE 128000 +#define VCAUDIO_PREFILLCOUNT 2 struct vcaudio_softc { device_t sc_dev; device_t sc_audiodev; + lwp_t *sc_lwp; + kmutex_t sc_lock; kmutex_t sc_intr_lock; + kcondvar_t sc_datacv; kmutex_t sc_msglock; kcondvar_t sc_msgcv; @@ -89,7 +105,9 @@ struct vcaudio_softc { void *sc_pintarg; audio_params_t sc_pparam; bool sc_started; - int sc_pbytes; + int sc_pblkcnt; // prefill block count + int sc_abytes; // available bytes + int sc_pbytes; // played bytes off_t sc_ppos; void *sc_pstart; void *sc_pend; @@ -102,8 +120,7 @@ struct vcaudio_softc { VCHI_CONNECTION_T sc_connection; VCHI_SERVICE_HANDLE_T sc_service; - struct workqueue *sc_wq; - struct vcaudio_work sc_work; + short sc_peer_version; int sc_volume; enum vcaudio_dest sc_dest; @@ -116,18 +133,17 @@ static void vcaudio_childdet(device_t, d static int vcaudio_init(struct vcaudio_softc *); static void vcaudio_service_callback(void *, - const VCHI_CALLBACK_REASON_T, - void *); -static int vcaudio_msg_sync(struct vcaudio_softc *, VC_AUDIO_MSG_T *, size_t); -static void vcaudio_worker(struct work *, void *); + const VCHI_CALLBACK_REASON_T, void *); +static int vcaudio_msg_sync(struct vcaudio_softc *, VC_AUDIO_MSG_T *, + size_t); +static void vcaudio_worker(void *); static int vcaudio_open(void *, int); static void vcaudio_close(void *); static int vcaudio_query_encoding(void *, struct audio_encoding *); static int vcaudio_set_params(void *, int, int, - audio_params_t *, audio_params_t *, - stream_filter_list_t *, - stream_filter_list_t *); + audio_params_t *, audio_params_t *, + stream_filter_list_t *, stream_filter_list_t *); static int vcaudio_halt_output(void *); static int vcaudio_halt_input(void *); static int vcaudio_set_port(void *, mixer_ctrl_t *); @@ -135,14 +151,16 @@ static int vcaudio_get_port(void *, mixe static int vcaudio_query_devinfo(void *, mixer_devinfo_t *); static int vcaudio_getdev(void *, struct audio_device *); static int vcaudio_get_props(void *); -static int vcaudio_round_blocksize(void *, int, int, const audio_params_t *); + +static int vcaudio_round_blocksize(void *, int, int, + const audio_params_t *); static size_t vcaudio_round_buffersize(void *, int, size_t); + static int vcaudio_trigger_output(void *, void *, void *, int, - void (*)(void *), void *, - const audio_params_t *); + void (*)(void *), void *, const audio_params_t *); static int vcaudio_trigger_input(void *, void *, void *, int, - void (*)(void *), void *, - const audio_params_t *); + void (*)(void *), void *, const audio_params_t *); + static void vcaudio_get_locks(void *, kmutex_t **, kmutex_t **); static const struct audio_hw_if vcaudio_hw_if = { @@ -165,7 +183,8 @@ static const struct audio_hw_if vcaudio_ }; CFATTACH_DECL2_NEW(vcaudio, sizeof(struct vcaudio_softc), - vcaudio_match, vcaudio_attach, NULL, NULL, vcaudio_rescan, vcaudio_childdet); + vcaudio_match, vcaudio_attach, NULL, NULL, vcaudio_rescan, + vcaudio_childdet); static int vcaudio_match(device_t parent, cfdata_t match, void *aux) @@ -185,32 +204,38 @@ vcaudio_attach(device_t parent, device_t mutex_init(&sc->sc_lock, MUTEX_DEFAULT, IPL_NONE); mutex_init(&sc->sc_intr_lock, MUTEX_DEFAULT, IPL_NONE); mutex_init(&sc->sc_msglock, MUTEX_DEFAULT, IPL_NONE); - cv_init(&sc->sc_msgcv, "vcaudiocv"); + cv_init(&sc->sc_msgcv, "msg"); + cv_init(&sc->sc_datacv, "data"); sc->sc_success = -1; - error = workqueue_create(&sc->sc_wq, "vcaudiowq", vcaudio_worker, - sc, PRI_BIO, IPL_SCHED, WQ_MPSAFE); + + error = kthread_create(PRI_BIO, KTHREAD_MPSAFE, NULL, vcaudio_worker, + sc, &sc->sc_lwp, "vcaudio"); if (error) { - aprint_error(": couldn't create workqueue (%d)\n", error); + aprint_error(": couldn't create thread (%d)\n", error); return; } aprint_naive("\n"); - aprint_normal(": AUDS\n"); + aprint_normal(": auds\n"); - if (vcaudio_init(sc) != 0) { + error = vcaudio_rescan(self, NULL, NULL); + if (error) aprint_error_dev(self, "not configured\n"); - return; - } - vcaudio_rescan(self, NULL, NULL); } static int vcaudio_rescan(device_t self, const char *ifattr, const int *locs) { struct vcaudio_softc *sc = device_private(self); + int error; if (ifattr_match(ifattr, "audiobus") && sc->sc_audiodev == NULL) { + error = vcaudio_init(sc); + if (error) { + return error; + } + sc->sc_audiodev = audio_attach_mi(&vcaudio_hw_if, sc, sc->sc_dev); } @@ -242,7 +267,7 @@ vcaudio_init(struct vcaudio_softc *sc) sc->sc_format.channels = 2; sc->sc_format.channel_mask = AUFMT_STEREO; sc->sc_format.frequency_type = 0; - sc->sc_format.frequency[0] = 8000; + sc->sc_format.frequency[0] = 48000; sc->sc_format.frequency[1] = 48000; error = auconv_create_encodings(&sc->sc_format, 1, &sc->sc_encodings); @@ -254,15 +279,15 @@ vcaudio_init(struct vcaudio_softc *sc) error = vchi_initialise(&sc->sc_instance); if (error) { - device_printf(sc->sc_dev, "couldn't init vchi instance (%d)\n", - error); + aprint_error_dev(sc->sc_dev, + "couldn't init vchi instance (%d)\n", error); return EIO; } error = vchi_connect(NULL, 0, sc->sc_instance); if (error) { - device_printf(sc->sc_dev, "couldn't connect vchi (%d)\n", - error); + aprint_error_dev(sc->sc_dev, + "couldn't connect vchi (%d)\n", error); return EIO; } @@ -281,20 +306,38 @@ vcaudio_init(struct vcaudio_softc *sc) error = vchi_service_open(sc->sc_instance, &setup, &sc->sc_service); if (error) { - device_printf(sc->sc_dev, "couldn't open service (%d)\n", + aprint_error_dev(sc->sc_dev, "couldn't open service (%d)\n", error); return EIO; } - vchi_service_release(sc->sc_service); - vchi_service_use(sc->sc_service); + vchi_get_peer_version(sc->sc_service, &sc->sc_peer_version); + + if (sc->sc_peer_version < 2) { + aprint_error_dev(sc->sc_dev, + "peer version (%d) is less than the required version (2)\n", + sc->sc_peer_version); + return EINVAL; + } + memset(&msg, 0, sizeof(msg)); msg.type = VC_AUDIO_MSG_TYPE_OPEN; error = vchi_msg_queue(sc->sc_service, &msg, sizeof(msg), VCHI_FLAGS_BLOCK_UNTIL_QUEUED, NULL); if (error) { - device_printf(sc->sc_dev, "couldn't send OPEN message (%d)\n", - error); + aprint_error_dev(sc->sc_dev, + "couldn't send OPEN message (%d)\n", error); + } + + memset(&msg, 0, sizeof(msg)); + msg.type = VC_AUDIO_MSG_TYPE_CONFIG; + msg.u.config.channels = 2; + msg.u.config.samplerate = 48000; + msg.u.config.bps = 16; + error = vcaudio_msg_sync(sc, &msg, sizeof(msg)); + if (error) { + aprint_error_dev(sc->sc_dev, + "couldn't send CONFIG message (%d)\n", error); } memset(&msg, 0, sizeof(msg)); @@ -303,8 +346,10 @@ vcaudio_init(struct vcaudio_softc *sc) msg.u.control.dest = VCAUDIO_DEST_AUTO; error = vcaudio_msg_sync(sc, &msg, sizeof(msg)); if (error) { - device_printf(sc->sc_dev, "couldn't send CONTROL message (%d)\n", error); + aprint_error_dev(sc->sc_dev, + "couldn't send CONTROL message (%d)\n", error); } + vchi_service_release(sc->sc_service); return 0; @@ -341,22 +386,35 @@ vcaudio_service_callback(void *priv, con cv_broadcast(&sc->sc_msgcv); mutex_exit(&sc->sc_msglock); break; + case VC_AUDIO_MSG_TYPE_COMPLETE: intr = msg.u.complete.callback; intrarg = msg.u.complete.cookie; if (intr && intrarg) { + int count = msg.u.complete.count & 0xffff; + int perr = (msg.u.complete.count & __BIT(30)) != 0; + bool sched = false; + mutex_enter(&sc->sc_intr_lock); - if (msg.u.complete.count > 0 && msg.u.complete.count <= sc->sc_pblksize) { - sc->sc_pbytes += msg.u.complete.count; - } else { - if (sc->sc_started) { - device_printf(sc->sc_dev, "WARNING: count = %d\n", msg.u.complete.count); - } + + if (count > 0) { + sc->sc_pbytes += count; + } + if (perr && sc->sc_started) { +#ifdef VCAUDIO_DEBUG + device_printf(sc->sc_dev, "underrun\n"); +#endif + sched = true; } if (sc->sc_pbytes >= sc->sc_pblksize) { sc->sc_pbytes -= sc->sc_pblksize; + sched = true; + } + + if (sched) { intr(intrarg); - workqueue_enqueue(sc->sc_wq, (struct work *)&sc->sc_work, NULL); + sc->sc_abytes += sc->sc_pblksize; + cv_signal(&sc->sc_datacv); } mutex_exit(&sc->sc_intr_lock); } @@ -367,7 +425,7 @@ vcaudio_service_callback(void *priv, con } static void -vcaudio_worker(struct work *wk, void *priv) +vcaudio_worker(void *priv) { struct vcaudio_softc *sc = priv; VC_AUDIO_MSG_T msg; @@ -377,103 +435,92 @@ vcaudio_worker(struct work *wk, void *pr int error, resid, off, nb, count; mutex_enter(&sc->sc_intr_lock); - intr = sc->sc_pint; - intrarg = sc->sc_pintarg; - - if (intr == NULL || intrarg == NULL) { - mutex_exit(&sc->sc_intr_lock); - return; - } - vchi_service_use(sc->sc_service); + while (true) { + intr = sc->sc_pint; + intrarg = sc->sc_pintarg; + + if (intr == NULL || intrarg == NULL) { + cv_wait_sig(&sc->sc_datacv, &sc->sc_intr_lock); + continue; + } - if (sc->sc_started == false) { -#ifdef VCAUDIO_DEBUG - device_printf(sc->sc_dev, "starting output\n"); -#endif + KASSERT(sc->sc_pblksize != 0); - memset(&msg, 0, sizeof(msg)); - msg.type = VC_AUDIO_MSG_TYPE_CONFIG; - msg.u.config.channels = sc->sc_pparam.channels; - msg.u.config.samplerate = sc->sc_pparam.sample_rate; - msg.u.config.bps = sc->sc_pparam.precision; - error = vcaudio_msg_sync(sc, &msg, sizeof(msg)); - if (error) { - printf("%s: failed to config (%d)\n", __func__, error); - goto done; + if (sc->sc_abytes < sc->sc_pblksize) { + cv_wait_sig(&sc->sc_datacv, &sc->sc_intr_lock); + continue; } + count = sc->sc_pblksize; memset(&msg, 0, sizeof(msg)); - msg.type = VC_AUDIO_MSG_TYPE_START; - error = vchi_msg_queue(sc->sc_service, &msg, sizeof(msg), - VCHI_FLAGS_BLOCK_UNTIL_QUEUED, NULL); - if (error) { - printf("%s: failed to start (%d)\n", __func__, error); - goto done; - } + msg.type = VC_AUDIO_MSG_TYPE_WRITE; + msg.u.write.max_packet = VCAUDIO_MSGSIZE; + msg.u.write.count = count; + msg.u.write.callback = intr; + msg.u.write.cookie = intrarg; + msg.u.write.silence = 0; + + block = (uint8_t *)sc->sc_pstart + sc->sc_ppos; + resid = count; + off = 0; - sc->sc_started = true; - sc->sc_pbytes = 0; - sc->sc_ppos = 0; - sc->sc_pblksize = sc->sc_pblksize; - count = (uintptr_t)sc->sc_pend - (uintptr_t)sc->sc_pstart; + vchi_service_use(sc->sc_service); - /* initial silence */ - memset(&msg, 0, sizeof(msg)); - msg.type = VC_AUDIO_MSG_TYPE_WRITE; - msg.u.write.count = PAGE_SIZE * 3; - msg.u.write.callback = NULL; - msg.u.write.cookie = NULL; - msg.u.write.silence = 1; - msg.u.write.max_packet = 0; error = vchi_msg_queue(sc->sc_service, &msg, sizeof(msg), VCHI_FLAGS_BLOCK_UNTIL_QUEUED, NULL); if (error) { printf("%s: failed to write (%d)\n", __func__, error); goto done; } - } else { - count = sc->sc_pblksize; - } - - memset(&msg, 0, sizeof(msg)); - msg.type = VC_AUDIO_MSG_TYPE_WRITE; - msg.u.write.max_packet = 4000; - msg.u.write.count = count; - msg.u.write.callback = intr; - msg.u.write.cookie = intrarg; - msg.u.write.silence = 0; - - error = vchi_msg_queue(sc->sc_service, &msg, sizeof(msg), - VCHI_FLAGS_BLOCK_UNTIL_QUEUED, NULL); - if (error) { - printf("%s: failed to write (%d)\n", __func__, error); - goto done; - } - block = (uint8_t *)sc->sc_pstart + sc->sc_ppos; - resid = count; - off = 0; - while (resid > 0) { - nb = min(resid, msg.u.write.max_packet); - error = vchi_msg_queue(sc->sc_service, - (char *)block + off, nb, - VCHI_FLAGS_BLOCK_UNTIL_QUEUED, NULL); - if (error) { - printf("%s: failed to queue data (%d)\n", __func__, error); - goto done; + while (resid > 0) { + nb = min(resid, msg.u.write.max_packet); + error = vchi_msg_queue(sc->sc_service, + (char *)block + off, nb, + VCHI_FLAGS_BLOCK_UNTIL_QUEUED, NULL); + if (error) { + /* XXX What to do here? */ + device_printf(sc->sc_dev, + "failed to queue data (%d)\n", error); + goto done; + } + off += nb; + resid -= nb; } - off += nb; - resid -= nb; - } - sc->sc_ppos += count; - if ((uint8_t *)sc->sc_pstart + sc->sc_ppos >= (uint8_t *)sc->sc_pend) - sc->sc_ppos = 0; + sc->sc_abytes -= count; + sc->sc_ppos += count; + if ((uint8_t *)sc->sc_pstart + sc->sc_ppos >= + (uint8_t *)sc->sc_pend) + sc->sc_ppos = 0; + + if (!sc->sc_started) { + ++sc->sc_pblkcnt; + + if (sc->sc_pblkcnt == VCAUDIO_PREFILLCOUNT) { + + memset(&msg, 0, sizeof(msg)); + msg.type = VC_AUDIO_MSG_TYPE_START; + error = vchi_msg_queue(sc->sc_service, &msg, + sizeof(msg), VCHI_FLAGS_BLOCK_UNTIL_QUEUED, + NULL); + if (error) { + device_printf(sc->sc_dev, + "failed to start (%d)\n", error); + goto done; + } + sc->sc_started = true; + sc->sc_pbytes = 0; + } else { + intr(intrarg); + sc->sc_abytes += sc->sc_pblksize; + } + } done: - mutex_exit(&sc->sc_intr_lock); - vchi_service_release(sc->sc_service); + vchi_service_release(sc->sc_service); + } } static int @@ -550,10 +597,12 @@ vcaudio_halt_output(void *priv) VC_AUDIO_MSG_T msg; int error = 0; + KASSERT(mutex_owned(&sc->sc_intr_lock)); + vchi_service_use(sc->sc_service); memset(&msg, 0, sizeof(msg)); msg.type = VC_AUDIO_MSG_TYPE_STOP; - msg.u.stop.draining = 1; + msg.u.stop.draining = 0; error = vchi_msg_queue(sc->sc_service, &msg, sizeof(msg), VCHI_FLAGS_BLOCK_UNTIL_QUEUED, NULL); if (error) { @@ -590,15 +639,20 @@ vcaudio_set_port(void *priv, mixer_ctrl_ case VCAUDIO_OUTPUT_MASTER_VOLUME: case VCAUDIO_INPUT_DAC_VOLUME: sc->sc_volume = mc->un.value.level[AUDIO_MIXER_LEVEL_LEFT]; + + vchi_service_use(sc->sc_service); + memset(&msg, 0, sizeof(msg)); msg.type = VC_AUDIO_MSG_TYPE_CONTROL; msg.u.control.volume = vol2pct(sc->sc_volume); msg.u.control.dest = VCAUDIO_DEST_AUTO; - vchi_service_use(sc->sc_service); + error = vcaudio_msg_sync(sc, &msg, sizeof(msg)); if (error) { - device_printf(sc->sc_dev, "couldn't send CONTROL message (%d)\n", error); + device_printf(sc->sc_dev, + "couldn't send CONTROL message (%d)\n", error); } + vchi_service_release(sc->sc_service); return error; @@ -662,9 +716,13 @@ vcaudio_query_devinfo(void *priv, mixer_ static int vcaudio_getdev(void *priv, struct audio_device *audiodev) { - snprintf(audiodev->name, sizeof(audiodev->name), "VCHIQ AUDS"); - snprintf(audiodev->version, sizeof(audiodev->version), ""); + struct vcaudio_softc *sc = priv; + + snprintf(audiodev->name, sizeof(audiodev->name), "vchiq auds"); + snprintf(audiodev->version, sizeof(audiodev->version), + "%d", sc->sc_peer_version); snprintf(audiodev->config, sizeof(audiodev->config), "vcaudio"); + return 0; } @@ -678,19 +736,14 @@ static int vcaudio_round_blocksize(void *priv, int bs, int mode, const audio_params_t *params) { - return PAGE_SIZE; + return VCAUDIO_BLOCKSIZE; } static size_t vcaudio_round_buffersize(void *priv, int direction, size_t bufsize) { - size_t sz; - sz = (bufsize + 0x3ff) & ~0x3ff; - if (sz > 32768) - sz = 32768; - - return sz; + return VCAUDIO_BUFFERSIZE; } static int @@ -699,6 +752,9 @@ vcaudio_trigger_output(void *priv, void { struct vcaudio_softc *sc = priv; + ASSERT_SLEEPABLE(); + KASSERT(mutex_owned(&sc->sc_intr_lock)); + sc->sc_pparam = *params; sc->sc_pint = intr; sc->sc_pintarg = intrarg; @@ -706,7 +762,11 @@ vcaudio_trigger_output(void *priv, void sc->sc_pstart = start; sc->sc_pend = end; sc->sc_pblksize = blksize; - workqueue_enqueue(sc->sc_wq, (struct work *)&sc->sc_work, NULL); + sc->sc_pblkcnt = 0; + sc->sc_pbytes = 0; + sc->sc_abytes = blksize; + + cv_signal(&sc->sc_datacv); return 0; } Index: src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_shim.c diff -u src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_shim.c:1.4 src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_shim.c:1.4.2.1 --- src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_shim.c:1.4 Wed Jul 16 23:59:58 2014 +++ src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_shim.c Sun Oct 19 15:22:00 2014 @@ -725,7 +725,6 @@ int32_t vchi_service_destroy(const VCHI_ } EXPORT_SYMBOL(vchi_service_destroy); -#ifdef notyet int32_t vchi_get_peer_version( const VCHI_SERVICE_HANDLE_T handle, short *peer_version ) { int32_t ret = -1; @@ -739,6 +738,7 @@ int32_t vchi_get_peer_version( const VCH } EXPORT_SYMBOL(vchi_get_peer_version); +#if notyet /* ---------------------------------------------------------------------- * read a uint32_t from buffer. * network format is defined to be little endian