Переглянути джерело

qcacmn: Synchronize VDEV_DELETE and VDEV_DOWN with peer delete response

Hold additional reference to BSS node during node allocation, and free
it in delete response. This ensures BSS Node Freed event is sent to MLME
only after receving peer delete response for BSS node.

Change-Id: I384eac54f437000a1c09eb53751ad8b8e26617ad
CRs-Fixed: 1112381
Vijay Pamidipati 8 роки тому
батько
коміт
da0611616d

+ 3 - 1
dp/inc/cdp_txrx_ops.h

@@ -489,8 +489,10 @@ struct ol_if_ops {
 	int (*peer_rx_reorder_queue_remove)(void *ol_soc_handle,
 			uint8_t vdev_id, uint8_t *peer_macaddr,
 			uint32_t tid_mask);
-	int (*peer_unref_delete)(void *ol_soc_handle);
+	int (*peer_unref_delete)(void *ol_soc_handle, uint8_t vdev_id,
+			uint8_t *peer_macaddr);
 	bool (*is_hw_dbs_2x2_capable)(void);
+
 	/* TODO: Add any other control path calls required to OL_IF/WMA layer */
 };
 

+ 3 - 1
dp/wifi3.0/dp_main.c

@@ -1683,8 +1683,10 @@ void dp_peer_unref_delete(void *peer_handle)
 		qdf_mem_free(peer);
 #endif
 		if (soc->cdp_soc.ol_ops->peer_unref_delete) {
-			soc->cdp_soc.ol_ops->peer_unref_delete(soc->osif_soc);
+			soc->cdp_soc.ol_ops->peer_unref_delete(soc->osif_soc,
+					vdev->vdev_id, peer->mac_addr.raw);
 		}
+
 	} else {
 		qdf_spin_unlock_bh(&soc->peer_ref_mutex);
 	}

+ 5 - 0
wmi/inc/wmi_unified_api.h

@@ -1375,7 +1375,12 @@ QDF_STATUS wmi_extract_reg_cap_service_ready_ext(
 			void *wmi_hdl,
 			uint8_t *evt_buf, uint8_t phy_idx,
 			struct WMI_HOST_HAL_REG_CAPABILITIES_EXT *param);
+
 QDF_STATUS wmi_extract_pdev_utf_event(void *wmi_hdl,
 				      uint8_t *evt_buf,
 				      struct wmi_host_pdev_utf_event *param);
+
+QDF_STATUS wmi_extract_peer_delete_response_event(void *wmi_hdl,
+		uint8_t *evt_buf,
+		struct wmi_host_peer_delete_response_event *param);
 #endif /* _WMI_UNIFIED_API_H_ */

+ 12 - 0
wmi/inc/wmi_unified_param.h

@@ -4947,6 +4947,7 @@ typedef enum {
 	wmi_peer_gid_userpos_list_event_id,
 	wmi_pdev_check_cal_version_event_id,
 	wmi_atf_peer_stats_event_id,
+	wmi_peer_delete_response_event_id,
 
 	wmi_events_max,
 } wmi_conv_event_id;
@@ -7201,6 +7202,17 @@ struct wmi_host_pdev_utf_event {
 	uint16_t datalen;
 };
 
+/**
+ * struct wmi_host_peer_delete_response_event - Peer Delete response event param
+ * @vdev_id: vdev id
+ * @mac_address: Peer Mac Address
+ *
+ */
+struct wmi_host_peer_delete_response_event {
+	uint32_t vdev_id;
+	struct qdf_mac_addr mac_address;
+};
+
 /**
  * @struct wmi_host_dcs_interference_param
  * @interference_type: Type of DCS Interference

+ 5 - 0
wmi/inc/wmi_unified_priv.h

@@ -1217,6 +1217,11 @@ QDF_STATUS (*extract_pdev_utf_event)(wmi_unified_t wmi_hdl,
 
 uint16_t (*wmi_set_htc_tx_tag)(wmi_unified_t wmi_handle,
 				wmi_buf_t buf, uint32_t cmd_id);
+
+QDF_STATUS (*extract_peer_delete_response_event)(
+			wmi_unified_t wmi_handle,
+			void *evt_buf,
+			struct wmi_host_peer_delete_response_event *param);
 };
 
 struct target_abi_version {

+ 25 - 0
wmi/src/wmi_unified_api.c

@@ -6506,6 +6506,7 @@ QDF_STATUS wmi_extract_mac_phy_cap_service_ready_ext(
 
 	return QDF_STATUS_E_FAILURE;
 }
+
 /**
  * wmi_extract_reg_cap_service_ready_ext() -
  *       extract REG cap from service ready event
@@ -6553,3 +6554,27 @@ QDF_STATUS wmi_extract_pdev_utf_event(void *wmi_hdl,
 
 	return QDF_STATUS_E_FAILURE;
 }
+
+/**
+ * wmi_extract_peer_delete_response_event() -
+ *       extract vdev id and peer mac addresse from peer delete response event
+ * @wmi_handle: wmi handle
+ * @param evt_buf: pointer to event buffer
+ * @param param: Pointer to hold evt buf
+ *
+ * Return: QDF_STATUS_SUCCESS for success or error code
+ */
+QDF_STATUS wmi_extract_peer_delete_response_event(
+			void *wmi_hdl,
+			uint8_t *evt_buf,
+			struct wmi_host_peer_delete_response_event *param)
+{
+	wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
+
+	if (wmi_handle->ops->extract_peer_delete_response_event)
+		return wmi_handle->ops->extract_peer_delete_response_event(
+				wmi_handle,
+				evt_buf, param);
+
+	return QDF_STATUS_E_FAILURE;
+}

+ 35 - 0
wmi/src/wmi_unified_tlv.c

@@ -172,6 +172,7 @@ QDF_STATUS send_vdev_stop_cmd_tlv(wmi_unified_t wmi,
 		wmi_buf_free(buf);
 		return QDF_STATUS_E_FAILURE;
 	}
+	WMI_LOGD("%s:vdev id = %d", __func__, vdev_id);
 
 	return 0;
 }
@@ -13442,6 +13443,36 @@ static QDF_STATUS extract_fips_event_data_tlv(wmi_unified_t wmi_handle,
 	return QDF_STATUS_SUCCESS;
 }
 
+/*
+ * extract_peer_delete_response_event_tlv() - extract peer delete response event
+ * @wmi_handle: wmi handle
+ * @param evt_buf: pointer to event buffer
+ * @param vdev_id: Pointer to hold vdev_id
+ * @param mac_addr: Pointer to hold peer mac address
+ *
+ * Return: QDF_STATUS_SUCCESS for success or error code
+ */
+static QDF_STATUS extract_peer_delete_response_event_tlv(wmi_unified_t wmi_hdl,
+	void *evt_buf, struct wmi_host_peer_delete_response_event *param)
+{
+	WMI_PEER_DELETE_RESP_EVENTID_param_tlvs *param_buf;
+	wmi_peer_delete_resp_event_fixed_param *ev;
+
+	param_buf = (WMI_PEER_DELETE_RESP_EVENTID_param_tlvs *)evt_buf;
+
+	ev = (wmi_peer_delete_resp_event_fixed_param *) param_buf->fixed_param;
+	if (!ev) {
+		WMI_LOGE("%s: Invalid peer_delete response\n", __func__);
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	param->vdev_id = ev->vdev_id;
+	WMI_MAC_ADDR_TO_CHAR_ARRAY(&ev->peer_macaddr,
+			&param->mac_address.bytes[0]);
+
+	return QDF_STATUS_SUCCESS;
+}
+
 #ifdef WMI_INTERFACE_EVENT_LOGGING
 static bool is_management_record_tlv(uint32_t cmd_id)
 {
@@ -13838,6 +13869,8 @@ struct wmi_ops tlv_ops =  {
 	.extract_dcs_im_tgt_stats = extract_dcs_im_tgt_stats_tlv,
 	.extract_fips_event_data = extract_fips_event_data_tlv,
 	.send_pdev_fips_cmd = send_pdev_fips_cmd_tlv,
+	.extract_peer_delete_response_event =
+				extract_peer_delete_response_event_tlv,
 };
 
 #ifndef CONFIG_MCL
@@ -14013,6 +14046,8 @@ static void populate_tlv_events_id(uint32_t *event_ids)
 	event_ids[wmi_peer_estimated_linkspeed_event_id] =
 				WMI_PEER_ESTIMATED_LINKSPEED_EVENTID;
 	event_ids[wmi_peer_state_event_id] = WMI_PEER_STATE_EVENTID;
+	event_ids[wmi_peer_delete_response_event_id] =
+					WMI_PEER_DELETE_RESP_EVENTID;
 	event_ids[wmi_mgmt_rx_event_id] = WMI_MGMT_RX_EVENTID;
 	event_ids[wmi_host_swba_event_id] = WMI_HOST_SWBA_EVENTID;
 	event_ids[wmi_tbttoffset_update_event_id] =