diff options
author | Roopa Prabhu <roprabhu@cisco.com> | 2010-12-08 08:53:58 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-12-10 18:42:21 -0500 |
commit | 0b1c00fc3e9f8d658e0632da7e7ee57bed779ec7 (patch) | |
tree | 3dc6bd6f7b0cde427c1527e5771ad78f40980eab /drivers/net/enic/enic_main.c | |
parent | 319d7e847355ec7e03d3c865917b2b0e2e592fb8 (diff) |
enic: Add ndo_set_vf_mac support for enic dynamic devices
This patch implements the ndo_set_vf_mac netdev operation for enic
dynamic devices. It treats the mac address set by IFLA_VF_MAC as a
special case to use it in the port profile provisioning data.
Signed-off-by: Roopa Prabhu <roprabhu@cisco.com>
Signed-off-by: David Wang <dwang2@cisco.com>
Signed-off-by: Christian Benvenuti <benve@cisco.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/enic/enic_main.c')
-rw-r--r-- | drivers/net/enic/enic_main.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c index 1931f156777c..ddeffb5192ae 100644 --- a/drivers/net/enic/enic_main.c +++ b/drivers/net/enic/enic_main.c | |||
@@ -1231,6 +1231,23 @@ static int enic_dev_init_done(struct enic *enic, int *done, int *error) | |||
1231 | return err; | 1231 | return err; |
1232 | } | 1232 | } |
1233 | 1233 | ||
1234 | static int enic_set_vf_mac(struct net_device *netdev, int vf, u8 *mac) | ||
1235 | { | ||
1236 | struct enic *enic = netdev_priv(netdev); | ||
1237 | |||
1238 | if (vf != PORT_SELF_VF) | ||
1239 | return -EOPNOTSUPP; | ||
1240 | |||
1241 | /* Ignore the vf argument for now. We can assume the request | ||
1242 | * is coming on a vf. | ||
1243 | */ | ||
1244 | if (is_valid_ether_addr(mac)) { | ||
1245 | memcpy(enic->pp.vf_mac, mac, ETH_ALEN); | ||
1246 | return 0; | ||
1247 | } else | ||
1248 | return -EINVAL; | ||
1249 | } | ||
1250 | |||
1234 | static int enic_set_port_profile(struct enic *enic, u8 *mac) | 1251 | static int enic_set_port_profile(struct enic *enic, u8 *mac) |
1235 | { | 1252 | { |
1236 | struct vic_provinfo *vp; | 1253 | struct vic_provinfo *vp; |
@@ -2411,6 +2428,9 @@ static const struct net_device_ops enic_netdev_dynamic_ops = { | |||
2411 | .ndo_tx_timeout = enic_tx_timeout, | 2428 | .ndo_tx_timeout = enic_tx_timeout, |
2412 | .ndo_set_vf_port = enic_set_vf_port, | 2429 | .ndo_set_vf_port = enic_set_vf_port, |
2413 | .ndo_get_vf_port = enic_get_vf_port, | 2430 | .ndo_get_vf_port = enic_get_vf_port, |
2431 | #ifdef IFLA_VF_MAX | ||
2432 | .ndo_set_vf_mac = enic_set_vf_mac, | ||
2433 | #endif | ||
2414 | #ifdef CONFIG_NET_POLL_CONTROLLER | 2434 | #ifdef CONFIG_NET_POLL_CONTROLLER |
2415 | .ndo_poll_controller = enic_poll_controller, | 2435 | .ndo_poll_controller = enic_poll_controller, |
2416 | #endif | 2436 | #endif |