Emanuele Giuseppe Esposito | a4cc719 | 2018-07-20 15:35:36 +0200 | [diff] [blame] | 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 |
Thomas Huth | dc0ad02 | 2020-06-05 12:02:42 +0200 | [diff] [blame] | 8 | * License version 2.1 as published by the Free Software Foundation. |
Emanuele Giuseppe Esposito | a4cc719 | 2018-07-20 15:35:36 +0200 | [diff] [blame] | 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 | |
Markus Armbruster | a8b991b | 2019-03-15 15:51:21 +0100 | [diff] [blame] | 19 | #ifndef QGRAPH_E1000E_H |
| 20 | #define QGRAPH_E1000E_H |
Emanuele Giuseppe Esposito | a4cc719 | 2018-07-20 15:35:36 +0200 | [diff] [blame] | 21 | |
| 22 | #include "libqos/qgraph.h" |
| 23 | #include "pci.h" |
| 24 | |
| 25 | #define E1000E_RX0_MSG_ID (0) |
| 26 | #define E1000E_TX0_MSG_ID (1) |
| 27 | #define E1000E_OTHER_MSG_ID (2) |
| 28 | |
| 29 | #define E1000E_TDLEN (0x3808) |
| 30 | #define E1000E_TDT (0x3818) |
| 31 | #define E1000E_RDLEN (0x2808) |
| 32 | #define E1000E_RDT (0x2818) |
| 33 | |
| 34 | typedef struct QE1000E QE1000E; |
| 35 | typedef struct QE1000E_PCI QE1000E_PCI; |
| 36 | |
| 37 | struct QE1000E { |
| 38 | uint64_t tx_ring; |
| 39 | uint64_t rx_ring; |
| 40 | }; |
| 41 | |
| 42 | struct QE1000E_PCI { |
| 43 | QOSGraphObject obj; |
| 44 | QPCIDevice pci_dev; |
| 45 | QPCIBar mac_regs; |
| 46 | QE1000E e1000e; |
| 47 | }; |
| 48 | |
| 49 | void e1000e_wait_isr(QE1000E *d, uint16_t msg_id); |
| 50 | void e1000e_tx_ring_push(QE1000E *d, void *descr); |
| 51 | void e1000e_rx_ring_push(QE1000E *d, void *descr); |
| 52 | |
| 53 | #endif |