Commit 08079a49 authored by Emmanuel Grumbach's avatar Emmanuel Grumbach Committed by Wey-Yi Guy

iwlwifi: move hw_rev to transport layer

The HW revision is now read by the transport layer in its allocation.
Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: default avatarWey-Yi Guy <wey-yi.w.guy@intel.com>
parent 99673ee5
...@@ -1691,13 +1691,6 @@ static void iwl_uninit_drv(struct iwl_priv *priv) ...@@ -1691,13 +1691,6 @@ static void iwl_uninit_drv(struct iwl_priv *priv)
#endif #endif
} }
static u32 iwl_hw_detect(struct iwl_priv *priv)
{
return iwl_read32(trans(priv), CSR_HW_REV);
}
/* Size of one Rx buffer in host DRAM */ /* Size of one Rx buffer in host DRAM */
#define IWL_RX_BUF_SIZE_4K (4 * 1024) #define IWL_RX_BUF_SIZE_4K (4 * 1024)
#define IWL_RX_BUF_SIZE_8K (8 * 1024) #define IWL_RX_BUF_SIZE_8K (8 * 1024)
...@@ -1769,7 +1762,6 @@ int iwl_probe(struct iwl_bus *bus, const struct iwl_trans_ops *trans_ops, ...@@ -1769,7 +1762,6 @@ int iwl_probe(struct iwl_bus *bus, const struct iwl_trans_ops *trans_ops,
struct iwl_priv *priv; struct iwl_priv *priv;
struct ieee80211_hw *hw; struct ieee80211_hw *hw;
u16 num_mac; u16 num_mac;
u32 hw_rev;
/************************ /************************
* 1. Allocating HW data * 1. Allocating HW data
...@@ -1818,9 +1810,8 @@ int iwl_probe(struct iwl_bus *bus, const struct iwl_trans_ops *trans_ops, ...@@ -1818,9 +1810,8 @@ int iwl_probe(struct iwl_bus *bus, const struct iwl_trans_ops *trans_ops,
/*********************** /***********************
* 3. Read REV register * 3. Read REV register
***********************/ ***********************/
hw_rev = iwl_hw_detect(priv);
IWL_INFO(priv, "Detected %s, REV=0x%X\n", IWL_INFO(priv, "Detected %s, REV=0x%X\n",
cfg(priv)->name, hw_rev); cfg(priv)->name, trans(priv)->hw_rev);
err = iwl_trans_start_hw(trans(priv)); err = iwl_trans_start_hw(trans(priv));
if (err) if (err)
...@@ -1830,7 +1821,7 @@ int iwl_probe(struct iwl_bus *bus, const struct iwl_trans_ops *trans_ops, ...@@ -1830,7 +1821,7 @@ int iwl_probe(struct iwl_bus *bus, const struct iwl_trans_ops *trans_ops,
* 4. Read EEPROM * 4. Read EEPROM
*****************/ *****************/
/* Read the EEPROM */ /* Read the EEPROM */
err = iwl_eeprom_init(priv, hw_rev); err = iwl_eeprom_init(priv, trans(priv)->hw_rev);
/* Reset chip to save power until we load uCode during "up". */ /* Reset chip to save power until we load uCode during "up". */
iwl_trans_stop_hw(trans(priv)); iwl_trans_stop_hw(trans(priv));
if (err) { if (err) {
......
...@@ -2317,6 +2317,7 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct iwl_shared *shrd, ...@@ -2317,6 +2317,7 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct iwl_shared *shrd,
trans->dev = &pdev->dev; trans->dev = &pdev->dev;
trans->irq = pdev->irq; trans->irq = pdev->irq;
trans_pcie->pci_dev = pdev; trans_pcie->pci_dev = pdev;
trans->hw_rev = iwl_read32(trans, CSR_HW_REV);
trans->hw_id = (pdev->device << 16) + pdev->subsystem_device; trans->hw_id = (pdev->device << 16) + pdev->subsystem_device;
snprintf(trans->hw_id_str, sizeof(trans->hw_id_str), snprintf(trans->hw_id_str, sizeof(trans->hw_id_str),
"PCI ID: 0x%04X:0x%04X", pdev->device, pdev->subsystem_device); "PCI ID: 0x%04X:0x%04X", pdev->device, pdev->subsystem_device);
......
...@@ -253,6 +253,7 @@ struct iwl_trans { ...@@ -253,6 +253,7 @@ struct iwl_trans {
struct device *dev; struct device *dev;
unsigned int irq; unsigned int irq;
u32 hw_rev;
u32 hw_id; u32 hw_id;
char hw_id_str[52]; char hw_id_str[52];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment