Skip to content

Commit

Permalink
stmmac: enhance mmc counter management
Browse files Browse the repository at this point in the history
For gmac3, the MMC addr map is: 0x100 - 0x2fc
For gmac4, the MMC addr map is: 0x700 - 0x8fc

So instead of adding 0x600 to the IO address when setup the mmc,
the RMON base address is saved inside the private structure and
then used to manage the counters.

Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: Alexandre TORGUE <alexandre.torgue@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Alexandre TORGUE authored and David S. Miller committed Apr 3, 2016
1 parent 477286b commit 36ff7c1
Show file tree
Hide file tree
Showing 5 changed files with 188 additions and 176 deletions.
4 changes: 4 additions & 0 deletions drivers/net/ethernet/stmicro/stmmac/mmc.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
* current value.*/
#define MMC_CNTRL_PRESET 0x10
#define MMC_CNTRL_FULL_HALF_PRESET 0x20

#define MMC_GMAC4_OFFSET 0x700
#define MMC_GMAC3_X_OFFSET 0x100

struct stmmac_counters {
unsigned int mmc_tx_octetcount_gb;
unsigned int mmc_tx_framecount_gb;
Expand Down
Loading

0 comments on commit 36ff7c1

Please sign in to comment.