From patchwork Fri Jun 25 22:42:58 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Reinette Chatre X-Patchwork-Id: 108162 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o5PMhKLT026714 for ; Fri, 25 Jun 2010 22:43:20 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932234Ab0FYWnS (ORCPT ); Fri, 25 Jun 2010 18:43:18 -0400 Received: from mga14.intel.com ([143.182.124.37]:50072 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756839Ab0FYWnK (ORCPT ); Fri, 25 Jun 2010 18:43:10 -0400 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga102.ch.intel.com with ESMTP; 25 Jun 2010 15:43:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.53,484,1272870000"; d="scan'208";a="293202675" Received: from rchatre-desk.jf.intel.com (HELO localhost.localdomain) ([10.23.232.219]) by azsmga001.ch.intel.com with ESMTP; 25 Jun 2010 15:43:06 -0700 From: Reinette Chatre To: linville@tuxdriver.com Cc: linux-wireless@vger.kernel.org, ipw3945-devel@lists.sourceforge.net, Johannes Berg , Reinette Chatre Subject: [PATCH 5/8] iwlwifi: read rfkill during resume Date: Fri, 25 Jun 2010 15:42:58 -0700 Message-Id: <1277505781-25268-6-git-send-email-reinette.chatre@intel.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1277505781-25268-1-git-send-email-reinette.chatre@intel.com> References: <1277505781-25268-1-git-send-email-reinette.chatre@intel.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Fri, 25 Jun 2010 22:43:21 +0000 (UTC) diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c index f47a58f..a56fb46 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.c +++ b/drivers/net/wireless/iwlwifi/iwl-core.c @@ -2845,6 +2845,7 @@ int iwl_pci_resume(struct pci_dev *pdev) { struct iwl_priv *priv = pci_get_drvdata(pdev); int ret; + bool hw_rfkill = false; /* * We disable the RETRY_TIMEOUT register (0x41) to keep @@ -2859,6 +2860,17 @@ int iwl_pci_resume(struct pci_dev *pdev) pci_restore_state(pdev); iwl_enable_interrupts(priv); + if (!(iwl_read32(priv, CSR_GP_CNTRL) & + CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW)) + hw_rfkill = true; + + if (hw_rfkill) + set_bit(STATUS_RF_KILL_HW, &priv->status); + else + clear_bit(STATUS_RF_KILL_HW, &priv->status); + + wiphy_rfkill_set_hw_state(priv->hw->wiphy, hw_rfkill); + return 0; } EXPORT_SYMBOL(iwl_pci_resume);