002-rate_definitions.patch 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. diff --git a/common.c b/common.c
  2. index c3a288d..9c607de 100644
  3. --- a/common.c
  4. +++ b/common.c
  5. @@ -1451,60 +1451,66 @@ void acx_free_modes(acx_device_t * adev)
  6. // adev->modes = NULL;
  7. }
  8. -/*
  9. -#define RATETAB_ENT(_rate, _rateid, _flags) \
  10. - { \
  11. - .rate = (_rate), \
  12. - .val = (_rateid), \
  13. - .val2 = (_rateid), \
  14. - .flags = (_flags), \
  15. - }
  16. -*/
  17. -
  18. static struct ieee80211_rate acx_rates[] = {
  19. { .bitrate = 10, .hw_value = 0, .flags = IEEE80211_RATE_SHORT_PREAMBLE },
  20. { .bitrate = 20, .hw_value = 1, .flags = IEEE80211_RATE_SHORT_PREAMBLE },
  21. { .bitrate = 55, .hw_value = 2, .flags = IEEE80211_RATE_SHORT_PREAMBLE },
  22. { .bitrate = 110, .hw_value = 3, .flags = IEEE80211_RATE_SHORT_PREAMBLE },
  23. - { .bitrate = 60, .hw_value = 4, },
  24. - { .bitrate = 90, .hw_value = 5, },
  25. - { .bitrate = 120, .hw_value = 6, },
  26. - { .bitrate = 180, .hw_value = 7, },
  27. - { .bitrate = 240, .hw_value = 8, },
  28. - { .bitrate = 360, .hw_value = 9, },
  29. - { .bitrate = 480, .hw_value = 10, },
  30. - { .bitrate = 540, .hw_value = 11, },
  31. + { .bitrate = 60, .hw_value = 4, .flags = 0 },
  32. + { .bitrate = 90, .hw_value = 5, .flags = 0 },
  33. + { .bitrate = 120, .hw_value = 6, .flags = 0 },
  34. + { .bitrate = 180, .hw_value = 7, .flags = 0 },
  35. + { .bitrate = 240, .hw_value = 8, .flags = 0 },
  36. + { .bitrate = 360, .hw_value = 9, .flags = 0 },
  37. + { .bitrate = 480, .hw_value = 10, .flags = 0 },
  38. + { .bitrate = 540, .hw_value = 11, .flags = 0 },
  39. };
  40. +#define CHAN4G(_channel, _freq, _flags) { \
  41. + .band = IEEE80211_BAND_2GHZ, \
  42. + .center_freq = (_freq), \
  43. + .hw_value = (_channel), \
  44. + .flags = (_flags), \
  45. + .max_antenna_gain = 0, \
  46. + .max_power = 30, \
  47. +}
  48. static struct ieee80211_channel channels[] = {
  49. - { .center_freq = 2412, .hw_value = 1, },
  50. - { .center_freq = 2417, .hw_value = 2, },
  51. - { .center_freq = 2422, .hw_value = 3, },
  52. - { .center_freq = 2427, .hw_value = 4, },
  53. - { .center_freq = 2432, .hw_value = 5, },
  54. - { .center_freq = 2437, .hw_value = 6, },
  55. - { .center_freq = 2442, .hw_value = 7, },
  56. - { .center_freq = 2447, .hw_value = 8, },
  57. - { .center_freq = 2452, .hw_value = 9, },
  58. - { .center_freq = 2457, .hw_value = 10, },
  59. - { .center_freq = 2462, .hw_value = 11, },
  60. - { .center_freq = 2467, .hw_value = 12, },
  61. - { .center_freq = 2472, .hw_value = 13, },
  62. - { .center_freq = 2484, .hw_value = 14, },
  63. + CHAN4G(1, 2412, 0),
  64. + CHAN4G(2, 2417, 0),
  65. + CHAN4G(3, 2422, 0),
  66. + CHAN4G(4, 2427, 0),
  67. + CHAN4G(5, 2432, 0),
  68. + CHAN4G(6, 2437, 0),
  69. + CHAN4G(7, 2442, 0),
  70. + CHAN4G(8, 2447, 0),
  71. + CHAN4G(9, 2452, 0),
  72. + CHAN4G(10, 2457, 0),
  73. + CHAN4G(11, 2462, 0),
  74. + CHAN4G(12, 2467, 0),
  75. + CHAN4G(13, 2472, 0),
  76. + CHAN4G(14, 2484, 0),
  77. };
  78. +#undef CHAN4G
  79. +
  80. +#define acx_b_ratetable (acx_rates + 0)
  81. +#define acx_b_ratetable_size 4
  82. +#define acx_g_ratetable (acx_rates + 0)
  83. +#define acx_g_ratetable_size 12
  84. static struct ieee80211_supported_band g_band_2GHz = {
  85. + .band = IEEE80211_BAND_2GHZ,
  86. .channels = channels,
  87. .n_channels = ARRAY_SIZE(channels),
  88. - .bitrates = acx_rates,
  89. - .n_bitrates = 12,
  90. + .bitrates = acx_b_ratetable,
  91. + .n_bitrates = acx_g_ratetable_size,
  92. };
  93. static struct ieee80211_supported_band b_band_2GHz = {
  94. + .band = IEEE80211_BAND_2GHZ,
  95. .channels = channels,
  96. .n_channels = ARRAY_SIZE(channels),
  97. - .bitrates = acx_rates,
  98. - .n_bitrates = 4,
  99. + .bitrates = acx_g_ratetable,
  100. + .n_bitrates = acx_b_ratetable_size,
  101. };
  102. int acx_setup_modes(acx_device_t * adev)