diff mbox

[Xenial,v2] UBUNTU: SAUCE: mwifiex: Use PCI ID instead of DMI ID to identify Edge Gateways

Message ID 1479134335-23968-1-git-send-email-jesse.sung@canonical.com
State New
Headers show

Commit Message

Wen-chien Jesse Sung Nov. 14, 2016, 2:38 p.m. UTC
From: Wen-chien Jesse Sung <jesse.sung@canonical.com>

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 <jesse.sung@canonical.com>
---
 drivers/net/wireless/mwifiex/pcie.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

Comments

Tim Gardner Nov. 14, 2016, 2:58 p.m. UTC | #1
What about Yakkety and Zesty ?
Wen-chien Jesse Sung Nov. 15, 2016, 8:07 a.m. UTC | #2
2016-11-14 22:58 GMT+08:00 Tim Gardner <tim.gardner@canonical.com>:
> What about Yakkety and Zesty ?

We don't have the LED patches in Yakkety and Zesty so no fix is required.

Thanks,
Jesse

>
>
> --
> Tim Gardner tim.gardner@canonical.com
Stefan Bader Nov. 15, 2016, 9:22 a.m. UTC | #3
On 15.11.2016 09:07, Jesse Sung wrote:
> 2016-11-14 22:58 GMT+08:00 Tim Gardner <tim.gardner@canonical.com>:
>> What about Yakkety and Zesty ?
> 
> We don't have the LED patches in Yakkety and Zesty so no fix is required.

Isn't that a "bug" on its own? Sounds like a regression on upgrade just waiting
to happen...

-Stefan
Seth Forshee Nov. 15, 2016, 1:08 p.m. UTC | #4
On Mon, Nov 14, 2016 at 10:38:55PM +0800, jesse.sung@canonical.com wrote:
> From: Wen-chien Jesse Sung <jesse.sung@canonical.com>
> 
> 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 <jesse.sung@canonical.com>
> ---
>  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;
>  }

That looks better.
Luis Henriques Nov. 15, 2016, 3:40 p.m. UTC | #5
Applied to xenial master-next branch.

Cheers,
--
Luís
diff mbox

Patch

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;
 }