[PATCH rtems 11/18] mv643xx_eth.c, mv643xx_eth_bsdnet.c: added some more debugging messages (#ifdef)

Vijay Kumar Banerjee vijay at rtems.org
Tue Mar 30 01:27:43 UTC 2021


From: till straumann <till.straumann at alumni.tu-berlin.de>

Update #4344
---
 bsps/powerpc/beatnik/net/if_mve/mv643xx_eth.c     | 15 ++++++++++++++-
 .../beatnik/net/if_mve/mv643xx_eth_bsdnet.c       | 13 +++++++++++++
 2 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/bsps/powerpc/beatnik/net/if_mve/mv643xx_eth.c b/bsps/powerpc/beatnik/net/if_mve/mv643xx_eth.c
index 35ef6622d9..82ecf5ffa4 100644
--- a/bsps/powerpc/beatnik/net/if_mve/mv643xx_eth.c
+++ b/bsps/powerpc/beatnik/net/if_mve/mv643xx_eth.c
@@ -908,6 +908,7 @@ static inline uint32_t
 mveth_ack_irqs(struct mveth_private *mp, uint32_t mask)
 {
 register uint32_t x,xe,p;
+register uint32_t rval;
 
 		p  = mp->port_num;
 		/* Get cause */
@@ -943,13 +944,21 @@ register uint32_t x,xe,p;
 		/* luckily, the extended and 'normal' interrupts we use don't overlap so
 		 * we can just OR them into a single word
 		 */
-		return  (xe & mp->xirq_mask) | (x & mp->irq_mask);
+		rval = (xe & mp->xirq_mask) | (x & mp->irq_mask);
+
+#ifdef MVETH_DEBUG
+		printk(DRVNAME"%i: mveth_ack_irqs 0x%08x\n", rval);
+#endif
+		return rval;
 }
 
 static void mveth_isr(rtems_irq_hdl_param arg)
 {
 struct mveth_private *mp   = (struct mveth_private*) arg;
 
+#ifdef MVETH_DEBUG
+	printk(DRVNAME": mveth_isr\n");
+#endif
 	mp->stats.irqs++;
 	mp->isr(mp->isr_arg);
 }
@@ -1577,6 +1586,10 @@ BSP_mve_update_serial_port(struct mveth_private *mp, int media)
 int port = mp->port_num;
 uint32_t old, new;
 
+#ifdef MVETH_DEBUG
+	printk(DRVNAME"%i: Entering BSP_mve_update_serial_port()\n");
+#endif
+
 	new = old = MV_READ(MV643XX_ETH_SERIAL_CONTROL_R(port));
 
 	/* mask speed and duplex settings */
diff --git a/bsps/powerpc/beatnik/net/if_mve/mv643xx_eth_bsdnet.c b/bsps/powerpc/beatnik/net/if_mve/mv643xx_eth_bsdnet.c
index cdec5c6e14..308b992479 100644
--- a/bsps/powerpc/beatnik/net/if_mve/mv643xx_eth_bsdnet.c
+++ b/bsps/powerpc/beatnik/net/if_mve/mv643xx_eth_bsdnet.c
@@ -884,8 +884,17 @@ struct mveth_softc	*sc;
 struct ifnet		*ifp;
 rtems_event_set		evs;
 int                 avail;
+
+#ifdef MVETH_DEBUG
+	sleep(1);
+	printk(DRVNAME": bsdnet mveth_daemon started\n");
+#endif
+
 	for (;;) {
 		rtems_bsdnet_event_receive( 7, RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &evs );
+#ifdef MVETH_DEBUG
+		printk(DRVNAME": bsdnet mveth_daemon event received 0x%x\n", evs);
+#endif
 		evs &= 7;
 		for ( sc = theMvEths; evs; evs>>=1, sc++ ) {
 			if ( (evs & 1) ) {
@@ -976,6 +985,10 @@ struct	ifnet		*ifp;
 			mveth_tid = rtems_bsdnet_newproc("MVEd", 4096, mveth_daemon, 0);
 		}
 
+#ifdef MVETH_DEBUG
+		printk(DRVNAME": daemon created; id 0x%08x\n", mveth_tid);
+#endif
+
 		if ( 0 == ifcfg->rbuf_count ) {
 			ifcfg->rbuf_count = MV643XX_RX_RING_SIZE;
 		}
-- 
2.26.2



More information about the devel mailing list