diff options
author | Santiago Leon <santil@linux.vnet.ibm.com> | 2010-09-03 14:28:58 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-09-06 21:21:50 -0400 |
commit | d2684b516020c162b2852a2171ec588713c6cec0 (patch) | |
tree | 54e8b5a658fabe8fcf88ec727a87be5fc5952bf0 /drivers/net/ibmveth.c | |
parent | ab78df75cac4d90b5b5471af795a64141243c02a (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.c | 113 |
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); | |||
94 | static int ibmveth_start_xmit(struct sk_buff *skb, struct net_device *dev); | 86 | static int ibmveth_start_xmit(struct sk_buff *skb, struct net_device *dev); |
95 | static void ibmveth_set_multicast_list(struct net_device *dev); | 87 | static void ibmveth_set_multicast_list(struct net_device *dev); |
96 | static int ibmveth_change_mtu(struct net_device *dev, int new_mtu); | 88 | static int ibmveth_change_mtu(struct net_device *dev, int new_mtu); |
97 | static void ibmveth_proc_register_driver(void); | ||
98 | static void ibmveth_proc_unregister_driver(void); | ||
99 | static void ibmveth_proc_register_adapter(struct ibmveth_adapter *adapter); | ||
100 | static void ibmveth_proc_unregister_adapter(struct ibmveth_adapter *adapter); | ||
101 | static irqreturn_t ibmveth_interrupt(int irq, void *dev_instance); | 89 | static irqreturn_t ibmveth_interrupt(int irq, void *dev_instance); |
102 | static void ibmveth_rxq_harvest_buffer(struct ibmveth_adapter *adapter); | 90 | static void ibmveth_rxq_harvest_buffer(struct ibmveth_adapter *adapter); |
103 | static unsigned long ibmveth_get_desired_dma(struct vio_dev *vdev); | 91 | static unsigned long ibmveth_get_desired_dma(struct vio_dev *vdev); |
104 | static struct kobj_type ktype_veth_pool; | 92 | static struct kobj_type ktype_veth_pool; |
105 | 93 | ||
106 | 94 | ||
107 | #ifdef CONFIG_PROC_FS | ||
108 | #define IBMVETH_PROC_DIR "ibmveth" | ||
109 | static struct proc_dir_entry *ibmveth_proc_dir; | ||
110 | #endif | ||
111 | |||
112 | static const char ibmveth_driver_name[] = "ibmveth"; | 95 | static const char ibmveth_driver_name[] = "ibmveth"; |
113 | static const char ibmveth_driver_string[] = "IBM i/pSeries Virtual Ethernet Driver"; | 96 | static 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 | ||
1500 | static 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 | |||
1507 | static void ibmveth_proc_unregister_driver(void) | ||
1508 | { | ||
1509 | remove_proc_entry(IBMVETH_PROC_DIR, init_net.proc_net); | ||
1510 | } | ||
1511 | |||
1512 | static 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 | |||
1536 | static int ibmveth_proc_open(struct inode *inode, struct file *file) | ||
1537 | { | ||
1538 | return single_open(file, ibmveth_show, PDE(inode)->data); | ||
1539 | } | ||
1540 | |||
1541 | static 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 | |||
1549 | static 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 | |||
1562 | static 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 */ | ||
1572 | static void ibmveth_proc_register_adapter(struct ibmveth_adapter *adapter) | ||
1573 | { | ||
1574 | } | ||
1575 | |||
1576 | static void ibmveth_proc_unregister_adapter(struct ibmveth_adapter *adapter) | ||
1577 | { | ||
1578 | } | ||
1579 | static void ibmveth_proc_register_driver(void) | ||
1580 | { | ||
1581 | } | ||
1582 | |||
1583 | static void ibmveth_proc_unregister_driver(void) | ||
1584 | { | ||
1585 | } | ||
1586 | #endif /* CONFIG_PROC_FS */ | ||
1587 | |||
1588 | static struct attribute veth_active_attr; | 1478 | static struct attribute veth_active_attr; |
1589 | static struct attribute veth_num_attr; | 1479 | static struct attribute veth_num_attr; |
1590 | static struct attribute veth_size_attr; | 1480 | static 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 | ||
1765 | static void __exit ibmveth_module_exit(void) | 1653 | static 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 | ||
1771 | module_init(ibmveth_module_init); | 1658 | module_init(ibmveth_module_init); |