qcacld-3.0: Added new parameter in p2p_set_noa command
Added support for new "start" parameter in p2p_set_noa driver command. Change-Id: I8bc743141ea6d9cfdf49ca89b0835f2e5519a12e CRs-Fixed: 3557825
This commit is contained in:

committed by
Rahul Choudhary

parent
fadf698982
commit
964f138fd9
@@ -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;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@@ -444,10 +444,11 @@ 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",
|
||||
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->duration, ps_config->single_noa_duration,
|
||||
ps_config->interval, ps_config->duration,
|
||||
ps_config->start, ps_config->single_noa_duration,
|
||||
ps_config->ps_selection);
|
||||
|
||||
if (!soc) {
|
||||
|
@@ -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,
|
||||
|
@@ -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,10 +1247,11 @@ 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",
|
||||
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->single_noa_duration,
|
||||
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);
|
||||
|
Reference in New Issue
Block a user