From 964731f33f9c3c20b7d310db98d5ea0936cf6a01 Mon Sep 17 00:00:00 2001 From: Yue Ma Date: Fri, 7 Feb 2014 14:38:46 -0800 Subject: [PATCH] cnss: Update SSR crash shutdown API Update the SSR API in order to support collect target RAM dump even when host driver or other sub-systems crash. CRs-Fixed: 609070 Change-Id: I8480f5d9a1a6b357792c7d92981b428cfb25f376 Signed-off-by: Yue Ma --- drivers/net/wireless/cnss/cnss.c | 9 +++++++++ include/net/cnss.h | 13 +++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/cnss/cnss.c b/drivers/net/wireless/cnss/cnss.c index 76ff47ed340..186e1633b30 100644 --- a/drivers/net/wireless/cnss/cnss.c +++ b/drivers/net/wireless/cnss/cnss.c @@ -795,7 +795,16 @@ static int cnss_ramdump(int enable, const struct subsys_desc *subsys) static void cnss_crash_shutdown(const struct subsys_desc *subsys) { + struct cnss_wlan_driver *wdrv; + struct pci_dev *pdev; + if (!penv) + return; + + wdrv = penv->driver; + pdev = penv->pdev; + if (pdev && wdrv && wdrv->crash_shutdown) + wdrv->crash_shutdown(pdev); } void cnss_device_self_recovery(void) diff --git a/include/net/cnss.h b/include/net/cnss.h index 06c8e45bf4b..e8e5677805d 100644 --- a/include/net/cnss.h +++ b/include/net/cnss.h @@ -30,12 +30,13 @@ struct cnss_fw_files { struct cnss_wlan_driver { char *name; - int (*probe)(struct pci_dev *, const struct pci_device_id *); - void (*remove)(struct pci_dev *); - int (*reinit)(struct pci_dev *, const struct pci_device_id *); - void (*shutdown)(struct pci_dev *); - int (*suspend)(struct pci_dev *, pm_message_t state); - int (*resume)(struct pci_dev *); + int (*probe)(struct pci_dev *pdev, const struct pci_device_id *id); + void (*remove)(struct pci_dev *pdev); + int (*reinit)(struct pci_dev *pdev, const struct pci_device_id *id); + void (*shutdown)(struct pci_dev *pdev); + void (*crash_shutdown)(struct pci_dev *pdev); + int (*suspend)(struct pci_dev *pdev, pm_message_t state); + int (*resume)(struct pci_dev *pdev); const struct pci_device_id *id_table; };