653-0032-rtl8xxxu-Implement-rtl8188e_disable_rf.patch 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. From f26f81e233f7a9b1bf21aa0de16a8db733c317ec Mon Sep 17 00:00:00 2001
  2. From: Jes Sorensen <Jes.Sorensen@redhat.com>
  3. Date: Fri, 22 Jul 2016 13:17:36 -0400
  4. Subject: [PATCH] rtl8xxxu: Implement rtl8188e_disable_rf()
  5. This is partly guessware as there is no straight forward disable RF
  6. routine in the vendor driver.
  7. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
  8. ---
  9. drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c | 15 +++++++++++++++
  10. 1 file changed, 15 insertions(+)
  11. --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
  12. +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
  13. @@ -1101,6 +1101,20 @@ static void rtl8188e_enable_rf(struct rt
  14. rtl8xxxu_write8(priv, REG_TXPAUSE, 0x00);
  15. }
  16. +static void rtl8188e_disable_rf(struct rtl8xxxu_priv *priv)
  17. +{
  18. + u32 val32;
  19. +
  20. + val32 = rtl8xxxu_read32(priv, REG_OFDM0_TRX_PATH_ENABLE);
  21. + val32 &= ~OFDM_RF_PATH_TX_MASK;
  22. + rtl8xxxu_write32(priv, REG_OFDM0_TRX_PATH_ENABLE, val32);
  23. +
  24. + /* Power down RF module */
  25. + rtl8xxxu_write_rfreg(priv, RF_A, RF6052_REG_AC, 0);
  26. + if (priv->rf_paths == 2)
  27. + rtl8xxxu_write_rfreg(priv, RF_B, RF6052_REG_AC, 0);
  28. +}
  29. +
  30. static void rtl8188e_usb_quirks(struct rtl8xxxu_priv *priv)
  31. {
  32. u16 val16;
  33. @@ -1133,6 +1147,7 @@ struct rtl8xxxu_fileops rtl8188eu_fops =
  34. .config_channel = rtl8188eu_config_channel,
  35. .parse_rx_desc = rtl8xxxu_parse_rxdesc16,
  36. .enable_rf = rtl8188e_enable_rf,
  37. + .disable_rf = rtl8188e_disable_rf,
  38. .usb_quirks = rtl8188e_usb_quirks,
  39. .update_rate_mask = rtl8xxxu_gen2_update_rate_mask,
  40. .report_connect = rtl8xxxu_gen2_report_connect,