linux/drivers/net/wireless/realtek/rtw88/rtw8821ce.c
Chin-Yen Lee cdb82c80b9 wifi: rtw88: pci: add PCI Express error handling
Sometimes PCIe Advanced Error Reporting(AER), like bad TLP or
Data link protocol error, happens due to unstable pci signal or
no response from PCI host.

  pcieport 0000:00:00.0: AER: Multiple Corrected error message received from 0000:00:00.0
  pcieport 0000:00:00.0: AER: PCIe Bus Error: severity=Corrected, type=Physical Layer, (Receiver ID)
  pcieport 0000:00:00.0: AER:   device [14c3:6786] error status/mask=000000c1/00006000
  pcieport 0000:00:00.0: AER:    [ 0] RxErr                  (First)
  pcieport 0000:00:00.0: AER:    [ 6] BadTLP
  pcieport 0000:00:00.0: AER:    [ 7] BadDLLP
  pcieport 0000:00:00.0: AER: Corrected error message received from 0000:00:00.0
  pcieport 0000:00:00.0: AER: found no error details for 0000:00:00.0
  pcieport 0000:00:00.0: AER: Multiple Corrected error message received from 0000:00:00.0
  pcieport 0000:00:00.0: AER: found no error details for 0000:00:00.0
  pcieport 0000:00:00.0: AER: Multiple Corrected error message received from 0000:00:00.0
  pcieport 0000:00:00.0: AER: found no error details for 0000:00:00.0

Setup callback function to call SER function to reset driver to recover
from these states

Signed-off-by: Chin-Yen Lee <timlee@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20250523062711.27213-2-pkshih@realtek.com
2025-06-10 09:22:44 +08:00

36 lines
944 B
C

// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
/* Copyright(c) 2018-2019 Realtek Corporation
*/
#include <linux/module.h>
#include <linux/pci.h>
#include "pci.h"
#include "rtw8821c.h"
static const struct pci_device_id rtw_8821ce_id_table[] = {
{
PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0xB821),
.driver_data = (kernel_ulong_t)&rtw8821c_hw_spec
},
{
PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0xC821),
.driver_data = (kernel_ulong_t)&rtw8821c_hw_spec
},
{}
};
MODULE_DEVICE_TABLE(pci, rtw_8821ce_id_table);
static struct pci_driver rtw_8821ce_driver = {
.name = KBUILD_MODNAME,
.id_table = rtw_8821ce_id_table,
.probe = rtw_pci_probe,
.remove = rtw_pci_remove,
.driver.pm = &rtw_pm_ops,
.shutdown = rtw_pci_shutdown,
.err_handler = &rtw_pci_err_handler,
};
module_pci_driver(rtw_8821ce_driver);
MODULE_AUTHOR("Realtek Corporation");
MODULE_DESCRIPTION("Realtek 802.11ac wireless 8821ce driver");
MODULE_LICENSE("Dual BSD/GPL");