344-0013-brcmfmac-move-module-init-and-exit-to-common.patch 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. From: Hante Meuleman <meuleman@broadcom.com>
  2. Date: Wed, 17 Feb 2016 11:27:02 +0100
  3. Subject: [PATCH] brcmfmac: move module init and exit to common
  4. In preparation of module parameters for all devices the module init
  5. and exit routines are moved to the common file.
  6. Reviewed-by: Arend Van Spriel <arend@broadcom.com>
  7. Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
  8. Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
  9. Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
  10. Signed-off-by: Arend van Spriel <arend@broadcom.com>
  11. Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
  12. ---
  13. --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
  14. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
  15. @@ -28,6 +28,10 @@
  16. #include "tracepoint.h"
  17. #include "common.h"
  18. +MODULE_AUTHOR("Broadcom Corporation");
  19. +MODULE_DESCRIPTION("Broadcom 802.11 wireless LAN fullmac driver.");
  20. +MODULE_LICENSE("Dual BSD/GPL");
  21. +
  22. const u8 ALLFFMAC[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
  23. #define BRCMF_DEFAULT_SCAN_CHANNEL_TIME 40
  24. @@ -221,7 +225,7 @@ void __brcmf_dbg(u32 level, const char *
  25. }
  26. #endif
  27. -void brcmf_mp_attach(void)
  28. +static void brcmf_mp_attach(void)
  29. {
  30. strlcpy(brcmf_mp_global.firmware_path, brcmf_firmware_path,
  31. BRCMF_FW_ALTPATH_LEN);
  32. @@ -249,3 +253,33 @@ void brcmf_mp_device_detach(struct brcmf
  33. kfree(drvr->settings);
  34. }
  35. +static int __init brcmfmac_module_init(void)
  36. +{
  37. + int err;
  38. +
  39. + /* Initialize debug system first */
  40. + brcmf_debugfs_init();
  41. +
  42. +#ifdef CPTCFG_BRCMFMAC_SDIO
  43. + brcmf_sdio_init();
  44. +#endif
  45. + /* Initialize global module paramaters */
  46. + brcmf_mp_attach();
  47. +
  48. + /* Continue the initialization by registering the different busses */
  49. + err = brcmf_core_init();
  50. + if (err)
  51. + brcmf_debugfs_exit();
  52. +
  53. + return err;
  54. +}
  55. +
  56. +static void __exit brcmfmac_module_exit(void)
  57. +{
  58. + brcmf_core_exit();
  59. + brcmf_debugfs_exit();
  60. +}
  61. +
  62. +module_init(brcmfmac_module_init);
  63. +module_exit(brcmfmac_module_exit);
  64. +
  65. --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h
  66. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h
  67. @@ -89,7 +89,6 @@ struct brcmf_mp_device {
  68. struct cc_translate *country_codes;
  69. };
  70. -void brcmf_mp_attach(void);
  71. int brcmf_mp_device_attach(struct brcmf_pub *drvr);
  72. void brcmf_mp_device_detach(struct brcmf_pub *drvr);
  73. #ifdef DEBUG
  74. --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
  75. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
  76. @@ -38,10 +38,6 @@
  77. #include "pcie.h"
  78. #include "common.h"
  79. -MODULE_AUTHOR("Broadcom Corporation");
  80. -MODULE_DESCRIPTION("Broadcom 802.11 wireless LAN fullmac driver.");
  81. -MODULE_LICENSE("Dual BSD/GPL");
  82. -
  83. #define MAX_WAIT_FOR_8021X_TX msecs_to_jiffies(950)
  84. /* AMPDU rx reordering definitions */
  85. @@ -1422,19 +1418,15 @@ static void brcmf_driver_register(struct
  86. }
  87. static DECLARE_WORK(brcmf_driver_work, brcmf_driver_register);
  88. -static int __init brcmfmac_module_init(void)
  89. +int __init brcmf_core_init(void)
  90. {
  91. - brcmf_debugfs_init();
  92. -#ifdef CPTCFG_BRCMFMAC_SDIO
  93. - brcmf_sdio_init();
  94. -#endif
  95. if (!schedule_work(&brcmf_driver_work))
  96. return -EBUSY;
  97. return 0;
  98. }
  99. -static void __exit brcmfmac_module_exit(void)
  100. +void __exit brcmf_core_exit(void)
  101. {
  102. cancel_work_sync(&brcmf_driver_work);
  103. @@ -1447,8 +1439,5 @@ static void __exit brcmfmac_module_exit(
  104. #ifdef CPTCFG_BRCMFMAC_PCIE
  105. brcmf_pcie_exit();
  106. #endif
  107. - brcmf_debugfs_exit();
  108. }
  109. -module_init(brcmfmac_module_init);
  110. -module_exit(brcmfmac_module_exit);
  111. --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h
  112. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h
  113. @@ -227,5 +227,7 @@ void brcmf_txflowblock_if(struct brcmf_i
  114. void brcmf_txfinalize(struct brcmf_if *ifp, struct sk_buff *txp, bool success);
  115. void brcmf_netif_rx(struct brcmf_if *ifp, struct sk_buff *skb);
  116. void brcmf_net_setcarrier(struct brcmf_if *ifp, bool on);
  117. +int __init brcmf_core_init(void);
  118. +void __exit brcmf_core_exit(void);
  119. #endif /* BRCMFMAC_CORE_H */