|
@@ -170,11 +170,6 @@ static QDF_STATUS pmo_core_do_enable_ns_offload(struct wlan_objmgr_vdev *vdev,
|
|
|
status = pmo_tgt_enable_ns_offload_req(vdev, vdev_id);
|
|
|
break;
|
|
|
case pmo_apps_suspend:
|
|
|
- if (psoc_ctx->psoc_cfg.active_mode_offload) {
|
|
|
- pmo_debug("active offload is enabled, skip in mode: %d",
|
|
|
- trigger);
|
|
|
- goto out;
|
|
|
- }
|
|
|
/* enable arp when active offload is false (apps suspend) */
|
|
|
status = pmo_tgt_enable_ns_offload_req(vdev, vdev_id);
|
|
|
break;
|
|
@@ -211,12 +206,6 @@ static QDF_STATUS pmo_core_do_disable_ns_offload(struct wlan_objmgr_vdev *vdev,
|
|
|
status = pmo_tgt_disable_ns_offload_req(vdev, vdev_id);
|
|
|
break;
|
|
|
case pmo_apps_resume:
|
|
|
- if (psoc_ctx->psoc_cfg.active_mode_offload) {
|
|
|
- pmo_debug("active offload is enabled, skip in mode: %d",
|
|
|
- trigger);
|
|
|
- goto out;
|
|
|
- }
|
|
|
- /* config arp/ns when active offload is disable */
|
|
|
status = pmo_tgt_disable_ns_offload_req(vdev, vdev_id);
|
|
|
break;
|
|
|
default:
|
|
@@ -259,8 +248,52 @@ static QDF_STATUS pmo_core_ns_offload_sanity(struct wlan_objmgr_vdev *vdev)
|
|
|
return QDF_STATUS_SUCCESS;
|
|
|
}
|
|
|
|
|
|
-QDF_STATUS pmo_core_cache_ns_offload_req(
|
|
|
- struct pmo_ns_req *ns_req)
|
|
|
+QDF_STATUS pmo_core_ns_check_offload(struct wlan_objmgr_psoc *psoc,
|
|
|
+ enum pmo_offload_trigger trigger,
|
|
|
+ uint8_t vdev_id)
|
|
|
+{
|
|
|
+ QDF_STATUS status = QDF_STATUS_SUCCESS;
|
|
|
+ struct pmo_psoc_priv_obj *psoc_ctx;
|
|
|
+ struct pmo_vdev_priv_obj *vdev_ctx;
|
|
|
+ struct wlan_objmgr_vdev *vdev;
|
|
|
+ bool active_offload_cond, is_applied_cond;
|
|
|
+
|
|
|
+ pmo_enter();
|
|
|
+
|
|
|
+ vdev = pmo_psoc_get_vdev(psoc, vdev_id);
|
|
|
+ if (!vdev) {
|
|
|
+ pmo_err("vdev is NULL");
|
|
|
+ status = QDF_STATUS_E_INVAL;
|
|
|
+ goto out;
|
|
|
+ }
|
|
|
+
|
|
|
+ status = pmo_vdev_get_ref(vdev);
|
|
|
+ if (QDF_IS_STATUS_ERROR(status))
|
|
|
+ goto out;
|
|
|
+
|
|
|
+ vdev_ctx = pmo_vdev_get_priv(vdev);
|
|
|
+ psoc_ctx = vdev_ctx->pmo_psoc_ctx;
|
|
|
+
|
|
|
+ if (trigger == pmo_apps_suspend || trigger == pmo_apps_resume) {
|
|
|
+ active_offload_cond = psoc_ctx->psoc_cfg.active_mode_offload;
|
|
|
+
|
|
|
+ qdf_spin_lock_bh(&vdev_ctx->pmo_vdev_lock);
|
|
|
+ is_applied_cond = vdev_ctx->vdev_ns_req.enable &&
|
|
|
+ vdev_ctx->vdev_ns_req.is_offload_applied;
|
|
|
+ qdf_spin_unlock_bh(&vdev_ctx->pmo_vdev_lock);
|
|
|
+
|
|
|
+ if (active_offload_cond && is_applied_cond) {
|
|
|
+ pmo_debug("active offload is enabled and offload already sent");
|
|
|
+ pmo_vdev_put_ref(vdev);
|
|
|
+ return QDF_STATUS_E_INVAL;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ pmo_vdev_put_ref(vdev);
|
|
|
+out:
|
|
|
+ return status;
|
|
|
+}
|
|
|
+
|
|
|
+QDF_STATUS pmo_core_cache_ns_offload_req(struct pmo_ns_req *ns_req)
|
|
|
{
|
|
|
QDF_STATUS status;
|
|
|
struct wlan_objmgr_vdev *vdev;
|