1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
#ifndef _COMMON_H
#define _COMMON_H
#define OPT_DEV (1 << 0)
#define OPT_UUID (1 << 1)
static inline int uio_quirks(const struct driver_ops *e)
{
if (e && e->rx_fill)
return e->vfio_quirks();
return 0;
}
static inline int uio_rx_fill(const struct driver_ops *e, int device,
void *rxring, struct iomem data, char *rx_buf[],
volatile void *ioaddr)
{
if (e && e->rx_fill)
return e->rx_fill(device, rxring, data, rx_buf, ioaddr);
return 0;
}
static inline void uio_recv(const struct driver_ops *e, void *rxring,
char *rxbuffers[], volatile void *iomem)
{
if (e && e->recv)
e->recv(rxring, rxbuffers, iomem);
return;
}
static inline void uio_xmit(const struct driver_ops *e, void *txring,
struct iomem tx_data, volatile void *iomem)
{
if (e && e->xmit)
e->xmit(txring, tx_data, iomem);
return;
}
static inline void *uio_map_mmio(const struct driver_ops *e, int device)
{
if (e && e->map_mmio)
return e->map_mmio(device);
return NULL;
}
#endif
|