|
@@ -37,6 +37,22 @@ static struct mwifiex_if_ops pcie_ops;
|
|
|
|
|
|
static struct semaphore add_remove_card_sem;
|
|
|
|
|
|
+static const struct of_device_id mwifiex_pcie_of_match_table[] = {
|
|
|
+ { .compatible = "pci11ab,2b42" },
|
|
|
+ { .compatible = "pci1b4b,2b42" },
|
|
|
+ { }
|
|
|
+};
|
|
|
+
|
|
|
+static int mwifiex_pcie_probe_of(struct device *dev)
|
|
|
+{
|
|
|
+ if (!of_match_node(mwifiex_pcie_of_match_table, dev->of_node)) {
|
|
|
+ dev_err(dev, "required compatible string missing\n");
|
|
|
+ return -EINVAL;
|
|
|
+ }
|
|
|
+
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
static int
|
|
|
mwifiex_map_pci_memory(struct mwifiex_adapter *adapter, struct sk_buff *skb,
|
|
|
size_t size, int flags)
|
|
@@ -185,6 +201,7 @@ static int mwifiex_pcie_probe(struct pci_dev *pdev,
|
|
|
const struct pci_device_id *ent)
|
|
|
{
|
|
|
struct pcie_service_card *card;
|
|
|
+ int ret;
|
|
|
|
|
|
pr_debug("info: vendor=0x%4.04X device=0x%4.04X rev=%d\n",
|
|
|
pdev->vendor, pdev->device, pdev->revision);
|
|
@@ -206,6 +223,13 @@ static int mwifiex_pcie_probe(struct pci_dev *pdev,
|
|
|
card->pcie.can_ext_scan = data->can_ext_scan;
|
|
|
}
|
|
|
|
|
|
+ /* device tree node parsing and platform specific configuration*/
|
|
|
+ if (pdev->dev.of_node) {
|
|
|
+ ret = mwifiex_pcie_probe_of(&pdev->dev);
|
|
|
+ if (ret)
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
+
|
|
|
if (mwifiex_add_card(card, &add_remove_card_sem, &pcie_ops,
|
|
|
MWIFIEX_PCIE)) {
|
|
|
pr_err("%s failed\n", __func__);
|