From patchwork Wed Sep 2 14:53:08 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Lutomirski X-Patchwork-Id: 45225 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n82Erq4x031261 for ; Wed, 2 Sep 2009 14:53:52 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752477AbZIBOxJ (ORCPT ); Wed, 2 Sep 2009 10:53:09 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751542AbZIBOxJ (ORCPT ); Wed, 2 Sep 2009 10:53:09 -0400 Received: from mail-fx0-f217.google.com ([209.85.220.217]:61670 "EHLO mail-fx0-f217.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752438AbZIBOxI (ORCPT ); Wed, 2 Sep 2009 10:53:08 -0400 Received: by fxm17 with SMTP id 17so832646fxm.37 for ; Wed, 02 Sep 2009 07:53:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=NRDyZWYuCZyAl2OkncKVHZMPVs5c1uG47gXSkNGpPgA=; b=FbF5H73g/t0V4HG5x+lS/1kypiS2BXaRzz83uDFcKqzTEjSwVMRzhJ8/PhZoJ8xyP5 m3k6ARhVDqoQfXNTt6lMYqvGksqK+kjtq21xaa2CgvEqwahR9F0eUw6wJCPTmfAOtbmv AwAzUuF8n3+4XuI2dStnhmG4pv1KgmaEfU/y0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; b=Ba2/s+E/pPs+mt9/kzft0kWZQPVkxgMTDXAlxxDUMkggA8OsnoEsRA4uw0J9mGDO55 fYhVBpzdbYnyE1N5T47cIsV3ZSUo/ZdSFMv3BjNBX4aB5PYilvckbniof06ax8/n9jHQ 33AJyol5b9n8uJJmvSSMcJjUY2ikI7GYvKV5E= MIME-Version: 1.0 Received: by 10.223.5.87 with SMTP id 23mr3139847fau.87.1251903188738; Wed, 02 Sep 2009 07:53:08 -0700 (PDT) Date: Wed, 2 Sep 2009 10:53:08 -0400 X-Google-Sender-Auth: 8081a6dcd05bc36b Message-ID: Subject: [PATCH 2.6.31] iwlwifi: Reenable power_level From: Andrew Lutomirski To: linux-wireless@vger.kernel.org, yi.zhu@intel.com, reinette.chatre@intel.com Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Right now, enabling power saving on iwlwifi is impossible, because mac80211 won't tell iwlwifi that power saving is on (since IEEE80211_HW_SUPPORTS_PS is not set) and iwlwifi will ignore the user's power_level setting until mac80211 asks for power saving. Setting this flag allows the user to manually enable power saving if desired. Signed-off-by: Andy Lutomirski --- This fixes what looks to me like a regression: power_level used to work but now fails silently. In 2.6.32 I think this code is going away, but this patch seems like a safe stopgap measure. iwlwifi mostly ignores mac80211's power settings, but I think advertising IEEE80211_HW_SUPPORTS_PS should be safe, even this late in the 2.6.31 cycle because: 1. This patch won't have any effect until the user requests power saving through wext or nl80211. 2. Even if that happens, the user still has to set power_level in sysfs for anything to change. 3. As far as I can tell, power_level in sysfs wasn't any safer in 2.6.29 or 2.6.30 than it will be with this patch. 4. This fixes a regression. The power_level sysfs entry is still rather odd in that setting and getting don't behave in quite the way that the user would expect (there should probably be power_level_requested and actual_power_level as separate entries), but power_level looks like it's going away soon, so this isn't worth fixing now. -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c index 18b135f..be6f1e0 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.c +++ b/drivers/net/wireless/iwlwifi/iwl-core.c @@ -1325,7 +1325,8 @@ int iwl_setup_mac(struct iwl_priv *priv) hw->flags = IEEE80211_HW_SIGNAL_DBM | IEEE80211_HW_NOISE_DBM | IEEE80211_HW_AMPDU_AGGREGATION | - IEEE80211_HW_SPECTRUM_MGMT; + IEEE80211_HW_SPECTRUM_MGMT | + IEEE80211_HW_SUPPORTS_PS; hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_ADHOC);