Explorar el Código

Merge "qcacmn: Fix compilation error in vdev state machine"

Linux Build Service Account hace 6 años
padre
commit
93850ab144

+ 77 - 24
dp/wifi3.0/dp_peer.c

@@ -338,6 +338,41 @@ static inline void dp_peer_ast_hash_remove(struct dp_soc *soc,
 	TAILQ_REMOVE(&soc->ast_hash.bins[index], ase, hash_list_elem);
 }
 
+/*
+ * dp_peer_ast_hash_find_by_pdevid() - Find AST entry by MAC address
+ *				       and pdev id
+ * @soc: SoC handle
+ * @ast_mac_addr: mac address
+ * @pdev_id: pdev_id
+ *
+ * It assumes caller has taken the ast lock to protect the access to
+ * AST hash table
+ *
+ * Return: AST entry
+ */
+struct dp_ast_entry *dp_peer_ast_hash_find_by_pdevid(struct dp_soc *soc,
+						     uint8_t *ast_mac_addr,
+						     uint8_t pdev_id)
+{
+	union dp_align_mac_addr local_mac_addr_aligned, *mac_addr;
+	uint32_t index;
+	struct dp_ast_entry *ase;
+
+	qdf_mem_copy(&local_mac_addr_aligned.raw[0],
+		     ast_mac_addr, DP_MAC_ADDR_LEN);
+	mac_addr = &local_mac_addr_aligned;
+
+	index = dp_peer_ast_hash_index(soc, mac_addr);
+	TAILQ_FOREACH(ase, &soc->ast_hash.bins[index], hash_list_elem) {
+		if ((pdev_id == ase->pdev_id) &&
+		    !dp_peer_find_mac_addr_cmp(mac_addr, &ase->mac_addr)) {
+			return ase;
+		}
+	}
+
+	return NULL;
+}
+
 /*
  * dp_peer_ast_hash_find() - Find AST entry by MAC address
  * @soc: SoC handle
@@ -447,6 +482,7 @@ int dp_peer_add_ast(struct dp_soc *soc,
 {
 	struct dp_ast_entry *ast_entry;
 	struct dp_vdev *vdev = peer->vdev;
+	struct dp_pdev *pdev = NULL;
 	uint8_t next_node_mac[6];
 	int  ret = -1;
 
@@ -457,6 +493,8 @@ int dp_peer_add_ast(struct dp_soc *soc,
 		return ret;
 	}
 
+	pdev = vdev->pdev;
+
 	QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
 		"%s: peer %pK mac %02x:%02x:%02x:%02x:%02x:%02x",
 		__func__, peer, mac_addr[0], mac_addr[1], mac_addr[2],
@@ -464,35 +502,50 @@ int dp_peer_add_ast(struct dp_soc *soc,
 
 	qdf_spin_lock_bh(&soc->ast_lock);
 
-	/* If AST entry already exists , just return from here */
-	ast_entry = dp_peer_ast_hash_find(soc, mac_addr);
-
-	if (ast_entry) {
-		if (ast_entry->type == CDP_TXRX_AST_TYPE_MEC) {
-			ast_entry->is_active = TRUE;
+	/* If AST entry already exists , just return from here
+	 * ast entry with same mac address can exist on different radios
+	 * if ast_override support is enabled use search by pdev in this
+	 * case
+	 */
+	if (soc->ast_override_support) {
+		ast_entry = dp_peer_ast_hash_find_by_pdevid(soc, mac_addr,
+							    pdev->pdev_id);
+		if (ast_entry) {
 			qdf_spin_unlock_bh(&soc->ast_lock);
 			return 0;
 		}
+	} else {
+		ast_entry = dp_peer_ast_hash_find(soc, mac_addr);
 
-		/*
-		 * WAR for HK 1.x AST issue
-		 * If an AST entry with same mac address already exists and is
-		 * mapped to a different radio, and if the current radio is
-		 * primary radio , delete the existing AST entry and return.
-		 *
-		 * New AST entry will be created again on next SA_invalid
-		 * frame
-		 */
-		if ((ast_entry->pdev_id != vdev->pdev->pdev_id) &&
-		    vdev->pdev->is_primary) {
-			qdf_print("Deleting ast_pdev=%d pdev=%d addr=%pM\n",
-				  ast_entry->pdev_id,
-				  vdev->pdev->pdev_id, mac_addr);
-			dp_peer_del_ast(soc, ast_entry);
-		}
+		if (ast_entry) {
+			if (ast_entry->type == CDP_TXRX_AST_TYPE_MEC) {
+				ast_entry->is_active = TRUE;
+				qdf_spin_unlock_bh(&soc->ast_lock);
+				return 0;
+			}
 
-		qdf_spin_unlock_bh(&soc->ast_lock);
-		return 0;
+			/*
+			 * WAR for HK 1.x AST issue
+			 * If an AST entry with same mac address already
+			 * exists and is mapped to a different radio, and
+			 * if the current radio is  primary radio , delete
+			 * the existing AST entry and return.
+			 *
+			 * New AST entry will be created again on next
+			 * SA_invalid frame
+			 */
+			if ((ast_entry->pdev_id != vdev->pdev->pdev_id) &&
+			    vdev->pdev->is_primary) {
+				QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
+					  "Deleting ast_pdev=%d pdev=%d addr=%pM\n",
+					  ast_entry->pdev_id,
+					  vdev->pdev->pdev_id, mac_addr);
+				dp_peer_del_ast(soc, ast_entry);
+			}
+
+			qdf_spin_unlock_bh(&soc->ast_lock);
+			return 0;
+		}
 	}
 
 	ast_entry = (struct dp_ast_entry *)

+ 4 - 0
dp/wifi3.0/dp_peer.h

@@ -93,6 +93,10 @@ void dp_peer_ast_unmap_handler(struct dp_soc *soc,
 int dp_peer_update_ast(struct dp_soc *soc, struct dp_peer *peer,
 			struct dp_ast_entry *ast_entry,	uint32_t flags);
 
+struct dp_ast_entry *dp_peer_ast_hash_find_by_pdevid(struct dp_soc *soc,
+						     uint8_t *ast_mac_addr,
+						     uint8_t pdev_id);
+
 struct dp_ast_entry *dp_peer_ast_hash_find(struct dp_soc *soc,
 						uint8_t *ast_mac_addr);
 

+ 11 - 0
umac/cmn_services/sm_engine/inc/wlan_sm_engine_dbg.h

@@ -39,6 +39,17 @@
 #define sm_engine_debug(params...) \
 		QDF_TRACE_DEBUG(QDF_MODULE_ID_SM_ENGINE, params)
 
+#define sm_engine_nofl_alert(params...) \
+	QDF_TRACE_FATAL_NO_FL(QDF_MODULE_ID_SM_ENGINE, params)
+#define sm_engine_nofl_err(params...) \
+	QDF_TRACE_ERROR_NO_FL(QDF_MODULE_ID_SM_ENGINE, params)
+#define sm_engine_nofl_warn(params...) \
+	QDF_TRACE_WARN_NO_FL(QDF_MODULE_ID_SM_ENGINE, params)
+#define sm_engine_nofl_info(params...) \
+	QDF_TRACE_INFO_NO_FL(QDF_MODULE_ID_SM_ENGINE, params)
+#define sm_engine_nofl_debug(params...) \
+	QDF_TRACE_DEBUG_NO_FL(QDF_MODULE_ID_SM_ENGINE, params)
+
 #define WLAN_SM_ENGINE_HISTORY_SIZE  50
 struct wlan_sm;
 /**

+ 20 - 19
umac/cmn_services/sm_engine/src/wlan_sm_engine.c

@@ -53,25 +53,24 @@ QDF_STATUS wlan_sm_dispatch(struct wlan_sm *sm, uint16_t event,
 		if (event < sm->num_event_names)
 			event_name = sm->event_names[event];
 
-		sm_engine_debug("%s: current state %s event %s[%d]",
-				sm->name,
-				sm->state_info[sm->cur_state].name,
-				event_name ? event_name : "UNKNOWN_EVENT",
-				event);
+		sm_engine_nofl_info("%s: current state %s[%d] event %s[%d]",
+				    sm->name, sm->state_info[state].name, state,
+				    event_name ? event_name : "UNKNOWN_EVENT",
+				    event);
 	} else {
-		sm_engine_debug("%s: current state %s event %d",
-				sm->name,
-				sm->state_info[sm->cur_state].name,
-				event);
+		sm_engine_nofl_info("%s: current state %s[%d] event %d",
+				    sm->name,
+				    sm->state_info[state].name, state,
+				    event);
 	}
 
 	if (state != WLAN_SM_ENGINE_STATE_NONE) {
 		event_handled = (*sm->state_info[state].wlan_sm_event) (
 				 sm->ctx, event, event_data_len, event_data);
 		if (!event_handled) {
-			sm_engine_err("%s: event %d not handled in state %s",
-				      sm->name, event,
-				      sm->state_info[sm->cur_state].name);
+			sm_engine_nofl_err("%s: event %d not handled in state %s",
+					   sm->name, event,
+					   sm->state_info[sm->cur_state].name);
 			return QDF_STATUS_E_INVAL;
 		}
 	}
@@ -146,13 +145,15 @@ void wlan_sm_transition_to(struct wlan_sm *sm, uint8_t state)
 	else
 		new_sub_st = 0;
 
-	sm_engine_debug("%s: transition(state) %s => %s",
-			sm->name, state_info[old_state].name,
-			state_info[new_state].name);
-	sm_engine_debug("%s: transition(sub_state) %s => %s",
-			sm->name,
-			ol_sub_st ? state_info[ol_sub_st].name : "IDLE",
-			new_sub_st ? state_info[new_sub_st].name : "IDLE");
+	sm_engine_nofl_info("%s: transition(state) %s[%d] => %s[%d]",
+			    sm->name, state_info[old_state].name, old_state,
+			    state_info[new_state].name, new_state);
+	sm_engine_nofl_info("%s: transition(sub_state) %s[%d] => %s[%d]",
+			    sm->name,
+			    ol_sub_st ? state_info[ol_sub_st].name : "IDLE",
+			    ol_sub_st,
+			    new_sub_st ? state_info[new_sub_st].name : "IDLE",
+			    new_sub_st);
 
 	/*
 	 * call the exit function(s) of the current state hierarchy

+ 9 - 2
umac/mlme/vdev_mgr/core/src/vdev_mlme_sm.c

@@ -1783,8 +1783,11 @@ void mlme_vdev_sm_history_print(struct vdev_mlme_obj *vdev_mlme)
 QDF_STATUS mlme_vdev_sm_create(struct vdev_mlme_obj *vdev_mlme)
 {
 	struct wlan_sm *sm;
+	uint8_t name[WLAN_SM_ENGINE_MAX_NAME];
 
-	sm = wlan_sm_create("VDEV MLME", vdev_mlme,
+	snprintf(name, sizeof(name), "VDEV%d-MLME",
+		 wlan_vdev_get_id(vdev_mlme->vdev));
+	sm = wlan_sm_create(name, vdev_mlme,
 			    WLAN_VDEV_S_INIT,
 			    sm_info,
 			    QDF_ARRAY_SIZE(sm_info),
@@ -1806,8 +1809,12 @@ QDF_STATUS mlme_vdev_sm_create(struct vdev_mlme_obj *vdev_mlme)
 QDF_STATUS mlme_vdev_sm_create(struct vdev_mlme_obj *vdev_mlme)
 {
 	struct wlan_sm *sm;
+	uint8_t name[WLAN_SM_ENGINE_MAX_NAME];
 
-	sm = wlan_sm_create("VDEV MLME", vdev_mlme, 0, NULL, 0, NULL, 0);
+	snprintf(name, sizeof(name), "VDEV%d-MLME",
+		 wlan_vdev_get_id(vdev_mlme->vdev));
+
+	sm = wlan_sm_create(name, vdev_mlme, 0, NULL, 0, NULL, 0);
 	if (!sm) {
 		mlme_err("VDEV MLME SM allocation failed");
 		return QDF_STATUS_E_FAILURE;

+ 1 - 0
umac/mlme/vdev_mgr/dispatcher/src/wlan_vdev_mlme_api.c

@@ -25,6 +25,7 @@
 #include "include/wlan_vdev_mlme.h"
 #include "../../core/src/vdev_mlme_sm.h"
 #include <wlan_vdev_mlme_api.h>
+#include <qdf_module.h>
 
 struct vdev_mlme_obj *wlan_vdev_mlme_get_cmpt_obj(struct wlan_objmgr_vdev *vdev)
 {

+ 2 - 0
wmi/inc/wmi_unified_param.h

@@ -864,7 +864,9 @@ struct hidden_ssid_vdev_restart_params {
 	uint32_t info;
 	uint32_t reg_info_1;
 	uint32_t reg_info_2;
+#ifndef CONFIG_VDEV_SM
 	qdf_atomic_t hidden_ssid_restart_in_progress;
+#endif
 };
 
 /**