mac80211: brcmfmac: fix memleak and add size optimization
[openwrt/staging/rmilecki.git] / package / kernel / mac80211 / patches / 855-0004-brcmfmac-compile-fws-ignal-code-only-with-BCDC-suppo.patch
1 From 8708697ab5f203f095b551c5f4abd0d9517498ef Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
3 Date: Sat, 24 Sep 2016 22:35:47 +0200
4 Subject: [PATCH 2/2] brcmfmac: compile fws(ignal) code only with BCDC support
5 enabled
6 MIME-Version: 1.0
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
9
10 It's not needed by the other (msgbuf) protocol, so let's save some size
11 and compile it conditionally.
12
13 Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
14 ---
15 .../wireless/broadcom/brcm80211/brcmfmac/Makefile | 4 +-
16 .../broadcom/brcm80211/brcmfmac/fwsignal.h | 59 ++++++++++++++++++++++
17 2 files changed, 61 insertions(+), 2 deletions(-)
18
19 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/Makefile
20 +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/Makefile
21 @@ -27,7 +27,6 @@ brcmfmac-objs += \
22 chip.o \
23 fwil.o \
24 fweh.o \
25 - fwsignal.o \
26 p2p.o \
27 proto.o \
28 common.o \
29 @@ -37,7 +36,8 @@ brcmfmac-objs += \
30 btcoex.o \
31 vendor.o
32 brcmfmac-$(CPTCFG_BRCMFMAC_PROTO_BCDC) += \
33 - bcdc.o
34 + bcdc.o \
35 + fwsignal.o
36 brcmfmac-$(CPTCFG_BRCMFMAC_PROTO_MSGBUF) += \
37 commonring.o \
38 flowring.o \
39 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.h
40 +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.h
41 @@ -18,6 +18,7 @@
42 #ifndef FWSIGNAL_H_
43 #define FWSIGNAL_H_
44
45 +#ifdef CPTCFG_BRCMFMAC_PROTO_BCDC
46 int brcmf_fws_init(struct brcmf_pub *drvr);
47 void brcmf_fws_deinit(struct brcmf_pub *drvr);
48 bool brcmf_fws_skbs_queueing(struct brcmf_fws_info *fws);
49 @@ -31,5 +32,63 @@ void brcmf_fws_del_interface(struct brcm
50 void brcmf_fws_bustxfail(struct brcmf_fws_info *fws, struct sk_buff *skb);
51 void brcmf_fws_bus_blocked(struct brcmf_pub *drvr, bool flow_blocked);
52 void brcmf_fws_rxreorder(struct brcmf_if *ifp, struct sk_buff *skb);
53 +#else
54 +static inline int brcmf_fws_init(struct brcmf_pub *drvr)
55 +{
56 + return -ENOTSUPP;
57 +}
58 +
59 +static inline void brcmf_fws_deinit(struct brcmf_pub *drvr)
60 +{
61 +}
62 +
63 +static inline bool brcmf_fws_skbs_queueing(struct brcmf_fws_info *fws)
64 +{
65 + return false;
66 +}
67 +
68 +static inline bool brcmf_fws_fc_active(struct brcmf_fws_info *fws)
69 +{
70 + return false;
71 +}
72 +
73 +static inline void brcmf_fws_hdrpull(struct brcmf_if *ifp, s16 siglen,
74 + struct sk_buff *skb)
75 +{
76 +}
77 +
78 +static inline int brcmf_fws_process_skb(struct brcmf_if *ifp,
79 + struct sk_buff *skb)
80 +{
81 + return -ENOTSUPP;
82 +}
83 +
84 +static inline void brcmf_fws_reset_interface(struct brcmf_if *ifp)
85 +{
86 +}
87 +
88 +static inline void brcmf_fws_add_interface(struct brcmf_if *ifp)
89 +{
90 +}
91 +
92 +static inline void brcmf_fws_del_interface(struct brcmf_if *ifp)
93 +{
94 +}
95 +
96 +static inline void brcmf_fws_bustxfail(struct brcmf_fws_info *fws,
97 + struct sk_buff *skb)
98 +{
99 +}
100 +
101 +static inline void brcmf_fws_bus_blocked(struct brcmf_pub *drvr,
102 + bool flow_blocked)
103 +{
104 +}
105 +
106 +static inline void brcmf_fws_rxreorder(struct brcmf_if *ifp,
107 + struct sk_buff *skb)
108 +{
109 +}
110 +#endif
111
112 #endif /* FWSIGNAL_H_ */