/* Setup the driver and init MAC address according to doc/README.enetaddr Called by ne2k_register() before registering the driver @eth layer */
static int ne2k_setup_driver(struct eth_device *dev)
/* Setup the driver and init MAC address according to doc/README.enetaddr Called by ne2k_register() before registering the driver @eth layer */
static int ne2k_setup_driver(struct eth_device *dev)
{
	PRINTK("### ne2k_setup_driver\n");
	if (!pbuf) {
		pbuf = malloc(2000);
		if (!pbuf) {
			printf("Cannot allocate rx buffer\n");
			return -1;
		}
	}
	nic.base = (u8 *) CONFIG_DRIVER_NE2000_BASE;
	nic.data = nic.base + DP_DATA;
	nic.tx_buf1 = START_PG;
	nic.tx_buf2 = START_PG2;
	nic.rx_buf_start = RX_START;
	nic.rx_buf_end = RX_END;
	if (!eth_env_get_enetaddr("ethaddr", dev->enetaddr)) {
		if (!get_prom(dev->enetaddr, nic.base))
			dp83902a_init(dev->enetaddr);
		eth_env_set_enetaddr("ethaddr", dev->enetaddr);
	}
	return 0;
}