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.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/drivers/net/ibmveth.c b/drivers/net/ibmveth.c
index d96eb7229548..acba90f1638e 100644
--- a/drivers/net/ibmveth.c
+++ b/drivers/net/ibmveth.c
@@ -963,7 +963,7 @@ static int __devinit ibmveth_probe(struct vio_dev *dev, const struct vio_device_
963{ 963{
964 int rc, i; 964 int rc, i;
965 struct net_device *netdev; 965 struct net_device *netdev;
966 struct ibmveth_adapter *adapter = NULL; 966 struct ibmveth_adapter *adapter;
967 967
968 unsigned char *mac_addr_p; 968 unsigned char *mac_addr_p;
969 unsigned int *mcastFilterSize_p; 969 unsigned int *mcastFilterSize_p;
@@ -997,7 +997,6 @@ static int __devinit ibmveth_probe(struct vio_dev *dev, const struct vio_device_
997 SET_MODULE_OWNER(netdev); 997 SET_MODULE_OWNER(netdev);
998 998
999 adapter = netdev->priv; 999 adapter = netdev->priv;
1000 memset(adapter, 0, sizeof(adapter));
1001 dev->dev.driver_data = netdev; 1000 dev->dev.driver_data = netdev;
1002 1001
1003 adapter->vdev = dev; 1002 adapter->vdev = dev;
@@ -1280,24 +1279,28 @@ const char * buf, size_t count)
1280 int i; 1279 int i;
1281 /* Make sure there is a buffer pool with buffers that 1280 /* Make sure there is a buffer pool with buffers that
1282 can hold a packet of the size of the MTU */ 1281 can hold a packet of the size of the MTU */
1283 for(i = 0; i<IbmVethNumBufferPools; i++) { 1282 for (i = 0; i < IbmVethNumBufferPools; i++) {
1284 if (pool == &adapter->rx_buff_pool[i]) 1283 if (pool == &adapter->rx_buff_pool[i])
1285 continue; 1284 continue;
1286 if (!adapter->rx_buff_pool[i].active) 1285 if (!adapter->rx_buff_pool[i].active)
1287 continue; 1286 continue;
1288 if (mtu < adapter->rx_buff_pool[i].buff_size) { 1287 if (mtu <= adapter->rx_buff_pool[i].buff_size)
1289 pool->active = 0; 1288 break;
1290 h_free_logical_lan_buffer(adapter->
1291 vdev->
1292 unit_address,
1293 pool->
1294 buff_size);
1295 }
1296 } 1289 }
1297 if (pool->active) { 1290
1291 if (i == IbmVethNumBufferPools) {
1298 ibmveth_error_printk("no active pool >= MTU\n"); 1292 ibmveth_error_printk("no active pool >= MTU\n");
1299 return -EPERM; 1293 return -EPERM;
1300 } 1294 }
1295
1296 pool->active = 0;
1297 if (netif_running(netdev)) {
1298 adapter->pool_config = 1;
1299 ibmveth_close(netdev);
1300 adapter->pool_config = 0;
1301 if ((rc = ibmveth_open(netdev)))
1302 return rc;
1303 }
1301 } 1304 }
1302 } else if (attr == &veth_num_attr) { 1305 } else if (attr == &veth_num_attr) {
1303 if (value <= 0 || value > IBMVETH_MAX_POOL_COUNT) 1306 if (value <= 0 || value > IBMVETH_MAX_POOL_COUNT)