diff options
-rw-r--r-- | drivers/net/team/team.c | 12 | ||||
-rw-r--r-- | include/linux/if_team.h | 2 |
2 files changed, 14 insertions, 0 deletions
diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c index 87707ab39430..70752e631a12 100644 --- a/drivers/net/team/team.c +++ b/drivers/net/team/team.c | |||
@@ -1787,6 +1787,12 @@ static int team_nl_fill_one_option_get(struct sk_buff *skb, struct team *team, | |||
1787 | nla_put_flag(skb, TEAM_ATTR_OPTION_DATA)) | 1787 | nla_put_flag(skb, TEAM_ATTR_OPTION_DATA)) |
1788 | goto nest_cancel; | 1788 | goto nest_cancel; |
1789 | break; | 1789 | break; |
1790 | case TEAM_OPTION_TYPE_S32: | ||
1791 | if (nla_put_u8(skb, TEAM_ATTR_OPTION_TYPE, NLA_S32)) | ||
1792 | goto nest_cancel; | ||
1793 | if (nla_put_s32(skb, TEAM_ATTR_OPTION_DATA, ctx.data.s32_val)) | ||
1794 | goto nest_cancel; | ||
1795 | break; | ||
1790 | default: | 1796 | default: |
1791 | BUG(); | 1797 | BUG(); |
1792 | } | 1798 | } |
@@ -1975,6 +1981,9 @@ static int team_nl_cmd_options_set(struct sk_buff *skb, struct genl_info *info) | |||
1975 | case NLA_FLAG: | 1981 | case NLA_FLAG: |
1976 | opt_type = TEAM_OPTION_TYPE_BOOL; | 1982 | opt_type = TEAM_OPTION_TYPE_BOOL; |
1977 | break; | 1983 | break; |
1984 | case NLA_S32: | ||
1985 | opt_type = TEAM_OPTION_TYPE_S32; | ||
1986 | break; | ||
1978 | default: | 1987 | default: |
1979 | goto team_put; | 1988 | goto team_put; |
1980 | } | 1989 | } |
@@ -2031,6 +2040,9 @@ static int team_nl_cmd_options_set(struct sk_buff *skb, struct genl_info *info) | |||
2031 | case TEAM_OPTION_TYPE_BOOL: | 2040 | case TEAM_OPTION_TYPE_BOOL: |
2032 | ctx.data.bool_val = attr_data ? true : false; | 2041 | ctx.data.bool_val = attr_data ? true : false; |
2033 | break; | 2042 | break; |
2043 | case TEAM_OPTION_TYPE_S32: | ||
2044 | ctx.data.s32_val = nla_get_s32(attr_data); | ||
2045 | break; | ||
2034 | default: | 2046 | default: |
2035 | BUG(); | 2047 | BUG(); |
2036 | } | 2048 | } |
diff --git a/include/linux/if_team.h b/include/linux/if_team.h index 6960fc1841a7..e5571c420800 100644 --- a/include/linux/if_team.h +++ b/include/linux/if_team.h | |||
@@ -130,6 +130,7 @@ enum team_option_type { | |||
130 | TEAM_OPTION_TYPE_STRING, | 130 | TEAM_OPTION_TYPE_STRING, |
131 | TEAM_OPTION_TYPE_BINARY, | 131 | TEAM_OPTION_TYPE_BINARY, |
132 | TEAM_OPTION_TYPE_BOOL, | 132 | TEAM_OPTION_TYPE_BOOL, |
133 | TEAM_OPTION_TYPE_S32, | ||
133 | }; | 134 | }; |
134 | 135 | ||
135 | struct team_option_inst_info { | 136 | struct team_option_inst_info { |
@@ -146,6 +147,7 @@ struct team_gsetter_ctx { | |||
146 | u32 len; | 147 | u32 len; |
147 | } bin_val; | 148 | } bin_val; |
148 | bool bool_val; | 149 | bool bool_val; |
150 | s32 s32_val; | ||
149 | } data; | 151 | } data; |
150 | struct team_option_inst_info *info; | 152 | struct team_option_inst_info *info; |
151 | }; | 153 | }; |