|
@@ -1381,6 +1381,27 @@ int cnss_pci_link_down(struct device *dev)
|
|
|
}
|
|
|
EXPORT_SYMBOL(cnss_pci_link_down);
|
|
|
|
|
|
+int cnss_pci_get_reg_dump(struct device *dev, uint8_t *buffer, uint32_t len)
|
|
|
+{
|
|
|
+ struct pci_dev *pci_dev = to_pci_dev(dev);
|
|
|
+ struct cnss_pci_data *pci_priv = cnss_get_pci_priv(pci_dev);
|
|
|
+
|
|
|
+ if (!pci_priv) {
|
|
|
+ cnss_pr_err("pci_priv is NULL\n");
|
|
|
+ return -ENODEV;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (pci_priv->pci_link_state == PCI_LINK_DOWN) {
|
|
|
+ cnss_pr_dbg("No PCIe reg dump since PCIe is suspended(D3)\n");
|
|
|
+ return -EACCES;
|
|
|
+ }
|
|
|
+
|
|
|
+ cnss_pr_dbg("Start to get PCIe reg dump\n");
|
|
|
+
|
|
|
+ return _cnss_pci_get_reg_dump(pci_priv, buffer, len);
|
|
|
+}
|
|
|
+EXPORT_SYMBOL(cnss_pci_get_reg_dump);
|
|
|
+
|
|
|
int cnss_pcie_is_device_down(struct cnss_pci_data *pci_priv)
|
|
|
{
|
|
|
struct cnss_plat_data *plat_priv;
|