Jelajahi Sumber

qcacld-3.0: Update MLME Cfg num_ppe_th

With Kernel 5.13.2 onwards, if
ppe_present is present in HE capabilities
then ppe_threshold fields are also required
to be sent such as length has to be non zero
and the data can be all zeros as part of
TDLS Discovery and Setup frame.

While sending setup frames, ies are packed using
dor11f apis such as dot11f_pack_ie_he_cap().
Even if ppet_present is set,
dot11f_pack_ie_he_cap() will only send
ppe_threshold if num_ppe_th is present.
The HE capabilties which are sent in these
are filled using MLME Cfg HE capabilities.
So, calculate and set num_ppe_th using cfg
ppe fields based on the operating band.
Also to cover a corner scenario where ppe_present
is set but calculated num_ppe_th is 0, set
num_ppe_th to 1 so that atleast 1 byte should be
sent to prevent framework from throwing
exception during add_sta.

Change-Id: Ibe4fd3fdacce24573c09b3609babf04ef4423fb1
CRs-Fixed: 3183531
Utkarsh Bhatnagar 2 tahun lalu
induk
melakukan
0fa84e975a
1 mengubah file dengan 33 tambahan dan 0 penghapusan
  1. 33 0
      core/mac/src/pe/lim/lim_process_tdls.c

+ 33 - 0
core/mac/src/pe/lim/lim_process_tdls.c

@@ -873,6 +873,38 @@ static void lim_tdls_set_he_chan_width(tDot11fIEhe_cap *heCap,
 	}
 }
 
+static void lim_tdls_populate_ppe_caps(struct mac_context *mac,
+				       struct pe_session *session,
+				       tDot11fIEhe_cap *he_cap)
+{
+	uint8_t *ppet;
+
+	/*
+	 * No Need to populate if ppet is not present
+	 */
+	if (!he_cap->ppet_present)
+		return;
+
+	if (!wlan_reg_is_24ghz_ch_freq(session->curr_op_freq))
+		ppet = mac->mlme_cfg->he_caps.he_ppet_5g;
+	else
+		ppet = mac->mlme_cfg->he_caps.he_ppet_2g;
+
+	he_cap->ppet.ppe_threshold.num_ppe_th = lim_truncate_ppet(ppet,
+							      MLME_HE_PPET_LEN);
+
+	/*
+	 * If num_ppe_th calculated above is zero and ppet_present is set then
+	 * atleast one byte should be sent with zero data otherwise framework
+	 * will fail add_sta on the peer end.
+	 */
+	if (he_cap->ppet.ppe_threshold.num_ppe_th)
+		qdf_mem_copy(he_cap->ppet.ppe_threshold.ppe_th, ppet,
+			     MLME_HE_PPET_LEN);
+	else
+		he_cap->ppet.ppe_threshold.num_ppe_th = 1;
+}
+
 static void populate_dot11f_set_tdls_he_cap(struct mac_context *mac,
 					    uint32_t selfDot11Mode,
 					    tDot11fIEhe_cap *heCap,
@@ -882,6 +914,7 @@ static void populate_dot11f_set_tdls_he_cap(struct mac_context *mac,
 	if (IS_DOT11_MODE_HE(selfDot11Mode)) {
 		populate_dot11f_he_caps(mac, NULL, heCap);
 		lim_tdls_set_he_chan_width(heCap, session);
+		lim_tdls_populate_ppe_caps(mac, session, heCap);
 		lim_log_he_cap(mac, heCap);
 		lim_populate_tdls_setup_6g_cap(mac, hecap_6g, session);
 	} else {