coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
ne2k.h
Go to the documentation of this file.
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 || ENV_RAMSTAGE)
13 static inline void __ne2k_init(void)
14 {
15  ne2k_init(CONFIG_CONSOLE_NE2K_IO_PORT);
16 }
17 static inline void __ne2k_tx_byte(u8 data)
18 {
19  ne2k_append_data(&data, 1, CONFIG_CONSOLE_NE2K_IO_PORT);
20 }
21 static inline void __ne2k_tx_flush(void)
22 {
23  ne2k_transmit(CONFIG_CONSOLE_NE2K_IO_PORT);
24 }
25 #else
26 static inline void __ne2k_init(void) {}
27 static inline void __ne2k_tx_byte(u8 data) {}
28 static inline void __ne2k_tx_flush(void) {}
29 #endif
30 
31 #endif /* _NE2K_H__ */
int ne2k_init(unsigned int eth_nic_base)
Definition: ne2k.c:264
static void __ne2k_tx_byte(u8 data)
Definition: ne2k.h:27
void ne2k_append_data(unsigned char *d, int len, unsigned int base)
Definition: ne2k.c:97
static void __ne2k_init(void)
Definition: ne2k.h:26
void ne2k_transmit(unsigned int eth_nic_base)
Definition: ne2k.c:195
static void __ne2k_tx_flush(void)
Definition: ne2k.h:28
uintptr_t base
Definition: uart.c:17
uint8_t u8
Definition: stdint.h:45