--- tme/ic/i825x6.c 2018/04/24 16:43:37 1.1.1.3 +++ tme/ic/i825x6.c 2018/04/24 16:45:31 1.1.1.4 @@ -1,4 +1,4 @@ -/* $Id: i825x6.c,v 1.1.1.3 2018/04/24 16:43:37 root Exp $ */ +/* $Id: i825x6.c,v 1.1.1.4 2018/04/24 16:45:31 root Exp $ */ /* ic/i825x6.c - implementation of the Intel 825x6 emulation: */ @@ -34,7 +34,7 @@ */ #include -_TME_RCSID("$Id: i825x6.c,v 1.1.1.3 2018/04/24 16:43:37 root Exp $"); +_TME_RCSID("$Id: i825x6.c,v 1.1.1.4 2018/04/24 16:45:31 root Exp $"); /* XXX FIXME - TLB usage here is not thread-safe: */ @@ -119,6 +119,10 @@ do { \ #define TME_I825X6_CALLOUT_CA TME_BIT(5) #define TME_I825X6_CALLOUT_CU TME_BIT(6) +#if 1 +extern int printf(const char *format, ...); +#endif + /* structures: */ /* an rx buffer: */ @@ -261,6 +265,10 @@ _tme_i825x6_reset(struct tme_i825x6 *i82 if (i825x6->tme_i825x6_stat_cus_rus_t & TME_I825X6_SCB_STAT_MASK) { i825x6->tme_i825x6_stat_cus_rus_t &= ~TME_I825X6_SCB_STAT_MASK; +#if 1 +printf("_tme_i825x6_reset() CALLOUT_INT\n"); +#endif + i825x6->tme_i825x6_callout_flags |= TME_I825X6_CALLOUT_INT; } @@ -697,6 +705,10 @@ _tme_i825x6_chunks_dma_tx(struct tme_i82 tme_uint32_t count; int rc; +#if 1 + printf("_tme_i825x6_chunks_dma_tx; xmit %d\n", size); +#endif + /* while we have bytes left to DMA: */ for (; size > 0; ) { @@ -777,6 +789,9 @@ _tme_i825x6_callout_ca(struct tme_i825x6 tme_uint16_t rbd_offset_first; int rc; +#if 1 +printf("_tme_i825x6_callout_ca()\n"); +#endif /* if this CA follows RESET: */ if (i825x6->tme_i825x6_ca_follows_reset) { @@ -817,6 +832,9 @@ _tme_i825x6_callout_ca(struct tme_i825x6 | TME_I825X6_SCB_RUS_IDLE); /* "The 82596 ... sends an interrupt to the CPU": */ +#if 1 +printf("_tme_i825x6_callout_ca() CALLOUT_INT\n"); +#endif i825x6->tme_i825x6_callout_flags = TME_I825X6_CALLOUTS_RUNNING | TME_I825X6_CALLOUT_INT; } @@ -1472,6 +1490,9 @@ _tme_i825x6_callout_ru(struct tme_i825x6 + TME_I825X6_RFD_C_B_OK_STATUS), c_b_ok_status); +#if 1 + printf("_tme_i825x6_callout_ru() signal int\n"); +#endif /* signal an interrupt: */ stat_cus_rus_t |= TME_I825X6_SCB_STAT_FR; @@ -1619,6 +1640,9 @@ _tme_i825x6_callout(struct tme_i825x6 *i /* unlock the mutex: */ tme_mutex_unlock(&i825x6->tme_i825x6_mutex); +#if 1 + printf("_tme_i825x6_callout; \n"); +#endif /* do the callout: */ rc = (conn_eth != NULL ? ((*conn_eth->tme_ethernet_connection_ctrl) @@ -1729,6 +1753,9 @@ _tme_i825x6_callout(struct tme_i825x6 *i & TME_I825X6_SCB_STAT_MASK) != !(stat_cus_rus_t & TME_I825X6_SCB_STAT_MASK)) { +#if 1 +printf("_tme_i825x6_callout() CALLOUT_INT\n"); +#endif i825x6->tme_i825x6_callout_flags |= TME_I825X6_CALLOUT_INT; } @@ -1763,6 +1790,9 @@ _tme_i825x6_callout(struct tme_i825x6 *i i825x6->tme_i825x6_device.tme_bus_device_connection, &i825x6->tme_i825x6_device.tme_bus_device_connection_rwlock); +#if 1 + printf("_tme_i825x6_callout; signal int - asserted %x\n", (int)int_asserted); +#endif /* call out the bus interrupt signal edge: */ rc = (*conn_bus->tme_bus_signal) (conn_bus, @@ -1777,6 +1807,9 @@ _tme_i825x6_callout(struct tme_i825x6 *i /* if this callout failed, remember that at some later time this callout should be attempted again: */ if (rc != TME_OK) { +#if 1 +printf("_tme_i825x6_callout() later CALLOUT_INT\n"); +#endif later_callouts |= TME_I825X6_CALLOUT_INT; } } @@ -1808,6 +1841,11 @@ _tme_i825x6_signal(void *_i825x6, level = signal & TME_BUS_SIGNAL_LEVEL_MASK; signal = TME_BUS_SIGNAL_WHICH(signal); +#if 1 + printf("_tme_i825x6_signal() level %x, signal %x; switch index %x\n", + (int)level, (int)signal, + (int)(signal - i825x6->tme_i825x6_bus_signals.tme_bus_signals_first)); +#endif /* dispatch on the generic bus signals: */ switch (signal) { case TME_BUS_SIGNAL_RESET: @@ -1826,6 +1864,14 @@ _tme_i825x6_signal(void *_i825x6, case TME_I825X6_SIGNAL_CA: if (level == TME_BUS_SIGNAL_LEVEL_ASSERTED) { new_callouts |= TME_I825X6_CALLOUT_CA; + } else { +#if 1 + printf("TME_I825X6_SIGNAL_CA; deasserted!!!!\n"); +#endif +#if 1 + i825x6->tme_i825x6_stat_cus_rus_t &= ~TME_I825X6_SCB_STAT_MASK; + new_callouts |= TME_I825X6_CALLOUT_INT; +#endif } break; @@ -1937,6 +1983,10 @@ _tme_i825x6_read(struct tme_ethernet_con & TME_I825X6_CB_CMD_MASK) == TME_I825X6_CB_CMD_TRANSMIT) { +#if 1 + printf("_tme_i825x6_read; xmit\n"); +#endif + /* assume that we will succeed: */ err = TME_OK; do {