aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/team
diff options
context:
space:
mode:
authorJiri Pirko <jiri@resnulli.us>2012-07-27 02:28:53 -0400
committerDavid S. Miller <davem@davemloft.net>2012-08-03 23:40:11 -0400
commit69821638b27407d8648cb04de01b06b30a291bde (patch)
tree114b3613dd57146fe4da2b55947649c29c8b14da /drivers/net/team
parent4778e0be16c291ba6d9d55eeff3a6764fc84a071 (diff)
team: add signed 32-bit team option type
Signed-off-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/team')
-rw-r--r--drivers/net/team/team.c12
1 files changed, 12 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 }