653-0054-rtl8xxxu-Handle-devices-with-a-smaller-LLT-buffer.patch 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. From 5dd3f1799baf4683c0161f7e49d65bee17f3e35d Mon Sep 17 00:00:00 2001
  2. From: Jes Sorensen <Jes.Sorensen@redhat.com>
  3. Date: Wed, 31 Aug 2016 16:31:38 -0400
  4. Subject: [PATCH] rtl8xxxu: Handle devices with a smaller LLT buffer
  5. The 8188e (except for I cut parts) seem to have a smaller LLT buffer
  6. than all other known devices.
  7. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
  8. ---
  9. drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 1 +
  10. drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c | 1 +
  11. drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 11 ++++++++---
  12. 3 files changed, 10 insertions(+), 3 deletions(-)
  13. --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
  14. +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
  15. @@ -1411,6 +1411,7 @@ struct rtl8xxxu_fileops {
  16. u8 page_num_hi;
  17. u8 page_num_lo;
  18. u8 page_num_norm;
  19. + u8 last_llt_entry;
  20. };
  21. extern int rtl8xxxu_debug;
  22. --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
  23. +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
  24. @@ -1454,4 +1454,5 @@ struct rtl8xxxu_fileops rtl8188eu_fops =
  25. .page_num_hi = TX_PAGE_NUM_HI_PQ_8188E,
  26. .page_num_lo = TX_PAGE_NUM_LO_PQ_8188E,
  27. .page_num_norm = TX_PAGE_NUM_NORM_PQ_8188E,
  28. + .last_llt_entry = 176,
  29. };
  30. --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
  31. +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
  32. @@ -2485,11 +2485,16 @@ static int rtl8xxxu_llt_write(struct rtl
  33. int rtl8xxxu_init_llt_table(struct rtl8xxxu_priv *priv)
  34. {
  35. int ret;
  36. - int i;
  37. + int i, last_entry;
  38. u8 last_tx_page;
  39. last_tx_page = priv->fops->total_page_num;
  40. + if (priv->fops->last_llt_entry)
  41. + last_entry = priv->fops->last_llt_entry;
  42. + else
  43. + last_entry = 255;
  44. +
  45. for (i = 0; i < last_tx_page; i++) {
  46. ret = rtl8xxxu_llt_write(priv, i, i + 1);
  47. if (ret)
  48. @@ -2501,14 +2506,14 @@ int rtl8xxxu_init_llt_table(struct rtl8x
  49. goto exit;
  50. /* Mark remaining pages as a ring buffer */
  51. - for (i = last_tx_page + 1; i < 0xff; i++) {
  52. + for (i = last_tx_page + 1; i < last_entry; i++) {
  53. ret = rtl8xxxu_llt_write(priv, i, (i + 1));
  54. if (ret)
  55. goto exit;
  56. }
  57. /* Let last entry point to the start entry of ring buffer */
  58. - ret = rtl8xxxu_llt_write(priv, 0xff, last_tx_page + 1);
  59. + ret = rtl8xxxu_llt_write(priv, last_entry, last_tx_page + 1);
  60. if (ret)
  61. goto exit;