15-linux47.patch 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. Since Linux 4.7, the enum ieee80211_band is no longer used
  2. This shall cause no problem's since both enums ieee80211_band
  3. and nl80211_band were added in the same commit:
  4. https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit?id=13ae75b103e07304a34ab40c9136e9f53e06475c
  5. This patch refactors the references of IEEE80211_BAND_* to NL80211_BAND_*
  6. Reference:
  7. https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit?id=57fbcce37be7c1d2622b56587c10ade00e96afa3
  8. This patch is based on
  9. https://github.com/archlinuxcn/repo/tree/f4d6cff1cacf8dad13006fade5f96bc2cf020a9b/broadcom-wl-dkms .
  10. Index: broadcom-sta/amd64/src/wl/sys/wl_cfg80211_hybrid.c
  11. ===================================================================
  12. --- broadcom-sta.orig/amd64/src/wl/sys/wl_cfg80211_hybrid.c
  13. +++ broadcom-sta/amd64/src/wl/sys/wl_cfg80211_hybrid.c
  14. @@ -236,7 +236,7 @@ static s8 wl_dbg_estr[][WL_DBG_ESTR_MAX]
  15. #endif
  16. #define CHAN2G(_channel, _freq, _flags) { \
  17. - .band = IEEE80211_BAND_2GHZ, \
  18. + .band = NL80211_BAND_2GHZ, \
  19. .center_freq = (_freq), \
  20. .hw_value = (_channel), \
  21. .flags = (_flags), \
  22. @@ -245,7 +245,7 @@ static s8 wl_dbg_estr[][WL_DBG_ESTR_MAX]
  23. }
  24. #define CHAN5G(_channel, _flags) { \
  25. - .band = IEEE80211_BAND_5GHZ, \
  26. + .band = NL80211_BAND_5GHZ, \
  27. .center_freq = 5000 + (5 * (_channel)), \
  28. .hw_value = (_channel), \
  29. .flags = (_flags), \
  30. @@ -379,7 +379,7 @@ static struct ieee80211_channel __wl_5gh
  31. };
  32. static struct ieee80211_supported_band __wl_band_2ghz = {
  33. - .band = IEEE80211_BAND_2GHZ,
  34. + .band = NL80211_BAND_2GHZ,
  35. .channels = __wl_2ghz_channels,
  36. .n_channels = ARRAY_SIZE(__wl_2ghz_channels),
  37. .bitrates = wl_g_rates,
  38. @@ -387,7 +387,7 @@ static struct ieee80211_supported_band _
  39. };
  40. static struct ieee80211_supported_band __wl_band_5ghz_a = {
  41. - .band = IEEE80211_BAND_5GHZ,
  42. + .band = NL80211_BAND_5GHZ,
  43. .channels = __wl_5ghz_a_channels,
  44. .n_channels = ARRAY_SIZE(__wl_5ghz_a_channels),
  45. .bitrates = wl_a_rates,
  46. @@ -395,7 +395,7 @@ static struct ieee80211_supported_band _
  47. };
  48. static struct ieee80211_supported_band __wl_band_5ghz_n = {
  49. - .band = IEEE80211_BAND_5GHZ,
  50. + .band = NL80211_BAND_5GHZ,
  51. .channels = __wl_5ghz_n_channels,
  52. .n_channels = ARRAY_SIZE(__wl_5ghz_n_channels),
  53. .bitrates = wl_a_rates,
  54. @@ -1876,8 +1876,8 @@ static s32 wl_alloc_wdev(struct device *
  55. wdev->wiphy->max_num_pmkids = WL_NUM_PMKIDS_MAX;
  56. #endif
  57. wdev->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_ADHOC);
  58. - wdev->wiphy->bands[IEEE80211_BAND_2GHZ] = &__wl_band_2ghz;
  59. - wdev->wiphy->bands[IEEE80211_BAND_5GHZ] = &__wl_band_5ghz_a;
  60. + wdev->wiphy->bands[NL80211_BAND_2GHZ] = &__wl_band_2ghz;
  61. + wdev->wiphy->bands[NL80211_BAND_5GHZ] = &__wl_band_5ghz_a;
  62. wdev->wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM;
  63. wdev->wiphy->cipher_suites = __wl_cipher_suites;
  64. wdev->wiphy->n_cipher_suites = ARRAY_SIZE(__wl_cipher_suites);
  65. @@ -2000,7 +2000,7 @@ static s32 wl_inform_single_bss(struct w
  66. #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39)
  67. freq = ieee80211_channel_to_frequency(notif_bss_info->channel,
  68. (notif_bss_info->channel <= CH_MAX_2G_CHANNEL) ?
  69. - IEEE80211_BAND_2GHZ : IEEE80211_BAND_5GHZ);
  70. + NL80211_BAND_2GHZ : NL80211_BAND_5GHZ);
  71. #else
  72. freq = ieee80211_channel_to_frequency(notif_bss_info->channel);
  73. #endif
  74. @@ -2116,7 +2116,7 @@ wl_notify_connect_status(struct wl_cfg80
  75. return err;
  76. }
  77. chan = wf_chspec_ctlchan(chanspec);
  78. - band = (chan <= CH_MAX_2G_CHANNEL) ? IEEE80211_BAND_2GHZ : IEEE80211_BAND_5GHZ;
  79. + band = (chan <= CH_MAX_2G_CHANNEL) ? NL80211_BAND_2GHZ : NL80211_BAND_5GHZ;
  80. freq = ieee80211_channel_to_frequency(chan, band);
  81. channel = ieee80211_get_channel(wiphy, freq);
  82. cfg80211_ibss_joined(ndev, (u8 *)&wl->bssid, channel, GFP_KERNEL);
  83. @@ -2250,10 +2250,10 @@ static void wl_ch_to_chanspec(struct iee
  84. join_params->params.chanspec_list[0] =
  85. ieee80211_frequency_to_channel(chan->center_freq);
  86. - if (chan->band == IEEE80211_BAND_2GHZ) {
  87. + if ( (int) chan->band == (int) NL80211_BAND_2GHZ) {
  88. chanspec |= WL_CHANSPEC_BAND_2G;
  89. }
  90. - else if (chan->band == IEEE80211_BAND_5GHZ) {
  91. + else if ( (int) chan->band == (int) NL80211_BAND_5GHZ) {
  92. chanspec |= WL_CHANSPEC_BAND_5G;
  93. }
  94. else {
  95. @@ -2885,7 +2885,7 @@ static s32 wl_update_wiphybands(struct w
  96. if (phy == 'n' || phy == 'a' || phy == 'v') {
  97. wiphy = wl_to_wiphy(wl);
  98. - wiphy->bands[IEEE80211_BAND_5GHZ] = &__wl_band_5ghz_n;
  99. + wiphy->bands[NL80211_BAND_5GHZ] = &__wl_band_5ghz_n;
  100. }
  101. return err;