qcacld-3.0: Add Support to offload icmp feature to fw
Add support to offload icmp feature to fw in case of suspended state to avoid high power consumption. Change-Id: I3ff19d71eac530c75be57e6b52b975e755ff2a53 CRs-Fixed: 3042452
此提交包含在:
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Copyright (c) 2021, The Linux Foundation. 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 above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* DOC: Declare icmp offload feature API's
|
||||
*/
|
||||
|
||||
#ifndef _WLAN_PMO_ICMP_H_
|
||||
#define _WLAN_PMO_ICMP_H_
|
||||
|
||||
#ifdef WLAN_POWER_MANAGEMENT_OFFLOAD
|
||||
|
||||
#include "wlan_pmo_obj_mgmt_public_struct.h"
|
||||
|
||||
/**
|
||||
* pmo_core_icmp_check_offload(): API to check if icmp offload is enabled
|
||||
* @psoc: objmgr psoc handle
|
||||
* @vdev_id: vdev id
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS for success or error code
|
||||
*/
|
||||
QDF_STATUS pmo_core_icmp_check_offload(struct wlan_objmgr_psoc *psoc,
|
||||
uint8_t vdev_id);
|
||||
|
||||
#endif /* WLAN_POWER_MANAGEMENT_OFFLOAD */
|
||||
|
||||
#endif /* end of _WLAN_PMO_ICMP_H_ */
|
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* Copyright (c) 2021, The Linux Foundation. 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 above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* DOC: Implements icmp offload feature API's
|
||||
*/
|
||||
|
||||
#include "wlan_pmo_icmp.h"
|
||||
#include "wlan_pmo_main.h"
|
||||
#include "wlan_pmo_obj_mgmt_public_struct.h"
|
||||
|
||||
QDF_STATUS pmo_core_icmp_check_offload(struct wlan_objmgr_psoc *psoc,
|
||||
uint8_t vdev_id)
|
||||
{
|
||||
QDF_STATUS status = QDF_STATUS_SUCCESS;
|
||||
struct wlan_objmgr_vdev *vdev;
|
||||
enum QDF_OPMODE opmode;
|
||||
|
||||
vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc, vdev_id, WLAN_PMO_ID);
|
||||
if (!vdev) {
|
||||
pmo_err("vdev is NULL. vdev_id is %d", vdev_id);
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
opmode = pmo_get_vdev_opmode(vdev);
|
||||
if (opmode != QDF_STA_MODE) {
|
||||
pmo_debug("ICMP offload is supported in STA mode only");
|
||||
status = QDF_STATUS_E_INVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
out:
|
||||
wlan_objmgr_vdev_release_ref(vdev, WLAN_PMO_ID);
|
||||
return status;
|
||||
}
|
||||
|
@@ -26,6 +26,7 @@
|
||||
#include "cfg_ucfg_api.h"
|
||||
#include "wlan_fwol_ucfg_api.h"
|
||||
#include "wlan_ipa_obj_mgmt_api.h"
|
||||
#include "wlan_pmo_icmp.h"
|
||||
|
||||
static struct wlan_pmo_ctx *gp_pmo_ctx;
|
||||
|
||||
@@ -218,6 +219,21 @@ wlan_pmo_get_igmp_offload_enable_cfg(struct wlan_objmgr_psoc *psoc,
|
||||
{}
|
||||
#endif
|
||||
|
||||
#ifdef WLAN_FEATURE_ICMP_OFFLOAD
|
||||
static void
|
||||
wlan_pmo_get_icmp_offload_enable_cfg(struct wlan_objmgr_psoc *psoc,
|
||||
struct pmo_psoc_cfg *psoc_cfg)
|
||||
{
|
||||
psoc_cfg->is_icmp_offload_enable =
|
||||
cfg_get(psoc, CFG_ENABLE_ICMP_OFFLOAD);
|
||||
}
|
||||
#else
|
||||
static inline void
|
||||
wlan_pmo_get_icmp_offload_enable_cfg(struct wlan_objmgr_psoc *psoc,
|
||||
struct pmo_psoc_cfg *psoc_cfg)
|
||||
{}
|
||||
#endif
|
||||
|
||||
static void wlan_pmo_init_cfg(struct wlan_objmgr_psoc *psoc,
|
||||
struct pmo_psoc_cfg *psoc_cfg)
|
||||
{
|
||||
@@ -275,8 +291,7 @@ static void wlan_pmo_init_cfg(struct wlan_objmgr_psoc *psoc,
|
||||
wlan_pmo_get_igmp_offload_enable_cfg(psoc, psoc_cfg);
|
||||
psoc_cfg->disconnect_sap_tdls_in_wow =
|
||||
cfg_get(psoc, CFG_DISCONNECT_SAP_TDLS_IN_WOW);
|
||||
psoc_cfg->is_icmp_offload_enable =
|
||||
cfg_get(psoc, CFG_ENABLE_ICMP_OFFLOAD);
|
||||
wlan_pmo_get_icmp_offload_enable_cfg(psoc, psoc_cfg);
|
||||
}
|
||||
|
||||
QDF_STATUS pmo_psoc_open(struct wlan_objmgr_psoc *psoc)
|
||||
|
@@ -603,6 +603,8 @@
|
||||
* This ini is used to enable/disable firmware's capability of sending ICMP
|
||||
* response to clients.
|
||||
*
|
||||
* Supported Feature: STA
|
||||
*
|
||||
* Usage: External
|
||||
*
|
||||
* </ini>
|
||||
|
@@ -285,6 +285,30 @@ enum pmo_gpio_wakeup_mode {
|
||||
PMO_GPIO_WAKEUP_MODE_LOW,
|
||||
};
|
||||
|
||||
#ifdef WLAN_FEATURE_ICMP_OFFLOAD
|
||||
#define ICMP_MAX_IPV6_ADDRESS 16
|
||||
|
||||
/**
|
||||
* pmo_icmp_offload - structure to hold icmp param
|
||||
*
|
||||
* @vdev_id: vdev id
|
||||
* @enable: enable/disable
|
||||
* @trigger: icmp offload trigger information
|
||||
* @ipv6_count: number of host ipv6 address
|
||||
* @ipv4_addr: host interface ipv4 address
|
||||
* @ipv6_addr: array of host ipv6 address
|
||||
*
|
||||
**/
|
||||
struct pmo_icmp_offload {
|
||||
uint8_t vdev_id;
|
||||
bool enable;
|
||||
enum pmo_offload_trigger trigger;
|
||||
uint8_t ipv6_count;
|
||||
uint8_t ipv4_addr[QDF_IPV4_ADDR_SIZE];
|
||||
uint8_t ipv6_addr[ICMP_MAX_IPV6_ADDRESS][QDF_IPV6_ADDR_SIZE];
|
||||
};
|
||||
#endif
|
||||
|
||||
/**
|
||||
* struct pmo_psoc_cfg - user configuration required for pmo
|
||||
* @ptrn_match_enable_all_vdev: true when pattern match is enable for all vdev
|
||||
@@ -429,7 +453,9 @@ struct pmo_psoc_cfg {
|
||||
bool igmp_offload_enable;
|
||||
#endif
|
||||
bool disconnect_sap_tdls_in_wow;
|
||||
#ifdef WLAN_FEATURE_ICMP_OFFLOAD
|
||||
bool is_icmp_offload_enable;
|
||||
#endif
|
||||
};
|
||||
|
||||
/**
|
||||
|
@@ -123,6 +123,7 @@ typedef int (*pmo_pld_auto_resume_cb)(void);
|
||||
* @psoc_send_d0wow_disable_req: fp to send D0 WOW disable request
|
||||
* @psoc_send_idle_roam_suspend_mode: fp to send suspend mode for
|
||||
* idle roam trigger to firmware.
|
||||
* @send_icmp_offload_req: fp to send icmp offload request
|
||||
*/
|
||||
struct wlan_pmo_tx_ops {
|
||||
QDF_STATUS (*send_arp_offload_req)(struct wlan_objmgr_vdev *vdev,
|
||||
@@ -233,7 +234,11 @@ struct wlan_pmo_tx_ops {
|
||||
struct wlan_objmgr_psoc *psoc);
|
||||
QDF_STATUS (*psoc_send_idle_roam_suspend_mode)(
|
||||
struct wlan_objmgr_psoc *psoc, uint8_t val);
|
||||
|
||||
#ifdef WLAN_FEATURE_ICMP_OFFLOAD
|
||||
QDF_STATUS (*send_icmp_offload_req)(
|
||||
struct wlan_objmgr_psoc *psoc,
|
||||
struct pmo_icmp_offload *pmo_icmp_req);
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif /* end of _WLAN_PMO_OBJ_MGMT_PUBLIC_STRUCT_H_ */
|
||||
|
@@ -486,4 +486,16 @@ QDF_STATUS pmo_tgt_psoc_send_target_resume_req(struct wlan_objmgr_psoc *psoc);
|
||||
QDF_STATUS pmo_tgt_psoc_send_idle_roam_monitor(struct wlan_objmgr_psoc *psoc,
|
||||
uint8_t val);
|
||||
|
||||
#ifdef WLAN_FEATURE_ICMP_OFFLOAD
|
||||
/**
|
||||
* pmo_tgt_config_icmp_offload_req() - Configure icmp offload req to target
|
||||
* @psoc: objmgr psoc
|
||||
* @pmo_icmp_req: ICMP offload parameters
|
||||
*
|
||||
* Return: QDF status
|
||||
*/
|
||||
QDF_STATUS
|
||||
pmo_tgt_config_icmp_offload_req(struct wlan_objmgr_psoc *psoc,
|
||||
struct pmo_icmp_offload *pmo_icmp_req);
|
||||
#endif
|
||||
#endif /* end of _WLAN_PMO_TGT_API_H_ */
|
||||
|
@@ -1284,6 +1284,37 @@ uint32_t ucfg_pmo_get_moddtim_user(struct wlan_objmgr_vdev *vdev);
|
||||
*/
|
||||
bool
|
||||
ucfg_pmo_get_disconnect_sap_tdls_in_wow(struct wlan_objmgr_psoc *psoc);
|
||||
|
||||
#ifdef WLAN_FEATURE_ICMP_OFFLOAD
|
||||
/**
|
||||
* ucfg_pmo_check_icmp_offload(): API to check if icmp offload is enabled
|
||||
* @psoc: objmgr psoc handle
|
||||
* @vdev_id: vdev_id
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS for success or error code
|
||||
*/
|
||||
QDF_STATUS ucfg_pmo_check_icmp_offload(struct wlan_objmgr_psoc *psoc,
|
||||
uint8_t vdev_id);
|
||||
/**
|
||||
* ucfg_pmo_is_icmp_offload_enabled() - Get icmp offload enable or not
|
||||
* @psoc: pointer to psoc object
|
||||
*
|
||||
* Return: icmp offload enable or not
|
||||
*/
|
||||
bool
|
||||
ucfg_pmo_is_icmp_offload_enabled(struct wlan_objmgr_psoc *psoc);
|
||||
|
||||
/**
|
||||
* ucfg_pmo_config_icmp_offload() - API to enable icmp offload request
|
||||
* @psoc: pointer to psoc object
|
||||
* @pmo_icmp_req: ICMP offload parameters
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS for success or error code
|
||||
*/
|
||||
QDF_STATUS
|
||||
ucfg_pmo_config_icmp_offload(struct wlan_objmgr_psoc *psoc,
|
||||
struct pmo_icmp_offload *pmo_icmp_req);
|
||||
#endif
|
||||
#else /* WLAN_POWER_MANAGEMENT_OFFLOAD */
|
||||
static inline QDF_STATUS
|
||||
ucfg_pmo_psoc_open(struct wlan_objmgr_psoc *psoc)
|
||||
@@ -1992,6 +2023,26 @@ ucfg_pmo_get_disconnect_sap_tdls_in_wow(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
static inline
|
||||
QDF_STATUS ucfg_pmo_check_icmp_offload(struct wlan_objmgr_psoc *psoc,
|
||||
uint8_t vdev_id)
|
||||
{
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static inline bool
|
||||
ucfg_pmo_is_icmp_offload_enabled(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
ucfg_pmo_config_icmp_offload(struct wlan_objmgr_psoc *psoc,
|
||||
struct pmo_icmp_offload *pmo_icmp_req)
|
||||
{
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
#endif /* WLAN_POWER_MANAGEMENT_OFFLOAD */
|
||||
|
||||
#ifdef WLAN_FEATURE_EXTWOW_SUPPORT
|
||||
|
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright (c) 2021, The Linux Foundation. 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 above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* DOC: Implements public API for pmo to interact with target/WMI
|
||||
*/
|
||||
|
||||
#include "wlan_pmo_tgt_api.h"
|
||||
#include "wlan_pmo_obj_mgmt_public_struct.h"
|
||||
#include "wlan_pmo_main.h"
|
||||
|
||||
QDF_STATUS
|
||||
pmo_tgt_config_icmp_offload_req(struct wlan_objmgr_psoc *psoc,
|
||||
struct pmo_icmp_offload *pmo_icmp_req)
|
||||
{
|
||||
QDF_STATUS status;
|
||||
struct wlan_pmo_tx_ops pmo_tx_ops;
|
||||
|
||||
pmo_debug("vdev_id: %d: ICMP offload %d", pmo_icmp_req->vdev_id,
|
||||
pmo_icmp_req->enable);
|
||||
|
||||
pmo_tx_ops = GET_PMO_TX_OPS_FROM_PSOC(psoc);
|
||||
if (!pmo_tx_ops.send_icmp_offload_req) {
|
||||
pmo_err("send_icmp_offload_req is null");
|
||||
status = QDF_STATUS_E_NULL_VALUE;
|
||||
return status;
|
||||
}
|
||||
|
||||
status = pmo_tx_ops.send_icmp_offload_req(psoc, pmo_icmp_req);
|
||||
|
||||
return status;
|
||||
}
|
@@ -34,6 +34,7 @@
|
||||
#include "wlan_pmo_cfg.h"
|
||||
#include "wlan_pmo_static_config.h"
|
||||
#include "cfg_ucfg_api.h"
|
||||
#include "wlan_pmo_icmp.h"
|
||||
|
||||
QDF_STATUS ucfg_pmo_psoc_open(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
@@ -1000,3 +1001,25 @@ ucfg_pmo_get_disconnect_sap_tdls_in_wow(struct wlan_objmgr_psoc *psoc)
|
||||
|
||||
return pmo_psoc_ctx->psoc_cfg.disconnect_sap_tdls_in_wow;
|
||||
}
|
||||
|
||||
#ifdef WLAN_FEATURE_ICMP_OFFLOAD
|
||||
QDF_STATUS ucfg_pmo_check_icmp_offload(struct wlan_objmgr_psoc *psoc,
|
||||
uint8_t vdev_id)
|
||||
{
|
||||
return pmo_core_icmp_check_offload(psoc, vdev_id);
|
||||
}
|
||||
|
||||
bool
|
||||
ucfg_pmo_is_icmp_offload_enabled(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
|
||||
|
||||
return pmo_psoc_ctx->psoc_cfg.is_icmp_offload_enable;
|
||||
}
|
||||
|
||||
QDF_STATUS ucfg_pmo_config_icmp_offload(struct wlan_objmgr_psoc *psoc,
|
||||
struct pmo_icmp_offload *pmo_icmp_req)
|
||||
{
|
||||
return pmo_tgt_config_icmp_offload_req(psoc, pmo_icmp_req);
|
||||
}
|
||||
#endif
|
||||
|
新增問題並參考
封鎖使用者