diff options
author | Jiri Pirko <jpirko@redhat.com> | 2012-06-19 01:54:10 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-06-19 18:00:23 -0400 |
commit | 85d59a87248de90e3266e10dce99477b60f524c0 (patch) | |
tree | 1642b59a05a69acdf8e9f754bce19864f3f66cbe /include/linux/if_team.h | |
parent | 0d572e45f7f8ae3a27c82c5f0e352abf1dcb67f4 (diff) |
team: push array_index and port into separate structure
Introduce struct team_option_inst_info and push option instance info
there. It can be then easily passed to gsetter context and used for
feature async option changes.
Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/if_team.h')
-rw-r--r-- | include/linux/if_team.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/include/linux/if_team.h b/include/linux/if_team.h index b1719e239a0b..30854cb0c855 100644 --- a/include/linux/if_team.h +++ b/include/linux/if_team.h | |||
@@ -83,6 +83,11 @@ enum team_option_type { | |||
83 | TEAM_OPTION_TYPE_BOOL, | 83 | TEAM_OPTION_TYPE_BOOL, |
84 | }; | 84 | }; |
85 | 85 | ||
86 | struct team_option_inst_info { | ||
87 | u32 array_index; | ||
88 | struct team_port *port; /* != NULL if per-port */ | ||
89 | }; | ||
90 | |||
86 | struct team_gsetter_ctx { | 91 | struct team_gsetter_ctx { |
87 | union { | 92 | union { |
88 | u32 u32_val; | 93 | u32 u32_val; |
@@ -93,8 +98,7 @@ struct team_gsetter_ctx { | |||
93 | } bin_val; | 98 | } bin_val; |
94 | bool bool_val; | 99 | bool bool_val; |
95 | } data; | 100 | } data; |
96 | u32 array_index; | 101 | struct team_option_inst_info *info; |
97 | struct team_port *port; | ||
98 | }; | 102 | }; |
99 | 103 | ||
100 | struct team_option { | 104 | struct team_option { |
@@ -103,6 +107,7 @@ struct team_option { | |||
103 | bool per_port; | 107 | bool per_port; |
104 | unsigned int array_size; /* != 0 means the option is array */ | 108 | unsigned int array_size; /* != 0 means the option is array */ |
105 | enum team_option_type type; | 109 | enum team_option_type type; |
110 | int (*init)(struct team *team, struct team_option_inst_info *info); | ||
106 | int (*getter)(struct team *team, struct team_gsetter_ctx *ctx); | 111 | int (*getter)(struct team *team, struct team_gsetter_ctx *ctx); |
107 | int (*setter)(struct team *team, struct team_gsetter_ctx *ctx); | 112 | int (*setter)(struct team *team, struct team_gsetter_ctx *ctx); |
108 | }; | 113 | }; |