diff options
| -rw-r--r-- | drivers/net/team/team.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c index fe7ca40284fa..c61ae35a53ce 100644 --- a/drivers/net/team/team.c +++ b/drivers/net/team/team.c | |||
| @@ -904,6 +904,23 @@ static int team_mode_option_set(struct team *team, struct team_gsetter_ctx *ctx) | |||
| 904 | return team_change_mode(team, ctx->data.str_val); | 904 | return team_change_mode(team, ctx->data.str_val); |
| 905 | } | 905 | } |
| 906 | 906 | ||
| 907 | static int team_port_en_option_get(struct team *team, | ||
| 908 | struct team_gsetter_ctx *ctx) | ||
| 909 | { | ||
| 910 | ctx->data.bool_val = team_port_enabled(ctx->port); | ||
| 911 | return 0; | ||
| 912 | } | ||
| 913 | |||
| 914 | static int team_port_en_option_set(struct team *team, | ||
| 915 | struct team_gsetter_ctx *ctx) | ||
| 916 | { | ||
| 917 | if (ctx->data.bool_val) | ||
| 918 | team_port_enable(team, ctx->port); | ||
| 919 | else | ||
| 920 | team_port_disable(team, ctx->port); | ||
| 921 | return 0; | ||
| 922 | } | ||
| 923 | |||
| 907 | static int team_user_linkup_option_get(struct team *team, | 924 | static int team_user_linkup_option_get(struct team *team, |
| 908 | struct team_gsetter_ctx *ctx) | 925 | struct team_gsetter_ctx *ctx) |
| 909 | { | 926 | { |
| @@ -946,6 +963,13 @@ static const struct team_option team_options[] = { | |||
| 946 | .setter = team_mode_option_set, | 963 | .setter = team_mode_option_set, |
| 947 | }, | 964 | }, |
| 948 | { | 965 | { |
| 966 | .name = "enabled", | ||
| 967 | .type = TEAM_OPTION_TYPE_BOOL, | ||
| 968 | .per_port = true, | ||
| 969 | .getter = team_port_en_option_get, | ||
| 970 | .setter = team_port_en_option_set, | ||
| 971 | }, | ||
| 972 | { | ||
| 949 | .name = "user_linkup", | 973 | .name = "user_linkup", |
| 950 | .type = TEAM_OPTION_TYPE_BOOL, | 974 | .type = TEAM_OPTION_TYPE_BOOL, |
| 951 | .per_port = true, | 975 | .per_port = true, |
