329-v4.17-0002-brcmfmac-move-brcmf_attach-function-in-core.c.patch 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. From 0542503c4c164c65cd1567b0f2b3f887af6c81eb Mon Sep 17 00:00:00 2001
  2. From: Arend Van Spriel <arend.vanspriel@broadcom.com>
  3. Date: Tue, 20 Feb 2018 00:14:22 +0100
  4. Subject: [PATCH] brcmfmac: move brcmf_attach() function in core.c
  5. Moving the function in preparation of subsequent patch.
  6. Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
  7. Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
  8. Reviewed-by: Franky Lin <franky.lin@broadcom.com>
  9. Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
  10. Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
  11. ---
  12. .../wireless/broadcom/brcm80211/brcmfmac/core.c | 98 +++++++++++-----------
  13. 1 file changed, 49 insertions(+), 49 deletions(-)
  14. --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
  15. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
  16. @@ -933,55 +933,6 @@ static int brcmf_inet6addr_changed(struc
  17. }
  18. #endif
  19. -int brcmf_attach(struct device *dev, struct brcmf_mp_device *settings)
  20. -{
  21. - struct brcmf_pub *drvr = NULL;
  22. - int ret = 0;
  23. - int i;
  24. -
  25. - brcmf_dbg(TRACE, "Enter\n");
  26. -
  27. - /* Allocate primary brcmf_info */
  28. - drvr = kzalloc(sizeof(struct brcmf_pub), GFP_ATOMIC);
  29. - if (!drvr)
  30. - return -ENOMEM;
  31. -
  32. - for (i = 0; i < ARRAY_SIZE(drvr->if2bss); i++)
  33. - drvr->if2bss[i] = BRCMF_BSSIDX_INVALID;
  34. -
  35. - mutex_init(&drvr->proto_block);
  36. -
  37. - /* Link to bus module */
  38. - drvr->hdrlen = 0;
  39. - drvr->bus_if = dev_get_drvdata(dev);
  40. - drvr->bus_if->drvr = drvr;
  41. - drvr->settings = settings;
  42. -
  43. - /* attach debug facilities */
  44. - brcmf_debug_attach(drvr);
  45. -
  46. - /* Attach and link in the protocol */
  47. - ret = brcmf_proto_attach(drvr);
  48. - if (ret != 0) {
  49. - brcmf_err("brcmf_prot_attach failed\n");
  50. - goto fail;
  51. - }
  52. -
  53. - /* Attach to events important for core code */
  54. - brcmf_fweh_register(drvr, BRCMF_E_PSM_WATCHDOG,
  55. - brcmf_psm_watchdog_notify);
  56. -
  57. - /* attach firmware event handler */
  58. - brcmf_fweh_attach(drvr);
  59. -
  60. - return ret;
  61. -
  62. -fail:
  63. - brcmf_detach(dev);
  64. -
  65. - return ret;
  66. -}
  67. -
  68. static int brcmf_revinfo_read(struct seq_file *s, void *data)
  69. {
  70. struct brcmf_bus *bus_if = dev_get_drvdata(s->private);
  71. @@ -1109,6 +1060,55 @@ fail:
  72. return ret;
  73. }
  74. +
  75. +int brcmf_attach(struct device *dev, struct brcmf_mp_device *settings)
  76. +{
  77. + struct brcmf_pub *drvr = NULL;
  78. + int ret = 0;
  79. + int i;
  80. +
  81. + brcmf_dbg(TRACE, "Enter\n");
  82. +
  83. + /* Allocate primary brcmf_info */
  84. + drvr = kzalloc(sizeof(*drvr), GFP_ATOMIC);
  85. + if (!drvr)
  86. + return -ENOMEM;
  87. +
  88. + for (i = 0; i < ARRAY_SIZE(drvr->if2bss); i++)
  89. + drvr->if2bss[i] = BRCMF_BSSIDX_INVALID;
  90. +
  91. + mutex_init(&drvr->proto_block);
  92. +
  93. + /* Link to bus module */
  94. + drvr->hdrlen = 0;
  95. + drvr->bus_if = dev_get_drvdata(dev);
  96. + drvr->bus_if->drvr = drvr;
  97. + drvr->settings = settings;
  98. +
  99. + /* attach debug facilities */
  100. + brcmf_debug_attach(drvr);
  101. +
  102. + /* Attach and link in the protocol */
  103. + ret = brcmf_proto_attach(drvr);
  104. + if (ret != 0) {
  105. + brcmf_err("brcmf_prot_attach failed\n");
  106. + goto fail;
  107. + }
  108. +
  109. + /* Attach to events important for core code */
  110. + brcmf_fweh_register(drvr, BRCMF_E_PSM_WATCHDOG,
  111. + brcmf_psm_watchdog_notify);
  112. +
  113. + /* attach firmware event handler */
  114. + brcmf_fweh_attach(drvr);
  115. +
  116. + return ret;
  117. +
  118. +fail:
  119. + brcmf_detach(dev);
  120. +
  121. + return ret;
  122. +}
  123. void brcmf_bus_add_txhdrlen(struct device *dev, uint len)
  124. {