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