Commit 5448bc2a authored by Jonas Dreßler's avatar Jonas Dreßler Committed by Kalle Valo

mwifiex: pcie: add DMI-based quirk implementation for Surface devices

This commit adds the ability to apply device-specific quirks to the
mwifiex driver. It uses DMI matching similar to the quirks brcmfmac uses
with dmi.c. We'll add identifiers to match various MS Surface devices,
which this is primarily meant for, later.

This commit is a slightly modified version of a previous patch sent in
by Tsuchiya Yuto.
Co-developed-by: default avatarTsuchiya Yuto <kitakar@gmail.com>
Signed-off-by: default avatarTsuchiya Yuto <kitakar@gmail.com>
Signed-off-by: default avatarJonas Dreßler <verdre@v0yd.nl>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210820142050.35741-2-verdre@v0yd.nl
parent d745ca4f
...@@ -49,6 +49,7 @@ mwifiex_sdio-y += sdio.o ...@@ -49,6 +49,7 @@ mwifiex_sdio-y += sdio.o
obj-$(CONFIG_MWIFIEX_SDIO) += mwifiex_sdio.o obj-$(CONFIG_MWIFIEX_SDIO) += mwifiex_sdio.o
mwifiex_pcie-y += pcie.o mwifiex_pcie-y += pcie.o
mwifiex_pcie-y += pcie_quirks.o
obj-$(CONFIG_MWIFIEX_PCIE) += mwifiex_pcie.o obj-$(CONFIG_MWIFIEX_PCIE) += mwifiex_pcie.o
mwifiex_usb-y += usb.o mwifiex_usb-y += usb.o
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include "wmm.h" #include "wmm.h"
#include "11n.h" #include "11n.h"
#include "pcie.h" #include "pcie.h"
#include "pcie_quirks.h"
#define PCIE_VERSION "1.0" #define PCIE_VERSION "1.0"
#define DRV_NAME "Marvell mwifiex PCIe" #define DRV_NAME "Marvell mwifiex PCIe"
...@@ -410,6 +411,9 @@ static int mwifiex_pcie_probe(struct pci_dev *pdev, ...@@ -410,6 +411,9 @@ static int mwifiex_pcie_probe(struct pci_dev *pdev,
return ret; return ret;
} }
/* check quirks */
mwifiex_initialize_quirks(card);
if (mwifiex_add_card(card, &card->fw_done, &pcie_ops, if (mwifiex_add_card(card, &card->fw_done, &pcie_ops,
MWIFIEX_PCIE, &pdev->dev)) { MWIFIEX_PCIE, &pdev->dev)) {
pr_err("%s failed\n", __func__); pr_err("%s failed\n", __func__);
......
...@@ -244,6 +244,7 @@ struct pcie_service_card { ...@@ -244,6 +244,7 @@ struct pcie_service_card {
unsigned long work_flags; unsigned long work_flags;
bool pci_reset_ongoing; bool pci_reset_ongoing;
unsigned long quirks;
}; };
static inline int static inline int
......
/*
* NXP Wireless LAN device driver: PCIE and platform specific quirks
*
* This software file (the "File") is distributed by NXP
* under the terms of the GNU General Public License Version 2, June 1991
* (the "License"). You may use, redistribute and/or modify this File in
* accordance with the terms and conditions of the License, a copy of which
* is available by writing to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
* worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
*
* THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
* IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
* ARE EXPRESSLY DISCLAIMED. The License provides additional details about
* this warranty disclaimer.
*/
#include <linux/dmi.h>
#include "pcie_quirks.h"
/* quirk table based on DMI matching */
static const struct dmi_system_id mwifiex_quirk_table[] = {
{}
};
void mwifiex_initialize_quirks(struct pcie_service_card *card)
{
struct pci_dev *pdev = card->dev;
const struct dmi_system_id *dmi_id;
dmi_id = dmi_first_match(mwifiex_quirk_table);
if (dmi_id)
card->quirks = (uintptr_t)dmi_id->driver_data;
if (!card->quirks)
dev_info(&pdev->dev, "no quirks enabled\n");
}
/*
* NXP Wireless LAN device driver: PCIE and platform specific quirks
*
* This software file (the "File") is distributed by NXP
* under the terms of the GNU General Public License Version 2, June 1991
* (the "License"). You may use, redistribute and/or modify this File in
* accordance with the terms and conditions of the License, a copy of which
* is available by writing to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
* worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
*
* THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
* IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
* ARE EXPRESSLY DISCLAIMED. The License provides additional details about
* this warranty disclaimer.
*/
#include "pcie.h"
void mwifiex_initialize_quirks(struct pcie_service_card *card);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment