653-0043-rtl8xxxu-Do-not-set-auto-rate-fallback-on-8188eu.patch 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. From 738832d9e91098f5b3ddb4e71fe8e666575c6bdb Mon Sep 17 00:00:00 2001
  2. From: Jes Sorensen <Jes.Sorensen@redhat.com>
  3. Date: Wed, 24 Aug 2016 13:54:00 -0400
  4. Subject: [PATCH] rtl8xxxu: Do not set auto rate fallback on 8188eu
  5. Introduce a fileops flag to indicate whether the device has this
  6. feature.
  7. Reported-by: Taehee Yoo <ap420073@gmail.com>
  8. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
  9. ---
  10. drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 1 +
  11. drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192c.c | 1 +
  12. drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c | 1 +
  13. drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723a.c | 1 +
  14. drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723b.c | 1 +
  15. drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 15 ++++++++++-----
  16. 6 files changed, 15 insertions(+), 5 deletions(-)
  17. --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
  18. +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
  19. @@ -1398,6 +1398,7 @@ struct rtl8xxxu_fileops {
  20. u8 has_s0s1:1;
  21. u8 has_tx_report:1;
  22. u8 gen2_thermal_meter:1;
  23. + u8 has_darfrc:1;
  24. u32 adda_1t_init;
  25. u32 adda_1t_path_on;
  26. u32 adda_2t_path_on_a;
  27. --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192c.c
  28. +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192c.c
  29. @@ -572,6 +572,7 @@ struct rtl8xxxu_fileops rtl8192cu_fops =
  30. .rx_agg_buf_size = 16000,
  31. .tx_desc_size = sizeof(struct rtl8xxxu_txdesc32),
  32. .rx_desc_size = sizeof(struct rtl8xxxu_rxdesc16),
  33. + .has_darfrc = 1,
  34. .adda_1t_init = 0x0b1b25a0,
  35. .adda_1t_path_on = 0x0bdb25a0,
  36. .adda_2t_path_on_a = 0x04db25a4,
  37. --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c
  38. +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c
  39. @@ -1655,6 +1655,7 @@ struct rtl8xxxu_fileops rtl8192eu_fops =
  40. .rx_desc_size = sizeof(struct rtl8xxxu_rxdesc24),
  41. .has_s0s1 = 0,
  42. .gen2_thermal_meter = 1,
  43. + .has_darfrc = 1,
  44. .adda_1t_init = 0x0fc01616,
  45. .adda_1t_path_on = 0x0fc01616,
  46. .adda_2t_path_on_a = 0x0fc01616,
  47. --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723a.c
  48. +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723a.c
  49. @@ -389,6 +389,7 @@ struct rtl8xxxu_fileops rtl8723au_fops =
  50. .rx_agg_buf_size = 16000,
  51. .tx_desc_size = sizeof(struct rtl8xxxu_txdesc32),
  52. .rx_desc_size = sizeof(struct rtl8xxxu_rxdesc16),
  53. + .has_darfrc = 1,
  54. .adda_1t_init = 0x0b1b25a0,
  55. .adda_1t_path_on = 0x0bdb25a0,
  56. .adda_2t_path_on_a = 0x04db25a4,
  57. --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723b.c
  58. +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723b.c
  59. @@ -1673,6 +1673,7 @@ struct rtl8xxxu_fileops rtl8723bu_fops =
  60. .has_s0s1 = 1,
  61. .has_tx_report = 1,
  62. .gen2_thermal_meter = 1,
  63. + .has_darfrc = 1,
  64. .adda_1t_init = 0x01c00014,
  65. .adda_1t_path_on = 0x01c00014,
  66. .adda_2t_path_on_a = 0x01c00014,
  67. --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
  68. +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
  69. @@ -4105,11 +4105,16 @@ static int rtl8xxxu_init_device(struct i
  70. rtl8xxxu_write32(priv, REG_EDCA_VI_PARAM, 0x005ea324);
  71. rtl8xxxu_write32(priv, REG_EDCA_VO_PARAM, 0x002fa226);
  72. - /* Set data auto rate fallback retry count */
  73. - rtl8xxxu_write32(priv, REG_DARFRC, 0x00000000);
  74. - rtl8xxxu_write32(priv, REG_DARFRC + 4, 0x10080404);
  75. - rtl8xxxu_write32(priv, REG_RARFRC, 0x04030201);
  76. - rtl8xxxu_write32(priv, REG_RARFRC + 4, 0x08070605);
  77. + /*
  78. + * Set data auto rate fallback retry count.
  79. + * Notably the 8188eu doesn't seem to use this
  80. + */
  81. + if (fops->has_darfrc) {
  82. + rtl8xxxu_write32(priv, REG_DARFRC, 0x00000000);
  83. + rtl8xxxu_write32(priv, REG_DARFRC + 4, 0x10080404);
  84. + rtl8xxxu_write32(priv, REG_RARFRC, 0x04030201);
  85. + rtl8xxxu_write32(priv, REG_RARFRC + 4, 0x08070605);
  86. + }
  87. val8 = rtl8xxxu_read8(priv, REG_FWHW_TXQ_CTRL);
  88. val8 |= FWHW_TXQ_CTRL_AMPDU_RETRY;