xref: /openbmc/qemu/tests/qtest/libqos/virtio-net.h (revision 4e6b1384)
1 /*
2  * libqos driver framework
3  *
4  * Copyright (c) 2018 Emanuele Giuseppe Esposito <e.emanuelegiuseppe@gmail.com>
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License version 2 as published by the Free Software Foundation.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, see <http://www.gnu.org/licenses/>
17  */
18 
19 #ifndef TESTS_LIBQOS_VIRTIO_NET_H
20 #define TESTS_LIBQOS_VIRTIO_NET_H
21 
22 #include "libqos/qgraph.h"
23 #include "libqos/virtio.h"
24 #include "libqos/virtio-pci.h"
25 
26 typedef struct QVirtioNet QVirtioNet;
27 typedef struct QVirtioNetPCI QVirtioNetPCI;
28 typedef struct QVirtioNetDevice QVirtioNetDevice;
29 
30 struct QVirtioNet {
31     QVirtioDevice *vdev;
32     int n_queues; /* total number of virtqueues (rx, tx, ctrl) */
33     QVirtQueue **queues;
34 };
35 
36 struct QVirtioNetPCI {
37     QVirtioPCIDevice pci_vdev;
38     QVirtioNet net;
39 };
40 
41 struct QVirtioNetDevice {
42     QOSGraphObject obj;
43     QVirtioNet net;
44 };
45 
46 #endif
47