soc: rockchip: add virtual poweroff support
[firefly-linux-kernel-4.4.55.git] / include / linux / if_team.h
index 25b8b15197b008635c9eb354ba3f2baf3c367886..a6aa970758a22065901f861dd29d4b14110bbe3b 100644 (file)
@@ -10,9 +10,9 @@
 #ifndef _LINUX_IF_TEAM_H_
 #define _LINUX_IF_TEAM_H_
 
-
 #include <linux/netpoll.h>
 #include <net/sch_generic.h>
+#include <linux/types.h>
 #include <uapi/linux/if_team.h>
 
 struct team_pcpu_stats {
@@ -69,6 +69,7 @@ struct team_port {
        s32 priority; /* lower number ~ higher priority */
        u16 queue_id;
        struct list_head qom_list; /* node in queue override mapping list */
+       struct rcu_head rcu;
        long mode_priv[0];
 };
 
@@ -194,6 +195,18 @@ struct team {
        bool queue_override_enabled;
        struct list_head *qom_lists; /* array of queue override mapping lists */
        bool port_mtu_change_allowed;
+       struct {
+               unsigned int count;
+               unsigned int interval; /* in ms */
+               atomic_t count_pending;
+               struct delayed_work dw;
+       } notify_peers;
+       struct {
+               unsigned int count;
+               unsigned int interval; /* in ms */
+               atomic_t count_pending;
+               struct delayed_work dw;
+       } mcast_rejoin;
        long mode_priv[TEAM_MODE_PRIV_LONGS];
 };
 
@@ -229,6 +242,16 @@ static inline struct team_port *team_get_port_by_index(struct team *team,
                        return port;
        return NULL;
 }
+
+static inline int team_num_to_port_index(struct team *team, int num)
+{
+       int en_port_count = ACCESS_ONCE(team->en_port_count);
+
+       if (unlikely(!en_port_count))
+               return 0;
+       return num % en_port_count;
+}
+
 static inline struct team_port *team_get_port_by_index_rcu(struct team *team,
                                                           int port_index)
 {