mac80211: brcmfmac: fix support for BCM4366
[openwrt.org/openwrt.git] / package / kernel / mac80211 / patches / 351-0009-brcmfmac-print-errors-if-creating-interface-fails.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5@gmail.com>
Date: Fri, 27 May 2016 10:54:28 +0200
Subject: [PATCH] brcmfmac: print errors if creating interface fails
 
This is helpful for debugging. Without this all I was getting from "iw"
command on failed creating of P2P interface was:
> command failed: Too many open files in system (-23)
 
Signed-off-by: Rafal Milecki <zajec5@gmail.com>
[arend@broadcom.com: reduce error prints upon iface creation]
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Reviewed-by: Julian Calaby <julian.calaby@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
---
 
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
@@ -670,20 +670,24 @@ static struct wireless_dev *brcmf_cfg802
                return ERR_PTR(-EOPNOTSUPP);
        case NL80211_IFTYPE_AP:
                wdev = brcmf_ap_add_vif(wiphy, name, flags, params);
-               if (!IS_ERR(wdev))
-                       brcmf_cfg80211_update_proto_addr_mode(wdev);
-               return wdev;
+               break;
        case NL80211_IFTYPE_P2P_CLIENT:
        case NL80211_IFTYPE_P2P_GO:
        case NL80211_IFTYPE_P2P_DEVICE:
                wdev = brcmf_p2p_add_vif(wiphy, name, name_assign_type, type, flags, params);
-               if (!IS_ERR(wdev))
-                       brcmf_cfg80211_update_proto_addr_mode(wdev);
-               return wdev;
+               break;
        case NL80211_IFTYPE_UNSPECIFIED:
        default:
                return ERR_PTR(-EINVAL);
        }
+
+       if (IS_ERR(wdev))
+               brcmf_err("add iface %s type %d failed: err=%d\n",
+                         name, type, (int)PTR_ERR(wdev));
+       else
+               brcmf_cfg80211_update_proto_addr_mode(wdev);
+
+       return wdev;
 }
 
 static void brcmf_scan_config_mpc(struct brcmf_if *ifp, int mpc)
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
@@ -2030,8 +2030,6 @@ static int brcmf_p2p_request_p2p_if(stru
 
        err = brcmf_fil_iovar_data_set(ifp, "p2p_ifadd", &if_request,
                                       sizeof(if_request));
-       if (err)
-               return err;
 
        return err;
 }
 
comments