]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: rtl8366rb: standardize init jam tables
authorLorenzo Carletti <lorenzo.carletti98@gmail.com>
Wed, 27 Jan 2021 01:06:32 +0000 (02:06 +0100)
committerJakub Kicinski <kuba@kernel.org>
Thu, 28 Jan 2021 04:21:20 +0000 (20:21 -0800)
commit795e0a353c5ef3c488aed58bba3772bbb0e3a58a
tree9f1070b4489a8daaa4944568ea168b745001b55e
parent8733bc64ee3df1d1fc5dd2b33a0b0593be2be94a
net: dsa: rtl8366rb: standardize init jam tables

In the rtl8366rb driver there are some jam tables which contain
undocumented values.
While trying to understand what these tables actually do,
I noticed a discrepancy in how one of those was treated.
Most of them were plain u16 arrays, while the ethernet one was
an u16 matrix.
By looking at the vendor's droplets of source code these tables came from,
I found out that they were all originally u16 matrixes.

This commit standardizes the jam tables, turning them all into
jam_tbl_entry arrays. Each entry contains 2 u16 values.
This change makes it easier to understand how the jam tables are used
and also makes it possible for a single function to handle all of them,
removing some duplicated code.

Signed-off-by: Lorenzo Carletti <lorenzo.carletti98@gmail.com>
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/dsa/rtl8366rb.c