void xemacif_input(struct netif *netif) { struct xemac_s *emac = (struct xemac_s *)netif->state; SYS_ARCH_DECL_PROTECT(lev); switch (emac->type) { case xemac_type_xps_emaclite: #ifdef XLWIP_CONFIG_INCLUDE_EMACLITE SYS_ARCH_PROTECT(lev); xemacliteif_input(netif); SYS_ARCH_UNPROTECT(lev); break; #else print("incorrect configuration: xps_ethernetlite drivers not present?"); while(1); return; #endif case xemac_type_xps_ll_temac: #ifdef XLWIP_CONFIG_INCLUDE_TEMAC SYS_ARCH_PROTECT(lev); xlltemacif_input(netif); SYS_ARCH_UNPROTECT(lev); break; #else print("incorrect configuration: xps_ll_temac drivers not present?"); while(1); return; #endif default: print("incorrect configuration: unknown temac type"); while(1); return; } }
int xemacif_input(struct netif *netif) { struct xemac_s *emac = (struct xemac_s *)netif->state; SYS_ARCH_DECL_PROTECT(lev); int n_packets = 0; switch (emac->type) { case xemac_type_xps_emaclite: #ifdef XLWIP_CONFIG_INCLUDE_EMACLITE SYS_ARCH_PROTECT(lev); n_packets = xemacliteif_input(netif); SYS_ARCH_UNPROTECT(lev); break; #else print("incorrect configuration: xps_ethernetlite drivers not present?"); while(1); return 0; #endif case xemac_type_xps_ll_temac: #ifdef XLWIP_CONFIG_INCLUDE_TEMAC SYS_ARCH_PROTECT(lev); n_packets = xlltemacif_input(netif); SYS_ARCH_UNPROTECT(lev); break; #else print("incorrect configuration: xps_ll_temac drivers not present?"); while(1); return 0; #endif case xemac_type_axi_ethernet: #ifdef XLWIP_CONFIG_INCLUDE_AXI_ETHERNET SYS_ARCH_PROTECT(lev); n_packets = xaxiemacif_input(netif); SYS_ARCH_UNPROTECT(lev); break; #else print("incorrect configuration: axi_ethernet drivers not present?"); while(1); return 0; #endif #ifdef __arm__ case xemac_type_emacps: #ifdef XLWIP_CONFIG_INCLUDE_GEM SYS_ARCH_PROTECT(lev); n_packets = xemacpsif_input(netif); SYS_ARCH_UNPROTECT(lev); break; #else xil_printf("incorrect configuration: ps7_ethernet drivers not present?\r\n"); while(1); return 0; #endif #endif default: print("incorrect configuration: unknown temac type"); while(1); return 0; } return n_packets; }