From patchwork Mon Nov 14 14:38:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wen-chien Jesse Sung X-Patchwork-Id: 694548 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 3tHY7K1gymz9ssP; Tue, 15 Nov 2016 01:39:09 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1c6IPZ-0000Rc-8X; Mon, 14 Nov 2016 14:39:05 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1c6IPU-0000RO-73 for kernel-team@lists.ubuntu.com; Mon, 14 Nov 2016 14:39:00 +0000 Received: from 1.general.jesse.uk.vpn ([10.172.197.96] helo=cola.voip.idv.tw) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1c6IPT-00063b-As; Mon, 14 Nov 2016 14:38:59 +0000 From: jesse.sung@canonical.com To: kernel-team@lists.ubuntu.com Subject: [Xenial][PATCH v2] UBUNTU: SAUCE: mwifiex: Use PCI ID instead of DMI ID to identify Edge Gateways Date: Mon, 14 Nov 2016 22:38:55 +0800 Message-Id: <1479134335-23968-1-git-send-email-jesse.sung@canonical.com> X-Mailer: git-send-email 2.7.4 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: kernel-team-bounces@lists.ubuntu.com From: Wen-chien Jesse Sung BugLink: https://launchpad.net/bugs/1640418 The DMI ID string may be changed in some models. Use PCI ID as an indentification instead. Signed-off-by: Wen-chien Jesse Sung --- drivers/net/wireless/mwifiex/pcie.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/mwifiex/pcie.c b/drivers/net/wireless/mwifiex/pcie.c index 0dbb528..8922593 100644 --- a/drivers/net/wireless/mwifiex/pcie.c +++ b/drivers/net/wireless/mwifiex/pcie.c @@ -191,6 +191,7 @@ static int mwifiex_pcie_probe(struct pci_dev *pdev, { struct pcie_service_card *card; struct mwifiex_private *priv; + struct pci_dev *pdev_host; pr_debug("info: vendor=0x%4.04X device=0x%4.04X rev=%d\n", pdev->vendor, pdev->device, pdev->revision); @@ -219,9 +220,13 @@ static int mwifiex_pcie_probe(struct pci_dev *pdev, } priv = mwifiex_get_priv(card->adapter, MWIFIEX_BSS_ROLE_STA); - if (dmi_match(DMI_PRODUCT_NAME, "Edge Gateway 5000") || - dmi_match(DMI_PRODUCT_NAME, "Edge Gateway 5100")) + pdev_host = pci_get_subsys(PCI_ANY_ID, PCI_ANY_ID, 0x1028, 0x0720, NULL); + if (!pdev_host) + pdev_host = pci_get_subsys(PCI_ANY_ID, PCI_ANY_ID, 0x1028, 0x0733, NULL); + if (pdev_host) { priv->is_edge_gateway = true; + pci_dev_put(pdev_host); + } return 0; }