diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-trans-pcie.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-trans-pcie.c | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c b/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c index 5d0cfe033407..80f531844f3e 100644 --- a/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c +++ b/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c | |||
@@ -1299,6 +1299,22 @@ static int iwl_trans_pcie_reclaim(struct iwl_trans *trans, int sta_id, int tid, | |||
1299 | return 0; | 1299 | return 0; |
1300 | } | 1300 | } |
1301 | 1301 | ||
1302 | static void iwl_trans_pcie_write8(struct iwl_trans *trans, u32 ofs, u8 val) | ||
1303 | { | ||
1304 | iowrite8(val, IWL_TRANS_GET_PCIE_TRANS(trans)->hw_base + ofs); | ||
1305 | } | ||
1306 | |||
1307 | static void iwl_trans_pcie_write32(struct iwl_trans *trans, u32 ofs, u32 val) | ||
1308 | { | ||
1309 | iowrite32(val, IWL_TRANS_GET_PCIE_TRANS(trans)->hw_base + ofs); | ||
1310 | } | ||
1311 | |||
1312 | static u32 iwl_trans_pcie_read32(struct iwl_trans *trans, u32 ofs) | ||
1313 | { | ||
1314 | u32 val = ioread32(IWL_TRANS_GET_PCIE_TRANS(trans)->hw_base + ofs); | ||
1315 | return val; | ||
1316 | } | ||
1317 | |||
1302 | static void iwl_trans_pcie_free(struct iwl_trans *trans) | 1318 | static void iwl_trans_pcie_free(struct iwl_trans *trans) |
1303 | { | 1319 | { |
1304 | struct iwl_trans_pcie *trans_pcie = | 1320 | struct iwl_trans_pcie *trans_pcie = |
@@ -1935,22 +1951,11 @@ const struct iwl_trans_ops trans_ops_pcie = { | |||
1935 | .suspend = iwl_trans_pcie_suspend, | 1951 | .suspend = iwl_trans_pcie_suspend, |
1936 | .resume = iwl_trans_pcie_resume, | 1952 | .resume = iwl_trans_pcie_resume, |
1937 | #endif | 1953 | #endif |
1954 | .write8 = iwl_trans_pcie_write8, | ||
1955 | .write32 = iwl_trans_pcie_write32, | ||
1956 | .read32 = iwl_trans_pcie_read32, | ||
1938 | }; | 1957 | }; |
1939 | 1958 | ||
1940 | /* TODO: remove this hack - will be possible when all the io{write/read} ops | ||
1941 | * will be done through the transport | ||
1942 | */ | ||
1943 | struct iwl_pci_bus { | ||
1944 | /* basic pci-network driver stuff */ | ||
1945 | struct pci_dev *pci_dev; | ||
1946 | |||
1947 | /* pci hardware address support */ | ||
1948 | void __iomem *hw_base; | ||
1949 | }; | ||
1950 | |||
1951 | #define IWL_BUS_GET_PCI_BUS(_iwl_bus) \ | ||
1952 | ((struct iwl_pci_bus *) ((_iwl_bus)->bus_specific)) | ||
1953 | |||
1954 | /* PCI registers */ | 1959 | /* PCI registers */ |
1955 | #define PCI_CFG_RETRY_TIMEOUT 0x041 | 1960 | #define PCI_CFG_RETRY_TIMEOUT 0x041 |
1956 | 1961 | ||
@@ -1958,7 +1963,6 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct iwl_shared *shrd, | |||
1958 | struct pci_dev *pdev, | 1963 | struct pci_dev *pdev, |
1959 | const struct pci_device_id *ent) | 1964 | const struct pci_device_id *ent) |
1960 | { | 1965 | { |
1961 | struct iwl_pci_bus *iwl_pci_bus = IWL_BUS_GET_PCI_BUS(shrd->bus); | ||
1962 | struct iwl_trans_pcie *trans_pcie; | 1966 | struct iwl_trans_pcie *trans_pcie; |
1963 | struct iwl_trans *trans; | 1967 | struct iwl_trans *trans; |
1964 | u16 pci_cmd; | 1968 | u16 pci_cmd; |
@@ -2018,9 +2022,6 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct iwl_shared *shrd, | |||
2018 | goto out_pci_release_regions; | 2022 | goto out_pci_release_regions; |
2019 | } | 2023 | } |
2020 | 2024 | ||
2021 | /* TODO: remove this hack */ | ||
2022 | iwl_pci_bus->hw_base = trans_pcie->hw_base; | ||
2023 | |||
2024 | dev_printk(KERN_INFO, &pdev->dev, | 2025 | dev_printk(KERN_INFO, &pdev->dev, |
2025 | "pci_resource_len = 0x%08llx\n", | 2026 | "pci_resource_len = 0x%08llx\n", |
2026 | (unsigned long long) pci_resource_len(pdev, 0)); | 2027 | (unsigned long long) pci_resource_len(pdev, 0)); |