summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/ath/ath10k/pci.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2015-01-26 16:09:45 -0800
committerDavid S. Miller <davem@davemloft.net>2015-01-26 16:09:45 -0800
commit9c5d94bc18782ab3c48aa2df4ad6c451286a7bb3 (patch)
tree4fc63e45729fe4cba491c9a7abc9d9e9f72372f2 /drivers/net/wireless/ath/ath10k/pci.c
parentfd3e646c87ab3f2ba98aa25394581af27cc78dc5 (diff)
parentc5ed1df781cb544d4e4d189bb5b6ec7336d8888c (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next
Kalle Valo says: ==================== pull-request: wireless-drivers-next 2015-01-22 now a bigger pull request for net-next. Rafal found a UTF-8 bug in patchwork[1] and because of that two commits (d0c102f70aec and d0f66df5392a) have his name corrupted: Acked-by: Rafa? Mi?ecki <zajec5@gmail.com> Somehow I failed to spot that when I commited the patches. As rebasing public git trees is bad, I thought we can live with these and decided not to rebase. But I'll pay close attention to this in the future to make sure that it won't happen again. Also we requested an update to patchwork.kernel.org, the latest patchwork doesn't seem to have this bug. Also please note this pull request also adds one DT binding doc, but this was reviewed in the device tree list: .../bindings/net/wireless/qcom,ath10k.txt | 30 + Please let me know if you have any issues. [1] https://lists.ozlabs.org/pipermail/patchwork/2015-January/001261.html ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wireless/ath/ath10k/pci.c')
-rw-r--r--drivers/net/wireless/ath/ath10k/pci.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c
index 7abb8367119a..5e50214246f8 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -64,6 +64,14 @@ static const struct pci_device_id ath10k_pci_id_table[] = {
{0}
};
+static const struct ath10k_pci_supp_chip ath10k_pci_supp_chips[] = {
+ /* QCA988X pre 2.0 chips are not supported because they need some nasty
+ * hacks. ath10k doesn't have them and these devices crash horribly
+ * because of that.
+ */
+ { QCA988X_2_0_DEVICE_ID, QCA988X_HW_2_0_CHIP_ID_REV },
+};
+
static void ath10k_pci_buffer_cleanup(struct ath10k *ar);
static int ath10k_pci_cold_reset(struct ath10k *ar);
static int ath10k_pci_warm_reset(struct ath10k *ar);
@@ -2476,6 +2484,23 @@ static void ath10k_pci_release(struct ath10k *ar)
pci_disable_device(pdev);
}
+static bool ath10k_pci_chip_is_supported(u32 dev_id, u32 chip_id)
+{
+ const struct ath10k_pci_supp_chip *supp_chip;
+ int i;
+ u32 rev_id = MS(chip_id, SOC_CHIP_ID_REV);
+
+ for (i = 0; i < ARRAY_SIZE(ath10k_pci_supp_chips); i++) {
+ supp_chip = &ath10k_pci_supp_chips[i];
+
+ if (supp_chip->dev_id == dev_id &&
+ supp_chip->rev_id == rev_id)
+ return true;
+ }
+
+ return false;
+}
+
static int ath10k_pci_probe(struct pci_dev *pdev,
const struct pci_device_id *pci_dev)
{
@@ -2521,6 +2546,12 @@ static int ath10k_pci_probe(struct pci_dev *pdev,
goto err_sleep;
}
+ if (!ath10k_pci_chip_is_supported(pdev->device, chip_id)) {
+ ath10k_err(ar, "device %04x with chip_id %08x isn't supported\n",
+ pdev->device, chip_id);
+ goto err_sleep;
+ }
+
ret = ath10k_pci_alloc_pipes(ar);
if (ret) {
ath10k_err(ar, "failed to allocate copy engine pipes: %d\n",