diff options
author | Rafał Miłecki <rafal@milecki.pl> | 2018-06-17 22:46:29 +0200 |
---|---|---|
committer | Rafał Miłecki <rafal@milecki.pl> | 2018-06-17 22:46:29 +0200 |
commit | 0da9303e5b444e2c98c24719c48c09f4c976c5a7 (patch) | |
tree | 2ab7fd140ff27b9762862f3a9556884c3f08756b /package/kernel/mac80211/patches/325-v4.17-0005-brcmfmac-move-brcmf_attach-function-in-core.c.patch | |
parent | e53d0da775082ee5d1d18949b00850590cf81650 (diff) | |
download | mtk-20170518-0da9303e5b444e2c98c24719c48c09f4c976c5a7.zip mtk-20170518-0da9303e5b444e2c98c24719c48c09f4c976c5a7.tar.gz mtk-20170518-0da9303e5b444e2c98c24719c48c09f4c976c5a7.tar.bz2 |
mac80211: backport "brcmfmac: cleanup and some rework" from 4.17
It was described by Arend as:
> This series is intended for 4.17 and includes following:
>
> * rework bus layer attach code.
> * remove duplicate variable declaration.
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Diffstat (limited to 'package/kernel/mac80211/patches/325-v4.17-0005-brcmfmac-move-brcmf_attach-function-in-core.c.patch')
-rw-r--r-- | package/kernel/mac80211/patches/325-v4.17-0005-brcmfmac-move-brcmf_attach-function-in-core.c.patch | 130 |
1 files changed, 130 insertions, 0 deletions
diff --git a/package/kernel/mac80211/patches/325-v4.17-0005-brcmfmac-move-brcmf_attach-function-in-core.c.patch b/package/kernel/mac80211/patches/325-v4.17-0005-brcmfmac-move-brcmf_attach-function-in-core.c.patch new file mode 100644 index 0000000..086b5fa --- /dev/null +++ b/package/kernel/mac80211/patches/325-v4.17-0005-brcmfmac-move-brcmf_attach-function-in-core.c.patch @@ -0,0 +1,130 @@ +From 0542503c4c164c65cd1567b0f2b3f887af6c81eb Mon Sep 17 00:00:00 2001 +From: Arend Van Spriel <arend.vanspriel@broadcom.com> +Date: Tue, 20 Feb 2018 00:14:22 +0100 +Subject: [PATCH] brcmfmac: move brcmf_attach() function in core.c + +Moving the function in preparation of subsequent patch. + +Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com> +Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com> +Reviewed-by: Franky Lin <franky.lin@broadcom.com> +Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com> +Signed-off-by: Kalle Valo <kvalo@codeaurora.org> +--- + .../wireless/broadcom/brcm80211/brcmfmac/core.c | 98 +++++++++++----------- + 1 file changed, 49 insertions(+), 49 deletions(-) + +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +@@ -992,55 +992,6 @@ static int brcmf_inet6addr_changed(struc + } + #endif + +-int brcmf_attach(struct device *dev, struct brcmf_mp_device *settings) +-{ +- struct brcmf_pub *drvr = NULL; +- int ret = 0; +- int i; +- +- brcmf_dbg(TRACE, "Enter\n"); +- +- /* Allocate primary brcmf_info */ +- drvr = kzalloc(sizeof(struct brcmf_pub), GFP_ATOMIC); +- if (!drvr) +- return -ENOMEM; +- +- for (i = 0; i < ARRAY_SIZE(drvr->if2bss); i++) +- drvr->if2bss[i] = BRCMF_BSSIDX_INVALID; +- +- mutex_init(&drvr->proto_block); +- +- /* Link to bus module */ +- drvr->hdrlen = 0; +- drvr->bus_if = dev_get_drvdata(dev); +- drvr->bus_if->drvr = drvr; +- drvr->settings = settings; +- +- /* attach debug facilities */ +- brcmf_debug_attach(drvr); +- +- /* Attach and link in the protocol */ +- ret = brcmf_proto_attach(drvr); +- if (ret != 0) { +- brcmf_err("brcmf_prot_attach failed\n"); +- goto fail; +- } +- +- /* Attach to events important for core code */ +- brcmf_fweh_register(drvr, BRCMF_E_PSM_WATCHDOG, +- brcmf_psm_watchdog_notify); +- +- /* attach firmware event handler */ +- brcmf_fweh_attach(drvr); +- +- return ret; +- +-fail: +- brcmf_detach(dev); +- +- return ret; +-} +- + static int brcmf_revinfo_read(struct seq_file *s, void *data) + { + struct brcmf_bus *bus_if = dev_get_drvdata(s->private); +@@ -1170,6 +1121,55 @@ fail: + + return ret; + } ++ ++int brcmf_attach(struct device *dev, struct brcmf_mp_device *settings) ++{ ++ struct brcmf_pub *drvr = NULL; ++ int ret = 0; ++ int i; ++ ++ brcmf_dbg(TRACE, "Enter\n"); ++ ++ /* Allocate primary brcmf_info */ ++ drvr = kzalloc(sizeof(*drvr), GFP_ATOMIC); ++ if (!drvr) ++ return -ENOMEM; ++ ++ for (i = 0; i < ARRAY_SIZE(drvr->if2bss); i++) ++ drvr->if2bss[i] = BRCMF_BSSIDX_INVALID; ++ ++ mutex_init(&drvr->proto_block); ++ ++ /* Link to bus module */ ++ drvr->hdrlen = 0; ++ drvr->bus_if = dev_get_drvdata(dev); ++ drvr->bus_if->drvr = drvr; ++ drvr->settings = settings; ++ ++ /* attach debug facilities */ ++ brcmf_debug_attach(drvr); ++ ++ /* Attach and link in the protocol */ ++ ret = brcmf_proto_attach(drvr); ++ if (ret != 0) { ++ brcmf_err("brcmf_prot_attach failed\n"); ++ goto fail; ++ } ++ ++ /* Attach to events important for core code */ ++ brcmf_fweh_register(drvr, BRCMF_E_PSM_WATCHDOG, ++ brcmf_psm_watchdog_notify); ++ ++ /* attach firmware event handler */ ++ brcmf_fweh_attach(drvr); ++ ++ return ret; ++ ++fail: ++ brcmf_detach(dev); ++ ++ return ret; ++} + + void brcmf_bus_add_txhdrlen(struct device *dev, uint len) + { |