1
0

0075-wifi-ath11k-refactor-vif-parameter-configurations.patch 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. From cb9bea773c85e372931cd7a177db4165adf29d95 Mon Sep 17 00:00:00 2001
  2. From: Aloka Dixit <quic_alokad@quicinc.com>
  3. Date: Fri, 5 May 2023 16:11:28 +0300
  4. Subject: [PATCH 75/77] wifi: ath11k: refactor vif parameter configurations
  5. Security parameters for each non-transmitting profile can be
  6. different when MBSSID is enabled and this information is included
  7. in the MBSSID element in the Beacon frame. Current implementation
  8. to set rsnie_present and wpaie_present does not parse this element
  9. hence it applies only to the transmitting interface.
  10. Move the code to a separate function to make additions for
  11. non-transmitting interfaces cleaner.
  12. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1
  13. Signed-off-by: Aloka Dixit <quic_alokad@quicinc.com>
  14. Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
  15. Link: https://lore.kernel.org/r/20230405221648.17950-6-quic_alokad@quicinc.com
  16. ---
  17. drivers/net/wireless/ath/ath11k/mac.c | 41 ++++++++++++++++-----------
  18. 1 file changed, 24 insertions(+), 17 deletions(-)
  19. --- a/drivers/net/wireless/ath/ath11k/mac.c
  20. +++ b/drivers/net/wireless/ath/ath11k/mac.c
  21. @@ -1351,28 +1351,14 @@ err_mon_del:
  22. return ret;
  23. }
  24. -static int ath11k_mac_setup_bcn_tmpl(struct ath11k_vif *arvif)
  25. +static void ath11k_mac_set_vif_params(struct ath11k_vif *arvif,
  26. + struct sk_buff *bcn)
  27. {
  28. - struct ath11k *ar = arvif->ar;
  29. - struct ath11k_base *ab = ar->ab;
  30. - struct ieee80211_hw *hw = ar->hw;
  31. - struct ieee80211_vif *vif = arvif->vif;
  32. - struct ieee80211_mutable_offsets offs = {};
  33. - struct sk_buff *bcn;
  34. struct ieee80211_mgmt *mgmt;
  35. u8 *ies;
  36. - int ret;
  37. -
  38. - if (arvif->vdev_type != WMI_VDEV_TYPE_AP)
  39. - return 0;
  40. -
  41. - bcn = ieee80211_beacon_get_template(hw, vif, &offs, 0);
  42. - if (!bcn) {
  43. - ath11k_warn(ab, "failed to get beacon template from mac80211\n");
  44. - return -EPERM;
  45. - }
  46. ies = bcn->data + ieee80211_get_hdrlen_from_skb(bcn);
  47. + mgmt = (struct ieee80211_mgmt *)bcn->data;
  48. ies += sizeof(mgmt->u.beacon);
  49. if (cfg80211_find_ie(WLAN_EID_RSN, ies, (skb_tail_pointer(bcn) - ies)))
  50. @@ -1386,7 +1372,28 @@ static int ath11k_mac_setup_bcn_tmpl(str
  51. arvif->wpaie_present = true;
  52. else
  53. arvif->wpaie_present = false;
  54. +}
  55. +
  56. +static int ath11k_mac_setup_bcn_tmpl(struct ath11k_vif *arvif)
  57. +{
  58. + struct ath11k *ar = arvif->ar;
  59. + struct ath11k_base *ab = ar->ab;
  60. + struct ieee80211_hw *hw = ar->hw;
  61. + struct ieee80211_vif *vif = arvif->vif;
  62. + struct ieee80211_mutable_offsets offs = {};
  63. + struct sk_buff *bcn;
  64. + int ret;
  65. +
  66. + if (arvif->vdev_type != WMI_VDEV_TYPE_AP)
  67. + return 0;
  68. +
  69. + bcn = ieee80211_beacon_get_template(hw, vif, &offs, 0);
  70. + if (!bcn) {
  71. + ath11k_warn(ab, "failed to get beacon template from mac80211\n");
  72. + return -EPERM;
  73. + }
  74. + ath11k_mac_set_vif_params(arvif, bcn);
  75. ret = ath11k_wmi_bcn_tmpl(ar, arvif->vdev_id, &offs, bcn);
  76. kfree_skb(bcn);