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 22a2ce7dbdSPaolo 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 28*00dc9a59SAkihiko Odaki #define E1000E_ADDRESS { 0x52, 0x54, 0x00, 0x12, 0x34, 0x56 } 29*00dc9a59SAkihiko Odaki 301cf4323eSThomas Huth typedef struct QE1000E QE1000E; 311cf4323eSThomas Huth typedef struct QE1000E_PCI QE1000E_PCI; 321cf4323eSThomas Huth 331cf4323eSThomas Huth struct QE1000E { 341cf4323eSThomas Huth uint64_t tx_ring; 351cf4323eSThomas Huth uint64_t rx_ring; 361cf4323eSThomas Huth }; 371cf4323eSThomas Huth 381cf4323eSThomas Huth struct QE1000E_PCI { 391cf4323eSThomas Huth QOSGraphObject obj; 401cf4323eSThomas Huth QPCIDevice pci_dev; 411cf4323eSThomas Huth QPCIBar mac_regs; 421cf4323eSThomas Huth QE1000E e1000e; 431cf4323eSThomas Huth }; 441cf4323eSThomas Huth 451cf4323eSThomas Huth void e1000e_wait_isr(QE1000E *d, uint16_t msg_id); 461cf4323eSThomas Huth void e1000e_tx_ring_push(QE1000E *d, void *descr); 471cf4323eSThomas Huth void e1000e_rx_ring_push(QE1000E *d, void *descr); 481cf4323eSThomas Huth 491cf4323eSThomas Huth #endif 50