001-21-v6.9-wifi-rtl8xxxu-declare-concurrent-mode-support-for-81.patch 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. From 1cd165adf314f6bf25cde58f02f4ff51d01730b0 Mon Sep 17 00:00:00 2001
  2. From: Martin Kaistra <[email protected]>
  3. Date: Fri, 22 Dec 2023 11:14:42 +0100
  4. Subject: [PATCH 21/21] wifi: rtl8xxxu: declare concurrent mode support for
  5. 8188f
  6. Everything is in place now for concurrent mode, we can tell the system
  7. that we support it.
  8. We will allow a maximum of 2 virtual interfaces, one of them can be in
  9. AP mode.
  10. Signed-off-by: Martin Kaistra <[email protected]>
  11. Reviewed-by: Ping-Ke Shih <[email protected]>
  12. Signed-off-by: Kalle Valo <[email protected]>
  13. Link: https://msgid.link/[email protected]
  14. ---
  15. .../net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 1 +
  16. .../realtek/rtl8xxxu/rtl8xxxu_8188f.c | 1 +
  17. .../wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 19 +++++++++++++++++++
  18. 3 files changed, 21 insertions(+)
  19. --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
  20. +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
  21. @@ -1992,6 +1992,7 @@ struct rtl8xxxu_fileops {
  22. u8 init_reg_rxfltmap:1;
  23. u8 init_reg_pkt_life_time:1;
  24. u8 init_reg_hmtfr:1;
  25. + u8 supports_concurrent:1;
  26. u8 ampdu_max_time;
  27. u8 ustime_tsf_edca;
  28. u16 max_aggr_num;
  29. --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188f.c
  30. +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188f.c
  31. @@ -1752,6 +1752,7 @@ struct rtl8xxxu_fileops rtl8188fu_fops =
  32. .supports_ap = 1,
  33. .max_macid_num = 16,
  34. .max_sec_cam_num = 16,
  35. + .supports_concurrent = 1,
  36. .adda_1t_init = 0x03c00014,
  37. .adda_1t_path_on = 0x03c00014,
  38. .trxff_boundary = 0x3f7f,
  39. --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
  40. +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
  41. @@ -7665,6 +7665,20 @@ static void rtl8xxxu_deinit_led(struct r
  42. led_classdev_unregister(led);
  43. }
  44. +struct ieee80211_iface_limit rtl8xxxu_limits[] = {
  45. + { .max = 2, .types = BIT(NL80211_IFTYPE_STATION), },
  46. + { .max = 1, .types = BIT(NL80211_IFTYPE_AP), },
  47. +};
  48. +
  49. +struct ieee80211_iface_combination rtl8xxxu_combinations[] = {
  50. + {
  51. + .limits = rtl8xxxu_limits,
  52. + .n_limits = ARRAY_SIZE(rtl8xxxu_limits),
  53. + .max_interfaces = 2,
  54. + .num_different_channels = 1,
  55. + },
  56. +};
  57. +
  58. static int rtl8xxxu_probe(struct usb_interface *interface,
  59. const struct usb_device_id *id)
  60. {
  61. @@ -7810,6 +7824,11 @@ static int rtl8xxxu_probe(struct usb_int
  62. hw->wiphy->interface_modes |= BIT(NL80211_IFTYPE_AP);
  63. hw->queues = 4;
  64. + if (priv->fops->supports_concurrent) {
  65. + hw->wiphy->iface_combinations = rtl8xxxu_combinations;
  66. + hw->wiphy->n_iface_combinations = ARRAY_SIZE(rtl8xxxu_combinations);
  67. + }
  68. +
  69. sband = &rtl8xxxu_supported_band;
  70. sband->ht_cap.ht_supported = true;
  71. sband->ht_cap.ampdu_factor = IEEE80211_HT_MAX_AMPDU_64K;