aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>2012-01-09 09:23:00 -0500
committerWey-Yi Guy <wey-yi.w.guy@intel.com>2012-02-02 17:37:45 -0500
commit08079a4919ca960c0f46d244cae3a6ec2c39041d (patch)
treea31e98e30ca290397f5c24ff1c43a11b86c3ee65
parent99673ee556fce2fb973eaa571adb12663330caa9 (diff)
iwlwifi: move hw_rev to transport layer
The HW revision is now read by the transport layer in its allocation. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c13
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-trans-pcie.c1
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-trans.h1
3 files changed, 4 insertions, 11 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 14f8b750c7c5..36f7adeb1768 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -1691,13 +1691,6 @@ static void iwl_uninit_drv(struct iwl_priv *priv)
1691#endif 1691#endif
1692} 1692}
1693 1693
1694
1695
1696static u32 iwl_hw_detect(struct iwl_priv *priv)
1697{
1698 return iwl_read32(trans(priv), CSR_HW_REV);
1699}
1700
1701/* Size of one Rx buffer in host DRAM */ 1694/* Size of one Rx buffer in host DRAM */
1702#define IWL_RX_BUF_SIZE_4K (4 * 1024) 1695#define IWL_RX_BUF_SIZE_4K (4 * 1024)
1703#define IWL_RX_BUF_SIZE_8K (8 * 1024) 1696#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 struct iwl_priv *priv; 1762 struct iwl_priv *priv;
1770 struct ieee80211_hw *hw; 1763 struct ieee80211_hw *hw;
1771 u16 num_mac; 1764 u16 num_mac;
1772 u32 hw_rev;
1773 1765
1774 /************************ 1766 /************************
1775 * 1. Allocating HW data 1767 * 1. Allocating HW data
@@ -1818,9 +1810,8 @@ int iwl_probe(struct iwl_bus *bus, const struct iwl_trans_ops *trans_ops,
1818 /*********************** 1810 /***********************
1819 * 3. Read REV register 1811 * 3. Read REV register
1820 ***********************/ 1812 ***********************/
1821 hw_rev = iwl_hw_detect(priv);
1822 IWL_INFO(priv, "Detected %s, REV=0x%X\n", 1813 IWL_INFO(priv, "Detected %s, REV=0x%X\n",
1823 cfg(priv)->name, hw_rev); 1814 cfg(priv)->name, trans(priv)->hw_rev);
1824 1815
1825 err = iwl_trans_start_hw(trans(priv)); 1816 err = iwl_trans_start_hw(trans(priv));
1826 if (err) 1817 if (err)
@@ -1830,7 +1821,7 @@ int iwl_probe(struct iwl_bus *bus, const struct iwl_trans_ops *trans_ops,
1830 * 4. Read EEPROM 1821 * 4. Read EEPROM
1831 *****************/ 1822 *****************/
1832 /* Read the EEPROM */ 1823 /* Read the EEPROM */
1833 err = iwl_eeprom_init(priv, hw_rev); 1824 err = iwl_eeprom_init(priv, trans(priv)->hw_rev);
1834 /* Reset chip to save power until we load uCode during "up". */ 1825 /* Reset chip to save power until we load uCode during "up". */
1835 iwl_trans_stop_hw(trans(priv)); 1826 iwl_trans_stop_hw(trans(priv));
1836 if (err) { 1827 if (err) {
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c b/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c
index 4b711b790a90..ed2a9216d807 100644
--- a/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c
+++ b/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c
@@ -2317,6 +2317,7 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct iwl_shared *shrd,
2317 trans->dev = &pdev->dev; 2317 trans->dev = &pdev->dev;
2318 trans->irq = pdev->irq; 2318 trans->irq = pdev->irq;
2319 trans_pcie->pci_dev = pdev; 2319 trans_pcie->pci_dev = pdev;
2320 trans->hw_rev = iwl_read32(trans, CSR_HW_REV);
2320 trans->hw_id = (pdev->device << 16) + pdev->subsystem_device; 2321 trans->hw_id = (pdev->device << 16) + pdev->subsystem_device;
2321 snprintf(trans->hw_id_str, sizeof(trans->hw_id_str), 2322 snprintf(trans->hw_id_str, sizeof(trans->hw_id_str),
2322 "PCI ID: 0x%04X:0x%04X", pdev->device, pdev->subsystem_device); 2323 "PCI ID: 0x%04X:0x%04X", pdev->device, pdev->subsystem_device);
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans.h b/drivers/net/wireless/iwlwifi/iwl-trans.h
index 0359d71e554f..a305e96d82a0 100644
--- a/drivers/net/wireless/iwlwifi/iwl-trans.h
+++ b/drivers/net/wireless/iwlwifi/iwl-trans.h
@@ -253,6 +253,7 @@ struct iwl_trans {
253 253
254 struct device *dev; 254 struct device *dev;
255 unsigned int irq; 255 unsigned int irq;
256 u32 hw_rev;
256 u32 hw_id; 257 u32 hw_id;
257 char hw_id_str[52]; 258 char hw_id_str[52];
258 259