Prechádzať zdrojové kódy

Merge f32ad32109a8649c2d9e97eaac35d3bbc5e401c7 on remote branch

Change-Id: If8f82976f9ac0ed6b4c818f2b111fc578bc67973
Linux Build Service Account 7 mesiacov pred
rodič
commit
76a793b28f

+ 27 - 8
umac/mlme/connection_mgr/core/src/wlan_cm_bss_scoring.c

@@ -113,7 +113,8 @@
 #define CM_SECURITY_INDEX_WEIGHTAGE 0x00643219
 
 #define CM_BEST_CANDIDATE_MAX_BSS_SCORE (CM_BEST_CANDIDATE_MAX_WEIGHT * 100)
-#define CM_AVOID_CANDIDATE_MIN_SCORE 1
+#define CM_AVOID_CANDIDATE_NON_ML_MIN_SCORE 1
+#define CM_AVOID_CANDIDATE_ML_MIN_SCORE 2
 
 #define CM_GET_SCORE_PERCENTAGE(value32, bw_index) \
 	QDF_GET_BITS(value32, (8 * (bw_index)), 8)
@@ -596,6 +597,22 @@ static uint32_t cm_get_sta_nss(struct wlan_objmgr_psoc *psoc,
 }
 #endif
 
+#ifdef WLAN_FEATURE_11BE_MLO_ADV_FEATURE
+static uint32_t wlan_cm_get_min_score(struct scan_cache_entry *entry)
+{
+	if (!entry->ie_list.multi_link_bv)
+		return CM_AVOID_CANDIDATE_NON_ML_MIN_SCORE;
+	/* Add more weigh for candidate with partner link */
+	return CM_AVOID_CANDIDATE_ML_MIN_SCORE +
+	       (CM_AVOID_CANDIDATE_ML_MIN_SCORE * entry->ml_info.num_links);
+}
+#else
+static uint32_t wlan_cm_get_min_score(struct scan_cache_entry *entry)
+{
+	return CM_AVOID_CANDIDATE_NON_ML_MIN_SCORE;
+}
+#endif
+
 #ifdef CONN_MGR_ADV_FEATURE
 static bool
 cm_get_pcl_weight_of_channel(uint32_t chan_freq,
@@ -1182,10 +1199,12 @@ cm_calculate_etp(struct wlan_objmgr_psoc *psoc,
 	uint32_t ppdu_payload_dur_us = 0, mpdu_per_ampdu, mpdu_per_ppdu;
 	uint32_t single_ppdu_dur_us, estimated_throughput_mbps, data_rate_kbps;
 	struct htcap_cmn_ie *htcap;
+	uint32_t min_score = wlan_cm_get_min_score(entry);
 
 	htcap = (struct htcap_cmn_ie *)util_scan_entry_htcap(entry);
+
 	if (ch_width > CH_WIDTH_160MHZ)
-		return CM_AVOID_CANDIDATE_MIN_SCORE;
+		return min_score;
 
 	if (is_he)
 		ntone = cm_get_etp_he_ntone(ch_width);
@@ -1197,7 +1216,7 @@ cm_calculate_etp(struct wlan_objmgr_psoc *psoc,
 		cm_get_etp_max_bits_per_sc_1000x_for_nss(psoc, entry,
 							 max_nss, phy_config);
 	if (rssi < WLAN_NOISE_FLOOR_DBM_DEFAULT)
-		return CM_AVOID_CANDIDATE_MIN_SCORE;
+		return min_score;
 
 	log_2_snr_tone_1000x = calculate_bit_per_tone(rssi, ch_width);
 
@@ -1216,8 +1235,8 @@ cm_calculate_etp(struct wlan_objmgr_psoc *psoc,
 				IS_ASSOC_LINK(ml_flag) ? "Candidate" : "Partner",
 				QDF_MAC_ADDR_REF(entry->bssid.bytes),
 				entry->channel.chan_freq, data_rate_kbps,
-				CM_AVOID_CANDIDATE_MIN_SCORE);
-		return CM_AVOID_CANDIDATE_MIN_SCORE;
+				min_score);
+		return min_score;
 	}
 	/* compute MPDU_p_PPDU */
 	if (is_ht) {
@@ -1253,8 +1272,8 @@ cm_calculate_etp(struct wlan_objmgr_psoc *psoc,
 		 etp_param->airtime_fraction) /
 		 CM_MAX_ESTIMATED_AIR_TIME_FRACTION;
 
-	if (estimated_throughput_mbps < CM_AVOID_CANDIDATE_MIN_SCORE)
-		estimated_throughput_mbps = CM_AVOID_CANDIDATE_MIN_SCORE;
+	if (estimated_throughput_mbps < min_score)
+		estimated_throughput_mbps = min_score;
 	if (estimated_throughput_mbps > CM_BEST_CANDIDATE_MAX_BSS_SCORE)
 		estimated_throughput_mbps = CM_BEST_CANDIDATE_MAX_BSS_SCORE;
 
@@ -3285,7 +3304,7 @@ void wlan_cm_calculate_bss_score(struct wlan_objmgr_pdev *pdev,
 		} else if (denylist_action == CM_DLM_AVOID) {
 			/* add min score so that it is added back in the end */
 			scan_entry->entry->bss_score =
-					CM_AVOID_CANDIDATE_MIN_SCORE;
+				wlan_cm_get_min_score(scan_entry->entry);
 			mlme_nofl_debug("Candidate("QDF_MAC_ADDR_FMT" freq %d): rssi %d, is in Avoidlist, give min score %d",
 					QDF_MAC_ADDR_REF(scan_entry->entry->bssid.bytes),
 					scan_entry->entry->channel.chan_freq,

+ 4 - 0
umac/mlme/connection_mgr/core/src/wlan_cm_connect.c

@@ -1453,6 +1453,10 @@ static QDF_STATUS cm_update_mlo_filter(struct wlan_objmgr_pdev *pdev,
 		 */
 		filter->match_mld_addr = true;
 		qdf_copy_macaddr(&filter->mld_addr, &cm_req->req.mld_addr);
+
+		/* Add link ID to the scan filter for partner link */
+		filter->match_link_id = true;
+		filter->link_id = cm_req->req.link_id;
 	}
 
 	mlme_debug(CM_PREFIX_FMT "band bitmap: 0x%x",

+ 3 - 0
umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_public_struct.h

@@ -233,6 +233,8 @@ enum wlan_cm_source {
  * @vht_caps_mask: mask of valid vht caps
  * @fils_info: Fills related connect info
  * @is_non_assoc_link: non assoc link
+ * @link_id: IEEE link ID of the candidate
+ *              -mandatory and only used for link VDEV connect
  * @mld_addr: MLD address of candidate
  *              -mandatory and only used for link VDEV connect
  * @ml_parnter_info: ml partner link info
@@ -264,6 +266,7 @@ struct wlan_cm_connect_req {
 #endif
 	bool is_non_assoc_link;
 #ifdef WLAN_FEATURE_11BE_MLO
+	uint8_t link_id;
 	struct qdf_mac_addr mld_addr;
 	struct mlo_partner_info ml_parnter_info;
 #endif

+ 9 - 0
umac/mlo_mgr/src/wlan_mlo_mgr_link_switch.c

@@ -808,6 +808,8 @@ QDF_STATUS mlo_mgr_link_switch_start_connect(struct wlan_objmgr_vdev *vdev)
 	conn_req.source = CM_MLO_LINK_SWITCH_CONNECT;
 	wlan_vdev_set_link_id(vdev, req->new_ieee_link_id);
 
+	conn_req.chan_freq = req->new_primary_freq;
+	conn_req.link_id = req->new_ieee_link_id;
 	qdf_copy_macaddr(&conn_req.bssid, &mlo_link_info->ap_link_addr);
 	wlan_vdev_mlme_get_ssid(assoc_vdev, conn_req.ssid.ssid,
 				&conn_req.ssid.length);
@@ -1180,6 +1182,13 @@ mlo_mgr_link_switch_validate_request(struct wlan_objmgr_vdev *vdev,
 		return status;
 	}
 
+	if (new_link_info->link_chan_info->ch_freq != req->new_primary_freq) {
+		mlo_err("Host freq(%d) FW req freq(%d)",
+			new_link_info->link_chan_info->ch_freq,
+			req->new_primary_freq);
+		return status;
+	}
+
 	/* Notify callers on the new link switch request before serializing */
 	status = mlo_mgr_link_switch_notify(vdev, req);
 	if (QDF_IS_STATUS_ERROR(status)) {

+ 2 - 0
umac/mlo_mgr/src/wlan_mlo_mgr_sta.c

@@ -883,6 +883,8 @@ mlo_prepare_and_send_connect(struct wlan_objmgr_vdev *vdev,
 
 	req.vdev_id = wlan_vdev_get_id(vdev);
 	req.ssid.length = ssid.length;
+	req.chan_freq = link_info.chan_freq;
+	req.link_id =  link_info.link_id;
 	qdf_mem_copy(&req.ssid.ssid, &ssid.ssid, ssid.length);
 	if (mld_addr)
 		qdf_copy_macaddr(&req.mld_addr, mld_addr);

+ 9 - 0
umac/scan/core/src/wlan_scan_filter.c

@@ -721,6 +721,15 @@ static bool scm_mlo_filter_match(struct wlan_objmgr_pdev *pdev,
 		}
 	}
 
+	if (filter->match_link_id && filter->link_id != WLAN_INVALID_LINK_ID &&
+	    filter->link_id != util_scan_entry_self_linkid(db_entry)) {
+		scm_debug(QDF_MAC_ADDR_FMT " link id %d mismatch filter link id %d",
+			  QDF_MAC_ADDR_REF(db_entry->bssid.bytes),
+			  util_scan_entry_self_linkid(db_entry),
+			  filter->link_id);
+		return false;
+	}
+
 	if (!db_entry->ie_list.multi_link_bv)
 		return true;
 	if (!filter->band_bitmap)

+ 3 - 1
umac/scan/core/src/wlan_scan_manager_6ghz.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -327,6 +327,8 @@ scm_copy_valid_channels(struct wlan_objmgr_psoc *psoc,
 	uint8_t i, num_ch = *num_scan_ch;
 	struct chan_list *chan_list = &req->scan_req.chan_list;
 	qdf_freq_t freq;
+	chan_list->num_chan =
+			qdf_min(chan_list->num_chan, (uint8_t)NUM_CHANNELS);
 
 	switch (scan_mode) {
 	case SCAN_MODE_6G_NO_CHANNEL:

+ 5 - 1
umac/scan/dispatcher/inc/wlan_scan_public_structs.h

@@ -741,6 +741,7 @@ enum dot11_mode_filter {
  * @ignore_nol_chan: Ignore entry with channel in the NOL list
  * @ignore_6ghz_channel: ignore 6Ghz channels
  * @match_mld_addr: Flag to match mld addr of scan entry
+ * @match_link_id: Flag to match self IEEE link id of scan entry
  * @age_threshold: If set return entry which are newer than the age_threshold
  * @num_of_bssid: number of bssid passed
  * @num_of_ssid: number of ssid
@@ -766,6 +767,7 @@ enum dot11_mode_filter {
  * @ccx_validate_bss: Function pointer to custom bssid filter
  * @ccx_validate_bss_arg: Function argument to custom bssid filter
  * @band_bitmap: Allowed band bit map, BIT0: 2G, BIT1: 5G, BIT2: 6G
+ * @link_id: IEEE link ID to match if @match_link_id is set to %true
  * @mld_addr: MLD addr to match if @match_mld_addr is set to true.
  */
 struct scan_filter {
@@ -775,7 +777,8 @@ struct scan_filter {
 		ignore_auth_enc_type:1,
 		ignore_nol_chan:1,
 		ignore_6ghz_channel:1,
-		match_mld_addr:1;
+		match_mld_addr:1,
+		match_link_id:1;
 	qdf_time_t age_threshold;
 	uint8_t num_of_bssid;
 	uint8_t num_of_ssid;
@@ -804,6 +807,7 @@ struct scan_filter {
 	bss_filter_arg_t ccx_validate_bss_arg;
 #ifdef WLAN_FEATURE_11BE_MLO
 	uint32_t band_bitmap;
+	uint8_t link_id;
 	struct qdf_mac_addr mld_addr;
 #endif
 };

+ 20 - 0
umac/scan/dispatcher/inc/wlan_scan_utils_api.h

@@ -141,12 +141,32 @@ util_scan_entry_mldaddr(struct scan_cache_entry *scan_entry)
 
 	return mld_addr;
 }
+
+/**
+ * util_scan_entry_self_linkid() - Function to get self IEEE link id
+ * @scan_entry: scan entry
+ *
+ * API will return self IEEE link ID
+ *
+ * Return: Value of self IEEE link ID
+ */
+static inline uint8_t
+util_scan_entry_self_linkid(struct scan_cache_entry *scan_entry)
+{
+	return scan_entry->ml_info.self_link_id;
+}
 #else
 static inline struct qdf_mac_addr *
 util_scan_entry_mldaddr(struct scan_cache_entry *scan_entry)
 {
 	return NULL;
 }
+
+static inline uint8_t
+util_scan_entry_self_linkid(struct scan_cache_entry *scan_entry)
+{
+	return WLAN_INVALID_LINK_ID;
+}
 #endif
 
 /**

+ 4 - 2
umac/scan/dispatcher/src/wlan_scan_utils_api.c

@@ -2386,6 +2386,8 @@ static void util_scan_update_ml_info(struct wlan_objmgr_pdev *pdev,
 	bool is_ml_ie_valid = true;
 	uint8_t *end_ptr = NULL;
 
+	scan_entry->ml_info.self_link_id = WLAN_INVALID_LINK_ID;
+
 	if (!scan_entry->ie_list.ehtcap && scan_entry->ie_list.multi_link_bv) {
 		scan_entry->ie_list.multi_link_bv = NULL;
 		return;
@@ -2431,8 +2433,8 @@ static void util_scan_update_ml_info(struct wlan_objmgr_pdev *pdev,
 	util_get_ml_bv_partner_link_info(pdev, scan_entry);
 }
 #else
-static void util_scan_update_ml_info(struct wlan_objmgr_pdev *pdev,
-				     struct scan_cache_entry *scan_entry)
+static inline void util_scan_update_ml_info(struct wlan_objmgr_pdev *pdev,
+					    struct scan_cache_entry *scan_entry)
 {
 }
 #endif

+ 57 - 59
utils/logging/src/wlan_logging_sock_svc.c

@@ -124,7 +124,8 @@
 #define HOST_LOG_FW_FLUSH_COMPLETE       0x003
 #define HOST_LOG_DRIVER_CONNECTIVITY_MSG 0x004
 #define HOST_LOG_CHIPSET_STATS           0x005
-#define FW_LOG_CHIPSET_STATS            0x006
+#define FW_LOG_CHIPSET_STATS             0x006
+#define WLAN_LOGGING_BITS_MAX            7
 
 #define DIAG_TYPE_LOGS                 1
 #define PTT_MSG_DIAG_CMDS_TYPE    0x5050
@@ -207,7 +208,7 @@ struct wlan_logging {
 	/* current logbuf to which the log will be filled to */
 	struct log_msg *pcur_node;
 	/* Event flag used for wakeup and post indication*/
-	unsigned long eventFlag;
+	qdf_bitmap(event_flag, WLAN_LOGGING_BITS_MAX);
 	/* Indicates logger thread is activated */
 	bool is_active;
 	/* Flush completion check */
@@ -481,7 +482,7 @@ int wlan_log_to_user(QDF_TRACE_LEVEL log_level, char *to_be_sent, int length)
 
 	/* Wakeup logger thread */
 	if (wake_up_thread) {
-		set_bit(HOST_LOG_DRIVER_MSG, &gwlan_logging.eventFlag);
+		qdf_set_bit(HOST_LOG_DRIVER_MSG, gwlan_logging.event_flag);
 		wake_up_interruptible(&gwlan_logging.wait_queue);
 	}
 
@@ -895,21 +896,16 @@ static int wlan_logging_thread(void *Arg)
 		setup_flush_timer();
 		ret_wait_status =
 			wait_event_interruptible(gwlan_logging.wait_queue,
-						 (!list_empty
-							  (&gwlan_logging.filled_list)
-						  || test_bit(
-						     HOST_LOG_DRIVER_MSG,
-						     &gwlan_logging.eventFlag)
-						  || test_bit(
-						     HOST_LOG_PER_PKT_STATS,
-						     &gwlan_logging.eventFlag)
-						  || test_bit(
-						     HOST_LOG_FW_FLUSH_COMPLETE,
-						     &gwlan_logging.eventFlag)
-						  || test_bit(
-						     HOST_LOG_DRIVER_CONNECTIVITY_MSG,
-						     &gwlan_logging.eventFlag)
-						  || gwlan_logging.exit));
+				(!list_empty(&gwlan_logging.filled_list) ||
+				 qdf_test_bit(HOST_LOG_DRIVER_MSG,
+					      gwlan_logging.event_flag) ||
+				 qdf_test_bit(HOST_LOG_PER_PKT_STATS,
+					      gwlan_logging.event_flag) ||
+				 qdf_test_bit(HOST_LOG_FW_FLUSH_COMPLETE,
+					      gwlan_logging.event_flag) ||
+				 qdf_test_bit(HOST_LOG_DRIVER_CONNECTIVITY_MSG,
+					      gwlan_logging.event_flag) ||
+				 gwlan_logging.exit));
 
 		if (ret_wait_status == -ERESTARTSYS) {
 			qdf_err("wait_event_interruptible returned -ERESTARTSYS");
@@ -920,8 +916,8 @@ static int wlan_logging_thread(void *Arg)
 			break;
 
 
-		if (test_and_clear_bit(HOST_LOG_DRIVER_MSG,
-					&gwlan_logging.eventFlag)) {
+		if (qdf_test_and_clear_bit(HOST_LOG_DRIVER_MSG,
+					   gwlan_logging.event_flag)) {
 			ret = send_filled_buffers_to_user();
 			if (-ENOMEM == ret)
 				msleep(200);
@@ -934,18 +930,18 @@ static int wlan_logging_thread(void *Arg)
 #endif
 		}
 
-		if (test_and_clear_bit(HOST_LOG_PER_PKT_STATS,
-					&gwlan_logging.eventFlag)) {
+		if (qdf_test_and_clear_bit(HOST_LOG_PER_PKT_STATS,
+					   gwlan_logging.event_flag)) {
 			ret = pktlog_send_per_pkt_stats_to_user();
 			if (-ENOMEM == ret)
 				msleep(200);
 		}
 
-		if (test_bit(HOST_LOG_CHIPSET_STATS,
-			     &gwlan_logging.eventFlag) &&
+		if (qdf_test_bit(HOST_LOG_CHIPSET_STATS,
+				 gwlan_logging.event_flag) &&
 		    gwlan_logging.is_flush_complete) {
-			test_and_clear_bit(HOST_LOG_CHIPSET_STATS,
-					   &gwlan_logging.eventFlag);
+			qdf_test_and_clear_bit(HOST_LOG_CHIPSET_STATS,
+					       gwlan_logging.event_flag);
 			ret = wlan_logging_cstats_send_host_buf_to_usr();
 			if (-ENOMEM == ret) {
 				QDF_TRACE_ERROR(QDF_MODULE_ID_QDF,
@@ -954,11 +950,11 @@ static int wlan_logging_thread(void *Arg)
 			}
 		}
 
-		if (test_bit(FW_LOG_CHIPSET_STATS,
-			     &gwlan_logging.eventFlag) &&
+		if (qdf_test_bit(FW_LOG_CHIPSET_STATS,
+				 gwlan_logging.event_flag) &&
 		    gwlan_logging.is_flush_complete) {
-			test_and_clear_bit(FW_LOG_CHIPSET_STATS,
-					   &gwlan_logging.eventFlag);
+			qdf_test_and_clear_bit(FW_LOG_CHIPSET_STATS,
+					       gwlan_logging.event_flag);
 			ret = wlan_logging_cstats_send_fw_buf_to_usr();
 			if (-ENOMEM == ret) {
 				QDF_TRACE_ERROR(QDF_MODULE_ID_QDF,
@@ -967,8 +963,8 @@ static int wlan_logging_thread(void *Arg)
 			}
 		}
 
-		if (test_and_clear_bit(HOST_LOG_FW_FLUSH_COMPLETE,
-					&gwlan_logging.eventFlag)) {
+		if (qdf_test_and_clear_bit(HOST_LOG_FW_FLUSH_COMPLETE,
+					   gwlan_logging.event_flag)) {
 			/* Flush bit could have been set while we were mid
 			 * way in the logging thread. So, need to check other
 			 * buffers like log messages, per packet stats again
@@ -989,12 +985,12 @@ static int wlan_logging_thread(void *Arg)
 				wlan_queue_logmsg_for_app();
 				spin_unlock_irqrestore(&gwlan_logging.spin_lock,
 					flags);
-				set_bit(HOST_LOG_DRIVER_MSG,
-						&gwlan_logging.eventFlag);
-				set_bit(HOST_LOG_PER_PKT_STATS,
-						&gwlan_logging.eventFlag);
-				set_bit(HOST_LOG_FW_FLUSH_COMPLETE,
-						&gwlan_logging.eventFlag);
+				qdf_set_bit(HOST_LOG_DRIVER_MSG,
+					    gwlan_logging.event_flag);
+				qdf_set_bit(HOST_LOG_PER_PKT_STATS,
+					    gwlan_logging.event_flag);
+				qdf_set_bit(HOST_LOG_FW_FLUSH_COMPLETE,
+					    gwlan_logging.event_flag);
 				wake_up_interruptible(
 						&gwlan_logging.wait_queue);
 			}
@@ -1002,8 +998,8 @@ static int wlan_logging_thread(void *Arg)
 
 		/* Dequeue the connectivity_log */
 		wlan_logging_send_connectivity_event();
-		clear_bit(HOST_LOG_DRIVER_CONNECTIVITY_MSG,
-			  &gwlan_logging.eventFlag);
+		qdf_clear_bit(HOST_LOG_DRIVER_CONNECTIVITY_MSG,
+			      gwlan_logging.event_flag);
 	}
 
 	gwlan_logging.exit_ts = qdf_get_log_timestamp();
@@ -1276,12 +1272,13 @@ int wlan_logging_sock_init_svc(void)
 
 	init_waitqueue_head(&gwlan_logging.wait_queue);
 	gwlan_logging.exit = false;
-	clear_bit(HOST_LOG_DRIVER_MSG, &gwlan_logging.eventFlag);
-	clear_bit(HOST_LOG_PER_PKT_STATS, &gwlan_logging.eventFlag);
-	clear_bit(HOST_LOG_FW_FLUSH_COMPLETE, &gwlan_logging.eventFlag);
-	clear_bit(HOST_LOG_DRIVER_CONNECTIVITY_MSG, &gwlan_logging.eventFlag);
-	clear_bit(HOST_LOG_CHIPSET_STATS, &gwlan_logging.eventFlag);
-	clear_bit(FW_LOG_CHIPSET_STATS, &gwlan_logging.eventFlag);
+	qdf_clear_bit(HOST_LOG_DRIVER_MSG, gwlan_logging.event_flag);
+	qdf_clear_bit(HOST_LOG_PER_PKT_STATS, gwlan_logging.event_flag);
+	qdf_clear_bit(HOST_LOG_FW_FLUSH_COMPLETE, gwlan_logging.event_flag);
+	qdf_clear_bit(HOST_LOG_DRIVER_CONNECTIVITY_MSG,
+		      gwlan_logging.event_flag);
+	qdf_clear_bit(HOST_LOG_CHIPSET_STATS, gwlan_logging.event_flag);
+	qdf_clear_bit(FW_LOG_CHIPSET_STATS, gwlan_logging.event_flag);
 
 	init_completion(&gwlan_logging.shutdown_comp);
 	gwlan_logging.thread = kthread_create(wlan_logging_thread, NULL,
@@ -1347,12 +1344,13 @@ int wlan_logging_sock_deinit_svc(void)
 	cds_set_multicast_logging(0);
 #endif
 	gwlan_logging.is_flush_complete = false;
-	clear_bit(HOST_LOG_DRIVER_MSG, &gwlan_logging.eventFlag);
-	clear_bit(HOST_LOG_PER_PKT_STATS, &gwlan_logging.eventFlag);
-	clear_bit(HOST_LOG_FW_FLUSH_COMPLETE, &gwlan_logging.eventFlag);
-	clear_bit(HOST_LOG_DRIVER_CONNECTIVITY_MSG, &gwlan_logging.eventFlag);
-	clear_bit(HOST_LOG_CHIPSET_STATS, &gwlan_logging.eventFlag);
-	clear_bit(FW_LOG_CHIPSET_STATS, &gwlan_logging.eventFlag);
+	qdf_clear_bit(HOST_LOG_DRIVER_MSG, gwlan_logging.event_flag);
+	qdf_clear_bit(HOST_LOG_PER_PKT_STATS, gwlan_logging.event_flag);
+	qdf_clear_bit(HOST_LOG_FW_FLUSH_COMPLETE, gwlan_logging.event_flag);
+	qdf_clear_bit(HOST_LOG_DRIVER_CONNECTIVITY_MSG,
+		      gwlan_logging.event_flag);
+	qdf_clear_bit(HOST_LOG_CHIPSET_STATS, gwlan_logging.event_flag);
+	qdf_clear_bit(FW_LOG_CHIPSET_STATS, gwlan_logging.event_flag);
 	wake_up_interruptible(&gwlan_logging.wait_queue);
 	wait_for_completion(&gwlan_logging.shutdown_comp);
 
@@ -1394,7 +1392,7 @@ void wlan_logging_set_per_pkt_stats(void)
 	if (gwlan_logging.is_active == false)
 		return;
 
-	set_bit(HOST_LOG_PER_PKT_STATS, &gwlan_logging.eventFlag);
+	qdf_set_bit(HOST_LOG_PER_PKT_STATS, gwlan_logging.event_flag);
 	wake_up_interruptible(&gwlan_logging.wait_queue);
 }
 
@@ -1403,7 +1401,7 @@ void wlan_logging_set_connectivity_log(void)
 	if (gwlan_logging.is_active == false)
 		return;
 
-	set_bit(HOST_LOG_DRIVER_CONNECTIVITY_MSG, &gwlan_logging.eventFlag);
+	qdf_set_bit(HOST_LOG_DRIVER_CONNECTIVITY_MSG, gwlan_logging.event_flag);
 	wake_up_interruptible(&gwlan_logging.wait_queue);
 }
 
@@ -1421,7 +1419,7 @@ void wlan_logging_set_fw_flush_complete(void)
 	if (!gwlan_logging.is_active)
 		return;
 
-	set_bit(HOST_LOG_FW_FLUSH_COMPLETE, &gwlan_logging.eventFlag);
+	qdf_set_bit(HOST_LOG_FW_FLUSH_COMPLETE, gwlan_logging.event_flag);
 	wake_up_interruptible(&gwlan_logging.wait_queue);
 }
 
@@ -1442,7 +1440,7 @@ void wlan_flush_host_logs_for_fatal(void)
 	spin_lock_irqsave(&gwlan_logging.spin_lock, flags);
 	wlan_queue_logmsg_for_app();
 	spin_unlock_irqrestore(&gwlan_logging.spin_lock, flags);
-	set_bit(HOST_LOG_DRIVER_MSG, &gwlan_logging.eventFlag);
+	qdf_set_bit(HOST_LOG_DRIVER_MSG, gwlan_logging.event_flag);
 	wake_up_interruptible(&gwlan_logging.wait_queue);
 }
 
@@ -1572,7 +1570,7 @@ void wlan_pkt_stats_to_logger_thread(void *pl_hdr, void *pkt_dump, void *data)
 
 	/* Wakeup logger thread */
 	if (true == wake_up_thread) {
-		set_bit(HOST_LOG_PER_PKT_STATS, &gwlan_logging.eventFlag);
+		qdf_set_bit(HOST_LOG_PER_PKT_STATS, gwlan_logging.event_flag);
 		wake_up_interruptible(&gwlan_logging.wait_queue);
 	}
 }
@@ -1865,8 +1863,8 @@ void wlan_register_txrx_packetdump(uint8_t pdev_id)
 #ifdef WLAN_CHIPSET_STATS
 void wlan_set_chipset_stats_bit(void)
 {
-	set_bit(HOST_LOG_CHIPSET_STATS, &gwlan_logging.eventFlag);
-	set_bit(FW_LOG_CHIPSET_STATS, &gwlan_logging.eventFlag);
+	qdf_set_bit(HOST_LOG_CHIPSET_STATS, gwlan_logging.event_flag);
+	qdf_set_bit(FW_LOG_CHIPSET_STATS, gwlan_logging.event_flag);
 }
 #endif /* WLAN_CHIPSET_STATS */
 #endif /* WLAN_LOGGING_SOCK_SVC_ENABLE */

+ 6 - 1
utils/pktlog/include/pktlog_ac.h

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2012-2020 The Linux Foundation. All rights reserved.
- * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -115,7 +115,12 @@ struct pktlog_dev_t {
 	uint32_t invalid_packets;
 };
 
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 6, 0))
+#define PKTLOG_SYSCTL_SIZE	10
+#else
 #define PKTLOG_SYSCTL_SIZE      14
+#endif
+
 #define PKTLOG_MAX_SEND_QUEUE_DEPTH 64
 
 /*

+ 96 - 1
utils/pktlog/linux_ac.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -315,6 +315,100 @@ qdf_sysctl_decl(ath_sysctl_pktlog_size, ctl, write, filp, buffer, lenp, ppos)
 	return ret;
 }
 
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 6, 0))
+static int pktlog_sysctl_register(struct hif_opaque_softc *scn)
+{
+	struct pktlog_dev_t *pl_dev = get_pktlog_handle();
+	struct ath_pktlog_info_lnx *pl_info_lnx;
+	char *proc_name;
+	char buf[64] = {0};
+
+	if (pl_dev) {
+		pl_info_lnx = PL_INFO_LNX(pl_dev->pl_info);
+		proc_name = pl_dev->name;
+	} else {
+		pl_info_lnx = PL_INFO_LNX(g_pktlog_info);
+		proc_name = PKTLOG_PROC_SYSTEM;
+	}
+
+	/*
+	 * Setup the sysctl table for creating the following sysctl entries:
+	 * /proc/sys/PKTLOG_PROC_DIR/<adapter>/enable for enabling/disabling
+	 * pktlog
+	 * /proc/sys/PKTLOG_PROC_DIR/<adapter>/size for changing the buffer size
+	 */
+	snprintf(buf, sizeof(buf), "%s/%s", PKTLOG_PROC_DIR, proc_name);
+	memset(pl_info_lnx->sysctls, 0, sizeof(pl_info_lnx->sysctls));
+
+	pl_info_lnx->sysctls[0].procname = "enable";
+	pl_info_lnx->sysctls[0].mode = PKTLOG_PROCSYS_PERM;
+	pl_info_lnx->sysctls[0].proc_handler = ath_sysctl_pktlog_enable;
+	pl_info_lnx->sysctls[0].extra1 = scn;
+
+	pl_info_lnx->sysctls[1].procname = "size";
+	pl_info_lnx->sysctls[1].mode = PKTLOG_PROCSYS_PERM;
+	pl_info_lnx->sysctls[1].proc_handler = ath_sysctl_pktlog_size;
+	pl_info_lnx->sysctls[1].extra1 = scn;
+
+	pl_info_lnx->sysctls[2].procname = "options";
+	pl_info_lnx->sysctls[2].mode = PKTLOG_PROCSYS_PERM;
+	pl_info_lnx->sysctls[2].proc_handler = proc_dointvec;
+	pl_info_lnx->sysctls[2].data = &pl_info_lnx->info.options;
+	pl_info_lnx->sysctls[2].maxlen = sizeof(pl_info_lnx->info.options);
+
+	pl_info_lnx->sysctls[3].procname = "sack_thr";
+	pl_info_lnx->sysctls[3].mode = PKTLOG_PROCSYS_PERM;
+	pl_info_lnx->sysctls[3].proc_handler = proc_dointvec;
+	pl_info_lnx->sysctls[3].data = &pl_info_lnx->info.sack_thr;
+	pl_info_lnx->sysctls[3].maxlen = sizeof(pl_info_lnx->info.sack_thr);
+
+	pl_info_lnx->sysctls[4].procname = "tail_length";
+	pl_info_lnx->sysctls[4].mode = PKTLOG_PROCSYS_PERM;
+	pl_info_lnx->sysctls[4].proc_handler = proc_dointvec;
+	pl_info_lnx->sysctls[4].data = &pl_info_lnx->info.tail_length;
+	pl_info_lnx->sysctls[4].maxlen = sizeof(pl_info_lnx->info.tail_length);
+
+	pl_info_lnx->sysctls[5].procname = "thruput_thresh";
+	pl_info_lnx->sysctls[5].mode = PKTLOG_PROCSYS_PERM;
+	pl_info_lnx->sysctls[5].proc_handler = proc_dointvec;
+	pl_info_lnx->sysctls[5].data = &pl_info_lnx->info.thruput_thresh;
+	pl_info_lnx->sysctls[5].maxlen =
+		sizeof(pl_info_lnx->info.thruput_thresh);
+
+	pl_info_lnx->sysctls[6].procname = "phyerr_thresh";
+	pl_info_lnx->sysctls[6].mode = PKTLOG_PROCSYS_PERM;
+	pl_info_lnx->sysctls[6].proc_handler = proc_dointvec;
+	pl_info_lnx->sysctls[6].data = &pl_info_lnx->info.phyerr_thresh;
+	pl_info_lnx->sysctls[6].maxlen =
+		sizeof(pl_info_lnx->info.phyerr_thresh);
+
+	pl_info_lnx->sysctls[7].procname = "per_thresh";
+	pl_info_lnx->sysctls[7].mode = PKTLOG_PROCSYS_PERM;
+	pl_info_lnx->sysctls[7].proc_handler = proc_dointvec;
+	pl_info_lnx->sysctls[7].data = &pl_info_lnx->info.per_thresh;
+	pl_info_lnx->sysctls[7].maxlen = sizeof(pl_info_lnx->info.per_thresh);
+
+	pl_info_lnx->sysctls[8].procname = "trigger_interval";
+	pl_info_lnx->sysctls[8].mode = PKTLOG_PROCSYS_PERM;
+	pl_info_lnx->sysctls[8].proc_handler = proc_dointvec;
+	pl_info_lnx->sysctls[8].data = &pl_info_lnx->info.trigger_interval;
+	pl_info_lnx->sysctls[8].maxlen =
+		sizeof(pl_info_lnx->info.trigger_interval);
+	/* [9] is NULL terminator */
+
+	/* and register everything */
+	/* register_sysctl_table changed from 2.6.21 onwards */
+	pl_info_lnx->sysctl_header =
+		register_sysctl(buf, pl_info_lnx->sysctls);
+
+	if (!pl_info_lnx->sysctl_header) {
+		qdf_nofl_info("%s: failed to register sysctls!", proc_name);
+		return -EINVAL;
+	}
+
+	return 0;
+}
+#else
 /* Register sysctl table */
 static int pktlog_sysctl_register(struct hif_opaque_softc *scn)
 {
@@ -415,6 +509,7 @@ static int pktlog_sysctl_register(struct hif_opaque_softc *scn)
 
 	return 0;
 }
+#endif
 
 /*
  * Initialize logging for system or adapter