xref: /openbmc/qemu/tests/qtest/libqos/e1000e.h (revision f0984d40)
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.1 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 QGRAPH_E1000E_H
20 #define QGRAPH_E1000E_H
21 
22 #include "qgraph.h"
23 #include "pci.h"
24 
25 #define E1000E_RX0_MSG_ID           (0)
26 #define E1000E_TX0_MSG_ID           (1)
27 
28 typedef struct QE1000E QE1000E;
29 typedef struct QE1000E_PCI QE1000E_PCI;
30 
31 struct QE1000E {
32     uint64_t tx_ring;
33     uint64_t rx_ring;
34 };
35 
36 struct QE1000E_PCI {
37     QOSGraphObject obj;
38     QPCIDevice pci_dev;
39     QPCIBar mac_regs;
40     QE1000E e1000e;
41 };
42 
43 void e1000e_wait_isr(QE1000E *d, uint16_t msg_id);
44 void e1000e_tx_ring_push(QE1000E *d, void *descr);
45 void e1000e_rx_ring_push(QE1000E *d, void *descr);
46 
47 #endif
48