linux/tools/virtio/ringtest/noring.c
<<
>>
Prefs
   1#define _GNU_SOURCE
   2#include "main.h"
   3#include <assert.h>
   4
   5/* stub implementation: useful for measuring overhead */
   6void alloc_ring(void)
   7{
   8}
   9
  10/* guest side */
  11int add_inbuf(unsigned len, void *buf, void *datap)
  12{
  13        return 0;
  14}
  15
  16/*
  17 * skb_array API provides no way for producer to find out whether a given
  18 * buffer was consumed.  Our tests merely require that a successful get_buf
  19 * implies that add_inbuf succeed in the past, and that add_inbuf will succeed,
  20 * fake it accordingly.
  21 */
  22void *get_buf(unsigned *lenp, void **bufp)
  23{
  24        return "Buffer";
  25}
  26
  27bool used_empty()
  28{
  29        return false;
  30}
  31
  32void disable_call()
  33{
  34        assert(0);
  35}
  36
  37bool enable_call()
  38{
  39        assert(0);
  40}
  41
  42void kick_available(void)
  43{
  44        assert(0);
  45}
  46
  47/* host side */
  48void disable_kick()
  49{
  50        assert(0);
  51}
  52
  53bool enable_kick()
  54{
  55        assert(0);
  56}
  57
  58bool avail_empty()
  59{
  60        return false;
  61}
  62
  63bool use_buf(unsigned *lenp, void **bufp)
  64{
  65        return true;
  66}
  67
  68void call_used(void)
  69{
  70        assert(0);
  71}
  72