Browse Source

qcacld-3.0: Remove wait for sta_authorised_event from FW

Firmware do not send WMI_PEER_STATE_CHANGE_EVENTID when WMI_PEER_AUTHORIZE
peer param is sent from host on peer. Host waits for this event from
firmware for 10ms and then times out. This leads to unnecessary delay of
atleast 10ms in enabling the TX queues every time after connection and
roaming.

So this change cleans up the existing handling of WMI_PEER_STATE_EVENTID
and removes wait for sta_authorised_event. This will improve the latency
in enabling the queues from host.

Change-Id: Iaf54d8298dab3cd47ad4779ec9ee11dc8f0bad0d
CRs-Fixed: 3436763
Surabhi Vishnoi 2 years ago
parent
commit
704dbe521a

+ 0 - 3
core/hdd/inc/wlan_hdd_main.h

@@ -1062,7 +1062,6 @@ struct wlan_hdd_link_info {
  * @qdf_monitor_mode_vdev_up_event: QDF event for monitor mode vdev up
  * @disconnect_comp_var: completion variable for disconnect callback
  * @linkup_event_var: completion variable for Linkup Event
- * @sta_authorized_event:
  * @is_link_up_service_needed: Track whether the linkup handling is needed
  * @hdd_wmm_status: WMM Status
  * @sta_info:
@@ -1200,8 +1199,6 @@ struct hdd_adapter {
 	struct completion disconnect_comp_var;
 	struct completion linkup_event_var;
 
-	struct completion sta_authorized_event;
-
 	bool is_link_up_service_needed;
 
 	struct hdd_wmm_status hdd_wmm_status;

+ 2 - 40
core/hdd/src/wlan_hdd_assoc.c

@@ -174,8 +174,6 @@ uint8_t ccp_wapi_oui02[HDD_WAPI_OUI_SIZE] = { 0x00, 0x14, 0x72, 0x02 };
 #define ASSOC_RSP_IES_OFFSET 6  /* Capability(2) + AID(2) + Status Code(2) */
 #define ASSOC_REQ_IES_OFFSET 4  /* Capability(2) + LI(2) */
 
-#define HDD_PEER_AUTHORIZE_WAIT 10
-
 /*
  * beacon_filter_table - table of IEs used for beacon filtering
  */
@@ -1227,40 +1225,10 @@ void hdd_clear_roam_profile_ie(struct hdd_adapter *adapter)
 	hdd_exit();
 }
 
-/**
- * hdd_set_peer_authorized_event() - set peer_authorized_event
- * @vdev_id: vdevid
- *
- * Return: None
- */
-static void hdd_set_peer_authorized_event(uint32_t vdev_id)
-{
-	struct hdd_context *hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
-	struct hdd_adapter *adapter = NULL;
-
-	if (!hdd_ctx)
-		return;
-
-	adapter = hdd_get_adapter_by_vdev(hdd_ctx, vdev_id);
-	if (!adapter) {
-		hdd_err("Invalid vdev_id");
-		return;
-	}
-	complete(&adapter->sta_authorized_event);
-}
-
 #if defined(QCA_LL_LEGACY_TX_FLOW_CONTROL) || defined(QCA_LL_TX_FLOW_CONTROL_V2)
 static inline
 void hdd_set_unpause_queue(void *soc, struct hdd_adapter *adapter)
 {
-	unsigned long rc;
-	/* wait for event from firmware to set the event */
-	rc = wait_for_completion_timeout(
-			&adapter->sta_authorized_event,
-			msecs_to_jiffies(HDD_PEER_AUTHORIZE_WAIT));
-	if (!rc)
-		hdd_debug("timeout waiting for sta_authorized_event");
-
 	cdp_fc_vdev_unpause(soc, adapter->deflink->vdev_id,
 			    OL_TXQ_PAUSE_REASON_PEER_UNAUTHORIZED,
 			    0);
@@ -1334,15 +1302,9 @@ QDF_STATUS hdd_change_peer_state(struct hdd_adapter *adapter,
 		/* Reset scan reject params on successful set key */
 		hdd_debug("Reset scan reject params");
 		hdd_init_scan_reject_params(adapter->hdd_ctx);
-#ifdef QCA_LL_LEGACY_TX_FLOW_CONTROL
-		/* make sure event is reset */
-		INIT_COMPLETION(adapter->sta_authorized_event);
-#endif
 
-		err = sme_set_peer_authorized(
-				peer_mac,
-				hdd_set_peer_authorized_event,
-				adapter->deflink->vdev_id);
+		err = sme_set_peer_authorized(peer_mac,
+					      adapter->deflink->vdev_id);
 		if (err != QDF_STATUS_SUCCESS) {
 			hdd_err("Failed to set the peer state to authorized");
 			return QDF_STATUS_E_FAULT;

+ 0 - 1
core/hdd/src/wlan_hdd_main.c

@@ -7542,7 +7542,6 @@ static void hdd_init_completion(struct hdd_adapter *adapter)
 {
 	init_completion(&adapter->disconnect_comp_var);
 	init_completion(&adapter->linkup_event_var);
-	init_completion(&adapter->sta_authorized_event);
 	init_completion(&adapter->lfr_fw_status.disable_lfr_event);
 }
 

+ 0 - 2
core/sme/inc/sme_api.h

@@ -1814,9 +1814,7 @@ QDF_STATUS sme_nss_update_request(uint32_t vdev_id,
 				  uint32_t original_vdev_id,
 				  uint32_t request_id);
 
-typedef void (*sme_peer_authorized_fp) (uint32_t vdev_id);
 QDF_STATUS sme_set_peer_authorized(uint8_t *peer_addr,
-				   sme_peer_authorized_fp auth_fp,
 				   uint32_t vdev_id);
 QDF_STATUS sme_soc_set_dual_mac_config(struct policy_mgr_dual_mac_config msg);
 QDF_STATUS sme_soc_set_antenna_mode(mac_handle_t mac_handle,

+ 0 - 3
core/sme/src/common/sme_api.c

@@ -11804,13 +11804,11 @@ QDF_STATUS sme_soc_set_antenna_mode(mac_handle_t mac_handle,
 /**
  * sme_set_peer_authorized() - call peer authorized callback
  * @peer_addr: peer mac address
- * @auth_cb: auth callback
  * @vdev_id: vdev id
  *
  * Return: QDF Status
  */
 QDF_STATUS sme_set_peer_authorized(uint8_t *peer_addr,
-				   sme_peer_authorized_fp auth_cb,
 				   uint32_t vdev_id)
 {
 	void *wma_handle;
@@ -11819,7 +11817,6 @@ QDF_STATUS sme_set_peer_authorized(uint8_t *peer_addr,
 	if (!wma_handle)
 		return QDF_STATUS_E_FAILURE;
 
-	wma_set_peer_authorized_cb(wma_handle, auth_cb);
 	return wma_set_peer_param(wma_handle, peer_addr,
 				  WMI_HOST_PEER_AUTHORIZE, 1, vdev_id);
 }

+ 0 - 2
core/wma/inc/wma.h

@@ -867,7 +867,6 @@ struct wma_wlm_stats_data {
  * @log_completion_timer: log completion timer
  * @old_hw_mode_index: Previous configured HW mode index
  * @new_hw_mode_index: Current configured HW mode index
- * @peer_authorized_cb: peer authorized hdd callback
  * @ocb_config_req: OCB request context
  * @self_gen_frm_pwr: Self-generated frame power
  * @tx_chain_mask_cck: Is the CCK tx chain mask enabled
@@ -995,7 +994,6 @@ typedef struct {
 	qdf_mc_timer_t log_completion_timer;
 	uint32_t old_hw_mode_index;
 	uint32_t new_hw_mode_index;
-	wma_peer_authorized_fp peer_authorized_cb;
 	uint16_t self_gen_frm_pwr;
 	bool tx_chain_mask_cck;
 	qdf_mc_timer_t service_ready_ext_timer;

+ 0 - 1
core/wma/inc/wma_api.h

@@ -174,7 +174,6 @@ void wma_get_phy_mode_cb(qdf_freq_t freq, uint32_t chan_width,
 
 QDF_STATUS wma_set_htconfig(uint8_t vdev_id, uint16_t ht_capab, int value);
 
-void wma_set_peer_authorized_cb(void *wma_ctx, wma_peer_authorized_fp auth_cb);
 QDF_STATUS wma_set_peer_param(void *wma_ctx, uint8_t *peer_addr,
 		  uint32_t param_id,
 		  uint32_t param_value, uint32_t vdev_id);

+ 0 - 4
core/wma/inc/wma_internal.h

@@ -934,10 +934,6 @@ int32_t wmi_unified_send_txbf(tp_wma_handle wma, tpAddStaParams params);
  */
 QDF_STATUS wma_check_txrx_chainmask(int num_rf_chains, int cmd_value);
 
-int wma_peer_state_change_event_handler(void *handle,
-					       uint8_t *event_buff,
-					       uint32_t len);
-
 QDF_STATUS wma_set_enable_disable_mcc_adaptive_scheduler(uint32_t
 						mcc_adaptive_scheduler);
 

+ 0 - 51
core/wma/src/wma_data.c

@@ -1059,57 +1059,6 @@ QDF_STATUS wma_check_txrx_chainmask(int num_rf_chains, int cmd_value)
 	return QDF_STATUS_SUCCESS;
 }
 
-/**
- * wma_peer_state_change_event_handler() - peer state change event handler
- * @handle: wma handle
- * @event_buff: event buffer
- * @len: length of buffer
- *
- * This event handler unpauses vdev if peer state change to AUTHORIZED STATE
- *
- * Return: 0 for success or error code
- */
-int wma_peer_state_change_event_handler(void *handle,
-					uint8_t *event_buff,
-					uint32_t len)
-{
-	WMI_PEER_STATE_EVENTID_param_tlvs *param_buf;
-	wmi_peer_state_event_fixed_param *event;
-#ifdef QCA_LL_LEGACY_TX_FLOW_CONTROL
-	tp_wma_handle wma_handle = (tp_wma_handle) handle;
-#endif
-
-	if (!event_buff) {
-		wma_err("Received NULL event ptr from FW");
-		return -EINVAL;
-	}
-	param_buf = (WMI_PEER_STATE_EVENTID_param_tlvs *) event_buff;
-	if (!param_buf) {
-		wma_err("Received NULL buf ptr from FW");
-		return -ENOMEM;
-	}
-
-	event = param_buf->fixed_param;
-
-	if ((cdp_get_opmode(cds_get_context(QDF_MODULE_ID_SOC),
-			    event->vdev_id) == wlan_op_mode_sta) &&
-	    event->state == WMI_PEER_STATE_AUTHORIZED) {
-		/*
-		 * set event so that hdd
-		 * can procced and unpause tx queue
-		 */
-#ifdef QCA_LL_LEGACY_TX_FLOW_CONTROL
-		if (!wma_handle->peer_authorized_cb) {
-			wma_err("peer authorized cb not registered");
-			return -EINVAL;
-		}
-		wma_handle->peer_authorized_cb(event->vdev_id);
-#endif
-	}
-
-	return 0;
-}
-
 /**
  * wma_set_enable_disable_mcc_adaptive_scheduler() -enable/disable mcc scheduler
  * @mcc_adaptive_scheduler: enable/disable

+ 0 - 14
core/wma/src/wma_dev_if.c

@@ -1419,20 +1419,6 @@ wma_vdev_set_param(wmi_unified_t wmi_handle, uint32_t if_id,
 	return wmi_unified_vdev_set_param_send(wmi_handle, &param);
 }
 
-/**
- * wma_set_peer_authorized_cb() - set peer authorized callback function
- * @wma_ctx: wma handle
- * @auth_cb: peer authorized callback
- *
- * Return: none
- */
-void wma_set_peer_authorized_cb(void *wma_ctx, wma_peer_authorized_fp auth_cb)
-{
-	tp_wma_handle wma_handle = (tp_wma_handle) wma_ctx;
-
-	wma_handle->peer_authorized_cb = auth_cb;
-}
-
 /**
  * wma_set_peer_param() - set peer parameter in fw
  * @wma_ctx: wma handle

+ 0 - 6
core/wma/src/wma_main.c

@@ -3703,12 +3703,6 @@ QDF_STATUS wma_open(struct wlan_objmgr_psoc *psoc,
 					   WMA_RX_SERIALIZER_CTX);
 #endif /* FEATURE_OEM_DATA_SUPPORT */
 
-	/* Register peer change event handler */
-	wmi_unified_register_event_handler(wma_handle->wmi_handle,
-					   wmi_peer_state_event_id,
-					   wma_peer_state_change_event_handler,
-					   WMA_RX_WORK_CTX);
-
 	/* Register beacon tx complete event id. The event is required
 	 * for sending channel switch announcement frames
 	 */