xref: /aosp_15_r20/external/coreboot/src/include/console/ne2k.h (revision b9411a12aaaa7e1e6a6fb7c5e057f44ee179a49c)
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)13 static inline void __ne2k_init(void)
14 {
15 	ne2k_init(CONFIG_CONSOLE_NE2K_IO_PORT);
16 }
__ne2k_tx_byte(u8 data)17 static inline void __ne2k_tx_byte(u8 data)
18 {
19 	ne2k_append_data(&data, 1, CONFIG_CONSOLE_NE2K_IO_PORT);
20 }
__ne2k_tx_flush(void)21 static inline void __ne2k_tx_flush(void)
22 {
23 	ne2k_transmit(CONFIG_CONSOLE_NE2K_IO_PORT);
24 }
25 #else
__ne2k_init(void)26 static inline void __ne2k_init(void)		{}
__ne2k_tx_byte(u8 data)27 static inline void __ne2k_tx_byte(u8 data)	{}
__ne2k_tx_flush(void)28 static inline void __ne2k_tx_flush(void)	{}
29 #endif
30 
31 #endif /* _NE2K_H__ */
32