FreeBSD/sys/dev/e1000/if_em.c
/*
** This routine is meant to be fluid, add whatever is
** needed for debugging a problem.  -jfv
*/
This routine is meant to be fluid, add whatever is
needed for debugging a problem.  -jfv
This routine is meant to be fluid add whatever is needed for debugging a problem . - jfv
static void
em_print_debug_info(struct adapter *adapter)
{
	device_t dev = adapter->dev;
	struct tx_ring *txr = adapter->tx_rings;
	struct rx_ring *rxr = adapter->rx_rings;
	if (if_getdrvflags(adapter->ifp) & IFF_DRV_RUNNING)
		printf("Interface is RUNNING ");
	else
		printf("Interface is NOT RUNNING\n");
	if (if_getdrvflags(adapter->ifp) & IFF_DRV_OACTIVE)
		printf("and INACTIVE\n");
	else
		printf("and ACTIVE\n");
	for (int i = 0; i < adapter->num_queues; i++, txr++, rxr++) {
		device_printf(dev, "TX Queue %d ------\n", i);
		device_printf(dev, "hw tdh = %d, hw tdt = %d\n",
	    		E1000_READ_REG(&adapter->hw, E1000_TDH(i)),
	    		E1000_READ_REG(&adapter->hw, E1000_TDT(i)));
		device_printf(dev, "Tx Queue Status = %d\n", txr->busy);
		device_printf(dev, "TX descriptors avail = %d\n",
	    		txr->tx_avail);
		device_printf(dev, "Tx Descriptors avail failure = %ld\n",
	    		txr->no_desc_avail);
		device_printf(dev, "RX Queue %d ------\n", i);
		device_printf(dev, "hw rdh = %d, hw rdt = %d\n",
	    		E1000_READ_REG(&adapter->hw, E1000_RDH(i)),
	    		E1000_READ_REG(&adapter->hw, E1000_RDT(i)));
		device_printf(dev, "RX discarded packets = %ld\n",
	    		rxr->rx_discarded);
		device_printf(dev, "RX Next to Check = %d\n", rxr->next_to_check);
		device_printf(dev, "RX Next to Refresh = %d\n", rxr->next_to_refresh);
	}
}
static void em_print_debug_info ( struct adapter * adapter ) { device_t dev = adapter -> dev ; struct tx_ring * txr = adapter -> tx_rings ; struct rx_ring * rxr = adapter -> rx_rings ; if ( if_getdrvflags ( adapter -> ifp ) & IFF_DRV_RUNNING ) printf ( " " ) ; else printf ( " \n " ) ; if ( if_getdrvflags ( adapter -> ifp ) & IFF_DRV_OACTIVE ) printf ( " \n " ) ; else printf ( " \n " ) ; for ( int i = 0 ; i < adapter -> num_queues ; i ++ , txr ++ , rxr ++ ) { device_printf ( dev , " \n " , i ) ; device_printf ( dev , " \n " , E1000_READ_REG ( & adapter -> hw , E1000_TDH ( i ) ) , E1000_READ_REG ( & adapter -> hw , E1000_TDT ( i ) ) ) ; device_printf ( dev , " \n " , txr -> busy ) ; device_printf ( dev , " \n " , txr -> tx_avail ) ; device_printf ( dev , " \n " , txr -> no_desc_avail ) ; device_printf ( dev , " \n " , i ) ; device_printf ( dev , " \n " , E1000_READ_REG ( & adapter -> hw , E1000_RDH ( i ) ) , E1000_READ_REG ( & adapter -> hw , E1000_RDT ( i ) ) ) ; device_printf ( dev , " \n " , rxr -> rx_discarded ) ; device_printf ( dev , " \n " , rxr -> next_to_check ) ; device_printf ( dev , " \n " , rxr -> next_to_refresh ) ; } }
This routine is meant to be fluid, add whatever is
needed for debugging a problem.
This routine is meant to be fluid add whatever is needed for debugging a problem .