xref: /openbmc/qemu/tests/qtest/libqos/e1000e.h (revision a2ce7dbd)
11cf4323eSThomas Huth /*
21cf4323eSThomas Huth  * libqos driver framework
31cf4323eSThomas Huth  *
41cf4323eSThomas Huth  * Copyright (c) 2018 Emanuele Giuseppe Esposito <e.emanuelegiuseppe@gmail.com>
51cf4323eSThomas Huth  *
61cf4323eSThomas Huth  * This library is free software; you can redistribute it and/or
71cf4323eSThomas Huth  * modify it under the terms of the GNU Lesser General Public
8dc0ad02dSThomas Huth  * License version 2.1 as published by the Free Software Foundation.
91cf4323eSThomas Huth  *
101cf4323eSThomas Huth  * This library is distributed in the hope that it will be useful,
111cf4323eSThomas Huth  * but WITHOUT ANY WARRANTY; without even the implied warranty of
121cf4323eSThomas Huth  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
131cf4323eSThomas Huth  * Lesser General Public License for more details.
141cf4323eSThomas Huth  *
151cf4323eSThomas Huth  * You should have received a copy of the GNU Lesser General Public
161cf4323eSThomas Huth  * License along with this library; if not, see <http://www.gnu.org/licenses/>
171cf4323eSThomas Huth  */
181cf4323eSThomas Huth 
191cf4323eSThomas Huth #ifndef QGRAPH_E1000E_H
201cf4323eSThomas Huth #define QGRAPH_E1000E_H
211cf4323eSThomas Huth 
22*a2ce7dbdSPaolo Bonzini #include "qgraph.h"
231cf4323eSThomas Huth #include "pci.h"
241cf4323eSThomas Huth 
251cf4323eSThomas Huth #define E1000E_RX0_MSG_ID           (0)
261cf4323eSThomas Huth #define E1000E_TX0_MSG_ID           (1)
271cf4323eSThomas Huth #define E1000E_OTHER_MSG_ID         (2)
281cf4323eSThomas Huth 
291cf4323eSThomas Huth #define E1000E_TDLEN    (0x3808)
301cf4323eSThomas Huth #define E1000E_TDT      (0x3818)
311cf4323eSThomas Huth #define E1000E_RDLEN    (0x2808)
321cf4323eSThomas Huth #define E1000E_RDT      (0x2818)
331cf4323eSThomas Huth 
341cf4323eSThomas Huth typedef struct QE1000E QE1000E;
351cf4323eSThomas Huth typedef struct QE1000E_PCI QE1000E_PCI;
361cf4323eSThomas Huth 
371cf4323eSThomas Huth struct QE1000E {
381cf4323eSThomas Huth     uint64_t tx_ring;
391cf4323eSThomas Huth     uint64_t rx_ring;
401cf4323eSThomas Huth };
411cf4323eSThomas Huth 
421cf4323eSThomas Huth struct QE1000E_PCI {
431cf4323eSThomas Huth     QOSGraphObject obj;
441cf4323eSThomas Huth     QPCIDevice pci_dev;
451cf4323eSThomas Huth     QPCIBar mac_regs;
461cf4323eSThomas Huth     QE1000E e1000e;
471cf4323eSThomas Huth };
481cf4323eSThomas Huth 
491cf4323eSThomas Huth void e1000e_wait_isr(QE1000E *d, uint16_t msg_id);
501cf4323eSThomas Huth void e1000e_tx_ring_push(QE1000E *d, void *descr);
511cf4323eSThomas Huth void e1000e_rx_ring_push(QE1000E *d, void *descr);
521cf4323eSThomas Huth 
531cf4323eSThomas Huth #endif
54