001-02-v6.9-wifi-rtl8xxxu-prepare-supporting-two-virtual-interfa.patch 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. From 2bbd7d584046038ce655e476628bb15e1460fac6 Mon Sep 17 00:00:00 2001
  2. From: Martin Kaistra <[email protected]>
  3. Date: Fri, 22 Dec 2023 11:14:23 +0100
  4. Subject: [PATCH 02/21] wifi: rtl8xxxu: prepare supporting two virtual
  5. interfaces
  6. To prepare for concurrent mode, add an array ("vifs") to rtl8xxxu_priv
  7. to keep track of both interfaces.
  8. Keep the old priv->vif as long there are still users of it and let
  9. priv->vifs[0] point to the same location.
  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. drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 2 ++
  16. drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 10 +++++++---
  17. 2 files changed, 9 insertions(+), 3 deletions(-)
  18. --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
  19. +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
  20. @@ -1897,6 +1897,8 @@ struct rtl8xxxu_priv {
  21. * is supported and no iface_combinations are provided.
  22. */
  23. struct ieee80211_vif *vif;
  24. +
  25. + struct ieee80211_vif *vifs[2];
  26. struct delayed_work ra_watchdog;
  27. struct work_struct c2hcmd_work;
  28. struct sk_buff_head c2hcmd_queue;
  29. --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
  30. +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
  31. @@ -6569,10 +6569,12 @@ static int rtl8xxxu_add_interface(struct
  32. int ret;
  33. u8 val8;
  34. - if (!priv->vif)
  35. + if (!priv->vif) {
  36. priv->vif = vif;
  37. - else
  38. + priv->vifs[0] = vif;
  39. + } else {
  40. return -EOPNOTSUPP;
  41. + }
  42. switch (vif->type) {
  43. case NL80211_IFTYPE_STATION:
  44. @@ -6622,8 +6624,10 @@ static void rtl8xxxu_remove_interface(st
  45. dev_dbg(&priv->udev->dev, "%s\n", __func__);
  46. - if (priv->vif)
  47. + if (priv->vif) {
  48. priv->vif = NULL;
  49. + priv->vifs[0] = NULL;
  50. + }
  51. }
  52. static int rtl8xxxu_config(struct ieee80211_hw *hw, u32 changed)