351-0009-brcmfmac-print-errors-if-creating-interface-fails.patch 1.9 KB

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