lib/sw_apps/img_rcvry/src/xbir_nw.c
int Xbir_NwCfgNetwork (struct netif *NetIf)
{
	int Status = XST_FAILURE;

	/* Initialize lwip network stack */
	lwip_init();

	/* Add network interface to the netif_list, and set it as default */
	if (!xemac_add(NetIf, NULL, NULL, NULL,
			(u8 *)Xbir_NwMacEthAddr, XBIR_PLATFORM_EMAC_BASEADDR)) {
		Xbir_Printf("ERROR: Error adding N/W interface\n\r");
		goto END;
	}

	netif_set_default(NetIf);
	Xbir_Platform_EnableInterrupts();

	/* Specify that the network if(interface) is UP */
	netif_set_up(NetIf);

	/* Assign default and fixed IP address, mask and gateway */
	if (Xbir_NwSetDefaultIp(&NetIf->ip_addr, &NetIf->netmask,
		&NetIf->gw) != XST_SUCCESS) {
		goto END;
	}

	Xbir_NwPrintIpCfg(&NetIf->ip_addr, &NetIf->netmask, &NetIf->gw);
	Status = XST_SUCCESS;

END:
	return Status;
}
/*****************************************************************************/
/**
 * @brief
 * This function configures the SysBoard network and assigns default IP address
 *
 * @param	NetIf	Pointer to network interface instance
 *
 * @return	XST_SUCCESS if initialization is successful
 *		XST_FAILURE if initialization is failed
 *
 *****************************************************************************/
@brief
This function configures the SysBoard network and assigns default IP address

@param       NetIf   Pointer to network interface instance

@return      XST_SUCCESS if initialization is successful
XST_FAILURE if initialization is failed
@brief This function configures the SysBoard network and assigns default IP address @param NetIf Pointer to network interface instance @return XST_SUCCESS if initialization is successful XST_FAILURE if initialization is failed
int Xbir_NwCfgNetwork (struct netif *NetIf)
{
	int Status = XST_FAILURE;
	lwip_init();
	if (!xemac_add(NetIf, NULL, NULL, NULL,
			(u8 *)Xbir_NwMacEthAddr, XBIR_PLATFORM_EMAC_BASEADDR)) {
		Xbir_Printf("ERROR: Error adding N/W interface\n\r");
		goto END;
	}
	netif_set_default(NetIf);
	Xbir_Platform_EnableInterrupts();
	netif_set_up(NetIf);
	if (Xbir_NwSetDefaultIp(&NetIf->ip_addr, &NetIf->netmask,
		&NetIf->gw) != XST_SUCCESS) {
		goto END;
	}
	Xbir_NwPrintIpCfg(&NetIf->ip_addr, &NetIf->netmask, &NetIf->gw);
	Status = XST_SUCCESS;
END:
	return Status;
}
int Xbir_NwCfgNetwork ( struct netif * NetIf ) { int Status = XST_FAILURE ; lwip_init ( ) ; if ( ! xemac_add ( NetIf , NULL , NULL , NULL , ( u8 * ) Xbir_NwMacEthAddr , XBIR_PLATFORM_EMAC_BASEADDR ) ) { Xbir_Printf ( " \n \r " ) ; goto END ; } netif_set_default ( NetIf ) ; Xbir_Platform_EnableInterrupts ( ) ; netif_set_up ( NetIf ) ; if ( Xbir_NwSetDefaultIp ( & NetIf -> ip_addr , & NetIf -> netmask , & NetIf -> gw ) != XST_SUCCESS ) { goto END ; } Xbir_NwPrintIpCfg ( & NetIf -> ip_addr , & NetIf -> netmask , & NetIf -> gw ) ; Status = XST_SUCCESS ; END : return Status ; }
@brief
 This function configures the SysBoard network and assigns default IP address
@brief This function configures the SysBoard network and assigns default IP address
/* Initialize lwip network stack */ /* Add network interface to the netif_list, and set it as default */ /* Specify that the network if(interface) is UP */ /* Assign default and fixed IP address, mask and gateway */