1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 3 #ifndef _NE2K_H__ 4 #define _NE2K_H__ 5 6 #include <stdint.h> 7 8 void ne2k_append_data(unsigned char *d, int len, unsigned int base); 9 int ne2k_init(unsigned int eth_nic_base); 10 void ne2k_transmit(unsigned int eth_nic_base); 11 12 #if CONFIG(CONSOLE_NE2K) && (ENV_ROMSTAGE_OR_BEFORE || ENV_RAMSTAGE) __ne2k_init(void)13static inline void __ne2k_init(void) 14 { 15 ne2k_init(CONFIG_CONSOLE_NE2K_IO_PORT); 16 } __ne2k_tx_byte(u8 data)17static inline void __ne2k_tx_byte(u8 data) 18 { 19 ne2k_append_data(&data, 1, CONFIG_CONSOLE_NE2K_IO_PORT); 20 } __ne2k_tx_flush(void)21static inline void __ne2k_tx_flush(void) 22 { 23 ne2k_transmit(CONFIG_CONSOLE_NE2K_IO_PORT); 24 } 25 #else __ne2k_init(void)26static inline void __ne2k_init(void) {} __ne2k_tx_byte(u8 data)27static inline void __ne2k_tx_byte(u8 data) {} __ne2k_tx_flush(void)28static inline void __ne2k_tx_flush(void) {} 29 #endif 30 31 #endif /* _NE2K_H__ */ 32