Rudolf Marek | 4aa93cc | 2010-07-16 20:02:09 +0000 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2010 Rudolf Marek <r.marek@assembler.cz> |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; version 2 of the License. |
| 9 | * |
| 10 | * This program 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 |
| 13 | * GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program; if not, write to the Free Software |
Paul Menzel | a46a712 | 2013-02-23 18:37:27 +0100 | [diff] [blame] | 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
Rudolf Marek | 4aa93cc | 2010-07-16 20:02:09 +0000 | [diff] [blame] | 18 | */ |
| 19 | |
Stefan Reinauer | 3f5f6d8 | 2013-05-07 20:35:29 +0200 | [diff] [blame] | 20 | #ifndef _NE2K_H__ |
| 21 | #define _NE2K_H__ |
Kyösti Mälkki | f339086 | 2014-02-26 15:19:04 +0200 | [diff] [blame^] | 22 | |
| 23 | #include <rules.h> |
| 24 | #include <stdint.h> |
| 25 | |
Rudolf Marek | 4aa93cc | 2010-07-16 20:02:09 +0000 | [diff] [blame] | 26 | void ne2k_append_data(unsigned char *d, int len, unsigned int base); |
| 27 | int ne2k_init(unsigned int eth_nic_base); |
| 28 | void ne2k_transmit(unsigned int eth_nic_base); |
Kyösti Mälkki | dbc7bd9 | 2014-01-28 11:34:38 +0200 | [diff] [blame] | 29 | |
| 30 | #ifndef __ROMCC__ |
| 31 | #define ne2k_append_data_byte(d, base) ne2k_append_data(&d, 1, base) |
| 32 | #endif |
Kyösti Mälkki | f339086 | 2014-02-26 15:19:04 +0200 | [diff] [blame^] | 33 | |
| 34 | #if CONFIG_CONSOLE_NE2K && (ENV_ROMSTAGE || ENV_RAMSTAGE) |
| 35 | static inline void __ne2k_init(void) { ne2k_init(CONFIG_CONSOLE_NE2K_IO_PORT); } |
| 36 | static inline void __ne2k_tx_byte(u8 data) { ne2k_append_data_byte(data, CONFIG_CONSOLE_NE2K_IO_PORT); } |
| 37 | static inline void __ne2k_tx_flush(void) { ne2k_transmit(CONFIG_CONSOLE_NE2K_IO_PORT); } |
| 38 | #else |
| 39 | static inline void __ne2k_init(void) {} |
| 40 | static inline void __ne2k_tx_byte(u8 data) {} |
| 41 | static inline void __ne2k_tx_flush(void) {} |
| 42 | #endif |
| 43 | |
Rudolf Marek | 4aa93cc | 2010-07-16 20:02:09 +0000 | [diff] [blame] | 44 | #endif /* _NE2K_H */ |