diff options
Diffstat (limited to 'drivers/net/ibmveth.c')
-rw-r--r-- | drivers/net/ibmveth.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/drivers/net/ibmveth.c b/drivers/net/ibmveth.c index cd508a8ee25b..7acb3edc47ef 100644 --- a/drivers/net/ibmveth.c +++ b/drivers/net/ibmveth.c | |||
@@ -45,6 +45,7 @@ | |||
45 | #include <linux/init.h> | 45 | #include <linux/init.h> |
46 | #include <linux/delay.h> | 46 | #include <linux/delay.h> |
47 | #include <linux/mm.h> | 47 | #include <linux/mm.h> |
48 | #include <linux/pm.h> | ||
48 | #include <linux/ethtool.h> | 49 | #include <linux/ethtool.h> |
49 | #include <linux/proc_fs.h> | 50 | #include <linux/proc_fs.h> |
50 | #include <linux/in.h> | 51 | #include <linux/in.h> |
@@ -199,7 +200,7 @@ static int ibmveth_alloc_buffer_pool(struct ibmveth_buff_pool *pool) | |||
199 | return -1; | 200 | return -1; |
200 | } | 201 | } |
201 | 202 | ||
202 | pool->skbuff = kmalloc(sizeof(void*) * pool->size, GFP_KERNEL); | 203 | pool->skbuff = kcalloc(pool->size, sizeof(void *), GFP_KERNEL); |
203 | 204 | ||
204 | if(!pool->skbuff) { | 205 | if(!pool->skbuff) { |
205 | kfree(pool->dma_addr); | 206 | kfree(pool->dma_addr); |
@@ -210,7 +211,6 @@ static int ibmveth_alloc_buffer_pool(struct ibmveth_buff_pool *pool) | |||
210 | return -1; | 211 | return -1; |
211 | } | 212 | } |
212 | 213 | ||
213 | memset(pool->skbuff, 0, sizeof(void*) * pool->size); | ||
214 | memset(pool->dma_addr, 0, sizeof(dma_addr_t) * pool->size); | 214 | memset(pool->dma_addr, 0, sizeof(dma_addr_t) * pool->size); |
215 | 215 | ||
216 | for(i = 0; i < pool->size; ++i) { | 216 | for(i = 0; i < pool->size; ++i) { |
@@ -957,7 +957,7 @@ static netdev_tx_t ibmveth_start_xmit(struct sk_buff *skb, | |||
957 | } else { | 957 | } else { |
958 | tx_packets++; | 958 | tx_packets++; |
959 | tx_bytes += skb->len; | 959 | tx_bytes += skb->len; |
960 | netdev->trans_start = jiffies; | 960 | netdev->trans_start = jiffies; /* NETIF_F_LLTX driver :( */ |
961 | } | 961 | } |
962 | 962 | ||
963 | if (!used_bounce) | 963 | if (!used_bounce) |
@@ -1073,7 +1073,7 @@ static void ibmveth_set_multicast_list(struct net_device *netdev) | |||
1073 | ibmveth_error_printk("h_multicast_ctrl rc=%ld when entering promisc mode\n", lpar_rc); | 1073 | ibmveth_error_printk("h_multicast_ctrl rc=%ld when entering promisc mode\n", lpar_rc); |
1074 | } | 1074 | } |
1075 | } else { | 1075 | } else { |
1076 | struct dev_mc_list *mclist; | 1076 | struct netdev_hw_addr *ha; |
1077 | /* clear the filter table & disable filtering */ | 1077 | /* clear the filter table & disable filtering */ |
1078 | lpar_rc = h_multicast_ctrl(adapter->vdev->unit_address, | 1078 | lpar_rc = h_multicast_ctrl(adapter->vdev->unit_address, |
1079 | IbmVethMcastEnableRecv | | 1079 | IbmVethMcastEnableRecv | |
@@ -1084,10 +1084,10 @@ static void ibmveth_set_multicast_list(struct net_device *netdev) | |||
1084 | ibmveth_error_printk("h_multicast_ctrl rc=%ld when attempting to clear filter table\n", lpar_rc); | 1084 | ibmveth_error_printk("h_multicast_ctrl rc=%ld when attempting to clear filter table\n", lpar_rc); |
1085 | } | 1085 | } |
1086 | /* add the addresses to the filter table */ | 1086 | /* add the addresses to the filter table */ |
1087 | netdev_for_each_mc_addr(mclist, netdev) { | 1087 | netdev_for_each_mc_addr(ha, netdev) { |
1088 | // add the multicast address to the filter table | 1088 | // add the multicast address to the filter table |
1089 | unsigned long mcast_addr = 0; | 1089 | unsigned long mcast_addr = 0; |
1090 | memcpy(((char *)&mcast_addr)+2, mclist->dmi_addr, 6); | 1090 | memcpy(((char *)&mcast_addr)+2, ha->addr, 6); |
1091 | lpar_rc = h_multicast_ctrl(adapter->vdev->unit_address, | 1091 | lpar_rc = h_multicast_ctrl(adapter->vdev->unit_address, |
1092 | IbmVethMcastAddFilter, | 1092 | IbmVethMcastAddFilter, |
1093 | mcast_addr); | 1093 | mcast_addr); |
@@ -1421,7 +1421,6 @@ static void ibmveth_proc_register_adapter(struct ibmveth_adapter *adapter) | |||
1421 | if (!entry) | 1421 | if (!entry) |
1422 | ibmveth_error_printk("Cannot create adapter proc entry"); | 1422 | ibmveth_error_printk("Cannot create adapter proc entry"); |
1423 | } | 1423 | } |
1424 | return; | ||
1425 | } | 1424 | } |
1426 | 1425 | ||
1427 | static void ibmveth_proc_unregister_adapter(struct ibmveth_adapter *adapter) | 1426 | static void ibmveth_proc_unregister_adapter(struct ibmveth_adapter *adapter) |
@@ -1589,6 +1588,12 @@ static struct kobj_type ktype_veth_pool = { | |||
1589 | .default_attrs = veth_pool_attrs, | 1588 | .default_attrs = veth_pool_attrs, |
1590 | }; | 1589 | }; |
1591 | 1590 | ||
1591 | static int ibmveth_resume(struct device *dev) | ||
1592 | { | ||
1593 | struct net_device *netdev = dev_get_drvdata(dev); | ||
1594 | ibmveth_interrupt(netdev->irq, netdev); | ||
1595 | return 0; | ||
1596 | } | ||
1592 | 1597 | ||
1593 | static struct vio_device_id ibmveth_device_table[] __devinitdata= { | 1598 | static struct vio_device_id ibmveth_device_table[] __devinitdata= { |
1594 | { "network", "IBM,l-lan"}, | 1599 | { "network", "IBM,l-lan"}, |
@@ -1596,6 +1601,10 @@ static struct vio_device_id ibmveth_device_table[] __devinitdata= { | |||
1596 | }; | 1601 | }; |
1597 | MODULE_DEVICE_TABLE(vio, ibmveth_device_table); | 1602 | MODULE_DEVICE_TABLE(vio, ibmveth_device_table); |
1598 | 1603 | ||
1604 | static struct dev_pm_ops ibmveth_pm_ops = { | ||
1605 | .resume = ibmveth_resume | ||
1606 | }; | ||
1607 | |||
1599 | static struct vio_driver ibmveth_driver = { | 1608 | static struct vio_driver ibmveth_driver = { |
1600 | .id_table = ibmveth_device_table, | 1609 | .id_table = ibmveth_device_table, |
1601 | .probe = ibmveth_probe, | 1610 | .probe = ibmveth_probe, |
@@ -1604,6 +1613,7 @@ static struct vio_driver ibmveth_driver = { | |||
1604 | .driver = { | 1613 | .driver = { |
1605 | .name = ibmveth_driver_name, | 1614 | .name = ibmveth_driver_name, |
1606 | .owner = THIS_MODULE, | 1615 | .owner = THIS_MODULE, |
1616 | .pm = &ibmveth_pm_ops, | ||
1607 | } | 1617 | } |
1608 | }; | 1618 | }; |
1609 | 1619 | ||