/* ******************************************************************** Statistic. return statistics about the device interface This routine is called by user code that wishes to inspect driver statistics. We call this routine in the demo program. It is not absolutely necessary to implement such a function (Leave it empty.), but it is a handy debugging tool. The address of this function must be placed into the "devices" table in iface.c either at compile time or before a device open is called. Non packet drivers should behave the same way. ******************************************************************** */ RTP_BOOL loop_statistics(PIFACE pi) { NATIVE_PROFILE_HAL_DRIVERS_ETHERNET(); #if (!INCLUDE_KEEP_STATS) ARGSUSED_PVOID(pi) #endif UPDATE_SET_INFO(pi, interface_packets_in, loop_packets_in) UPDATE_SET_INFO(pi, interface_packets_out, loop_packets_out) UPDATE_SET_INFO(pi, interface_bytes_in, loop_bytes_in) UPDATE_SET_INFO(pi, interface_bytes_out, loop_bytes_out) UPDATE_SET_INFO(pi, interface_errors_in, loop_errors_in) UPDATE_SET_INFO(pi, interface_errors_out, loop_errors_out) UPDATE_SET_INFO(pi, interface_packets_lost, 0L) return(RTP_TRUE); }
/* ******************************************************************** */ RTIP_BOOLEAN r8139_statistics(PIFACE pi) /*__fn__*/ { PETHER_STATS p; PR8139_SOFTC sc; sc = iface_to_r8139_softc(pi); if (!sc) return(FALSE); p = (PETHER_STATS) &(sc->stats); UPDATE_SET_INFO(pi,interface_packets_in, p->packets_in) UPDATE_SET_INFO(pi,interface_packets_out, p->packets_out) UPDATE_SET_INFO(pi,interface_bytes_in, p->bytes_in) UPDATE_SET_INFO(pi,interface_bytes_out, p->bytes_out) UPDATE_SET_INFO(pi,interface_errors_in, p->errors_in) UPDATE_SET_INFO(pi,interface_errors_out, p->errors_out) UPDATE_SET_INFO(pi,interface_packets_lost, p->packets_lost) return(TRUE); }