diff options
author | Mugunthan V N <mugunthanvnm@ti.com> | 2014-07-22 21:55:07 +0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-07-23 06:58:25 +0400 |
commit | 52c4f0ec662bbf02f1b0bcb311a48af2c8e5ee89 (patch) | |
tree | 64293c54add14d887ffcd6fa1313238f0085d2b5 /drivers/net/ethernet/ti/cpsw_ale.c | |
parent | 63502b8d01631bd41778a64c9f6b72ea409bf97b (diff) | |
download | linux-52c4f0ec662bbf02f1b0bcb311a48af2c8e5ee89.tar.xz |
drivers: net: cpsw: add support to dump ALE table via ethtool register dump
Add support to view addresses added by the driver and learnt by the
hardware from ALE table via ethtool register dump interface.
Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/ti/cpsw_ale.c')
-rw-r--r-- | drivers/net/ethernet/ti/cpsw_ale.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/net/ethernet/ti/cpsw_ale.c b/drivers/net/ethernet/ti/cpsw_ale.c index 7f893069c418..0579b2243bb6 100644 --- a/drivers/net/ethernet/ti/cpsw_ale.c +++ b/drivers/net/ethernet/ti/cpsw_ale.c @@ -25,8 +25,6 @@ #include "cpsw_ale.h" #define BITMASK(bits) (BIT(bits) - 1) -#define ALE_ENTRY_BITS 68 -#define ALE_ENTRY_WORDS DIV_ROUND_UP(ALE_ENTRY_BITS, 32) #define ALE_VERSION_MAJOR(rev) ((rev >> 8) & 0xff) #define ALE_VERSION_MINOR(rev) (rev & 0xff) @@ -763,3 +761,13 @@ int cpsw_ale_destroy(struct cpsw_ale *ale) kfree(ale); return 0; } + +void cpsw_ale_dump(struct cpsw_ale *ale, u32 *data) +{ + int i; + + for (i = 0; i < ale->params.ale_entries; i++) { + cpsw_ale_read(ale, i, data); + data += ALE_ENTRY_WORDS; + } +} |