diff --git a/components/p2p/dispatcher/inc/wlan_p2p_public_struct.h b/components/p2p/dispatcher/inc/wlan_p2p_public_struct.h index c01179eae1..e3a12160e7 100644 --- a/components/p2p/dispatcher/inc/wlan_p2p_public_struct.h +++ b/components/p2p/dispatcher/inc/wlan_p2p_public_struct.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2017-2019, 2021 The Linux Foundation. All rights reserved. - * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -47,6 +47,7 @@ * @single_noa_duration: single shot noa duration * @ps_selection: power save selection * @session_id: session id + * @start: start time */ struct p2p_ps_params { uint8_t opp_ps; @@ -57,6 +58,7 @@ struct p2p_ps_params { uint32_t single_noa_duration; uint8_t ps_selection; uint8_t session_id; + uint32_t start; }; /** @@ -177,6 +179,7 @@ struct p2p_set_mac_filter_evt { * @interval: Interval * @single_noa_duration: Single shot noa duration * @ps_selection: power save selection + * @start: Start time */ struct p2p_ps_config { uint32_t vdev_id; @@ -187,6 +190,7 @@ struct p2p_ps_config { uint32_t interval; uint32_t single_noa_duration; uint32_t ps_selection; + uint32_t start; }; /** diff --git a/components/p2p/dispatcher/src/wlan_p2p_ucfg_api.c b/components/p2p/dispatcher/src/wlan_p2p_ucfg_api.c index d3bfbf08bc..612396dc3c 100644 --- a/components/p2p/dispatcher/src/wlan_p2p_ucfg_api.c +++ b/components/p2p/dispatcher/src/wlan_p2p_ucfg_api.c @@ -444,11 +444,12 @@ QDF_STATUS ucfg_p2p_set_ps(struct wlan_objmgr_psoc *soc, struct wlan_objmgr_vdev *vdev; struct p2p_ps_config go_ps_config; - p2p_debug("soc:%pK, vdev_id:%d, opp_ps:%d, ct_window:%d, count:%d, duration:%d, duration:%d, ps_selection:%d", - soc, ps_config->vdev_id, ps_config->opp_ps, - ps_config->ct_window, ps_config->count, - ps_config->duration, ps_config->single_noa_duration, - ps_config->ps_selection); + p2p_debug("soc:%pK, vdev_id:%d, opp_ps:%d, ct_window:%d, count:%d, interval:%d, duration:%d, start:%d, single noa duration:%d, ps_selection:%d", + soc, ps_config->vdev_id, ps_config->opp_ps, + ps_config->ct_window, ps_config->count, + ps_config->interval, ps_config->duration, + ps_config->start, ps_config->single_noa_duration, + ps_config->ps_selection); if (!soc) { p2p_err("psoc context passed is NULL"); diff --git a/components/target_if/p2p/src/target_if_p2p.c b/components/target_if/p2p/src/target_if_p2p.c index 87aaab52bd..db2c72d9f8 100644 --- a/components/target_if/p2p/src/target_if_p2p.c +++ b/components/target_if/p2p/src/target_if_p2p.c @@ -340,6 +340,7 @@ QDF_STATUS target_if_p2p_set_ps(struct wlan_objmgr_psoc *psoc, cmd.single_noa_duration = ps_config->single_noa_duration; cmd.ps_selection = ps_config->ps_selection; cmd.session_id = ps_config->vdev_id; + cmd.start = ps_config->start; if (ps_config->opp_ps) status = wmi_unified_set_p2pgo_oppps_req(wmi_handle, diff --git a/core/hdd/src/wlan_hdd_p2p.c b/core/hdd/src/wlan_hdd_p2p.c index b02ac40b51..4d50c2f3d5 100644 --- a/core/hdd/src/wlan_hdd_p2p.c +++ b/core/hdd/src/wlan_hdd_p2p.c @@ -442,7 +442,7 @@ int hdd_set_p2p_noa(struct net_device *dev, uint8_t *command) { struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); struct p2p_ps_config noa = {0}; - int count, duration, interval; + int count, duration, interval, start = 0; char *param; int ret; @@ -452,19 +452,25 @@ int hdd_set_p2p_noa(struct net_device *dev, uint8_t *command) return -EINVAL; } param++; - ret = sscanf(param, "%d %d %d", &count, &interval, &duration); - if (ret != 3) { + ret = sscanf(param, "%d %d %d %d", &count, &start, &duration, + &interval); + if (ret < 3) { hdd_err("P2P_SET GO noa: fail to read params, ret=%d", ret); return -EINVAL; } - if (count < 0 || interval < 0 || duration < 0 || - interval > MAX_MUS_VAL || duration > MAX_MUS_VAL) { + + if (ret == 3) + interval = 100; + + if (start < 0 || count < 0 || interval < 0 || duration < 0 || + start > MAX_MUS_VAL || interval > MAX_MUS_VAL || + duration > MAX_MUS_VAL) { hdd_err("Invalid NOA parameters"); return -EINVAL; } - hdd_debug("P2P_SET GO noa: count=%d interval=%d duration=%d", - count, interval, duration); + hdd_debug("P2P_SET GO noa: count=%d interval=%d duration=%d start=%d", + count, interval, duration, start); duration = MS_TO_TU_MUS(duration); interval = MS_TO_TU_MUS(interval); /* PS Selection @@ -488,15 +494,17 @@ int hdd_set_p2p_noa(struct net_device *dev, uint8_t *command) noa.single_noa_duration = 0; noa.ps_selection = P2P_POWER_SAVE_TYPE_PERIODIC_NOA; } + + noa.start = start; noa.interval = interval; noa.count = count; noa.vdev_id = adapter->deflink->vdev_id; - hdd_debug("P2P_PS_ATTR:opp ps %d ct window %d duration %d " - "interval %d count %d single noa duration %d " - "ps selection %x", noa.opp_ps, - noa.ct_window, noa.duration, noa.interval, - noa.count, noa.single_noa_duration, noa.ps_selection); + hdd_debug("P2P_PS_ATTR:opp ps %d ct window %d count %d interval %d " + "duration %d start %d single noa duration %d " + "ps selection %x", noa.opp_ps, noa.ct_window, noa.count, + noa.interval, noa.duration, noa.start, + noa.single_noa_duration, noa.ps_selection); return wlan_hdd_set_power_save(adapter, &noa); } @@ -1239,11 +1247,12 @@ int wlan_hdd_set_power_save(struct hdd_adapter *adapter, return -EINVAL; } - hdd_debug("opp ps:%d, ct window:%d, duration:%d, interval:%d, count:%d, single noa duration:%d, ps selection:%d, vdev id:%d", - ps_config->opp_ps, ps_config->ct_window, - ps_config->duration, ps_config->interval, - ps_config->count, ps_config->single_noa_duration, - ps_config->ps_selection, ps_config->vdev_id); + hdd_debug("opp ps:%d, ct window:%d, duration:%d, interval:%d, count:%d start:%d, single noa duration:%d, ps selection:%d, vdev id:%d", + ps_config->opp_ps, ps_config->ct_window, + ps_config->duration, ps_config->interval, + ps_config->count, ps_config->start, + ps_config->single_noa_duration, + ps_config->ps_selection, ps_config->vdev_id); status = ucfg_p2p_set_ps(psoc, ps_config); hdd_debug("p2p set power save, status:%d", status);