mac80211: remove WARN_ON() from ieee80211_hw_config
authorReinette Chatre <reinette.chatre@intel.com>
Thu, 4 Dec 2008 22:49:08 +0000 (14:49 -0800)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 12 Dec 2008 18:48:20 +0000 (13:48 -0500)
ieee80211_hw_config can return an error when the hardware
has rfkill enabled. A WARN_ON() is too harsh for this
failure as it is a valid scenario. Only comment this warning
as we would like to have it back when rfkill is integrated into
mac80211.

Also reintroduce propagation of error if ieee80211_hw_config fails
in ieee80211_config_beacon.

This patch partially reverts patch:
5f0387fc3337ca26f0745f945f550f0c3734960f
"mac80211: clean up ieee80211_hw_config errors"

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/mac80211/cfg.c
net/mac80211/main.c

index 7a7a6c176dc57d8709da34dda086cbe940400e0a..7912eb14eca0858047fe1b337848cf281c5d621b 100644 (file)
@@ -396,8 +396,10 @@ static int ieee80211_config_beacon(struct ieee80211_sub_if_data *sdata,
         */
        if (params->interval) {
                sdata->local->hw.conf.beacon_int = params->interval;
-               ieee80211_hw_config(sdata->local,
-                                   IEEE80211_CONF_CHANGE_BEACON_INTERVAL);
+               err = ieee80211_hw_config(sdata->local,
+                                       IEEE80211_CONF_CHANGE_BEACON_INTERVAL);
+               if (err < 0)
+                       return err;
                /*
                 * We updated some parameter so if below bails out
                 * it's not an error.
index 29c3ecf7e914c4722734ef51f667611325a2dc0a..df7e9a810b888ac9983f6830210456c28c27d085 100644 (file)
@@ -243,10 +243,20 @@ int ieee80211_hw_config(struct ieee80211_local *local, u32 changed)
        if (changed && local->open_count) {
                ret = local->ops->config(local_to_hw(local), changed);
                /*
+                * Goal:
                 * HW reconfiguration should never fail, the driver has told
                 * us what it can support so it should live up to that promise.
+                *
+                * Current status:
+                * rfkill is not integrated with mac80211 and a
+                * configuration command can thus fail if hardware rfkill
+                * is enabled
+                *
+                * FIXME: integrate rfkill with mac80211 and then add this
+                * WARN_ON() back
+                *
                 */
-               WARN_ON(ret);
+               /* WARN_ON(ret); */
        }
 
        return ret;