600-03-rt2x00-rt2800lib-add-rf_vals-for-RF3853.patch 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. From ecb394ccf248d8652c463133c4f404458a57a9c1 Mon Sep 17 00:00:00 2001
  2. From: Gabor Juhos <juhosg@openwrt.org>
  3. Date: Sun, 24 Mar 2013 19:26:26 +0100
  4. Subject: [PATCH] rt2x00: rt2800lib: add rf_vals for RF3853
  5. Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
  6. ---
  7. drivers/net/wireless/ralink/rt2x00/rt2800.h | 4 +-
  8. drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 65 +++++++++++++++++++++++++++++++
  9. 2 files changed, 68 insertions(+), 1 deletion(-)
  10. --- a/drivers/net/wireless/ralink/rt2x00/rt2800.h
  11. +++ b/drivers/net/wireless/ralink/rt2x00/rt2800.h
  12. @@ -48,7 +48,8 @@
  13. * RF2853 2.4G/5G 3T3R
  14. * RF3320 2.4G 1T1R(RT3350/RT3370/RT3390)
  15. * RF3322 2.4G 2T2R(RT3352/RT3371/RT3372/RT3391/RT3392)
  16. - * RF3053 2.4G/5G 3T3R(RT3883/RT3563/RT3573/RT3593/RT3662)
  17. + * RF3053 2.4G/5G 3T3R(RT3563/RT3573/RT3593)
  18. + * RF3853 2.4G/5G 3T3R(RT3883/RT3662)
  19. * RF5592 2.4G/5G 2T2R
  20. * RF3070 2.4G 1T1R
  21. * RF5360 2.4G 1T1R
  22. @@ -72,6 +73,7 @@
  23. #define RF5592 0x000f
  24. #define RF3070 0x3070
  25. #define RF3290 0x3290
  26. +#define RF3853 0x3853
  27. #define RF5350 0x5350
  28. #define RF5360 0x5360
  29. #define RF5362 0x5362
  30. --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
  31. +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
  32. @@ -8957,6 +8957,66 @@ static const struct rf_channel rf_vals_3
  33. {14, 0xF0, 2, 0x18},
  34. };
  35. +static const struct rf_channel rf_vals_3853[] = {
  36. + {1, 241, 6, 2},
  37. + {2, 241, 6, 7},
  38. + {3, 242, 6, 2},
  39. + {4, 242, 6, 7},
  40. + {5, 243, 6, 2},
  41. + {6, 243, 6, 7},
  42. + {7, 244, 6, 2},
  43. + {8, 244, 6, 7},
  44. + {9, 245, 6, 2},
  45. + {10, 245, 6, 7},
  46. + {11, 246, 6, 2},
  47. + {12, 246, 6, 7},
  48. + {13, 247, 6, 2},
  49. + {14, 248, 6, 4},
  50. +
  51. + {36, 0x56, 8, 4},
  52. + {38, 0x56, 8, 6},
  53. + {40, 0x56, 8, 8},
  54. + {44, 0x57, 8, 0},
  55. + {46, 0x57, 8, 2},
  56. + {48, 0x57, 8, 4},
  57. + {52, 0x57, 8, 8},
  58. + {54, 0x57, 8, 10},
  59. + {56, 0x58, 8, 0},
  60. + {60, 0x58, 8, 4},
  61. + {62, 0x58, 8, 6},
  62. + {64, 0x58, 8, 8},
  63. +
  64. + {100, 0x5b, 8, 8},
  65. + {102, 0x5b, 8, 10},
  66. + {104, 0x5c, 8, 0},
  67. + {108, 0x5c, 8, 4},
  68. + {110, 0x5c, 8, 6},
  69. + {112, 0x5c, 8, 8},
  70. + {114, 0x5c, 8, 10},
  71. + {116, 0x5d, 8, 0},
  72. + {118, 0x5d, 8, 2},
  73. + {120, 0x5d, 8, 4},
  74. + {124, 0x5d, 8, 8},
  75. + {126, 0x5d, 8, 10},
  76. + {128, 0x5e, 8, 0},
  77. + {132, 0x5e, 8, 4},
  78. + {134, 0x5e, 8, 6},
  79. + {136, 0x5e, 8, 8},
  80. + {140, 0x5f, 8, 0},
  81. +
  82. + {149, 0x5f, 8, 9},
  83. + {151, 0x5f, 8, 11},
  84. + {153, 0x60, 8, 1},
  85. + {157, 0x60, 8, 5},
  86. + {159, 0x60, 8, 7},
  87. + {161, 0x60, 8, 9},
  88. + {165, 0x61, 8, 1},
  89. + {167, 0x61, 8, 3},
  90. + {169, 0x61, 8, 5},
  91. + {171, 0x61, 8, 7},
  92. + {173, 0x61, 8, 9},
  93. +};
  94. +
  95. static const struct rf_channel rf_vals_5592_xtal20[] = {
  96. /* Channel, N, K, mod, R */
  97. {1, 482, 4, 10, 3},
  98. @@ -9220,6 +9280,11 @@ static int rt2800_probe_hw_mode(struct r
  99. spec->channels = rf_vals_3x;
  100. break;
  101. + case RF3853:
  102. + spec->num_channels = ARRAY_SIZE(rf_vals_3853);
  103. + spec->channels = rf_vals_3853;
  104. + break;
  105. +
  106. case RF5592:
  107. rt2800_register_read(rt2x00dev, MAC_DEBUG_INDEX, &reg);
  108. if (rt2x00_get_field32(reg, MAC_DEBUG_INDEX_XTAL)) {