aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/if_team.h30
1 files changed, 17 insertions, 13 deletions
diff --git a/include/linux/if_team.h b/include/linux/if_team.h
index 41163ac14ab4..6f27c841c9a8 100644
--- a/include/linux/if_team.h
+++ b/include/linux/if_team.h
@@ -71,25 +71,27 @@ enum team_option_type {
71 TEAM_OPTION_TYPE_BINARY, 71 TEAM_OPTION_TYPE_BINARY,
72}; 72};
73 73
74struct team_gsetter_ctx {
75 union {
76 u32 u32_val;
77 const char *str_val;
78 struct {
79 const void *ptr;
80 u32 len;
81 } bin_val;
82 } data;
83 struct team_port *port;
84};
85
74struct team_option { 86struct team_option {
75 struct list_head list; 87 struct list_head list;
76 const char *name; 88 const char *name;
89 bool per_port;
77 enum team_option_type type; 90 enum team_option_type type;
78 int (*getter)(struct team *team, void *arg); 91 int (*getter)(struct team *team, struct team_gsetter_ctx *ctx);
79 int (*setter)(struct team *team, void *arg); 92 int (*setter)(struct team *team, struct team_gsetter_ctx *ctx);
80
81 /* Custom gennetlink interface related flags */
82 bool changed;
83 bool removed;
84}; 93};
85 94
86struct team_option_binary {
87 u32 data_len;
88 void *data;
89};
90
91#define team_optarg_tbinary(arg) (*((struct team_option_binary **) arg))
92
93struct team_mode { 95struct team_mode {
94 struct list_head list; 96 struct list_head list;
95 const char *kind; 97 const char *kind;
@@ -118,6 +120,7 @@ struct team {
118 struct list_head port_list; 120 struct list_head port_list;
119 121
120 struct list_head option_list; 122 struct list_head option_list;
123 struct list_head option_inst_list; /* list of option instances */
121 124
122 const struct team_mode *mode; 125 const struct team_mode *mode;
123 struct team_mode_ops ops; 126 struct team_mode_ops ops;
@@ -224,6 +227,7 @@ enum {
224 TEAM_ATTR_OPTION_TYPE, /* u8 */ 227 TEAM_ATTR_OPTION_TYPE, /* u8 */
225 TEAM_ATTR_OPTION_DATA, /* dynamic */ 228 TEAM_ATTR_OPTION_DATA, /* dynamic */
226 TEAM_ATTR_OPTION_REMOVED, /* flag */ 229 TEAM_ATTR_OPTION_REMOVED, /* flag */
230 TEAM_ATTR_OPTION_PORT_IFINDEX, /* u32 */ /* for per-port options */
227 231
228 __TEAM_ATTR_OPTION_MAX, 232 __TEAM_ATTR_OPTION_MAX,
229 TEAM_ATTR_OPTION_MAX = __TEAM_ATTR_OPTION_MAX - 1, 233 TEAM_ATTR_OPTION_MAX = __TEAM_ATTR_OPTION_MAX - 1,