Commit c44768e0 authored by David S. Miller's avatar David S. Miller

Merge branch 'dsa-lan9303-Add-fdb-mdb-methods'

Egil Hjelmeland says:

====================
net: dsa: lan9303: Add fdb/mdb methods

This series add support for accessing and managing the lan9303 ALR
(Address Logic Resolution).

The first patch add low level functions for accessing the ALR, along
with port_fast_age and port_fdb_dump methods.

The second patch add functions for managing ALR entires, along with
remaining fdb/mdb methods.

Note that to complete STP support, a special ALR entry with the STP eth
address must be added too. This must be addressed later.

Comments welcome!

Changes v2 -> v3:
 - Whitespace polishing. Removed some "section" comments.
 - Prefixed ALR constants with LAN9303_ for consistency.
 - Patch 2: lan9303_port_fast_age() wrap the "port" into a struct for passing
   as context to alr_loop_cb_del_port_learned. Safer in event of type change.
 - Patch 2: Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>

Changes v1 -> v2:
 - Patch 2: Removed question comment
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 0d5fcebf 0620427e
This diff is collapsed.
......@@ -11,6 +11,13 @@ struct lan9303_phy_ops {
int regnum, u16 val);
};
#define LAN9303_NUM_ALR_RECORDS 512
struct lan9303_alr_cache_entry {
u8 mac_addr[ETH_ALEN];
u8 port_map; /* Bitmap of ports. Zero if unused entry */
u8 stp_override; /* non zero if set ALR_DAT1_AGE_OVERRID */
};
struct lan9303 {
struct device *dev;
struct regmap *regmap;
......@@ -23,6 +30,10 @@ struct lan9303 {
const struct lan9303_phy_ops *ops;
bool is_bridged; /* true if port 1 and 2 are bridged */
u32 swe_port_state; /* remember SWE_PORT_STATE while not bridged */
/* LAN9303 do not offer reading specific ALR entry. Cache all
* static entries in a flat table
**/
struct lan9303_alr_cache_entry alr_cache[LAN9303_NUM_ALR_RECORDS];
};
extern const struct regmap_access_table lan9303_register_set;
......
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