summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/marvell/prestera/prestera.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethernet/marvell/prestera/prestera.h')
-rw-r--r--drivers/net/ethernet/marvell/prestera/prestera.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/drivers/net/ethernet/marvell/prestera/prestera.h b/drivers/net/ethernet/marvell/prestera/prestera.h
index 69628632e2bd..55aa4bf8a27c 100644
--- a/drivers/net/ethernet/marvell/prestera/prestera.h
+++ b/drivers/net/ethernet/marvell/prestera/prestera.h
@@ -12,6 +12,8 @@
#define PRESTERA_DRV_NAME "prestera"
+#define PRESTERA_DEFAULT_VID 1
+
struct prestera_fw_rev {
u16 maj;
u16 min;
@@ -66,11 +68,13 @@ struct prestera_port {
u32 hw_id;
u32 dev_id;
u16 fp_id;
+ u16 pvid;
bool autoneg;
u64 adver_link_modes;
u8 adver_fec;
struct prestera_port_caps caps;
struct list_head list;
+ struct list_head vlans_list;
struct {
struct prestera_port_stats stats;
struct delayed_work caching_dw;
@@ -100,6 +104,7 @@ enum prestera_event_type {
PRESTERA_EVENT_TYPE_UNSPEC,
PRESTERA_EVENT_TYPE_PORT,
+ PRESTERA_EVENT_TYPE_FDB,
PRESTERA_EVENT_TYPE_RXTX,
PRESTERA_EVENT_TYPE_MAX
@@ -122,19 +127,37 @@ struct prestera_port_event {
} data;
};
+enum prestera_fdb_event_id {
+ PRESTERA_FDB_EVENT_UNSPEC,
+ PRESTERA_FDB_EVENT_LEARNED,
+ PRESTERA_FDB_EVENT_AGED,
+};
+
+struct prestera_fdb_event {
+ u32 port_id;
+ u32 vid;
+ union {
+ u8 mac[ETH_ALEN];
+ } data;
+};
+
struct prestera_event {
u16 id;
union {
struct prestera_port_event port_evt;
+ struct prestera_fdb_event fdb_evt;
};
};
+struct prestera_switchdev;
struct prestera_rxtx;
struct prestera_switch {
struct prestera_device *dev;
+ struct prestera_switchdev *swdev;
struct prestera_rxtx *rxtx;
struct list_head event_handlers;
+ struct notifier_block netdev_nb;
char base_mac[ETH_ALEN];
struct list_head port_list;
rwlock_t port_list_lock;
@@ -172,4 +195,12 @@ struct prestera_port *prestera_port_find_by_hwid(struct prestera_switch *sw,
int prestera_port_autoneg_set(struct prestera_port *port, bool enable,
u64 adver_link_modes, u8 adver_fec);
+struct prestera_port *prestera_find_port(struct prestera_switch *sw, u32 id);
+
+struct prestera_port *prestera_port_dev_lower_find(struct net_device *dev);
+
+int prestera_port_pvid_set(struct prestera_port *port, u16 vid);
+
+bool prestera_netdev_check(const struct net_device *dev);
+
#endif /* _PRESTERA_H_ */