mirror of
https://github.com/hermitcore/libhermit.git
synced 2025-03-09 00:00:03 +01:00
add option to enable e1000 driver
This commit is contained in:
parent
4c8c6b00c4
commit
7f6bdd72b1
3 changed files with 10 additions and 0 deletions
|
@ -45,6 +45,8 @@
|
|||
#include <netif/etharp.h>
|
||||
#include <net/e1000.h>
|
||||
|
||||
#if USE_E1000
|
||||
|
||||
#define RX_BUF_LEN (2048)
|
||||
#define TX_BUF_LEN (1792)
|
||||
|
||||
|
@ -603,3 +605,5 @@ oom:
|
|||
|
||||
return ERR_MEM;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -32,6 +32,8 @@
|
|||
#include <hermit/stddef.h>
|
||||
#include <hermit/spinlock.h>
|
||||
|
||||
#ifdef USE_E1000
|
||||
|
||||
#define NUM_RX_DESCRIPTORS 64
|
||||
#define NUM_TX_DESCRIPTORS 64
|
||||
|
||||
|
@ -324,3 +326,5 @@ typedef struct e1000if {
|
|||
err_t e1000if_init(struct netif* netif);
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -206,8 +206,10 @@ static int init_netifs(void)
|
|||
goto success;
|
||||
if ((err = netifapi_netif_add(&default_netif, ip_2_ip4(&ipaddr), ip_2_ip4(&netmask), ip_2_ip4(&gw), NULL, rtl8139if_init, ethernet_input)) == ERR_OK)
|
||||
goto success;
|
||||
#ifdef USE_E1000
|
||||
if ((err = netifapi_netif_add(&default_netif, ip_2_ip4(&ipaddr), ip_2_ip4(&netmask), ip_2_ip4(&gw), NULL, e1000if_init, ethernet_input)) == ERR_OK)
|
||||
goto success;
|
||||
#endif
|
||||
|
||||
LOG_ERROR("Unable to add the network interface: err = %d\n", err);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue