aboutsummaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2009-03-05 05:06:47 -0500
committerDavid S. Miller <davem@davemloft.net>2009-03-05 05:06:47 -0500
commit508827ff0ac3981d420edac64a70de7f4e304d38 (patch)
treeb0cee8ddef9f0ceab68c388e4ae46b7295eb2cb5 /net/core
parent2c3c3d02f28801d7ad2da4952b2c7ca6621ef221 (diff)
parent72e2240f181871675d3a979766330c91d48a1673 (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts: drivers/net/tokenring/tmspci.c drivers/net/ucc_geth_mii.c
Diffstat (limited to 'net/core')
-rw-r--r--net/core/dev.c55
-rw-r--r--net/core/net-sysfs.c4
2 files changed, 37 insertions, 22 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index bcd0c2154bb2..033d7ca28e6e 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -4336,6 +4336,39 @@ unsigned long netdev_fix_features(unsigned long features, const char *name)
4336} 4336}
4337EXPORT_SYMBOL(netdev_fix_features); 4337EXPORT_SYMBOL(netdev_fix_features);
4338 4338
4339/* Some devices need to (re-)set their netdev_ops inside
4340 * ->init() or similar. If that happens, we have to setup
4341 * the compat pointers again.
4342 */
4343void netdev_resync_ops(struct net_device *dev)
4344{
4345#ifdef CONFIG_COMPAT_NET_DEV_OPS
4346 const struct net_device_ops *ops = dev->netdev_ops;
4347
4348 dev->init = ops->ndo_init;
4349 dev->uninit = ops->ndo_uninit;
4350 dev->open = ops->ndo_open;
4351 dev->change_rx_flags = ops->ndo_change_rx_flags;
4352 dev->set_rx_mode = ops->ndo_set_rx_mode;
4353 dev->set_multicast_list = ops->ndo_set_multicast_list;
4354 dev->set_mac_address = ops->ndo_set_mac_address;
4355 dev->validate_addr = ops->ndo_validate_addr;
4356 dev->do_ioctl = ops->ndo_do_ioctl;
4357 dev->set_config = ops->ndo_set_config;
4358 dev->change_mtu = ops->ndo_change_mtu;
4359 dev->neigh_setup = ops->ndo_neigh_setup;
4360 dev->tx_timeout = ops->ndo_tx_timeout;
4361 dev->get_stats = ops->ndo_get_stats;
4362 dev->vlan_rx_register = ops->ndo_vlan_rx_register;
4363 dev->vlan_rx_add_vid = ops->ndo_vlan_rx_add_vid;
4364 dev->vlan_rx_kill_vid = ops->ndo_vlan_rx_kill_vid;
4365#ifdef CONFIG_NET_POLL_CONTROLLER
4366 dev->poll_controller = ops->ndo_poll_controller;
4367#endif
4368#endif
4369}
4370EXPORT_SYMBOL(netdev_resync_ops);
4371
4339/** 4372/**
4340 * register_netdevice - register a network device 4373 * register_netdevice - register a network device
4341 * @dev: device to register 4374 * @dev: device to register
@@ -4380,27 +4413,7 @@ int register_netdevice(struct net_device *dev)
4380 * This is temporary until all network devices are converted. 4413 * This is temporary until all network devices are converted.
4381 */ 4414 */
4382 if (dev->netdev_ops) { 4415 if (dev->netdev_ops) {
4383 const struct net_device_ops *ops = dev->netdev_ops; 4416 netdev_resync_ops(dev);
4384
4385 dev->init = ops->ndo_init;
4386 dev->uninit = ops->ndo_uninit;
4387 dev->open = ops->ndo_open;
4388 dev->change_rx_flags = ops->ndo_change_rx_flags;
4389 dev->set_rx_mode = ops->ndo_set_rx_mode;
4390 dev->set_multicast_list = ops->ndo_set_multicast_list;
4391 dev->set_mac_address = ops->ndo_set_mac_address;
4392 dev->validate_addr = ops->ndo_validate_addr;
4393 dev->do_ioctl = ops->ndo_do_ioctl;
4394 dev->set_config = ops->ndo_set_config;
4395 dev->change_mtu = ops->ndo_change_mtu;
4396 dev->tx_timeout = ops->ndo_tx_timeout;
4397 dev->get_stats = ops->ndo_get_stats;
4398 dev->vlan_rx_register = ops->ndo_vlan_rx_register;
4399 dev->vlan_rx_add_vid = ops->ndo_vlan_rx_add_vid;
4400 dev->vlan_rx_kill_vid = ops->ndo_vlan_rx_kill_vid;
4401#ifdef CONFIG_NET_POLL_CONTROLLER
4402 dev->poll_controller = ops->ndo_poll_controller;
4403#endif
4404 } else { 4417 } else {
4405 char drivername[64]; 4418 char drivername[64];
4406 pr_info("%s (%s): not using net_device_ops yet\n", 4419 pr_info("%s (%s): not using net_device_ops yet\n",
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
index 6ac29a46e23e..484f58750eba 100644
--- a/net/core/net-sysfs.c
+++ b/net/core/net-sysfs.c
@@ -77,7 +77,9 @@ static ssize_t netdev_store(struct device *dev, struct device_attribute *attr,
77 if (endp == buf) 77 if (endp == buf)
78 goto err; 78 goto err;
79 79
80 rtnl_lock(); 80 if (!rtnl_trylock())
81 return -ERESTARTSYS;
82
81 if (dev_isalive(net)) { 83 if (dev_isalive(net)) {
82 if ((ret = (*set)(net, new)) == 0) 84 if ((ret = (*set)(net, new)) == 0)
83 ret = len; 85 ret = len;