soc/picorv32/test/badger_lwip/liblwip/badgerif.c
/**
 * In this function, the hardware should be initialized.
 * Called from ethernetif_init().
 *
 * @param netif the already initialized lwip network interface structure
 *        for this ethernetif
 */
In this function, the hardware should be initialized.

@param netif the already initialized lwip network interface structure
for this ethernetif
In this function the hardware should be initialized . @param netif the already initialized lwip network interface structure for this ethernetif
err_t badger_init(struct netif *netif)
{
    netif->hwaddr_len = ETH_HWADDR_LEN;
    for(unsigned i = 0; i < netif->hwaddr_len; i++)
        netif->hwaddr[i] = i;   
    netif->mtu = 1514;
    netif->name[0] = 'p';   
    netif->name[1] = 'b';
    netif->flags |= NETIF_FLAG_BROADCAST | NETIF_FLAG_ETHERNET | NETIF_FLAG_ETHARP;
    netif->output = etharp_output;
    netif->linkoutput = badger_output;
    SET_SFR1(BASE_BADGER_SFR, 0, BIT_BADGER_RX_ACCEPT, 1);
    return ERR_OK;
}
err_t badger_init ( struct netif * netif ) { netif -> hwaddr_len = ETH_HWADDR_LEN ; for ( unsigned i = 0 ; i < netif -> hwaddr_len ; i ++ ) netif -> hwaddr [ i ] = i ; netif -> mtu = 1514 ; netif -> name [ 0 ] = ' ' ; netif -> name [ 1 ] = ' ' ; netif -> flags |= NETIF_FLAG_BROADCAST | NETIF_FLAG_ETHERNET | NETIF_FLAG_ETHARP ; netif -> output = etharp_output ; netif -> linkoutput = badger_output ; SET_SFR1 ( BASE_BADGER_SFR , 0 , BIT_BADGER_RX_ACCEPT , 1 ) ; return ERR_OK ; }
In this function, the hardware should be initialized.
In this function the hardware should be initialized .
// TODO manage mac address //Packet Badger // Enable hardware MAC