diff options
Diffstat (limited to 'drivers/net/ethernet/ibm/ibmveth.c')
-rw-r--r-- | drivers/net/ethernet/ibm/ibmveth.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/drivers/net/ethernet/ibm/ibmveth.c b/drivers/net/ethernet/ibm/ibmveth.c index 21978cc019e7..072426a72745 100644 --- a/drivers/net/ethernet/ibm/ibmveth.c +++ b/drivers/net/ethernet/ibm/ibmveth.c | |||
@@ -1327,6 +1327,28 @@ static unsigned long ibmveth_get_desired_dma(struct vio_dev *vdev) | |||
1327 | return ret; | 1327 | return ret; |
1328 | } | 1328 | } |
1329 | 1329 | ||
1330 | static int ibmveth_set_mac_addr(struct net_device *dev, void *p) | ||
1331 | { | ||
1332 | struct ibmveth_adapter *adapter = netdev_priv(dev); | ||
1333 | struct sockaddr *addr = p; | ||
1334 | u64 mac_address; | ||
1335 | int rc; | ||
1336 | |||
1337 | if (!is_valid_ether_addr(addr->sa_data)) | ||
1338 | return -EADDRNOTAVAIL; | ||
1339 | |||
1340 | mac_address = ibmveth_encode_mac_addr(addr->sa_data); | ||
1341 | rc = h_change_logical_lan_mac(adapter->vdev->unit_address, mac_address); | ||
1342 | if (rc) { | ||
1343 | netdev_err(adapter->netdev, "h_change_logical_lan_mac failed with rc=%d\n", rc); | ||
1344 | return rc; | ||
1345 | } | ||
1346 | |||
1347 | ether_addr_copy(dev->dev_addr, addr->sa_data); | ||
1348 | |||
1349 | return 0; | ||
1350 | } | ||
1351 | |||
1330 | static const struct net_device_ops ibmveth_netdev_ops = { | 1352 | static const struct net_device_ops ibmveth_netdev_ops = { |
1331 | .ndo_open = ibmveth_open, | 1353 | .ndo_open = ibmveth_open, |
1332 | .ndo_stop = ibmveth_close, | 1354 | .ndo_stop = ibmveth_close, |
@@ -1337,7 +1359,7 @@ static const struct net_device_ops ibmveth_netdev_ops = { | |||
1337 | .ndo_fix_features = ibmveth_fix_features, | 1359 | .ndo_fix_features = ibmveth_fix_features, |
1338 | .ndo_set_features = ibmveth_set_features, | 1360 | .ndo_set_features = ibmveth_set_features, |
1339 | .ndo_validate_addr = eth_validate_addr, | 1361 | .ndo_validate_addr = eth_validate_addr, |
1340 | .ndo_set_mac_address = eth_mac_addr, | 1362 | .ndo_set_mac_address = ibmveth_set_mac_addr, |
1341 | #ifdef CONFIG_NET_POLL_CONTROLLER | 1363 | #ifdef CONFIG_NET_POLL_CONTROLLER |
1342 | .ndo_poll_controller = ibmveth_poll_controller, | 1364 | .ndo_poll_controller = ibmveth_poll_controller, |
1343 | #endif | 1365 | #endif |