Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8e072168 authored by Arend Van Spriel's avatar Arend Van Spriel Committed by Kalle Valo
Browse files

brcmfmac: add support for sysfs initiated coredump



The driver already supports device coredump initiated by firmware
event. Since commit 3c47d19f ("drivers: base: add coredump driver
ops") it is also possible to initiate it from user-space through
sysfs. This patch adds support for SDIO and PCIe devices.

Reviewed-by: default avatarHante Meuleman <hante.meuleman@broadcom.com>
Reviewed-by: default avatarPieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
Reviewed-by: default avatarFranky Lin <franky.lin@broadcom.com>
Signed-off-by: default avatarArend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent f8793c26
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -1165,6 +1165,7 @@ static struct sdio_driver brcmf_sdmmc_driver = {
#ifdef CONFIG_PM_SLEEP
#ifdef CONFIG_PM_SLEEP
		.pm = &brcmf_sdio_pm_ops,
		.pm = &brcmf_sdio_pm_ops,
#endif	/* CONFIG_PM_SLEEP */
#endif	/* CONFIG_PM_SLEEP */
		.coredump = brcmf_dev_coredump,
	},
	},
};
};


+2 −0
Original line number Original line Diff line number Diff line
@@ -250,6 +250,8 @@ int brcmf_attach(struct device *dev, struct brcmf_mp_device *settings);
void brcmf_detach(struct device *dev);
void brcmf_detach(struct device *dev);
/* Indication from bus module that dongle should be reset */
/* Indication from bus module that dongle should be reset */
void brcmf_dev_reset(struct device *dev);
void brcmf_dev_reset(struct device *dev);
/* Request from bus module to initiate a coredump */
void brcmf_dev_coredump(struct device *dev);


/* Configure the "global" bus state used by upper layers */
/* Configure the "global" bus state used by upper layers */
void brcmf_bus_change_state(struct brcmf_bus *bus, enum brcmf_bus_state state);
void brcmf_bus_change_state(struct brcmf_bus *bus, enum brcmf_bus_state state);
+8 −0
Original line number Original line Diff line number Diff line
@@ -1180,6 +1180,14 @@ void brcmf_dev_reset(struct device *dev)
		brcmf_fil_cmd_int_set(drvr->iflist[0], BRCMF_C_TERMINATED, 1);
		brcmf_fil_cmd_int_set(drvr->iflist[0], BRCMF_C_TERMINATED, 1);
}
}


void brcmf_dev_coredump(struct device *dev)
{
	struct brcmf_bus *bus_if = dev_get_drvdata(dev);

	if (brcmf_debug_create_memdump(bus_if, NULL, 0) < 0)
		brcmf_dbg(TRACE, "failed to create coredump\n");
}

void brcmf_detach(struct device *dev)
void brcmf_detach(struct device *dev)
{
{
	s32 i;
	s32 i;
+1 −0
Original line number Original line Diff line number Diff line
@@ -2044,6 +2044,7 @@ static struct pci_driver brcmf_pciedrvr = {
#ifdef CONFIG_PM
#ifdef CONFIG_PM
	.driver.pm = &brcmf_pciedrvr_pm,
	.driver.pm = &brcmf_pciedrvr_pm,
#endif
#endif
	.driver.coredump = brcmf_dev_coredump,
};
};