aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ibmveth.c
diff options
context:
space:
mode:
authorSantiago Leon <santil@linux.vnet.ibm.com>2010-09-03 14:28:58 -0400
committerDavid S. Miller <davem@davemloft.net>2010-09-06 21:21:50 -0400
commitd2684b516020c162b2852a2171ec588713c6cec0 (patch)
tree54e8b5a658fabe8fcf88ec727a87be5fc5952bf0 /drivers/net/ibmveth.c
parentab78df75cac4d90b5b5471af795a64141243c02a (diff)
ibmveth: remove procfs code
We export all the driver specific statistics via ethtool, so there is no need to duplicate this in procfs. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Santiago Leon <santil@linux.vnet.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ibmveth.c')
-rw-r--r--drivers/net/ibmveth.c113
1 files changed, 0 insertions, 113 deletions
diff --git a/drivers/net/ibmveth.c b/drivers/net/ibmveth.c
index 25cf7e0476d0..574f4d472551 100644
--- a/drivers/net/ibmveth.c
+++ b/drivers/net/ibmveth.c
@@ -26,11 +26,6 @@
26/* ethernet NICs that are presented to the partition by the hypervisor. */ 26/* ethernet NICs that are presented to the partition by the hypervisor. */
27/* */ 27/* */
28/**************************************************************************/ 28/**************************************************************************/
29/*
30 TODO:
31 - add support for sysfs
32 - possibly remove procfs support
33*/
34 29
35#include <linux/module.h> 30#include <linux/module.h>
36#include <linux/moduleparam.h> 31#include <linux/moduleparam.h>
@@ -47,19 +42,16 @@
47#include <linux/mm.h> 42#include <linux/mm.h>
48#include <linux/pm.h> 43#include <linux/pm.h>
49#include <linux/ethtool.h> 44#include <linux/ethtool.h>
50#include <linux/proc_fs.h>
51#include <linux/in.h> 45#include <linux/in.h>
52#include <linux/ip.h> 46#include <linux/ip.h>
53#include <linux/ipv6.h> 47#include <linux/ipv6.h>
54#include <linux/slab.h> 48#include <linux/slab.h>
55#include <net/net_namespace.h>
56#include <asm/hvcall.h> 49#include <asm/hvcall.h>
57#include <asm/atomic.h> 50#include <asm/atomic.h>
58#include <asm/vio.h> 51#include <asm/vio.h>
59#include <asm/iommu.h> 52#include <asm/iommu.h>
60#include <asm/uaccess.h> 53#include <asm/uaccess.h>
61#include <asm/firmware.h> 54#include <asm/firmware.h>
62#include <linux/seq_file.h>
63 55
64#include "ibmveth.h" 56#include "ibmveth.h"
65 57
@@ -94,21 +86,12 @@ static int ibmveth_poll(struct napi_struct *napi, int budget);
94static int ibmveth_start_xmit(struct sk_buff *skb, struct net_device *dev); 86static int ibmveth_start_xmit(struct sk_buff *skb, struct net_device *dev);
95static void ibmveth_set_multicast_list(struct net_device *dev); 87static void ibmveth_set_multicast_list(struct net_device *dev);
96static int ibmveth_change_mtu(struct net_device *dev, int new_mtu); 88static int ibmveth_change_mtu(struct net_device *dev, int new_mtu);
97static void ibmveth_proc_register_driver(void);
98static void ibmveth_proc_unregister_driver(void);
99static void ibmveth_proc_register_adapter(struct ibmveth_adapter *adapter);
100static void ibmveth_proc_unregister_adapter(struct ibmveth_adapter *adapter);
101static irqreturn_t ibmveth_interrupt(int irq, void *dev_instance); 89static irqreturn_t ibmveth_interrupt(int irq, void *dev_instance);
102static void ibmveth_rxq_harvest_buffer(struct ibmveth_adapter *adapter); 90static void ibmveth_rxq_harvest_buffer(struct ibmveth_adapter *adapter);
103static unsigned long ibmveth_get_desired_dma(struct vio_dev *vdev); 91static unsigned long ibmveth_get_desired_dma(struct vio_dev *vdev);
104static struct kobj_type ktype_veth_pool; 92static struct kobj_type ktype_veth_pool;
105 93
106 94
107#ifdef CONFIG_PROC_FS
108#define IBMVETH_PROC_DIR "ibmveth"
109static struct proc_dir_entry *ibmveth_proc_dir;
110#endif
111
112static const char ibmveth_driver_name[] = "ibmveth"; 95static const char ibmveth_driver_name[] = "ibmveth";
113static const char ibmveth_driver_string[] = "IBM i/pSeries Virtual Ethernet Driver"; 96static const char ibmveth_driver_string[] = "IBM i/pSeries Virtual Ethernet Driver";
114#define ibmveth_driver_version "1.03" 97#define ibmveth_driver_version "1.03"
@@ -1472,8 +1455,6 @@ static int __devinit ibmveth_probe(struct vio_dev *dev, const struct vio_device_
1472 1455
1473 ibmveth_debug_printk("registered\n"); 1456 ibmveth_debug_printk("registered\n");
1474 1457
1475 ibmveth_proc_register_adapter(adapter);
1476
1477 return 0; 1458 return 0;
1478} 1459}
1479 1460
@@ -1488,103 +1469,12 @@ static int __devexit ibmveth_remove(struct vio_dev *dev)
1488 1469
1489 unregister_netdev(netdev); 1470 unregister_netdev(netdev);
1490 1471
1491 ibmveth_proc_unregister_adapter(adapter);
1492
1493 free_netdev(netdev); 1472 free_netdev(netdev);
1494 dev_set_drvdata(&dev->dev, NULL); 1473 dev_set_drvdata(&dev->dev, NULL);
1495 1474
1496 return 0; 1475 return 0;
1497} 1476}
1498 1477
1499#ifdef CONFIG_PROC_FS
1500static void ibmveth_proc_register_driver(void)
1501{
1502 ibmveth_proc_dir = proc_mkdir(IBMVETH_PROC_DIR, init_net.proc_net);
1503 if (ibmveth_proc_dir) {
1504 }
1505}
1506
1507static void ibmveth_proc_unregister_driver(void)
1508{
1509 remove_proc_entry(IBMVETH_PROC_DIR, init_net.proc_net);
1510}
1511
1512static int ibmveth_show(struct seq_file *seq, void *v)
1513{
1514 struct ibmveth_adapter *adapter = seq->private;
1515 char *current_mac = (char *) adapter->netdev->dev_addr;
1516 char *firmware_mac = (char *) &adapter->mac_addr;
1517
1518 seq_printf(seq, "%s %s\n\n", ibmveth_driver_string, ibmveth_driver_version);
1519
1520 seq_printf(seq, "Unit Address: 0x%x\n", adapter->vdev->unit_address);
1521 seq_printf(seq, "Current MAC: %pM\n", current_mac);
1522 seq_printf(seq, "Firmware MAC: %pM\n", firmware_mac);
1523
1524 seq_printf(seq, "\nAdapter Statistics:\n");
1525 seq_printf(seq, " TX: vio_map_single failres: %lld\n", adapter->tx_map_failed);
1526 seq_printf(seq, " send failures: %lld\n", adapter->tx_send_failed);
1527 seq_printf(seq, " RX: replenish task cycles: %lld\n", adapter->replenish_task_cycles);
1528 seq_printf(seq, " alloc_skb_failures: %lld\n", adapter->replenish_no_mem);
1529 seq_printf(seq, " add buffer failures: %lld\n", adapter->replenish_add_buff_failure);
1530 seq_printf(seq, " invalid buffers: %lld\n", adapter->rx_invalid_buffer);
1531 seq_printf(seq, " no buffers: %lld\n", adapter->rx_no_buffer);
1532
1533 return 0;
1534}
1535
1536static int ibmveth_proc_open(struct inode *inode, struct file *file)
1537{
1538 return single_open(file, ibmveth_show, PDE(inode)->data);
1539}
1540
1541static const struct file_operations ibmveth_proc_fops = {
1542 .owner = THIS_MODULE,
1543 .open = ibmveth_proc_open,
1544 .read = seq_read,
1545 .llseek = seq_lseek,
1546 .release = single_release,
1547};
1548
1549static void ibmveth_proc_register_adapter(struct ibmveth_adapter *adapter)
1550{
1551 struct proc_dir_entry *entry;
1552 if (ibmveth_proc_dir) {
1553 char u_addr[10];
1554 sprintf(u_addr, "%x", adapter->vdev->unit_address);
1555 entry = proc_create_data(u_addr, S_IFREG, ibmveth_proc_dir,
1556 &ibmveth_proc_fops, adapter);
1557 if (!entry)
1558 ibmveth_error_printk("Cannot create adapter proc entry");
1559 }
1560}
1561
1562static void ibmveth_proc_unregister_adapter(struct ibmveth_adapter *adapter)
1563{
1564 if (ibmveth_proc_dir) {
1565 char u_addr[10];
1566 sprintf(u_addr, "%x", adapter->vdev->unit_address);
1567 remove_proc_entry(u_addr, ibmveth_proc_dir);
1568 }
1569}
1570
1571#else /* CONFIG_PROC_FS */
1572static void ibmveth_proc_register_adapter(struct ibmveth_adapter *adapter)
1573{
1574}
1575
1576static void ibmveth_proc_unregister_adapter(struct ibmveth_adapter *adapter)
1577{
1578}
1579static void ibmveth_proc_register_driver(void)
1580{
1581}
1582
1583static void ibmveth_proc_unregister_driver(void)
1584{
1585}
1586#endif /* CONFIG_PROC_FS */
1587
1588static struct attribute veth_active_attr; 1478static struct attribute veth_active_attr;
1589static struct attribute veth_num_attr; 1479static struct attribute veth_num_attr;
1590static struct attribute veth_size_attr; 1480static struct attribute veth_size_attr;
@@ -1757,15 +1647,12 @@ static int __init ibmveth_module_init(void)
1757{ 1647{
1758 ibmveth_printk("%s: %s %s\n", ibmveth_driver_name, ibmveth_driver_string, ibmveth_driver_version); 1648 ibmveth_printk("%s: %s %s\n", ibmveth_driver_name, ibmveth_driver_string, ibmveth_driver_version);
1759 1649
1760 ibmveth_proc_register_driver();
1761
1762 return vio_register_driver(&ibmveth_driver); 1650 return vio_register_driver(&ibmveth_driver);
1763} 1651}
1764 1652
1765static void __exit ibmveth_module_exit(void) 1653static void __exit ibmveth_module_exit(void)
1766{ 1654{
1767 vio_unregister_driver(&ibmveth_driver); 1655 vio_unregister_driver(&ibmveth_driver);
1768 ibmveth_proc_unregister_driver();
1769} 1656}
1770 1657
1771module_init(ibmveth_module_init); 1658module_init(ibmveth_module_init);