aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-4965.c
diff options
context:
space:
mode:
authorAssaf Krauss <assaf.krauss@intel.com>2008-03-11 19:17:18 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-03-13 19:32:32 -0400
commit6bc913bd965e03b5273a5366eecce5c28c9b01da (patch)
treeebc5aee6b2eb48660ab555af62b4da0119bd8446 /drivers/net/wireless/iwlwifi/iwl-4965.c
parenteb7ae89cb0b03e6e6e39737b1c8bcc1912281a00 (diff)
iwlwifi: Use eeprom form iwlcore
This patch puts in use eeprom from iwlcore module Signed-off-by: Assaf Krauss <assaf.krauss@intel.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-4965.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965.c45
1 files changed, 14 insertions, 31 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
index a79e8c383a3..dc55ff294b7 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -38,6 +38,7 @@
38#include <linux/etherdevice.h> 38#include <linux/etherdevice.h>
39#include <asm/unaligned.h> 39#include <asm/unaligned.h>
40 40
41#include "iwl-eeprom.h"
41#include "iwl-core.h" 42#include "iwl-core.h"
42#include "iwl-4965.h" 43#include "iwl-4965.h"
43#include "iwl-helpers.h" 44#include "iwl-helpers.h"
@@ -4824,10 +4825,23 @@ void iwl4965_hw_cancel_deferred_work(struct iwl4965_priv *priv)
4824 cancel_delayed_work(&priv->init_alive_start); 4825 cancel_delayed_work(&priv->init_alive_start);
4825} 4826}
4826 4827
4828static struct iwl_lib_ops iwl4965_lib = {
4829 .eeprom_ops = {
4830 .verify_signature = iwlcore_eeprom_verify_signature,
4831 .acquire_semaphore = iwlcore_eeprom_acquire_semaphore,
4832 .release_semaphore = iwlcore_eeprom_release_semaphore,
4833 },
4834};
4835
4836static struct iwl_ops iwl4965_ops = {
4837 .lib = &iwl4965_lib,
4838};
4839
4827static struct iwl_cfg iwl4965_agn_cfg = { 4840static struct iwl_cfg iwl4965_agn_cfg = {
4828 .name = "4965AGN", 4841 .name = "4965AGN",
4829 .fw_name = "iwlwifi-4965" IWL4965_UCODE_API ".ucode", 4842 .fw_name = "iwlwifi-4965" IWL4965_UCODE_API ".ucode",
4830 .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N, 4843 .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
4844 .ops = &iwl4965_ops,
4831}; 4845};
4832 4846
4833struct pci_device_id iwl4965_hw_card_ids[] = { 4847struct pci_device_id iwl4965_hw_card_ids[] = {
@@ -4836,35 +4850,4 @@ struct pci_device_id iwl4965_hw_card_ids[] = {
4836 {0} 4850 {0}
4837}; 4851};
4838 4852
4839/*
4840 * The device's EEPROM semaphore prevents conflicts between driver and uCode
4841 * when accessing the EEPROM; each access is a series of pulses to/from the
4842 * EEPROM chip, not a single event, so even reads could conflict if they
4843 * weren't arbitrated by the semaphore.
4844 */
4845int iwl4965_eeprom_acquire_semaphore(struct iwl4965_priv *priv)
4846{
4847 u16 count;
4848 int rc;
4849
4850 for (count = 0; count < EEPROM_SEM_RETRY_LIMIT; count++) {
4851 /* Request semaphore */
4852 iwl4965_set_bit(priv, CSR_HW_IF_CONFIG_REG,
4853 CSR_HW_IF_CONFIG_REG_BIT_EEPROM_OWN_SEM);
4854
4855 /* See if we got it */
4856 rc = iwl4965_poll_bit(priv, CSR_HW_IF_CONFIG_REG,
4857 CSR_HW_IF_CONFIG_REG_BIT_EEPROM_OWN_SEM,
4858 CSR_HW_IF_CONFIG_REG_BIT_EEPROM_OWN_SEM,
4859 EEPROM_SEM_TIMEOUT);
4860 if (rc >= 0) {
4861 IWL_DEBUG_IO("Acquired semaphore after %d tries.\n",
4862 count+1);
4863 return rc;
4864 }
4865 }
4866
4867 return rc;
4868}
4869
4870MODULE_DEVICE_TABLE(pci, iwl4965_hw_card_ids); 4853MODULE_DEVICE_TABLE(pci, iwl4965_hw_card_ids);