Commit aa61296c authored by Grygorii Strashko's avatar Grygorii Strashko Committed by David S. Miller

net: ethernet: ti: ale: switch to use tables for vlan entry description

The ALE VLAN entries are too much differ between different TI CPSW ALE
versions. So, handling them using flags, defines and get/set functions
became over-complicated.

This patch introduces tables to describe the ALE VLAN entries fields, which
are different between TI CPSW ALE versions, and new get/set access
functions. It also allows to detect incorrect access to not available ALL
entry fields.
Signed-off-by: default avatarGrygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 23015ff1
This diff is collapsed.
...@@ -28,6 +28,8 @@ struct cpsw_ale_params { ...@@ -28,6 +28,8 @@ struct cpsw_ale_params {
unsigned long bus_freq; unsigned long bus_freq;
}; };
struct ale_entry_fld;
struct cpsw_ale { struct cpsw_ale {
struct cpsw_ale_params params; struct cpsw_ale_params params;
struct timer_list timer; struct timer_list timer;
...@@ -39,6 +41,7 @@ struct cpsw_ale { ...@@ -39,6 +41,7 @@ struct cpsw_ale {
u32 port_num_bits; u32 port_num_bits;
u32 vlan_field_bits; u32 vlan_field_bits;
unsigned long *p0_untag_vid_mask; unsigned long *p0_untag_vid_mask;
const struct ale_entry_fld *vlan_entry_tbl;
}; };
enum cpsw_ale_control { enum cpsw_ale_control {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment