Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 102463
b: refs/heads/master
c: b661c81
h: refs/heads/master
i:
  102461: 2b1283c
  102459: d8dd26c
  102455: 0702f05
  102447: 30ae79d
  102431: 1c504ea
  102399: 63fdcda
v: v3
  • Loading branch information
Tomas Winkler authored and John W. Linville committed May 7, 2008
1 parent 8825283 commit 12abf70
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 91238714affef7603446207ad03a594d95d2eb9d
refs/heads/master: b661c8190e91c0baeebf813fec7ff8e99e155a54
10 changes: 1 addition & 9 deletions trunk/drivers/net/wireless/iwlwifi/iwl-4965.c
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,6 @@ int iwl4965_hw_nic_init(struct iwl_priv *priv)
{
unsigned long flags;
struct iwl4965_rx_queue *rxq = &priv->rxq;
u8 rev_id;
u8 val_link;
u32 val;
int ret;
Expand All @@ -751,18 +750,11 @@ int iwl4965_hw_nic_init(struct iwl_priv *priv)
iwl_write32(priv, CSR_INT_COALESCING, 512 / 32);
spin_unlock_irqrestore(&priv->lock, flags);

/* Determine HW type */
ret = pci_read_config_byte(priv->pci_dev, PCI_REVISION_ID, &rev_id);
if (ret)
return ret;

IWL_DEBUG_INFO("HW Revision ID = 0x%X\n", rev_id);

ret = priv->cfg->ops->lib->apm_ops.set_pwr_src(priv, IWL_PWR_SRC_VMAIN);

spin_lock_irqsave(&priv->lock, flags);

if ((rev_id & 0x80) == 0x80 && (rev_id & 0x7f) < 8) {
if ((priv->rev_id & 0x80) == 0x80 && (priv->rev_id & 0x7f) < 8) {
pci_read_config_dword(priv->pci_dev, PCI_REG_WUM8, &val);
/* Enable No Snoop field */
pci_write_config_dword(priv->pci_dev, PCI_REG_WUM8,
Expand Down
3 changes: 3 additions & 0 deletions trunk/drivers/net/wireless/iwlwifi/iwl-4965.h
Original file line number Diff line number Diff line change
Expand Up @@ -1003,6 +1003,9 @@ struct iwl_priv {

/* pci hardware address support */
void __iomem *hw_base;
u32 hw_rev;
u32 hw_wa_rev;
u8 rev_id;

/* uCode images, save to reload in case of failure */
struct fw_desc ucode_code; /* runtime inst */
Expand Down
9 changes: 9 additions & 0 deletions trunk/drivers/net/wireless/iwlwifi/iwl-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ struct iwl_priv; /* FIXME: remove */
#include "iwl-eeprom.h"
#include "iwl-4965.h" /* FIXME: remove */
#include "iwl-core.h"
#include "iwl-io.h"
#include "iwl-rfkill.h"
#include "iwl-power.h"

Expand Down Expand Up @@ -73,6 +74,14 @@ struct ieee80211_hw *iwl_alloc_all(struct iwl_cfg *cfg,
}
EXPORT_SYMBOL(iwl_alloc_all);

void iwl_hw_detect(struct iwl_priv *priv)
{
priv->hw_rev = _iwl_read32(priv, CSR_HW_REV);
priv->hw_wa_rev = _iwl_read32(priv, CSR_HW_REV_WA_REG);
pci_read_config_byte(priv->pci_dev, PCI_REVISION_ID, &priv->rev_id);
}
EXPORT_SYMBOL(iwl_hw_detect);

/**
* iwlcore_clear_stations_table - Clear the driver's station table
*
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/wireless/iwlwifi/iwl-core.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ struct iwl_cfg {

struct ieee80211_hw *iwl_alloc_all(struct iwl_cfg *cfg,
struct ieee80211_ops *hw_ops);
void iwl_hw_detect(struct iwl_priv *priv);

void iwlcore_clear_stations_table(struct iwl_priv *priv);
void iwlcore_reset_qos(struct iwl_priv *priv);
Expand Down
5 changes: 5 additions & 0 deletions trunk/drivers/net/wireless/iwlwifi/iwl-csr.h
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,11 @@
#define CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW (0x08000000)


/* HW REV */
#define CSR_HW_REV_TYPE_MSK (0x00000F0)
#define CSR_HW_REV_TYPE_3945 (0x00000D0)
#define CSR_HW_REV_TYPE_4965 (0x0000000)

/* EEPROM REG */
#define CSR_EEPROM_REG_READ_VALID_MSK (0x00000001)
#define CSR_EEPROM_REG_BIT_CMD (0x00000002)
Expand Down
4 changes: 3 additions & 1 deletion trunk/drivers/net/wireless/iwlwifi/iwl4965-base.c
Original file line number Diff line number Diff line change
Expand Up @@ -7459,8 +7459,10 @@ static int iwl4965_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
(unsigned long long) pci_resource_len(pdev, 0));
IWL_DEBUG_INFO("pci_resource_base = %p\n", priv->hw_base);

iwl_hw_detect(priv);
printk(KERN_INFO DRV_NAME
": Detected Intel Wireless WiFi Link %s\n", priv->cfg->name);
": Detected Intel Wireless WiFi Link %s REV=0x%X\n",
priv->cfg->name, priv->hw_rev);

/* amp init */
err = priv->cfg->ops->lib->apm_ops.init(priv);
Expand Down

0 comments on commit 12abf70

Please sign in to comment.