diff options
author | till straumann <till.straumann@alumni.tu-berlin.de> | 2021-03-11 17:39:05 +0100 |
---|---|---|
committer | Vijay Kumar Banerjee <vijay@rtems.org> | 2021-03-17 19:53:52 -0600 |
commit | 4e914bd7af385fa35811576cd706e5779f32df5a (patch) | |
tree | b9ab7905bee6134bef6184278a0a869abd7c7940 | |
parent | 0a9186985f84008efd1a37547db6790f3d384364 (diff) |
mv643xx_nexus.c: added a helper routine that allows printing of driver statistics
The 'legal' access by means of a special ioctl() is way too cumbersome
when you need to do quick diagnosis.
Update #4345
-rw-r--r-- | rtemsbsd/sys/dev/mve/mv643xx_nexus.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/rtemsbsd/sys/dev/mve/mv643xx_nexus.c b/rtemsbsd/sys/dev/mve/mv643xx_nexus.c index e72fe98c..9bca4d77 100644 --- a/rtemsbsd/sys/dev/mve/mv643xx_nexus.c +++ b/rtemsbsd/sys/dev/mve/mv643xx_nexus.c @@ -171,6 +171,8 @@ struct mve_enet_softc { int oif_flags; }; +static struct mve_enet_softc * ifaces[MV643XXETH_NUM_DRIVER_SLOTS] = { 0 }; + typedef struct MveMbufIter { MveEthBufIter it; struct mbuf *next; @@ -695,6 +697,18 @@ int f, df; return err; } +/* SIO RTEMS_SHOW_STATS is too cumbersome to use -- for debugging, provide direct hack */ +int +mv643xx_nexus_dump_stats(int unit, FILE *f) +{ + if ( unit < 0 || unit >= MV643XXETH_NUM_DRIVER_SLOTS || ! ifaces[unit] ) + return -EINVAL; + if ( ! f ) + f = stdout; + BSP_mve_dump_stats(ifaces[unit]->mp, f); + return 0; +} + /* * Used to update speed settings in the hardware * when the phy setup changes. @@ -840,6 +854,8 @@ int tx_q_size = MV643XX_TX_QUEUE_SIZE; printk(DRVNAME": mve_attach (leaving)\n"); #endif + ifaces[unit] = sc; + return 0; } |