summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/libertas/mesh.c
diff options
context:
space:
mode:
authorDaniel Drake <dsd@laptop.org>2011-08-01 19:43:13 +0400
committerJohn W. Linville <linville@tuxdriver.com>2011-08-09 23:52:02 +0400
commitd2e7b3425c474300318e1d28b10a93c2401b9255 (patch)
treeaf286b83e34688202d7a2345b3900a42a547a043 /drivers/net/wireless/libertas/mesh.c
parent6de062ced91d894936edc54d79158b9f69f85d0e (diff)
downloadlinux-d2e7b3425c474300318e1d28b10a93c2401b9255.tar.xz
libertas: disable functionality when interface is down
Modify the driver so that it does not function when the interface is down, in preparation for runtime power management. No commands can be run while the interface is down, so the ndo_dev_stop routine now directly does all necessary work (including asking the device to disconnect from the network and disabling multicast functionality) directly. power_save and power_restore hooks are added meaning that card drivers can take steps to turn the device off when the interface is down. The MAC address can now only be changed when all interfaces are down; the new address will be programmed when an interface gets brought up. This matches mac80211 behaviour. Also, some small cleanups/simplifications were made in the surrounding device handling logic. Signed-off-by: Daniel Drake <dsd@laptop.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/libertas/mesh.c')
-rw-r--r--drivers/net/wireless/libertas/mesh.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/net/wireless/libertas/mesh.c b/drivers/net/wireless/libertas/mesh.c
index 2a635d279ffe..138699baf90e 100644
--- a/drivers/net/wireless/libertas/mesh.c
+++ b/drivers/net/wireless/libertas/mesh.c
@@ -924,7 +924,9 @@ static int lbs_mesh_stop(struct net_device *dev)
spin_unlock_irq(&priv->driver_lock);
- schedule_work(&priv->mcast_work);
+ lbs_update_mcast(priv);
+ if (!lbs_iface_active(priv))
+ lbs_stop_iface(priv);
lbs_deb_leave(LBS_DEB_MESH);
return 0;
@@ -942,6 +944,11 @@ static int lbs_mesh_dev_open(struct net_device *dev)
int ret = 0;
lbs_deb_enter(LBS_DEB_NET);
+ if (!priv->iface_running) {
+ ret = lbs_start_iface(priv);
+ if (ret)
+ goto out;
+ }
spin_lock_irq(&priv->driver_lock);