Explorar el Código

qcacmn: Add target_if/mlme support for vdev delete all peer

Add target_if/mlme support for vdev delete all
peer request which will replace individual peer
delete of peers under a vdev during vdev down.

Change-Id: Ic9aadefefe26bcdcd38bb5a28be712e3c5e2963a
CRs-Fixed: 2456858
Naga hace 5 años
padre
commit
52beb2c087

+ 85 - 11
target_if/mlme/vdev_mgr/src/target_if_vdev_mgr_rx_ops.c

@@ -43,6 +43,7 @@ void target_if_vdev_mgr_rsp_timer_mgmt_cb(void *arg)
 	struct vdev_start_response start_rsp = {0};
 	struct vdev_stop_response stop_rsp = {0};
 	struct vdev_delete_response del_rsp = {0};
+	struct peer_delete_all_response peer_del_all_rsp = {0};
 	uint8_t vdev_id;
 
 	vdev_id = wlan_vdev_get_id(vdev);
@@ -64,7 +65,10 @@ void target_if_vdev_mgr_rsp_timer_mgmt_cb(void *arg)
 	if (!qdf_atomic_test_bit(START_RESPONSE_BIT, &vdev_rsp->rsp_status) &&
 	    !qdf_atomic_test_bit(RESTART_RESPONSE_BIT, &vdev_rsp->rsp_status) &&
 	    !qdf_atomic_test_bit(STOP_RESPONSE_BIT, &vdev_rsp->rsp_status) &&
-	    !qdf_atomic_test_bit(DELETE_RESPONSE_BIT, &vdev_rsp->rsp_status)) {
+	    !qdf_atomic_test_bit(DELETE_RESPONSE_BIT, &vdev_rsp->rsp_status) &&
+	    !qdf_atomic_test_bit(
+			PEER_DELETE_ALL_RESPONSE_BIT,
+			&vdev_rsp->rsp_status)) {
 		mlme_debug("No response bit is set, ignoring actions");
 		return;
 	}
@@ -102,6 +106,14 @@ void target_if_vdev_mgr_rsp_timer_mgmt_cb(void *arg)
 			rx_ops->vdev_mgr_delete_response(psoc, &del_rsp);
 		}
 
+		if (qdf_atomic_test_bit(PEER_DELETE_ALL_RESPONSE_BIT,
+					&vdev_rsp->rsp_status)) {
+			peer_del_all_rsp.vdev_id = wlan_vdev_get_id(vdev);
+			rx_ops->vdev_mgr_peer_delete_all_response(
+							psoc,
+							&peer_del_all_rsp);
+		}
+
 		return;
 	}
 
@@ -135,7 +147,7 @@ static int target_if_vdev_mgr_start_response_handler(
 	wmi_host_vdev_start_resp vdev_start_resp;
 
 	if (!scn || !data) {
-		mlme_err("scn: 0x%pK, data: 0x%pK", scn, data);
+		mlme_err("Invalid input");
 		return -EINVAL;
 	}
 
@@ -190,7 +202,7 @@ static int target_if_vdev_mgr_stop_response_handler(
 	uint32_t vdev_id;
 
 	if (!scn || !data) {
-		mlme_err("scn: 0x%pK, data: 0x%pK", scn, data);
+		mlme_err("Invalid input");
 		return -EINVAL;
 	}
 
@@ -236,7 +248,7 @@ static int target_if_vdev_mgr_delete_response_handler(
 	struct wmi_host_vdev_delete_resp vdev_del_resp;
 
 	if (!scn || !data) {
-		mlme_err("scn: 0x%pK, data: 0x%pK", scn, data);
+		mlme_err("Invalid input");
 		return -EINVAL;
 	}
 
@@ -247,8 +259,7 @@ static int target_if_vdev_mgr_delete_response_handler(
 	}
 
 	rx_ops = target_if_vdev_mgr_get_rx_ops(psoc);
-	if (!rx_ops || !rx_ops->vdev_mgr_stop_response ||
-	    !rx_ops->vdev_mgr_get_response_timer_info) {
+	if (!rx_ops || !rx_ops->vdev_mgr_delete_response) {
 		mlme_err("No Rx Ops");
 		return -EINVAL;
 	}
@@ -270,6 +281,56 @@ static int target_if_vdev_mgr_delete_response_handler(
 	return qdf_status_to_os_return(status);
 }
 
+static int target_if_vdev_mgr_peer_delete_all_response_handler(
+							ol_scn_t scn,
+							uint8_t *data,
+							uint32_t datalen)
+{
+	QDF_STATUS status;
+	struct wlan_objmgr_psoc *psoc;
+	struct wmi_unified *wmi_handle;
+	struct wlan_lmac_if_mlme_rx_ops *rx_ops;
+	struct peer_delete_all_response rsp = {0};
+	struct wmi_host_vdev_peer_delete_all_response_event
+						vdev_peer_del_all_resp;
+
+	if (!scn || !data) {
+		mlme_err("Invalid input");
+		return -EINVAL;
+	}
+
+	psoc = target_if_get_psoc_from_scn_hdl(scn);
+	if (!psoc) {
+		mlme_err("PSOC is NULL");
+		return -EINVAL;
+	}
+
+	rx_ops = target_if_vdev_mgr_get_rx_ops(psoc);
+	if (!rx_ops || !rx_ops->vdev_mgr_peer_delete_all_response) {
+		mlme_err("No Rx Ops");
+		return -EINVAL;
+	}
+
+	wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
+	if (!wmi_handle) {
+		mlme_err("wmi_handle is null");
+		return -EINVAL;
+	}
+
+	if (wmi_extract_vdev_peer_delete_all_response_event(
+						wmi_handle, data,
+						&vdev_peer_del_all_resp)) {
+		mlme_err("WMI extract failed");
+		return -EINVAL;
+	}
+
+	rsp.vdev_id = vdev_peer_del_all_resp.vdev_id;
+	rsp.status = vdev_peer_del_all_resp.status;
+	status = rx_ops->vdev_mgr_peer_delete_all_response(psoc, &rsp);
+
+	return qdf_status_to_os_return(status);
+}
+
 static int target_if_vdev_mgr_offload_bcn_tx_status_handler(
 							ol_scn_t scn,
 							uint8_t *data,
@@ -282,7 +343,7 @@ static int target_if_vdev_mgr_offload_bcn_tx_status_handler(
 	uint32_t vdev_id, tx_status;
 
 	if (!scn || !data) {
-		mlme_err("scn: 0x%pK, data: 0x%pK", scn, data);
+		mlme_err("Invalid input");
 		return -EINVAL;
 	}
 	psoc = target_if_get_psoc_from_scn_hdl(scn);
@@ -328,7 +389,7 @@ static int target_if_vdev_mgr_tbttoffset_update_handler(
 	uint32_t num_vdevs = 0;
 
 	if (!scn || !data) {
-		mlme_err("scn: 0x%pK, data: 0x%pK", scn, data);
+		mlme_err("Invalid input");
 		return -EINVAL;
 	}
 	psoc = target_if_get_psoc_from_scn_hdl(scn);
@@ -354,7 +415,8 @@ static int target_if_vdev_mgr_tbttoffset_update_handler(
 		return -EINVAL;
 	}
 
-	status = rx_ops->vdev_mgr_tbttoffset_update_handle(num_vdevs, false);
+	status = rx_ops->vdev_mgr_tbttoffset_update_handle(num_vdevs,
+							   false);
 
 	return qdf_status_to_os_return(status);
 }
@@ -371,7 +433,7 @@ static int target_if_vdev_mgr_ext_tbttoffset_update_handler(
 	uint32_t num_vdevs = 0;
 
 	if (!scn || !data) {
-		mlme_err("scn: 0x%pK, data: 0x%pK", scn, data);
+		mlme_err("Invalid input");
 		return -EINVAL;
 	}
 	psoc = target_if_get_psoc_from_scn_hdl(scn);
@@ -398,7 +460,8 @@ static int target_if_vdev_mgr_ext_tbttoffset_update_handler(
 		return -EINVAL;
 	}
 
-	status = rx_ops->vdev_mgr_tbttoffset_update_handle(num_vdevs, true);
+	status = rx_ops->vdev_mgr_tbttoffset_update_handle(num_vdevs,
+							   true);
 
 	return qdf_status_to_os_return(status);
 }
@@ -444,6 +507,14 @@ QDF_STATUS target_if_vdev_mgr_wmi_event_register(
 	if (retval)
 		mlme_err("failed to register for start response");
 
+	retval = wmi_unified_register_event_handler(
+			wmi_handle,
+			wmi_peer_delete_all_response_event_id,
+			target_if_vdev_mgr_peer_delete_all_response_handler,
+			WMI_RX_UMAC_CTX);
+	if (retval)
+		mlme_err("failed to register for peer delete all response");
+
 	return qdf_status_from_os_return(retval);
 }
 
@@ -472,5 +543,8 @@ QDF_STATUS target_if_vdev_mgr_wmi_event_unregister(
 	wmi_unified_unregister_event_handler(wmi_handle,
 					     wmi_vdev_start_resp_event_id);
 
+	wmi_unified_unregister_event_handler(
+					wmi_handle,
+					wmi_peer_delete_all_response_event_id);
 	return QDF_STATUS_SUCCESS;
 }

+ 54 - 0
target_if/mlme/vdev_mgr/src/target_if_vdev_mgr_tx_ops.c

@@ -963,6 +963,58 @@ static QDF_STATUS target_if_vdev_mgr_sta_ps_param_send(
 	return status;
 }
 
+static QDF_STATUS target_if_vdev_mgr_peer_delete_all_send(
+					struct wlan_objmgr_vdev *vdev,
+					struct peer_delete_all_params *param)
+{
+	QDF_STATUS status;
+	struct wmi_unified *wmi_handle;
+	struct wlan_lmac_if_mlme_rx_ops *rx_ops;
+	struct wlan_objmgr_psoc *psoc;
+	struct vdev_response_timer *vdev_rsp;
+	uint8_t vdev_id;
+
+	if (!vdev || !param) {
+		mlme_err("Invalid input");
+		return QDF_STATUS_E_INVAL;
+	}
+
+	wmi_handle = target_if_vdev_mgr_wmi_handle_get(vdev);
+	if (!wmi_handle) {
+		mlme_err("Failed to get WMI handle!");
+		return QDF_STATUS_E_INVAL;
+	}
+
+	vdev_id = wlan_vdev_get_id(vdev);
+	psoc = wlan_vdev_get_psoc(vdev);
+	rx_ops = target_if_vdev_mgr_get_rx_ops(psoc);
+
+	if (!rx_ops && !rx_ops->vdev_mgr_get_response_timer_info) {
+		mlme_err("VDEV_%d: No Rx Ops", vdev_id);
+		return QDF_STATUS_E_INVAL;
+	}
+
+	vdev_rsp = rx_ops->vdev_mgr_get_response_timer_info(vdev);
+	if (!vdev_rsp) {
+		mlme_err("VDEV_%d: Invalid response structure", vdev_id);
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	vdev_rsp->expire_time = PEER_DELETE_ALL_RESPONSE_TIMER;
+	target_if_vdev_mgr_rsp_timer_start(vdev, vdev_rsp,
+					   PEER_DELETE_ALL_RESPONSE_BIT);
+
+	status = wmi_unified_peer_delete_all_send(wmi_handle, param);
+	if (QDF_IS_STATUS_ERROR(status)) {
+		vdev_rsp->expire_time = 0;
+		vdev_rsp->timer_status = QDF_STATUS_E_CANCELED;
+		target_if_vdev_mgr_rsp_timer_stop(vdev, vdev_rsp,
+						  PEER_DELETE_ALL_RESPONSE_BIT);
+	}
+
+	return status;
+}
+
 QDF_STATUS
 target_if_vdev_mgr_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops)
 {
@@ -1015,6 +1067,8 @@ target_if_vdev_mgr_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops)
 			target_if_vdev_mgr_rsp_timer_mod;
 	mlme_tx_ops->vdev_mgr_rsp_timer_stop =
 			target_if_vdev_mgr_rsp_timer_stop;
+	mlme_tx_ops->peer_delete_all_send =
+			target_if_vdev_mgr_peer_delete_all_send;
 
 	return QDF_STATUS_SUCCESS;
 }