aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ibmveth.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ibmveth.c')
-rw-r--r--drivers/net/ibmveth.c40
1 files changed, 23 insertions, 17 deletions
diff --git a/drivers/net/ibmveth.c b/drivers/net/ibmveth.c
index 5c6315df86b9..0995c438f286 100644
--- a/drivers/net/ibmveth.c
+++ b/drivers/net/ibmveth.c
@@ -1203,6 +1203,20 @@ static unsigned long ibmveth_get_desired_dma(struct vio_dev *vdev)
1203 return ret; 1203 return ret;
1204} 1204}
1205 1205
1206static const struct net_device_ops ibmveth_netdev_ops = {
1207 .ndo_open = ibmveth_open,
1208 .ndo_stop = ibmveth_close,
1209 .ndo_start_xmit = ibmveth_start_xmit,
1210 .ndo_set_multicast_list = ibmveth_set_multicast_list,
1211 .ndo_do_ioctl = ibmveth_ioctl,
1212 .ndo_change_mtu = ibmveth_change_mtu,
1213 .ndo_validate_addr = eth_validate_addr,
1214 .ndo_set_mac_address = eth_mac_addr,
1215#ifdef CONFIG_NET_POLL_CONTROLLER
1216 .ndo_poll_controller = ibmveth_poll_controller,
1217#endif
1218};
1219
1206static int __devinit ibmveth_probe(struct vio_dev *dev, const struct vio_device_id *id) 1220static int __devinit ibmveth_probe(struct vio_dev *dev, const struct vio_device_id *id)
1207{ 1221{
1208 int rc, i; 1222 int rc, i;
@@ -1241,7 +1255,7 @@ static int __devinit ibmveth_probe(struct vio_dev *dev, const struct vio_device_
1241 return -ENOMEM; 1255 return -ENOMEM;
1242 1256
1243 adapter = netdev_priv(netdev); 1257 adapter = netdev_priv(netdev);
1244 dev->dev.driver_data = netdev; 1258 dev_set_drvdata(&dev->dev, netdev);
1245 1259
1246 adapter->vdev = dev; 1260 adapter->vdev = dev;
1247 adapter->netdev = netdev; 1261 adapter->netdev = netdev;
@@ -1265,21 +1279,13 @@ static int __devinit ibmveth_probe(struct vio_dev *dev, const struct vio_device_
1265 memcpy(&adapter->mac_addr, mac_addr_p, 6); 1279 memcpy(&adapter->mac_addr, mac_addr_p, 6);
1266 1280
1267 netdev->irq = dev->irq; 1281 netdev->irq = dev->irq;
1268 netdev->open = ibmveth_open; 1282 netdev->netdev_ops = &ibmveth_netdev_ops;
1269 netdev->stop = ibmveth_close; 1283 netdev->ethtool_ops = &netdev_ethtool_ops;
1270 netdev->hard_start_xmit = ibmveth_start_xmit;
1271 netdev->set_multicast_list = ibmveth_set_multicast_list;
1272 netdev->do_ioctl = ibmveth_ioctl;
1273 netdev->ethtool_ops = &netdev_ethtool_ops;
1274 netdev->change_mtu = ibmveth_change_mtu;
1275 SET_NETDEV_DEV(netdev, &dev->dev); 1284 SET_NETDEV_DEV(netdev, &dev->dev);
1276#ifdef CONFIG_NET_POLL_CONTROLLER
1277 netdev->poll_controller = ibmveth_poll_controller;
1278#endif
1279 netdev->features |= NETIF_F_LLTX; 1285 netdev->features |= NETIF_F_LLTX;
1280 spin_lock_init(&adapter->stats_lock); 1286 spin_lock_init(&adapter->stats_lock);
1281 1287
1282 memcpy(&netdev->dev_addr, &adapter->mac_addr, netdev->addr_len); 1288 memcpy(netdev->dev_addr, &adapter->mac_addr, netdev->addr_len);
1283 1289
1284 for(i = 0; i<IbmVethNumBufferPools; i++) { 1290 for(i = 0; i<IbmVethNumBufferPools; i++) {
1285 struct kobject *kobj = &adapter->rx_buff_pool[i].kobj; 1291 struct kobject *kobj = &adapter->rx_buff_pool[i].kobj;
@@ -1335,7 +1341,7 @@ static int __devinit ibmveth_probe(struct vio_dev *dev, const struct vio_device_
1335 1341
1336static int __devexit ibmveth_remove(struct vio_dev *dev) 1342static int __devexit ibmveth_remove(struct vio_dev *dev)
1337{ 1343{
1338 struct net_device *netdev = dev->dev.driver_data; 1344 struct net_device *netdev = dev_get_drvdata(&dev->dev);
1339 struct ibmveth_adapter *adapter = netdev_priv(netdev); 1345 struct ibmveth_adapter *adapter = netdev_priv(netdev);
1340 int i; 1346 int i;
1341 1347
@@ -1368,8 +1374,8 @@ static void ibmveth_proc_unregister_driver(void)
1368static int ibmveth_show(struct seq_file *seq, void *v) 1374static int ibmveth_show(struct seq_file *seq, void *v)
1369{ 1375{
1370 struct ibmveth_adapter *adapter = seq->private; 1376 struct ibmveth_adapter *adapter = seq->private;
1371 char *current_mac = ((char*) &adapter->netdev->dev_addr); 1377 char *current_mac = (char *) adapter->netdev->dev_addr;
1372 char *firmware_mac = ((char*) &adapter->mac_addr) ; 1378 char *firmware_mac = (char *) &adapter->mac_addr;
1373 1379
1374 seq_printf(seq, "%s %s\n\n", ibmveth_driver_string, ibmveth_driver_version); 1380 seq_printf(seq, "%s %s\n\n", ibmveth_driver_string, ibmveth_driver_version);
1375 1381
@@ -1468,8 +1474,8 @@ const char * buf, size_t count)
1468 struct ibmveth_buff_pool *pool = container_of(kobj, 1474 struct ibmveth_buff_pool *pool = container_of(kobj,
1469 struct ibmveth_buff_pool, 1475 struct ibmveth_buff_pool,
1470 kobj); 1476 kobj);
1471 struct net_device *netdev = 1477 struct net_device *netdev = dev_get_drvdata(
1472 container_of(kobj->parent, struct device, kobj)->driver_data; 1478 container_of(kobj->parent, struct device, kobj));
1473 struct ibmveth_adapter *adapter = netdev_priv(netdev); 1479 struct ibmveth_adapter *adapter = netdev_priv(netdev);
1474 long value = simple_strtol(buf, NULL, 10); 1480 long value = simple_strtol(buf, NULL, 10);
1475 long rc; 1481 long rc;