summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/ti/cpsw_ale.c
diff options
context:
space:
mode:
authorGrygorii Strashko <grygorii.strashko@ti.com>2020-09-10 23:27:59 +0300
committerDavid S. Miller <davem@davemloft.net>2020-09-11 17:34:39 -0700
commitb574bf0c6a8da461dcbe1c266ddd7e5ee10584a1 (patch)
tree6750bc1de3518bda20085ce019fb47451ed9618a /drivers/net/ethernet/ti/cpsw_ale.c
parentc4f3341700c51948cbfb2a37e7ff6d9b43eb1ce2 (diff)
downloadlinux-b574bf0c6a8da461dcbe1c266ddd7e5ee10584a1.tar.gz
linux-b574bf0c6a8da461dcbe1c266ddd7e5ee10584a1.tar.bz2
linux-b574bf0c6a8da461dcbe1c266ddd7e5ee10584a1.zip
net: ethernet: ti: ale: add cpsw_ale_get_num_entries api
Add cpsw_ale_get_num_entries() API to return number of ALE table entries and update existing drivers to use it. Signed-off-by: Grygorii Strashko <grygorii.strashko@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.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/ethernet/ti/cpsw_ale.c b/drivers/net/ethernet/ti/cpsw_ale.c
index 9ad872bfae3a..a94aef3f54a5 100644
--- a/drivers/net/ethernet/ti/cpsw_ale.c
+++ b/drivers/net/ethernet/ti/cpsw_ale.c
@@ -1079,3 +1079,8 @@ void cpsw_ale_dump(struct cpsw_ale *ale, u32 *data)
data += ALE_ENTRY_WORDS;
}
}
+
+u32 cpsw_ale_get_num_entries(struct cpsw_ale *ale)
+{
+ return ale ? ale->params.ale_entries : 0;
+}