Merge /local/mnt/workspace/naveen1/srcs/qcacld-3.0 into wlan-cmn.driver.lnx.2.0
Change-Id: I880638078022d6ce6898924b25bb02eb4593080d Signed-off-by: Linux Build Service Account <lnxbuild@localhost>
Цей коміт міститься в:
@@ -1,43 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2018 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 various api/struct which shall be used
|
||||
* by action_oui component for wmi command path.
|
||||
*/
|
||||
|
||||
#ifndef _TARGET_IF_ACTION_OUI_H_
|
||||
#define _TARGET_IF_ACTION_OUI_H_
|
||||
|
||||
#include "target_if.h"
|
||||
#include <wmi_unified_api.h>
|
||||
#include <wmi_unified_priv.h>
|
||||
#include <wmi_unified_param.h>
|
||||
#include "wlan_action_oui_tgt_api.h"
|
||||
#include "wlan_action_oui_public_struct.h"
|
||||
|
||||
/**
|
||||
* target_if_action_oui_register_tx_ops() - Register action_oui component TX OPS
|
||||
* @tx_ops: action_oui transmit ops
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
void
|
||||
target_if_action_oui_register_tx_ops(struct action_oui_tx_ops *tx_ops);
|
||||
|
||||
#endif /* _TARGET_IF_ACTION_OUI_H_ */
|
@@ -1,51 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2013-2018 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: Target interface file for action_oui component to
|
||||
* Implement api's which shall be used by action_oui component
|
||||
* in target_if internally.
|
||||
*/
|
||||
|
||||
#include "target_if_action_oui.h"
|
||||
#include "wlan_action_oui_tgt_api.h"
|
||||
#include "wlan_action_oui_public_struct.h"
|
||||
|
||||
static QDF_STATUS
|
||||
target_if_action_oui_send_req(struct wlan_objmgr_psoc *psoc,
|
||||
struct action_oui_request *req)
|
||||
{
|
||||
void *wmi_hdl;
|
||||
|
||||
wmi_hdl = GET_WMI_HDL_FROM_PSOC(psoc);
|
||||
if (!wmi_hdl)
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
|
||||
return wmi_unified_send_action_oui_cmd(wmi_hdl, req);
|
||||
}
|
||||
|
||||
void
|
||||
target_if_action_oui_register_tx_ops(struct action_oui_tx_ops *tx_ops)
|
||||
{
|
||||
if (!tx_ops) {
|
||||
target_if_err("action_oui tx_ops is null");
|
||||
return;
|
||||
}
|
||||
|
||||
tx_ops->send_req = target_if_action_oui_send_req;
|
||||
}
|
@@ -1,61 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2019-2020 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: Target interface file for blacklist manager component to
|
||||
* declare api's which shall be used by blacklist manager component
|
||||
* in target if internally.
|
||||
*/
|
||||
|
||||
#ifndef __TARGET_IF_BLM_H
|
||||
#define __TARGET_IF_BLM_H
|
||||
|
||||
#include "wlan_blm_public_struct.h"
|
||||
|
||||
#if defined(WLAN_FEATURE_ROAM_OFFLOAD)
|
||||
/**
|
||||
* target_if_blm_send_reject_ap_list() - API to send reject ap list to FW
|
||||
* @pdev: pdev object
|
||||
* @reject_params: This contains the reject ap list, and the num of BSSIDs
|
||||
*
|
||||
* This API will send the reject ap list to the target for it to handle roaming
|
||||
* case scenarios.
|
||||
*
|
||||
* Return: Qdf status
|
||||
*/
|
||||
QDF_STATUS
|
||||
target_if_blm_send_reject_ap_list(struct wlan_objmgr_pdev *pdev,
|
||||
struct reject_ap_params *reject_params);
|
||||
|
||||
/**
|
||||
* target_if_blm_register_tx_ops() - Register blm tx ops
|
||||
* @blm_tx_ops: BLM tx ops
|
||||
*
|
||||
* This API will register the tx ops used by the BLM to send commands to the
|
||||
* target.
|
||||
*
|
||||
* Return: void
|
||||
*/
|
||||
void target_if_blm_register_tx_ops(struct wlan_blm_tx_ops *blm_tx_ops);
|
||||
#else
|
||||
static inline void target_if_blm_register_tx_ops(
|
||||
struct wlan_blm_tx_ops *blm_tx_ops)
|
||||
{
|
||||
}
|
||||
#endif //WLAN_FEATURE_ROAM_OFFLOAD
|
||||
|
||||
#endif //__TARGET_IF_BLM_H
|
@@ -1,52 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2019-2020 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: Target interface file for blacklist manager component to
|
||||
* Implement api's which shall be used by blacklist manager component
|
||||
* in target if internally.
|
||||
*/
|
||||
|
||||
#include <target_if_blm.h>
|
||||
#include "target_if.h"
|
||||
|
||||
#if defined(WLAN_FEATURE_ROAM_OFFLOAD)
|
||||
QDF_STATUS
|
||||
target_if_blm_send_reject_ap_list(struct wlan_objmgr_pdev *pdev,
|
||||
struct reject_ap_params *reject_params)
|
||||
{
|
||||
struct wmi_unified *wmi_handle;
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_pdev(pdev);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi handle");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
return wmi_unified_send_reject_ap_list(wmi_handle, reject_params);
|
||||
}
|
||||
|
||||
void target_if_blm_register_tx_ops(struct wlan_blm_tx_ops *blm_tx_ops)
|
||||
{
|
||||
if (!blm_tx_ops) {
|
||||
target_if_err("blm_tx_ops is null");
|
||||
return;
|
||||
}
|
||||
|
||||
blm_tx_ops->blm_send_reject_ap_list = target_if_blm_send_reject_ap_list;
|
||||
}
|
||||
#endif
|
@@ -1,33 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2020, 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: contains coex target if declarations
|
||||
*/
|
||||
#ifndef __TARGET_IF_COEX_H__
|
||||
#define __TARGET_IF_COEX_H__
|
||||
|
||||
#include <target_if.h>
|
||||
|
||||
/**
|
||||
* target_if_coex_register_tx_ops() - Register coex target_if tx ops
|
||||
* @tx_ops: pointer to target if tx ops
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error
|
||||
*/
|
||||
QDF_STATUS
|
||||
target_if_coex_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops);
|
||||
#endif
|
@@ -1,52 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2020, 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: contains coex target if functions
|
||||
*/
|
||||
#include <wlan_coex_main.h>
|
||||
#include <target_if_coex.h>
|
||||
|
||||
static QDF_STATUS
|
||||
target_if_coex_config_send(struct wlan_objmgr_pdev *pdev,
|
||||
struct coex_config_params *param)
|
||||
{
|
||||
wmi_unified_t pdev_wmi_handle;
|
||||
|
||||
pdev_wmi_handle = GET_WMI_HDL_FROM_PDEV(pdev);
|
||||
if (!pdev_wmi_handle) {
|
||||
coex_err("Invalid PDEV WMI handle");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
return wmi_unified_send_coex_config_cmd(pdev_wmi_handle, param);
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
target_if_coex_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops)
|
||||
{
|
||||
struct wlan_lmac_if_coex_tx_ops *coex_ops;
|
||||
|
||||
if (!tx_ops) {
|
||||
coex_err("target if tx ops is NULL!");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
coex_ops = &tx_ops->coex_ops;
|
||||
coex_ops->coex_config_send = target_if_coex_config_send;
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
@@ -1,186 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2020-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: This file contains definitions for target_if
|
||||
* roaming events.
|
||||
*/
|
||||
|
||||
#ifndef TARGET_IF_CM_ROAM_EVENT_H__
|
||||
#define TARGET_IF_CM_ROAM_EVENT_H__
|
||||
|
||||
#include "qdf_types.h"
|
||||
#include "wlan_objmgr_psoc_obj.h"
|
||||
#include "wlan_objmgr_pdev_obj.h"
|
||||
#include "wlan_objmgr_vdev_obj.h"
|
||||
#include "wlan_cm_roam_public_struct.h"
|
||||
#include <target_if.h>
|
||||
|
||||
#ifdef WLAN_FEATURE_ROAM_OFFLOAD
|
||||
/**
|
||||
* target_if_cm_roam_sync_event() - Target IF handler for roam sync events
|
||||
* @scn: target handle
|
||||
* @event: event buffer
|
||||
* @len: event buffer length
|
||||
*
|
||||
* Return: int for success or error code
|
||||
*/
|
||||
int target_if_cm_roam_sync_event(ol_scn_t scn, uint8_t *event,
|
||||
uint32_t len);
|
||||
|
||||
/**
|
||||
* target_if_cm_roam_sync_frame_event() - Target IF handler for
|
||||
* roam sync frame events
|
||||
* @scn: target handle
|
||||
* @event: event buffer
|
||||
* @len: event buffer length
|
||||
*
|
||||
* Return: int for success or error code
|
||||
*/
|
||||
int
|
||||
target_if_cm_roam_sync_frame_event(ol_scn_t scn,
|
||||
uint8_t *event,
|
||||
uint32_t len);
|
||||
|
||||
/**
|
||||
* target_if_cm_roam_event() - Target IF handler for roam events
|
||||
* @scn: target handle
|
||||
* @event: event buffer
|
||||
* @len: event buffer length
|
||||
*
|
||||
* Return: int for success or error code
|
||||
*/
|
||||
int target_if_cm_roam_event(ol_scn_t scn, uint8_t *event, uint32_t len);
|
||||
|
||||
/**
|
||||
* target_if_cm_roam_stats_event() - Target IF handler for roam stats event
|
||||
* @scn: target handle
|
||||
* @event: event buffer
|
||||
* @len: event buffer length
|
||||
*
|
||||
* Return: int for success or error code
|
||||
*/
|
||||
int
|
||||
target_if_cm_roam_stats_event(ol_scn_t scn, uint8_t *event, uint32_t len);
|
||||
|
||||
/**
|
||||
* target_if_cm_roam_auth_offload_event - auth roam offload event handler
|
||||
* @scn: target handle
|
||||
* @event: event buffer
|
||||
* @len: event buffer length
|
||||
*
|
||||
* Return: int for success or error code
|
||||
*/
|
||||
int
|
||||
target_if_cm_roam_auth_offload_event(ol_scn_t scn, uint8_t *event,
|
||||
uint32_t len);
|
||||
|
||||
/**
|
||||
* target_if_roam_offload_register_events() - register roam events
|
||||
* @psoc: pointer to psoc object
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS
|
||||
target_if_roam_offload_register_events(struct wlan_objmgr_psoc *psoc);
|
||||
|
||||
/**
|
||||
* target_if_cm_roam_vdev_disconnect_event_handler - vdev disconnect evt handler
|
||||
* @scn: target handle
|
||||
* @event: event buffer
|
||||
* @len: event buffer length
|
||||
*
|
||||
* Return: int for success or error code
|
||||
*/
|
||||
int
|
||||
target_if_cm_roam_vdev_disconnect_event_handler(ol_scn_t scn, uint8_t *event,
|
||||
uint32_t len);
|
||||
|
||||
/**
|
||||
* target_if_cm_roam_scan_chan_list_event_handler - roam scan ch evt handler
|
||||
* @scn: target handle
|
||||
* @event: event buffer
|
||||
* @len: event buffer length
|
||||
*
|
||||
* Return: int for success or error code
|
||||
*/
|
||||
int
|
||||
target_if_cm_roam_scan_chan_list_event_handler(ol_scn_t scn, uint8_t *event,
|
||||
uint32_t len);
|
||||
|
||||
/**
|
||||
* target_if_pmkid_request_event_handler - pmkid request event handler
|
||||
* @scn: target handle
|
||||
* @event: event buffer
|
||||
* @len: event buffer length
|
||||
*
|
||||
* Return: int for success or error code
|
||||
*/
|
||||
int
|
||||
target_if_pmkid_request_event_handler(ol_scn_t scn, uint8_t *event,
|
||||
uint32_t len);
|
||||
|
||||
/**
|
||||
* target_if_cm_roam_register_rx_ops - Target IF API to register roam
|
||||
* related rx op.
|
||||
* @rx_ops: Pointer to rx ops fp struct
|
||||
*
|
||||
* Return: none
|
||||
*/
|
||||
void
|
||||
target_if_cm_roam_register_rx_ops(struct wlan_cm_roam_rx_ops *rx_ops);
|
||||
#else /* WLAN_FEATURE_ROAM_OFFLOAD */
|
||||
static inline
|
||||
void
|
||||
target_if_cm_roam_register_rx_ops(struct wlan_cm_roam_rx_ops *rx_ops)
|
||||
{
|
||||
}
|
||||
|
||||
static inline
|
||||
QDF_STATUS
|
||||
target_if_roam_offload_register_events(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
return QDF_STATUS_E_NOSUPPORT;
|
||||
}
|
||||
|
||||
static inline int
|
||||
target_if_cm_roam_event(ol_scn_t scn, uint8_t *event, uint32_t len)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int
|
||||
target_if_cm_roam_vdev_disconnect_event_handler(ol_scn_t scn, uint8_t *event,
|
||||
uint32_t len)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int
|
||||
target_if_cm_roam_scan_chan_list_event_handler(ol_scn_t scn, uint8_t *event,
|
||||
uint32_t len)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int
|
||||
target_if_pmkid_request_event_handler(ol_scn_t scn, uint8_t *event,
|
||||
uint32_t len)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif /* WLAN_FEATURE_ROAM_OFFLOAD */
|
||||
#endif
|
@@ -1,35 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2020, 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: This file contains definitions for target_if roaming offload.
|
||||
*/
|
||||
|
||||
#ifndef TARGET_IF_CM_ROAM_OFFLOAD_H__
|
||||
#define TARGET_IF_CM_ROAM_OFFLOAD_H__
|
||||
|
||||
#include "wlan_cm_roam_public_struct.h"
|
||||
|
||||
/**
|
||||
* target_if_cm_roam_register_tx_ops - Target IF API to register roam
|
||||
* related tx op.
|
||||
* @tx_ops: Pointer to tx ops fp struct
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS
|
||||
target_if_cm_roam_register_tx_ops(struct wlan_cm_roam_tx_ops *tx_ops);
|
||||
#endif
|
@@ -1,618 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2020-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: This file contains definitions for target_if roaming events.
|
||||
*/
|
||||
#include "qdf_types.h"
|
||||
#include "wlan_objmgr_psoc_obj.h"
|
||||
#include "wlan_objmgr_pdev_obj.h"
|
||||
#include "wlan_objmgr_vdev_obj.h"
|
||||
#include "wmi_unified_api.h"
|
||||
#include "scheduler_api.h"
|
||||
#include <wmi_unified.h>
|
||||
#include "target_if_cm_roam_event.h"
|
||||
#include "wlan_psoc_mlme_api.h"
|
||||
#include "wlan_mlme_main.h"
|
||||
#include <../../core/src/wlan_cm_roam_i.h>
|
||||
#include "wlan_cm_roam_api.h"
|
||||
|
||||
static inline struct wlan_cm_roam_rx_ops *
|
||||
target_if_cm_get_roam_rx_ops(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
struct wlan_mlme_psoc_ext_obj *psoc_ext_priv;
|
||||
struct wlan_cm_roam_rx_ops *rx_ops;
|
||||
|
||||
if (!psoc) {
|
||||
target_if_err("psoc object is NULL");
|
||||
return NULL;
|
||||
}
|
||||
psoc_ext_priv = wlan_psoc_mlme_get_ext_hdl(psoc);
|
||||
if (!psoc_ext_priv) {
|
||||
target_if_err("psoc legacy private object is NULL");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
rx_ops = &psoc_ext_priv->rso_rx_ops;
|
||||
return rx_ops;
|
||||
}
|
||||
|
||||
void
|
||||
target_if_cm_roam_register_rx_ops(struct wlan_cm_roam_rx_ops *rx_ops)
|
||||
{
|
||||
rx_ops->roam_sync_event = cm_roam_sync_event_handler;
|
||||
rx_ops->roam_sync_frame_event = cm_roam_sync_frame_event_handler;
|
||||
rx_ops->roam_event_rx = cm_roam_event_handler;
|
||||
rx_ops->btm_blacklist_event = cm_btm_blacklist_event_handler;
|
||||
rx_ops->vdev_disconnect_event = cm_vdev_disconnect_event_handler;
|
||||
rx_ops->roam_scan_chan_list_event = cm_roam_scan_ch_list_event_handler;
|
||||
rx_ops->roam_stats_event_rx = cm_roam_stats_event_handler;
|
||||
rx_ops->roam_auth_offload_event = cm_roam_auth_offload_event_handler;
|
||||
rx_ops->roam_pmkid_request_event_rx = cm_roam_pmkid_request_handler;
|
||||
}
|
||||
|
||||
int
|
||||
target_if_cm_roam_sync_frame_event(ol_scn_t scn,
|
||||
uint8_t *event,
|
||||
uint32_t len)
|
||||
{
|
||||
QDF_STATUS qdf_status;
|
||||
struct roam_synch_frame_ind *frame_ind_ptr;
|
||||
struct wmi_unified *wmi_handle;
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
struct wlan_cm_roam_rx_ops *roam_rx_ops;
|
||||
int status = 0;
|
||||
|
||||
psoc = target_if_get_psoc_from_scn_hdl(scn);
|
||||
if (!psoc) {
|
||||
target_if_err("psoc is null");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("wmi_handle is null");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
frame_ind_ptr = qdf_mem_malloc(sizeof(*frame_ind_ptr));
|
||||
|
||||
if (!frame_ind_ptr)
|
||||
return -ENOMEM;
|
||||
|
||||
qdf_status = wmi_extract_roam_sync_frame_event(wmi_handle, event,
|
||||
len,
|
||||
frame_ind_ptr);
|
||||
if (QDF_IS_STATUS_ERROR(qdf_status)) {
|
||||
target_if_err("parsing of event failed, %d", qdf_status);
|
||||
status = -EINVAL;
|
||||
goto err;
|
||||
}
|
||||
|
||||
roam_rx_ops = target_if_cm_get_roam_rx_ops(psoc);
|
||||
|
||||
if (!roam_rx_ops || !roam_rx_ops->roam_sync_frame_event) {
|
||||
target_if_err("No valid roam rx ops");
|
||||
status = -EINVAL;
|
||||
goto err;
|
||||
}
|
||||
|
||||
qdf_status = roam_rx_ops->roam_sync_frame_event(psoc,
|
||||
frame_ind_ptr);
|
||||
|
||||
if (QDF_IS_STATUS_ERROR(qdf_status))
|
||||
status = -EINVAL;
|
||||
|
||||
err:
|
||||
qdf_mem_free(frame_ind_ptr);
|
||||
return status;
|
||||
}
|
||||
|
||||
int target_if_cm_roam_sync_event(ol_scn_t scn, uint8_t *event,
|
||||
uint32_t len)
|
||||
{
|
||||
QDF_STATUS qdf_status;
|
||||
struct wmi_unified *wmi_handle;
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
struct wlan_cm_roam_rx_ops *roam_rx_ops;
|
||||
struct roam_offload_synch_ind *sync_ind = NULL;
|
||||
int status = 0;
|
||||
|
||||
psoc = target_if_get_psoc_from_scn_hdl(scn);
|
||||
if (!psoc) {
|
||||
target_if_err("psoc is null");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("wmi_handle is null");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
qdf_status = wmi_extract_roam_sync_event(wmi_handle, event,
|
||||
len, &sync_ind);
|
||||
if (QDF_IS_STATUS_ERROR(qdf_status)) {
|
||||
target_if_err("parsing of event failed, %d", qdf_status);
|
||||
status = -EINVAL;
|
||||
goto err;
|
||||
}
|
||||
|
||||
roam_rx_ops = target_if_cm_get_roam_rx_ops(psoc);
|
||||
|
||||
if (!roam_rx_ops || !roam_rx_ops->roam_sync_event) {
|
||||
target_if_err("No valid roam rx ops");
|
||||
status = -EINVAL;
|
||||
goto err;
|
||||
}
|
||||
|
||||
qdf_status = roam_rx_ops->roam_sync_event(psoc,
|
||||
event,
|
||||
len,
|
||||
sync_ind);
|
||||
|
||||
if (QDF_IS_STATUS_ERROR(qdf_status))
|
||||
status = -EINVAL;
|
||||
|
||||
err:
|
||||
if (sync_ind && sync_ind->ric_tspec_data)
|
||||
qdf_mem_free(sync_ind->ric_tspec_data);
|
||||
if (sync_ind)
|
||||
qdf_mem_free(sync_ind);
|
||||
return status;
|
||||
}
|
||||
|
||||
int target_if_cm_roam_event(ol_scn_t scn, uint8_t *event, uint32_t len)
|
||||
{
|
||||
QDF_STATUS qdf_status;
|
||||
struct wmi_unified *wmi_handle;
|
||||
struct roam_offload_roam_event *roam_event = NULL;
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
struct wlan_cm_roam_rx_ops *roam_rx_ops;
|
||||
|
||||
psoc = target_if_get_psoc_from_scn_hdl(scn);
|
||||
if (!psoc) {
|
||||
target_if_err("psoc is null");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("wmi_handle is null");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
roam_event = qdf_mem_malloc(sizeof(*roam_event));
|
||||
if (!roam_event)
|
||||
return -ENOMEM;
|
||||
|
||||
qdf_status = wmi_extract_roam_event(wmi_handle, event, len, roam_event);
|
||||
if (QDF_IS_STATUS_ERROR(qdf_status)) {
|
||||
target_if_err("parsing of event failed, %d", qdf_status);
|
||||
qdf_status = QDF_STATUS_E_INVAL;
|
||||
goto done;
|
||||
}
|
||||
|
||||
roam_event->psoc = psoc;
|
||||
|
||||
roam_rx_ops = target_if_cm_get_roam_rx_ops(psoc);
|
||||
if (!roam_rx_ops || !roam_rx_ops->roam_event_rx) {
|
||||
target_if_err("No valid roam rx ops");
|
||||
qdf_status = QDF_STATUS_E_INVAL;
|
||||
goto done;
|
||||
}
|
||||
|
||||
/**
|
||||
* This can be called from IRQ context for WOW events such as
|
||||
* WOW_REASON_LOW_RSSI and WOW_REASON_HO_FAIL. There is no issue
|
||||
* currently, as these events are posted to schedular thread from
|
||||
* cm_roam_event_handler, to access umac which use mutex.
|
||||
* If any new ROAM event is added in IRQ context in future, avoid taking
|
||||
* mutex. If mutex/sleep is needed, post a message to scheduler thread.
|
||||
*/
|
||||
qdf_status = roam_rx_ops->roam_event_rx(roam_event);
|
||||
|
||||
done:
|
||||
qdf_mem_free(roam_event);
|
||||
return qdf_status_to_os_return(qdf_status);
|
||||
}
|
||||
|
||||
static int
|
||||
target_if_cm_btm_blacklist_event(ol_scn_t scn, uint8_t *event, uint32_t len)
|
||||
{
|
||||
QDF_STATUS qdf_status;
|
||||
int status = 0;
|
||||
struct roam_blacklist_event *dst_list = NULL;
|
||||
struct wmi_unified *wmi_handle;
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
struct wlan_cm_roam_rx_ops *roam_rx_ops;
|
||||
|
||||
psoc = target_if_get_psoc_from_scn_hdl(scn);
|
||||
if (!psoc) {
|
||||
target_if_err("psoc is null");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("wmi_handle is null");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
qdf_status = wmi_extract_btm_blacklist_event(wmi_handle, event, len,
|
||||
&dst_list);
|
||||
if (QDF_IS_STATUS_ERROR(qdf_status)) {
|
||||
target_if_err("parsing of event failed, %d", qdf_status);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (!dst_list) {
|
||||
/* No APs to blacklist, just return */
|
||||
target_if_err_rl("No APs in blacklist received");
|
||||
return 0;
|
||||
}
|
||||
|
||||
roam_rx_ops = target_if_cm_get_roam_rx_ops(psoc);
|
||||
if (!roam_rx_ops || !roam_rx_ops->btm_blacklist_event) {
|
||||
target_if_err("No valid roam rx ops");
|
||||
status = -EINVAL;
|
||||
goto done;
|
||||
}
|
||||
qdf_status = roam_rx_ops->btm_blacklist_event(psoc, dst_list);
|
||||
if (QDF_IS_STATUS_ERROR(qdf_status))
|
||||
status = -EINVAL;
|
||||
|
||||
done:
|
||||
qdf_mem_free(dst_list);
|
||||
return status;
|
||||
}
|
||||
|
||||
int
|
||||
target_if_cm_roam_vdev_disconnect_event_handler(ol_scn_t scn, uint8_t *event,
|
||||
uint32_t len)
|
||||
{
|
||||
QDF_STATUS qdf_status;
|
||||
struct wmi_unified *wmi_handle;
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
struct vdev_disconnect_event_data *data;
|
||||
struct wlan_cm_roam_rx_ops *roam_rx_ops;
|
||||
|
||||
psoc = target_if_get_psoc_from_scn_hdl(scn);
|
||||
if (!psoc) {
|
||||
target_if_err("psoc is null");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("wmi_handle is null");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
data = qdf_mem_malloc(sizeof(*data));
|
||||
if (!data)
|
||||
return -ENOMEM;
|
||||
qdf_status = wmi_extract_vdev_disconnect_event(wmi_handle, event, len,
|
||||
data);
|
||||
if (QDF_IS_STATUS_ERROR(qdf_status)) {
|
||||
target_if_err("parsing of event failed, %d", qdf_status);
|
||||
goto done;
|
||||
}
|
||||
|
||||
data->psoc = psoc;
|
||||
roam_rx_ops = target_if_cm_get_roam_rx_ops(psoc);
|
||||
if (!roam_rx_ops || !roam_rx_ops->vdev_disconnect_event) {
|
||||
target_if_err("No valid roam rx ops");
|
||||
qdf_status = QDF_STATUS_E_INVAL;
|
||||
goto done;
|
||||
}
|
||||
|
||||
/**
|
||||
* This can be called from IRQ context for WOW events. There is no
|
||||
* issue currently as this event is posted to scheduler thread from
|
||||
* wma_handle_disconnect_reason(). Avoid aquiring mutex/sleep in this
|
||||
* context in future and post a message to scheduler thread if needed.
|
||||
*/
|
||||
qdf_status = roam_rx_ops->vdev_disconnect_event(data);
|
||||
|
||||
done:
|
||||
qdf_mem_free(data);
|
||||
return qdf_status_to_os_return(qdf_status);
|
||||
}
|
||||
|
||||
int
|
||||
target_if_cm_roam_scan_chan_list_event_handler(ol_scn_t scn, uint8_t *event,
|
||||
uint32_t len)
|
||||
{
|
||||
QDF_STATUS qdf_status;
|
||||
int status = 0;
|
||||
struct wmi_unified *wmi_handle;
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
struct wlan_cm_roam_rx_ops *roam_rx_ops;
|
||||
struct cm_roam_scan_ch_resp *data = NULL;
|
||||
|
||||
psoc = target_if_get_psoc_from_scn_hdl(scn);
|
||||
if (!psoc) {
|
||||
target_if_err("psoc is null");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("wmi_handle is null");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
qdf_status = wmi_extract_roam_scan_chan_list(wmi_handle, event, len,
|
||||
&data);
|
||||
if (QDF_IS_STATUS_ERROR(qdf_status)) {
|
||||
target_if_err("parsing of event failed, %d", qdf_status);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
roam_rx_ops = target_if_cm_get_roam_rx_ops(psoc);
|
||||
if (!roam_rx_ops || !roam_rx_ops->roam_scan_chan_list_event) {
|
||||
target_if_err("No valid roam rx ops");
|
||||
qdf_mem_free(data);
|
||||
return -EINVAL;
|
||||
}
|
||||
qdf_status = roam_rx_ops->roam_scan_chan_list_event(data);
|
||||
if (QDF_IS_STATUS_ERROR(qdf_status))
|
||||
status = -EINVAL;
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
int
|
||||
target_if_cm_roam_stats_event(ol_scn_t scn, uint8_t *event, uint32_t len)
|
||||
{
|
||||
QDF_STATUS qdf_status;
|
||||
int status = 0;
|
||||
struct wmi_unified *wmi_handle;
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
struct wlan_cm_roam_rx_ops *roam_rx_ops;
|
||||
struct roam_stats_event *stats_info = NULL;
|
||||
|
||||
psoc = target_if_get_psoc_from_scn_hdl(scn);
|
||||
if (!psoc) {
|
||||
target_if_err("psoc is null");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("wmi_handle is null");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
qdf_status = wmi_extract_roam_stats_event(wmi_handle, event, len,
|
||||
&stats_info);
|
||||
if (QDF_IS_STATUS_ERROR(qdf_status)) {
|
||||
target_if_err("parsing of event failed, %d", qdf_status);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
roam_rx_ops = target_if_cm_get_roam_rx_ops(psoc);
|
||||
if (!roam_rx_ops || !roam_rx_ops->roam_stats_event_rx) {
|
||||
target_if_err("No valid roam rx ops");
|
||||
status = -EINVAL;
|
||||
if (stats_info) {
|
||||
if (stats_info->roam_msg_info)
|
||||
qdf_mem_free(stats_info->roam_msg_info);
|
||||
qdf_mem_free(stats_info);
|
||||
}
|
||||
goto err;
|
||||
}
|
||||
|
||||
qdf_status = roam_rx_ops->roam_stats_event_rx(psoc, stats_info);
|
||||
if (QDF_IS_STATUS_ERROR(qdf_status))
|
||||
status = -EINVAL;
|
||||
|
||||
err:
|
||||
return status;
|
||||
}
|
||||
|
||||
int
|
||||
target_if_cm_roam_auth_offload_event(ol_scn_t scn, uint8_t *event, uint32_t len)
|
||||
{
|
||||
QDF_STATUS qdf_status;
|
||||
int status = 0;
|
||||
struct wmi_unified *wmi_handle;
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
struct wlan_cm_roam_rx_ops *roam_rx_ops;
|
||||
struct auth_offload_event auth_event = {0};
|
||||
|
||||
psoc = target_if_get_psoc_from_scn_hdl(scn);
|
||||
if (!psoc) {
|
||||
target_if_err("psoc is null");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("wmi_handle is null");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
qdf_status = wmi_extract_auth_offload_event(wmi_handle, event, len,
|
||||
&auth_event);
|
||||
if (QDF_IS_STATUS_ERROR(qdf_status)) {
|
||||
target_if_err("parsing of event failed, %d", qdf_status);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
roam_rx_ops = target_if_cm_get_roam_rx_ops(psoc);
|
||||
if (!roam_rx_ops || !roam_rx_ops->roam_auth_offload_event) {
|
||||
target_if_err("No valid roam rx ops");
|
||||
return -EINVAL;
|
||||
}
|
||||
qdf_status = roam_rx_ops->roam_auth_offload_event(&auth_event);
|
||||
if (QDF_IS_STATUS_ERROR(status))
|
||||
status = -EINVAL;
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
int
|
||||
target_if_pmkid_request_event_handler(ol_scn_t scn, uint8_t *event,
|
||||
uint32_t len)
|
||||
{
|
||||
QDF_STATUS qdf_status;
|
||||
struct wmi_unified *wmi_handle;
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
struct roam_pmkid_req_event *data = NULL;
|
||||
struct wlan_cm_roam_rx_ops *roam_rx_ops;
|
||||
|
||||
psoc = target_if_get_psoc_from_scn_hdl(scn);
|
||||
if (!psoc) {
|
||||
target_if_err("psoc is null");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("wmi_handle is null");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
qdf_status = wmi_extract_roam_pmkid_request(wmi_handle, event, len,
|
||||
&data);
|
||||
if (QDF_IS_STATUS_ERROR(qdf_status)) {
|
||||
target_if_err("parsing of event failed, %d", qdf_status);
|
||||
goto done;
|
||||
}
|
||||
|
||||
data->psoc = psoc;
|
||||
|
||||
roam_rx_ops = target_if_cm_get_roam_rx_ops(data->psoc);
|
||||
if (!roam_rx_ops || !roam_rx_ops->roam_pmkid_request_event_rx) {
|
||||
target_if_err("No valid roam rx ops");
|
||||
qdf_status = QDF_STATUS_E_INVAL;
|
||||
goto done;
|
||||
}
|
||||
|
||||
/**
|
||||
* This can be called from IRQ context for WOW events. There is no
|
||||
* issue currently as this event doesn't take any mutex.
|
||||
* If there is a mutex/sleep is needed in future, post a message to
|
||||
* scheduler thread.
|
||||
*/
|
||||
qdf_status = roam_rx_ops->roam_pmkid_request_event_rx(data);
|
||||
|
||||
done:
|
||||
qdf_mem_free(data);
|
||||
return qdf_status_to_os_return(qdf_status);
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
target_if_roam_offload_register_events(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
QDF_STATUS ret;
|
||||
wmi_unified_t handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
|
||||
if (!handle) {
|
||||
target_if_err("handle is NULL");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
/* Register for roam offload event */
|
||||
ret = wmi_unified_register_event_handler(handle,
|
||||
wmi_roam_synch_event_id,
|
||||
target_if_cm_roam_sync_event,
|
||||
WMI_RX_SERIALIZER_CTX);
|
||||
if (QDF_IS_STATUS_ERROR(ret)) {
|
||||
target_if_err("wmi event registration failed, ret: %d", ret);
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
/* Register for roam offload event */
|
||||
ret = wmi_unified_register_event_handler(handle,
|
||||
wmi_roam_synch_frame_event_id,
|
||||
target_if_cm_roam_sync_frame_event,
|
||||
WMI_RX_SERIALIZER_CTX);
|
||||
if (QDF_IS_STATUS_ERROR(ret)) {
|
||||
target_if_err("wmi event registration failed, ret: %d", ret);
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
ret = wmi_unified_register_event_handler(handle, wmi_roam_event_id,
|
||||
target_if_cm_roam_event,
|
||||
WMI_RX_SERIALIZER_CTX);
|
||||
if (QDF_IS_STATUS_ERROR(ret)) {
|
||||
target_if_err("wmi event registration failed, ret: %d", ret);
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
ret = wmi_unified_register_event_handler(handle,
|
||||
wmi_roam_blacklist_event_id,
|
||||
target_if_cm_btm_blacklist_event,
|
||||
WMI_RX_SERIALIZER_CTX);
|
||||
if (QDF_IS_STATUS_ERROR(ret)) {
|
||||
target_if_err("wmi event(%u) registration failed, ret: %d",
|
||||
wmi_roam_blacklist_event_id, ret);
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
ret = wmi_unified_register_event_handler(handle,
|
||||
wmi_vdev_disconnect_event_id,
|
||||
target_if_cm_roam_vdev_disconnect_event_handler,
|
||||
WMI_RX_SERIALIZER_CTX);
|
||||
if (QDF_IS_STATUS_ERROR(ret)) {
|
||||
target_if_err("wmi event(%u) registration failed, ret: %d",
|
||||
wmi_vdev_disconnect_event_id, ret);
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
ret = wmi_unified_register_event_handler(handle,
|
||||
wmi_roam_scan_chan_list_id,
|
||||
target_if_cm_roam_scan_chan_list_event_handler,
|
||||
WMI_RX_SERIALIZER_CTX);
|
||||
if (QDF_IS_STATUS_ERROR(ret)) {
|
||||
target_if_err("wmi event(%u) registration failed, ret: %d",
|
||||
wmi_roam_scan_chan_list_id, ret);
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
ret = wmi_unified_register_event_handler(handle,
|
||||
wmi_roam_stats_event_id,
|
||||
target_if_cm_roam_stats_event,
|
||||
WMI_RX_SERIALIZER_CTX);
|
||||
if (QDF_IS_STATUS_ERROR(ret)) {
|
||||
target_if_err("wmi event registration failed, ret: %d", ret);
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
ret = wmi_unified_register_event_handler(handle,
|
||||
wmi_roam_auth_offload_event_id,
|
||||
target_if_cm_roam_auth_offload_event,
|
||||
WMI_RX_SERIALIZER_CTX);
|
||||
if (QDF_IS_STATUS_ERROR(ret)) {
|
||||
target_if_err("wmi event(%u) registration failed, ret: %d",
|
||||
wmi_roam_auth_offload_event_id, ret);
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
ret = wmi_unified_register_event_handler(handle,
|
||||
wmi_roam_pmkid_request_event_id,
|
||||
target_if_pmkid_request_event_handler,
|
||||
WMI_RX_SERIALIZER_CTX);
|
||||
if (QDF_IS_STATUS_ERROR(ret)) {
|
||||
target_if_err("wmi event(%u) registration failed, ret: %d",
|
||||
wmi_roam_stats_event_id, ret);
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
Різницю між файлами не показано, бо вона завелика
Завантажити різницю
Різницю між файлами не показано, бо вона завелика
Завантажити різницю
@@ -1,80 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2018 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 various api/struct which shall be used
|
||||
* by disa component for wmi cmd (tx path) and
|
||||
* event (rx) handling.
|
||||
*/
|
||||
|
||||
#ifndef _TARGET_IF_DISA_H_
|
||||
#define _TARGET_IF_DISA_H_
|
||||
|
||||
#include <wlan_objmgr_psoc_obj.h>
|
||||
#include <wmi_unified_param.h>
|
||||
#include "wlan_disa_obj_mgmt_public_struct.h"
|
||||
|
||||
/**
|
||||
* target_if_disa_encrypt_decrypt_req() - Send encrypt/decrypt request to
|
||||
* target.
|
||||
* @psoc: objmgr psoc handle
|
||||
* @req: Encrypt/decrypt request params
|
||||
*
|
||||
* Return: QDF status
|
||||
*/
|
||||
QDF_STATUS target_if_disa_encrypt_decrypt_req(struct wlan_objmgr_psoc *psoc,
|
||||
struct disa_encrypt_decrypt_req_params *req);
|
||||
|
||||
/**
|
||||
* target_if_encrypt_decrypt_event_handler() - Collect encrypt/decrypt request
|
||||
* event from the target and pass on the data to tgt api of DISA.
|
||||
* @scn_handle: target handle
|
||||
* @data: event data
|
||||
* @data_len: data length
|
||||
*
|
||||
* Return: QDF status
|
||||
*/
|
||||
int target_if_encrypt_decrypt_event_handler(ol_scn_t scn_handle, uint8_t *data,
|
||||
uint32_t data_len);
|
||||
|
||||
/**
|
||||
* target_if_disa_register_tx_ops() - Register DISA component TX OPS
|
||||
* @tx_ops: DISA if transmit ops
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
void target_if_disa_register_tx_ops(struct wlan_disa_tx_ops *tx_ops);
|
||||
|
||||
/**
|
||||
* target_if_disa_register_ev_handler() - Register disa event handlers.
|
||||
* @psoc:objmgr psoc handle
|
||||
*
|
||||
* Return: QDF status
|
||||
*/
|
||||
QDF_STATUS
|
||||
target_if_disa_register_ev_handlers(struct wlan_objmgr_psoc *psoc);
|
||||
|
||||
/**
|
||||
* target_if_disa_register_ev_handler() - Unregister disa event handlers.
|
||||
* @psoc:objmgr psoc handle
|
||||
*
|
||||
* Return: QDF status
|
||||
*/
|
||||
QDF_STATUS
|
||||
target_if_disa_unregister_ev_handlers(struct wlan_objmgr_psoc *psoc);
|
||||
#endif
|
||||
|
@@ -1,140 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2020 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: Target interface file for disa component to
|
||||
* Implement api's which shall be used by disa component
|
||||
* in target if internally.
|
||||
*/
|
||||
|
||||
#include "target_if.h"
|
||||
#include "target_if_disa.h"
|
||||
#include "wlan_disa_tgt_api.h"
|
||||
#include "wlan_disa_public_struct.h"
|
||||
#include <wmi_unified_api.h>
|
||||
|
||||
int
|
||||
target_if_encrypt_decrypt_event_handler(ol_scn_t scn_handle, uint8_t *data,
|
||||
uint32_t data_len)
|
||||
{
|
||||
struct disa_encrypt_decrypt_resp_params resp;
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
wmi_unified_t wmi_handle;
|
||||
|
||||
if (!data) {
|
||||
target_if_err("Invalid pointer");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
psoc = target_if_get_psoc_from_scn_hdl(scn_handle);
|
||||
if (!psoc) {
|
||||
target_if_err("psoc ptr is NULL");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi handle");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (wmi_extract_encrypt_decrypt_resp_params(wmi_handle, data, &resp) !=
|
||||
QDF_STATUS_SUCCESS) {
|
||||
target_if_err("Extraction of encrypt decrypt resp params failed");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
tgt_disa_encrypt_decrypt_resp(psoc, &resp);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
target_if_disa_register_ev_handlers(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
QDF_STATUS status;
|
||||
wmi_unified_t wmi_handle;
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi handle");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
status = wmi_unified_register_event(wmi_handle,
|
||||
wmi_vdev_encrypt_decrypt_data_rsp_event_id,
|
||||
target_if_encrypt_decrypt_event_handler);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
target_if_err("Failed to register Scan match event cb");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
target_if_disa_unregister_ev_handlers(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
QDF_STATUS status;
|
||||
wmi_unified_t wmi_handle;
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi handle");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
status = wmi_unified_unregister_event(wmi_handle,
|
||||
wmi_vdev_encrypt_decrypt_data_rsp_event_id);
|
||||
if (status) {
|
||||
target_if_err("Failed to unregister Scan match event cb");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
target_if_disa_encrypt_decrypt_req(struct wlan_objmgr_psoc *psoc,
|
||||
struct disa_encrypt_decrypt_req_params *req)
|
||||
{
|
||||
wmi_unified_t wmi_handle;
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi handle");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
return wmi_unified_encrypt_decrypt_send_cmd(wmi_handle, req);
|
||||
}
|
||||
|
||||
|
||||
void target_if_disa_register_tx_ops(struct wlan_disa_tx_ops *disa_tx_ops)
|
||||
{
|
||||
if (!disa_tx_ops) {
|
||||
target_if_err("disa_tx_ops is null");
|
||||
return;
|
||||
}
|
||||
|
||||
disa_tx_ops->disa_encrypt_decrypt_req =
|
||||
target_if_disa_encrypt_decrypt_req;
|
||||
disa_tx_ops->disa_register_ev_handlers =
|
||||
target_if_disa_register_ev_handlers;
|
||||
disa_tx_ops->disa_unregister_ev_handlers =
|
||||
target_if_disa_unregister_ev_handlers;
|
||||
}
|
@@ -1,59 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2020, 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 various api/struct which shall be used
|
||||
* by FTM time sync component for wmi cmd (tx path) and
|
||||
* event (rx) handling.
|
||||
*/
|
||||
|
||||
#ifndef _TARGET_IF_FTM_TIME_SYNC_H_
|
||||
#define _TARGET_IF_FTM_TIME_SYNC_H_
|
||||
|
||||
#include <wlan_objmgr_psoc_obj.h>
|
||||
#include <wmi_unified_param.h>
|
||||
#include "wlan_ftm_time_sync_public_struct.h"
|
||||
|
||||
/**
|
||||
* target_if_ftm_time_sync_register_rx_ops() - Register FTM TIME SYNC component
|
||||
* RX ops
|
||||
* @rx_ops: FTM time sync component reception ops
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
void target_if_ftm_time_sync_register_rx_ops(struct wlan_ftm_time_sync_rx_ops
|
||||
*rx_ops);
|
||||
|
||||
/**
|
||||
* target_if_ftm_time_sync_register_tx_ops() - Register FTM TIME SYNC component
|
||||
* TX OPS
|
||||
* @tx_ops: FTM time sync component transmit ops
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
void target_if_ftm_time_sync_register_tx_ops(struct wlan_ftm_time_sync_tx_ops
|
||||
*tx_ops);
|
||||
|
||||
/**
|
||||
* target_if_ftm_time_sync_unregister_ev_handlers() - Unregister wmi events
|
||||
* handlers
|
||||
* @psoc: psoc context
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS
|
||||
target_if_ftm_time_sync_unregister_ev_handlers(struct wlan_objmgr_psoc *psoc);
|
||||
#endif /*_TARGET_IF_FTM_TIME_SYNC_H_ */
|
@@ -1,239 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2020, 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: Target interface file for ftm time sync component to
|
||||
* Implement api's which shall be used by ftm time sync component
|
||||
* in target_if internally.
|
||||
*/
|
||||
|
||||
#include "target_if.h"
|
||||
#include "target_if_ftm_time_sync.h"
|
||||
#include "wlan_ftm_time_sync_public_struct.h"
|
||||
#include "wlan_ftm_time_sync_tgt_api.h"
|
||||
#include <wmi_unified_api.h>
|
||||
|
||||
static QDF_STATUS
|
||||
target_if_ftm_time_sync_send_qtime(struct wlan_objmgr_psoc *psoc,
|
||||
uint32_t vdev_id, uint64_t lpass_ts)
|
||||
{
|
||||
wmi_unified_t wmi_hdl;
|
||||
|
||||
wmi_hdl = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_hdl)
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
|
||||
return wmi_unified_send_wlan_time_sync_qtime(wmi_hdl, vdev_id,
|
||||
lpass_ts);
|
||||
}
|
||||
|
||||
static QDF_STATUS
|
||||
target_if_ftm_time_sync_send_trigger(struct wlan_objmgr_psoc *psoc,
|
||||
uint32_t vdev_id, bool mode)
|
||||
{
|
||||
wmi_unified_t wmi_hdl;
|
||||
|
||||
wmi_hdl = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_hdl)
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
|
||||
return wmi_unified_send_wlan_time_sync_ftm_trigger(wmi_hdl, vdev_id,
|
||||
mode);
|
||||
}
|
||||
|
||||
static int
|
||||
target_if_time_sync_ftm_start_stop_event_handler(ol_scn_t scn_handle,
|
||||
uint8_t *data, uint32_t len)
|
||||
{
|
||||
struct ftm_time_sync_start_stop_params param;
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
wmi_unified_t wmi_handle;
|
||||
|
||||
if (!data) {
|
||||
target_if_err("Invalid pointer");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
psoc = target_if_get_psoc_from_scn_hdl(scn_handle);
|
||||
if (!psoc) {
|
||||
target_if_err("psoc ptr is NULL");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi handle");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (wmi_unified_extract_time_sync_ftm_start_stop_params(
|
||||
wmi_handle, data, ¶m) != QDF_STATUS_SUCCESS) {
|
||||
target_if_err("Extraction of time sync ftm start stop failed");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
tgt_ftm_ts_start_stop_evt(psoc, ¶m);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static QDF_STATUS
|
||||
target_if_ftm_time_sync_start_stop_event(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
QDF_STATUS status;
|
||||
wmi_unified_t wmi_handle;
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi handle");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
status = wmi_unified_register_event_handler(
|
||||
wmi_handle, wmi_wlan_time_sync_ftm_start_stop_event_id,
|
||||
target_if_time_sync_ftm_start_stop_event_handler,
|
||||
WMI_RX_SERIALIZER_CTX);
|
||||
if (status) {
|
||||
target_if_err("Ftm time_sync start stop event register failed");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
static int
|
||||
target_if_time_sync_master_slave_offset_event_handler(ol_scn_t scn_handle,
|
||||
uint8_t *data,
|
||||
uint32_t len)
|
||||
{
|
||||
struct ftm_time_sync_offset param;
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
wmi_unified_t wmi_handle;
|
||||
|
||||
if (!data) {
|
||||
target_if_err("Invalid pointer");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
psoc = target_if_get_psoc_from_scn_hdl(scn_handle);
|
||||
if (!psoc) {
|
||||
target_if_err("psoc ptr is NULL");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi handle");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (wmi_unified_extract_time_sync_ftm_offset(
|
||||
wmi_handle, data, ¶m) != QDF_STATUS_SUCCESS) {
|
||||
target_if_err("Extraction of time_sync ftm offset param failed");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
tgt_ftm_ts_offset_evt(psoc, ¶m);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static QDF_STATUS
|
||||
target_if_ftm_time_sync_master_slave_offset(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
QDF_STATUS status;
|
||||
wmi_unified_t wmi_handle;
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi handle");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
status = wmi_unified_register_event_handler(
|
||||
wmi_handle,
|
||||
wmi_wlan_time_sync_q_master_slave_offset_eventid,
|
||||
target_if_time_sync_master_slave_offset_event_handler,
|
||||
WMI_RX_SERIALIZER_CTX);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
target_if_err("Ftm time_sync offset event register failed");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
target_if_ftm_time_sync_unregister_ev_handlers(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
wmi_unified_t wmi_handle;
|
||||
QDF_STATUS ret, status = QDF_STATUS_SUCCESS;
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi handle");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
ret = wmi_unified_unregister_event(
|
||||
wmi_handle,
|
||||
wmi_wlan_time_sync_ftm_start_stop_event_id);
|
||||
if (QDF_IS_STATUS_ERROR(ret)) {
|
||||
target_if_err("failed to unregister time sync start/stop evt");
|
||||
status = ret;
|
||||
}
|
||||
|
||||
ret = wmi_unified_unregister_event(
|
||||
wmi_handle,
|
||||
wmi_wlan_time_sync_q_master_slave_offset_eventid);
|
||||
if (QDF_IS_STATUS_ERROR(ret)) {
|
||||
target_if_err("failed to unregister time sync offset evt");
|
||||
status = ret;
|
||||
}
|
||||
|
||||
if (QDF_IS_STATUS_ERROR(status))
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
else
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
void target_if_ftm_time_sync_register_rx_ops(
|
||||
struct wlan_ftm_time_sync_rx_ops *rx_ops)
|
||||
{
|
||||
if (!rx_ops) {
|
||||
target_if_err("FTM time_sync rx_ops is null");
|
||||
return;
|
||||
}
|
||||
|
||||
rx_ops->ftm_time_sync_register_start_stop =
|
||||
target_if_ftm_time_sync_start_stop_event;
|
||||
rx_ops->ftm_time_sync_regiser_master_slave_offset =
|
||||
target_if_ftm_time_sync_master_slave_offset;
|
||||
}
|
||||
|
||||
void target_if_ftm_time_sync_register_tx_ops(
|
||||
struct wlan_ftm_time_sync_tx_ops *tx_ops)
|
||||
{
|
||||
if (!tx_ops) {
|
||||
target_if_err("FTM time_sync tx_ops is null");
|
||||
return;
|
||||
}
|
||||
|
||||
tx_ops->ftm_time_sync_send_qtime = target_if_ftm_time_sync_send_qtime;
|
||||
tx_ops->ftm_time_sync_send_trigger =
|
||||
target_if_ftm_time_sync_send_trigger;
|
||||
}
|
||||
|
@@ -1,58 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2019 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: target interface APIs for fw offload
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __TARGET_IF_FWOL_H__
|
||||
#define __TARGET_IF_FWOL_H__
|
||||
|
||||
/**
|
||||
* target_if_fwol_register_event_handler() - register fw offload event handler
|
||||
* @psoc: psoc object
|
||||
* @arg: argument passed to lmac
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS target_if_fwol_register_event_handler(struct wlan_objmgr_psoc *psoc,
|
||||
void *arg);
|
||||
|
||||
/**
|
||||
* target_if_fwol_unregister_event_handler() - unregister fw offload event
|
||||
* handler
|
||||
* @psoc: psoc object
|
||||
* @arg: argument passed to lmac
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS
|
||||
target_if_fwol_unregister_event_handler(struct wlan_objmgr_psoc *psoc,
|
||||
void *arg);
|
||||
|
||||
/**
|
||||
* target_if_fwol_register_tx_ops() - register fw offload tx ops callback
|
||||
* functions
|
||||
* @tx_ops: fw offload tx operations
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS target_if_fwol_register_tx_ops(struct wlan_fwol_tx_ops *tx_ops);
|
||||
|
||||
#endif /* __TARGET_IF_FWOL_H__ */
|
@@ -1,544 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2019-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: target interface APIs for fw offload
|
||||
*
|
||||
*/
|
||||
|
||||
#include "qdf_mem.h"
|
||||
#include "target_if.h"
|
||||
#include "qdf_status.h"
|
||||
#include "wmi_unified_api.h"
|
||||
#include "wmi_unified_priv.h"
|
||||
#include "wmi_unified_param.h"
|
||||
#include "wlan_objmgr_psoc_obj.h"
|
||||
#include "wlan_utility.h"
|
||||
#include "wlan_defs.h"
|
||||
#include "wlan_fwol_public_structs.h"
|
||||
#include "wlan_fw_offload_main.h"
|
||||
#include "target_if_fwol.h"
|
||||
|
||||
#ifdef WLAN_FEATURE_ELNA
|
||||
/**
|
||||
* target_if_fwol_set_elna_bypass() - send set eLNA bypass request to FW
|
||||
* @psoc: pointer to PSOC object
|
||||
* @req: set eLNA bypass request
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS on success
|
||||
*/
|
||||
static QDF_STATUS
|
||||
target_if_fwol_set_elna_bypass(struct wlan_objmgr_psoc *psoc,
|
||||
struct set_elna_bypass_request *req)
|
||||
{
|
||||
QDF_STATUS status;
|
||||
wmi_unified_t wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi_handle");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
status = wmi_unified_send_set_elna_bypass_cmd(wmi_handle, req);
|
||||
if (status)
|
||||
target_if_err("Failed to set eLNA bypass %d", status);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* target_if_fwol_get_elna_bypass() - send get eLNA bypass request to FW
|
||||
* @psoc: pointer to PSOC object
|
||||
* @req: get eLNA bypass request
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS on success
|
||||
*/
|
||||
static QDF_STATUS
|
||||
target_if_fwol_get_elna_bypass(struct wlan_objmgr_psoc *psoc,
|
||||
struct get_elna_bypass_request *req)
|
||||
{
|
||||
QDF_STATUS status;
|
||||
wmi_unified_t wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi_handle");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
status = wmi_unified_send_get_elna_bypass_cmd(wmi_handle, req);
|
||||
if (status)
|
||||
target_if_err("Failed to set eLNA bypass %d", status);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* target_if_fwol_get_elna_bypass_resp() - handler for get eLNA bypass response
|
||||
* @scn: scn handle
|
||||
* @event_buf: pointer to the event buffer
|
||||
* @len: length of the buffer
|
||||
*
|
||||
* Return: 0 on success
|
||||
*/
|
||||
static int target_if_fwol_get_elna_bypass_resp(ol_scn_t scn, uint8_t *event_buf,
|
||||
uint32_t len)
|
||||
{
|
||||
QDF_STATUS status;
|
||||
struct get_elna_bypass_response resp;
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
wmi_unified_t wmi_handle;
|
||||
struct wlan_fwol_psoc_obj *fwol_obj;
|
||||
struct wlan_fwol_rx_ops *rx_ops;
|
||||
|
||||
target_if_debug("scn:%pK, data:%pK, datalen:%d", scn, event_buf, len);
|
||||
if (!scn || !event_buf) {
|
||||
target_if_err("scn: 0x%pK, data: 0x%pK", scn, event_buf);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
psoc = target_if_get_psoc_from_scn_hdl(scn);
|
||||
if (!psoc) {
|
||||
target_if_err("null psoc");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi_handle");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
fwol_obj = fwol_get_psoc_obj(psoc);
|
||||
if (!fwol_obj) {
|
||||
target_if_err("Failed to get FWOL Obj");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
rx_ops = &fwol_obj->rx_ops;
|
||||
if (rx_ops->get_elna_bypass_resp) {
|
||||
status = wmi_extract_get_elna_bypass_resp(wmi_handle,
|
||||
event_buf, &resp);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
target_if_err("Failed to extract eLNA bypass");
|
||||
return -EINVAL;
|
||||
}
|
||||
status = rx_ops->get_elna_bypass_resp(psoc, &resp);
|
||||
if (status != QDF_STATUS_SUCCESS) {
|
||||
target_if_err("get_elna_bypass_resp failed.");
|
||||
return -EINVAL;
|
||||
}
|
||||
} else {
|
||||
target_if_fatal("No get_elna_bypass_resp callback");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return 0;
|
||||
};
|
||||
|
||||
static void
|
||||
target_if_fwol_register_elna_event_handler(struct wlan_objmgr_psoc *psoc,
|
||||
void *arg)
|
||||
{
|
||||
QDF_STATUS rc;
|
||||
|
||||
rc = wmi_unified_register_event(get_wmi_unified_hdl_from_psoc(psoc),
|
||||
wmi_get_elna_bypass_event_id,
|
||||
target_if_fwol_get_elna_bypass_resp);
|
||||
if (QDF_IS_STATUS_ERROR(rc))
|
||||
target_if_debug("Failed to register get eLNA bypass event cb");
|
||||
}
|
||||
|
||||
static void
|
||||
target_if_fwol_unregister_elna_event_handler(struct wlan_objmgr_psoc *psoc,
|
||||
void *arg)
|
||||
{
|
||||
QDF_STATUS rc;
|
||||
|
||||
rc = wmi_unified_unregister_event_handler(
|
||||
get_wmi_unified_hdl_from_psoc(psoc),
|
||||
wmi_get_elna_bypass_event_id);
|
||||
if (QDF_IS_STATUS_ERROR(rc))
|
||||
target_if_debug("Failed to unregister get eLNA bypass event cb");
|
||||
}
|
||||
|
||||
static void
|
||||
target_if_fwol_register_elna_tx_ops(struct wlan_fwol_tx_ops *tx_ops)
|
||||
{
|
||||
tx_ops->set_elna_bypass = target_if_fwol_set_elna_bypass;
|
||||
tx_ops->get_elna_bypass = target_if_fwol_get_elna_bypass;
|
||||
}
|
||||
#else
|
||||
static void
|
||||
target_if_fwol_register_elna_event_handler(struct wlan_objmgr_psoc *psoc,
|
||||
void *arg)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
target_if_fwol_unregister_elna_event_handler(struct wlan_objmgr_psoc *psoc,
|
||||
void *arg)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
target_if_fwol_register_elna_tx_ops(struct wlan_fwol_tx_ops *tx_ops)
|
||||
{
|
||||
}
|
||||
#endif /* WLAN_FEATURE_ELNA */
|
||||
|
||||
#ifdef WLAN_SEND_DSCP_UP_MAP_TO_FW
|
||||
/**
|
||||
* target_if_fwol_send_dscp_up_map_to_fw() - send dscp up map to FW
|
||||
* @psoc: pointer to PSOC object
|
||||
* @dscp_to_up_map: DSCP to UP map array
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS on success
|
||||
*/
|
||||
static QDF_STATUS
|
||||
target_if_fwol_send_dscp_up_map_to_fw(struct wlan_objmgr_psoc *psoc,
|
||||
uint32_t *dscp_to_up_map)
|
||||
{
|
||||
QDF_STATUS status;
|
||||
wmi_unified_t wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi_handle");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
status = wmi_unified_send_dscp_tip_map_cmd(wmi_handle, dscp_to_up_map);
|
||||
if (status)
|
||||
target_if_err("Failed to send dscp_up_map_to_fw %d", status);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
static void
|
||||
target_if_fwol_register_dscp_up_tx_ops(struct wlan_fwol_tx_ops *tx_ops)
|
||||
{
|
||||
tx_ops->send_dscp_up_map_to_fw = target_if_fwol_send_dscp_up_map_to_fw;
|
||||
}
|
||||
#else
|
||||
static void
|
||||
target_if_fwol_register_dscp_up_tx_ops(struct wlan_fwol_tx_ops *tx_ops)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef THERMAL_STATS_SUPPORT
|
||||
/**
|
||||
* target_if_fwol_get_thermal_stats() - send get thermal stats request to FW
|
||||
* @psoc: pointer to PSOC object
|
||||
* @req_type: get thermal stats request type
|
||||
* @therm_stats_offset: thermal temp stats offset for each temp range
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS on success
|
||||
*/
|
||||
static QDF_STATUS
|
||||
target_if_fwol_get_thermal_stats(struct wlan_objmgr_psoc *psoc,
|
||||
enum thermal_stats_request_type req_type,
|
||||
uint8_t therm_stats_offset)
|
||||
{
|
||||
QDF_STATUS status;
|
||||
wmi_unified_t wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi_handle");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
status = wmi_unified_send_get_thermal_stats_cmd(wmi_handle, req_type,
|
||||
therm_stats_offset);
|
||||
if (status)
|
||||
target_if_err("Failed to send get thermal stats cmd %d",
|
||||
status);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
static void
|
||||
target_if_fwol_register_thermal_stats_tx_ops(struct wlan_fwol_tx_ops *tx_ops)
|
||||
{
|
||||
tx_ops->get_thermal_stats = target_if_fwol_get_thermal_stats;
|
||||
}
|
||||
|
||||
static QDF_STATUS
|
||||
target_if_fwol_handle_thermal_lvl_stats_evt(struct wlan_objmgr_psoc *psoc,
|
||||
struct wlan_fwol_rx_ops *rx_ops,
|
||||
struct thermal_throttle_info *info)
|
||||
{
|
||||
QDF_STATUS status = QDF_STATUS_E_FAILURE;
|
||||
|
||||
if (rx_ops->get_thermal_stats_resp && info->therm_throt_levels)
|
||||
status = rx_ops->get_thermal_stats_resp(psoc, info);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
static bool
|
||||
target_if_fwol_is_thermal_stats_enable(struct wlan_fwol_psoc_obj *fwol_obj)
|
||||
{
|
||||
return (fwol_obj->capability_info.fw_thermal_stats_cap &&
|
||||
fwol_obj->cfg.thermal_temp_cfg.therm_stats_offset);
|
||||
}
|
||||
#else
|
||||
static void
|
||||
target_if_fwol_register_thermal_stats_tx_ops(struct wlan_fwol_tx_ops *tx_ops)
|
||||
{
|
||||
}
|
||||
|
||||
#ifdef FW_THERMAL_THROTTLE_SUPPORT
|
||||
static QDF_STATUS
|
||||
target_if_fwol_handle_thermal_lvl_stats_evt(struct wlan_objmgr_psoc *psoc,
|
||||
struct wlan_fwol_rx_ops *rx_ops,
|
||||
struct thermal_throttle_info *info)
|
||||
{
|
||||
return QDF_STATUS_E_NOSUPPORT;
|
||||
}
|
||||
|
||||
static bool
|
||||
target_if_fwol_is_thermal_stats_enable(struct wlan_fwol_psoc_obj *fwol_obj)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined FW_THERMAL_THROTTLE_SUPPORT || defined THERMAL_STATS_SUPPORT
|
||||
/**
|
||||
* target_if_fwol_thermal_throttle_event_handler() - handler for thermal
|
||||
* throttle event
|
||||
* @scn: scn handle
|
||||
* @event_buf: pointer to the event buffer
|
||||
* @len: length of the buffer
|
||||
*
|
||||
* Return: 0 on success
|
||||
*/
|
||||
static int
|
||||
target_if_fwol_thermal_throttle_event_handler(ol_scn_t scn, uint8_t *event_buf,
|
||||
uint32_t len)
|
||||
{
|
||||
QDF_STATUS status = QDF_STATUS_E_FAILURE;
|
||||
struct thermal_throttle_info info = {0};
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
wmi_unified_t wmi_handle;
|
||||
struct wlan_fwol_psoc_obj *fwol_obj;
|
||||
struct wlan_fwol_rx_ops *rx_ops;
|
||||
|
||||
target_if_debug("scn:%pK, data:%pK, datalen:%d", scn, event_buf, len);
|
||||
if (!scn || !event_buf) {
|
||||
target_if_err("scn: 0x%pK, data: 0x%pK", scn, event_buf);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
psoc = target_if_get_psoc_from_scn_hdl(scn);
|
||||
if (!psoc) {
|
||||
target_if_err("null psoc");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi_handle");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
fwol_obj = fwol_get_psoc_obj(psoc);
|
||||
if (!fwol_obj) {
|
||||
target_if_err("Failed to get FWOL Obj");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
status = wmi_extract_thermal_stats(wmi_handle,
|
||||
event_buf,
|
||||
&info.temperature,
|
||||
&info.level,
|
||||
&info.therm_throt_levels,
|
||||
info.level_info,
|
||||
&info.pdev_id);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
target_if_debug("Failed to convert thermal target level");
|
||||
return -EINVAL;
|
||||
}
|
||||
rx_ops = &fwol_obj->rx_ops;
|
||||
if (!rx_ops) {
|
||||
target_if_debug("rx_ops Null");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
status = target_if_fwol_handle_thermal_lvl_stats_evt(psoc, rx_ops,
|
||||
&info);
|
||||
if (QDF_IS_STATUS_ERROR(status))
|
||||
target_if_debug("thermal stats level response failed.");
|
||||
|
||||
if (rx_ops->notify_thermal_throttle_handler)
|
||||
{
|
||||
if (info.level == THERMAL_UNKNOWN) {
|
||||
target_if_debug("Failed to convert thermal target lvl");
|
||||
return -EINVAL;
|
||||
}
|
||||
status = rx_ops->notify_thermal_throttle_handler(psoc, &info);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
target_if_debug("notify thermal_throttle failed.");
|
||||
return -EINVAL;
|
||||
}
|
||||
} else {
|
||||
target_if_debug("No notify thermal_throttle callback");
|
||||
return -EINVAL;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* target_if_fwol_register_thermal_throttle_handler() - Register handler for
|
||||
* thermal throttle stats firmware event
|
||||
* @psoc: psoc object
|
||||
*
|
||||
* Return: void
|
||||
*/
|
||||
static void
|
||||
target_if_fwol_register_thermal_throttle_handler(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
QDF_STATUS status;
|
||||
struct wlan_fwol_psoc_obj *fwol_obj;
|
||||
|
||||
fwol_obj = fwol_get_psoc_obj(psoc);
|
||||
if (!fwol_obj) {
|
||||
target_if_err("Failed to get FWOL Obj");
|
||||
return;
|
||||
}
|
||||
if (!fwol_obj->cfg.thermal_temp_cfg.thermal_mitigation_enable &&
|
||||
!target_if_fwol_is_thermal_stats_enable(fwol_obj)) {
|
||||
target_if_debug("thermal mitigation or stats offload not enabled");
|
||||
return;
|
||||
}
|
||||
status = wmi_unified_register_event_handler(
|
||||
get_wmi_unified_hdl_from_psoc(psoc),
|
||||
wmi_tt_stats_event_id,
|
||||
target_if_fwol_thermal_throttle_event_handler,
|
||||
WMI_RX_SERIALIZER_CTX);
|
||||
if (QDF_IS_STATUS_ERROR(status))
|
||||
target_if_debug("Failed to register thermal stats event cb");
|
||||
}
|
||||
|
||||
/**
|
||||
* target_if_fwol_unregister_thermal_stats_handler() - Register handler for
|
||||
* thermal throttle stats firmware event
|
||||
* @psoc: psoc object
|
||||
*
|
||||
* Return: void
|
||||
*/
|
||||
static void
|
||||
target_if_fwol_unregister_thermal_throttle_handler(
|
||||
struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
QDF_STATUS status;
|
||||
|
||||
status = wmi_unified_unregister_event_handler(
|
||||
get_wmi_unified_hdl_from_psoc(psoc),
|
||||
wmi_tt_stats_event_id);
|
||||
if (QDF_IS_STATUS_ERROR(status))
|
||||
target_if_debug("Failed to unregister thermal stats event cb");
|
||||
}
|
||||
|
||||
#else
|
||||
static void
|
||||
target_if_fwol_register_thermal_throttle_handler(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
target_if_fwol_unregister_thermal_throttle_handler(
|
||||
struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef WLAN_FEATURE_MDNS_OFFLOAD
|
||||
/**
|
||||
* target_if_fwol_set_mdns_config() - Set mdns Config to FW
|
||||
* @psoc: pointer to PSOC object
|
||||
* @offload_info: pointer to mdns config info
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS on success
|
||||
*/
|
||||
static QDF_STATUS
|
||||
target_if_fwol_set_mdns_config(struct wlan_objmgr_psoc *psoc,
|
||||
struct mdns_config_info *mdns_info)
|
||||
{
|
||||
QDF_STATUS status;
|
||||
wmi_unified_t wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi_handle");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
status = wmi_unified_send_set_mdns_config_cmd(wmi_handle,
|
||||
mdns_info);
|
||||
if (QDF_IS_STATUS_ERROR(status))
|
||||
target_if_err("Failed to set mDNS Config %d", status);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
static void
|
||||
target_if_fwol_register_mdns_tx_ops(struct wlan_fwol_tx_ops *tx_ops)
|
||||
{
|
||||
tx_ops->set_mdns_config = target_if_fwol_set_mdns_config;
|
||||
}
|
||||
#else
|
||||
static void
|
||||
target_if_fwol_register_mdns_tx_ops(struct wlan_fwol_tx_ops *tx_ops)
|
||||
{
|
||||
}
|
||||
#endif /* WLAN_FEATURE_MDNS_OFFLOAD */
|
||||
|
||||
QDF_STATUS
|
||||
target_if_fwol_register_event_handler(struct wlan_objmgr_psoc *psoc,
|
||||
void *arg)
|
||||
{
|
||||
target_if_fwol_register_elna_event_handler(psoc, arg);
|
||||
target_if_fwol_register_thermal_throttle_handler(psoc);
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
target_if_fwol_unregister_event_handler(struct wlan_objmgr_psoc *psoc,
|
||||
void *arg)
|
||||
{
|
||||
target_if_fwol_unregister_thermal_throttle_handler(psoc);
|
||||
target_if_fwol_unregister_elna_event_handler(psoc, arg);
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
QDF_STATUS target_if_fwol_register_tx_ops(struct wlan_fwol_tx_ops *tx_ops)
|
||||
{
|
||||
target_if_fwol_register_elna_tx_ops(tx_ops);
|
||||
target_if_fwol_register_dscp_up_tx_ops(tx_ops);
|
||||
target_if_fwol_register_mdns_tx_ops(tx_ops);
|
||||
target_if_fwol_register_thermal_stats_tx_ops(tx_ops);
|
||||
|
||||
tx_ops->reg_evt_handler = target_if_fwol_register_event_handler;
|
||||
tx_ops->unreg_evt_handler = target_if_fwol_unregister_event_handler;
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
@@ -1,73 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2019 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: offload lmac interface APIs for interop issues ap
|
||||
*/
|
||||
#ifndef __TARGET_IF_INTEROP_ISSUES_AP_H__
|
||||
#define __TARGET_IF_INTEROP_ISSUES_AP_H__
|
||||
|
||||
#ifdef WLAN_FEATURE_INTEROP_ISSUES_AP
|
||||
#include <wlan_objmgr_cmn.h>
|
||||
#include <wlan_objmgr_pdev_obj.h>
|
||||
#include <qdf_status.h>
|
||||
#include <wlan_lmac_if_def.h>
|
||||
#include <wlan_interop_issues_ap_public_structs.h>
|
||||
|
||||
/**
|
||||
* target_if_interop_issues_ap_register_event_handler() - register callback
|
||||
* @psoc: the pointer to psoc object
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS
|
||||
target_if_interop_issues_ap_register_event_handler(
|
||||
struct wlan_objmgr_psoc *psoc);
|
||||
|
||||
/**
|
||||
* target_if_interop_issues_ap_unregister_event_handler() - unregister callback
|
||||
* @psoc: the pointer to psoc object
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS
|
||||
target_if_interop_issues_ap_unregister_event_handler(
|
||||
struct wlan_objmgr_psoc *psoc);
|
||||
|
||||
/**
|
||||
* target_if_interop_issues_ap_register_tx_ops() - register tx ops funcs
|
||||
* @psoc: the pointer of psoc object
|
||||
* @tx_ops: pointer to rap_ps tx ops
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error
|
||||
*/
|
||||
QDF_STATUS
|
||||
target_if_interop_issues_ap_register_tx_ops(struct wlan_objmgr_psoc *psoc,
|
||||
struct wlan_interop_issues_ap_tx_ops *tx_ops);
|
||||
/**
|
||||
* target_if_interop_issues_ap_unregister_tx_ops() - unregister tx ops funcs
|
||||
* @psoc: the pointer of psoc object
|
||||
* @tx_ops: pointer to rap_ps tx ops
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error
|
||||
*/
|
||||
QDF_STATUS
|
||||
target_if_interop_issues_ap_unregister_tx_ops(struct wlan_objmgr_psoc *psoc,
|
||||
struct wlan_interop_issues_ap_tx_ops *tx_ops);
|
||||
#endif
|
||||
#endif /* __TARGET_IF_INTEROP_ISSUES_AP_H__ */
|
@@ -1,187 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2019-2020 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: target_if_interop_issues_ap.c
|
||||
*
|
||||
* This file provide definition for APIs registered through lmac Tx Ops
|
||||
*/
|
||||
|
||||
#include <qdf_mem.h>
|
||||
#include <qdf_status.h>
|
||||
#include <qdf_types.h>
|
||||
#include <target_if.h>
|
||||
#include <wlan_tgt_def_config.h>
|
||||
#include <wlan_osif_priv.h>
|
||||
#include <wlan_interop_issues_ap_tgt_api.h>
|
||||
#include <wlan_interop_issues_ap_api.h>
|
||||
#include <target_if_interop_issues_ap.h>
|
||||
#include <wmi_unified_interop_issues_ap_api.h>
|
||||
|
||||
/**
|
||||
* target_if_interop_issues_ap_event_handler() - callback for event
|
||||
* @event: firmware event
|
||||
* @len: the event length
|
||||
*
|
||||
* Return: 0 or error status
|
||||
*/
|
||||
static int target_if_interop_issues_ap_event_handler(ol_scn_t sc,
|
||||
uint8_t *event,
|
||||
uint32_t len)
|
||||
{
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
struct wmi_unified *wmi_handle;
|
||||
struct wlan_interop_issues_ap_event data = {0};
|
||||
int ret;
|
||||
|
||||
TARGET_IF_ENTER();
|
||||
|
||||
psoc = target_if_get_psoc_from_scn_hdl(sc);
|
||||
if (!psoc) {
|
||||
target_if_err("psoc ptr is NULL");
|
||||
return -EINVAL;
|
||||
}
|
||||
data.psoc = psoc;
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("wmi_handle is null.");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
ret = wmi_extract_interop_issues_ap_ev_param(wmi_handle, event, &data);
|
||||
if (ret)
|
||||
return -EINVAL;
|
||||
|
||||
target_if_debug("interop issues ap macaddr: " QDF_MAC_ADDR_FMT,
|
||||
QDF_MAC_ADDR_REF(data.rap_addr.bytes));
|
||||
|
||||
return tgt_interop_issues_ap_info_callback(psoc, &data);
|
||||
}
|
||||
|
||||
/**
|
||||
* target_if_interop_issues_ap_register_event_handler() - register callback
|
||||
* @psoc: the pointer to psoc object
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS
|
||||
target_if_interop_issues_ap_register_event_handler(
|
||||
struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
QDF_STATUS ret_val;
|
||||
struct wmi_unified *wmi_handle;
|
||||
|
||||
if (!psoc) {
|
||||
target_if_err("PSOC is NULL!");
|
||||
return QDF_STATUS_E_NULL_VALUE;
|
||||
}
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("wmi_handle is null");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
ret_val =
|
||||
wmi_unified_register_event_handler(wmi_handle,
|
||||
wmi_pdev_interop_issues_ap_event_id,
|
||||
target_if_interop_issues_ap_event_handler,
|
||||
WMI_RX_WORK_CTX);
|
||||
if (QDF_IS_STATUS_ERROR(ret_val))
|
||||
target_if_err("Failed to register event cb");
|
||||
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
/**
|
||||
* target_if_interop_issues_ap_unregister_event_handler() - unregister callback
|
||||
* @psoc: the pointer to psoc object
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS
|
||||
target_if_interop_issues_ap_unregister_event_handler(
|
||||
struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
struct wmi_unified *wmi_handle;
|
||||
|
||||
if (!psoc) {
|
||||
target_if_err("PSOC is NULL!");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("wmi_handle is null");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
wmi_unified_unregister_event_handler(wmi_handle,
|
||||
wmi_pdev_interop_issues_ap_event_id);
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* target_if_set_interop_issues_ap_req() - API to send stats request to wmi
|
||||
* @psoc: pointer to psoc object
|
||||
* @raq: pointer to interop issues ap info
|
||||
*
|
||||
* Return: status of operation.
|
||||
*/
|
||||
static QDF_STATUS
|
||||
target_if_set_interop_issues_ap_req(struct wlan_objmgr_psoc *psoc,
|
||||
struct wlan_interop_issues_ap_info *rap)
|
||||
{
|
||||
struct wmi_unified *wmi_handle;
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("wmi_handle is null.");
|
||||
return QDF_STATUS_E_NULL_VALUE;
|
||||
}
|
||||
|
||||
return wmi_unified_set_rap_ps_cmd(wmi_handle, rap);
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
target_if_interop_issues_ap_register_tx_ops(struct wlan_objmgr_psoc *psoc,
|
||||
struct wlan_interop_issues_ap_tx_ops *tx_ops)
|
||||
{
|
||||
if (!tx_ops) {
|
||||
target_if_err("tx ops is NULL!");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
tx_ops->set_rap_ps = target_if_set_interop_issues_ap_req;
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
target_if_interop_issues_ap_unregister_tx_ops(struct wlan_objmgr_psoc *psoc,
|
||||
struct wlan_interop_issues_ap_tx_ops *tx_ops)
|
||||
{
|
||||
if (!tx_ops) {
|
||||
target_if_err("tx ops is NULL!");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
tx_ops->set_rap_ps = NULL;
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
@@ -1,111 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2017-2018, 2020 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: contains nan target if declarations
|
||||
*/
|
||||
|
||||
#ifndef _WLAN_NAN_TGT_IF_H_
|
||||
#define _WLAN_NAN_TGT_IF_H_
|
||||
|
||||
#include "qdf_types.h"
|
||||
|
||||
#include <qdf_mem.h>
|
||||
#include <qdf_status.h>
|
||||
#include <wmi_unified_api.h>
|
||||
#include <wmi_unified_priv.h>
|
||||
#include <wmi_unified_param.h>
|
||||
#include <wlan_objmgr_psoc_obj.h>
|
||||
#include <wlan_scan_tgt_api.h>
|
||||
#include <target_if.h>
|
||||
#include "nan_public_structs.h"
|
||||
|
||||
struct wlan_objmgr_psoc;
|
||||
|
||||
/**
|
||||
* target_if_nan_get_tx_ops() - retrieve the nan tx_ops
|
||||
* @psoc: psoc context
|
||||
*
|
||||
* API to retrieve the nan tx_ops from the psoc context
|
||||
*
|
||||
* Return: nan tx_ops pointer
|
||||
*/
|
||||
struct wlan_nan_tx_ops *target_if_nan_get_tx_ops(struct wlan_objmgr_psoc *psoc);
|
||||
|
||||
/**
|
||||
* target_if_nan_get_rx_ops() - retrieve the nan rx_ops
|
||||
* @psoc: psoc context
|
||||
*
|
||||
* API to retrieve the nan rx_ops from the psoc context
|
||||
*
|
||||
* Return: nan rx_ops pointer
|
||||
*/
|
||||
struct wlan_nan_rx_ops *target_if_nan_get_rx_ops(struct wlan_objmgr_psoc *psoc);
|
||||
|
||||
/**
|
||||
* target_if_nan_register_tx_ops() - registers nan tx ops
|
||||
* @tx_ops: tx ops
|
||||
*
|
||||
* Return: none
|
||||
*/
|
||||
void target_if_nan_register_tx_ops(struct wlan_nan_tx_ops *tx_ops);
|
||||
|
||||
/**
|
||||
* target_if_nan_register_rx_ops() - registers nan rx ops
|
||||
* @tx_ops: rx ops
|
||||
*
|
||||
* Return: none
|
||||
*/
|
||||
void target_if_nan_register_rx_ops(struct wlan_nan_rx_ops *rx_ops);
|
||||
|
||||
/**
|
||||
* target_if_nan_register_events() - registers with NDP events
|
||||
* @psoc: pointer to psoc object
|
||||
*
|
||||
* Return: status of operation
|
||||
*/
|
||||
QDF_STATUS target_if_nan_register_events(struct wlan_objmgr_psoc *psoc);
|
||||
|
||||
/**
|
||||
* target_if_nan_deregister_events() - registers nan rx ops
|
||||
* @psoc: pointer to psoc object
|
||||
*
|
||||
* Return: status of operation
|
||||
*/
|
||||
QDF_STATUS target_if_nan_deregister_events(struct wlan_objmgr_psoc *psoc);
|
||||
|
||||
/**
|
||||
* target_if_nan_rsp_handler() - Target IF handler for NAN Discovery events
|
||||
* @scn: target handle
|
||||
* @data: event buffer
|
||||
* @len: event buffer length
|
||||
*
|
||||
* Return: 0 for success or error code
|
||||
*/
|
||||
int target_if_nan_rsp_handler(ol_scn_t scn, uint8_t *data, uint32_t len);
|
||||
|
||||
/**
|
||||
* target_if_nan_set_vdev_feature_config() - Init NAN feature config params
|
||||
* @psoc: Pointer to PSOC Object
|
||||
* @vdev_id: vdev_id of the current vdev
|
||||
*
|
||||
* This function updates NAN feature config bitmap to firmware
|
||||
*/
|
||||
void target_if_nan_set_vdev_feature_config(struct wlan_objmgr_psoc *psoc,
|
||||
uint8_t vdev_id);
|
||||
#endif /* _WIFI_POS_TGT_IF_H_ */
|
Різницю між файлами не показано, бо вона завелика
Завантажити різницю
@@ -1,58 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2018 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: offload lmac interface APIs for ocb
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __TARGET_IF_OCB_H__
|
||||
#define __TARGET_IF_OCB_H__
|
||||
|
||||
/**
|
||||
* target_if_ocb_register_event_handler() - lmac handler to register ocb event
|
||||
* handler
|
||||
* @psoc : psoc object
|
||||
* @arg: argument passed to lmac
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS target_if_ocb_register_event_handler(struct wlan_objmgr_psoc *psoc,
|
||||
void *arg);
|
||||
|
||||
/**
|
||||
* target_if_ocb_unregister_event_handler() - lmac handler to unregister ocb
|
||||
* event handler
|
||||
* @psoc : psoc object
|
||||
* @arg: argument passed to lmac
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS target_if_ocb_unregister_event_handler(struct wlan_objmgr_psoc *psoc,
|
||||
void *arg);
|
||||
/**
|
||||
* target_if_ocb_register_tx_ops() - lmac handler to register ocb tx ops
|
||||
* callback functions
|
||||
* @tx_ops: ocb tx operations
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS target_if_ocb_register_tx_ops(
|
||||
struct wlan_ocb_tx_ops *tx_ops);
|
||||
|
||||
#endif
|
@@ -1,703 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2018, 2020 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: offload lmac interface APIs for ocb
|
||||
*
|
||||
*/
|
||||
|
||||
#include <qdf_mem.h>
|
||||
#include <target_if.h>
|
||||
#include <qdf_status.h>
|
||||
#include <wmi_unified_api.h>
|
||||
#include <wmi_unified_priv.h>
|
||||
#include <wmi_unified_param.h>
|
||||
#include <wlan_objmgr_psoc_obj.h>
|
||||
#include <wlan_utility.h>
|
||||
#include <wlan_defs.h>
|
||||
#include <wlan_ocb_public_structs.h>
|
||||
#include <wlan_ocb_main.h>
|
||||
#include <target_if_ocb.h>
|
||||
|
||||
/**
|
||||
* target_if_ocb_get_rx_ops() - get target interface RX operations
|
||||
* @pdev: pdev handle
|
||||
*
|
||||
* Return: fp to target interface RX operations
|
||||
*/
|
||||
static inline struct wlan_ocb_rx_ops *
|
||||
target_if_ocb_get_rx_ops(struct wlan_objmgr_pdev *pdev)
|
||||
{
|
||||
struct ocb_pdev_obj *ocb_obj;
|
||||
|
||||
ocb_obj = wlan_get_pdev_ocb_obj(pdev);
|
||||
|
||||
return &ocb_obj->ocb_rxops;
|
||||
}
|
||||
|
||||
/**
|
||||
* target_if_ocb_set_config() - send the OCB config to the FW
|
||||
* @psoc: pointer to PSOC object
|
||||
* @config: OCB channel configuration
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS on success
|
||||
*/
|
||||
static QDF_STATUS target_if_ocb_set_config(struct wlan_objmgr_psoc *psoc,
|
||||
struct ocb_config *config)
|
||||
{
|
||||
QDF_STATUS status;
|
||||
|
||||
status = wmi_unified_ocb_set_config(get_wmi_unified_hdl_from_psoc(psoc),
|
||||
config);
|
||||
if (status)
|
||||
target_if_err("Failed to set OCB config %d", status);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* target_if_ocb_set_utc_time() - send the UTC time to the firmware
|
||||
* @psoc: pointer to PSOC object
|
||||
* @utc: pointer to the UTC time structure
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS on success
|
||||
*/
|
||||
static QDF_STATUS target_if_ocb_set_utc_time(struct wlan_objmgr_psoc *psoc,
|
||||
struct ocb_utc_param *utc)
|
||||
{
|
||||
QDF_STATUS status;
|
||||
|
||||
status = wmi_unified_ocb_set_utc_time_cmd(
|
||||
get_wmi_unified_hdl_from_psoc(psoc), utc);
|
||||
if (status)
|
||||
target_if_err("Failed to set OCB UTC time %d", status);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* target_if_ocb_start_timing_advert() - start sending the timing
|
||||
* advertisement frame on a channel
|
||||
* @psoc: pointer to PSOC object
|
||||
* @ta: pointer to the timing advertisement
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS on success
|
||||
*/
|
||||
static QDF_STATUS
|
||||
target_if_ocb_start_timing_advert(struct wlan_objmgr_psoc *psoc,
|
||||
struct ocb_timing_advert_param *ta)
|
||||
{
|
||||
QDF_STATUS status;
|
||||
|
||||
status = wmi_unified_ocb_start_timing_advert(
|
||||
get_wmi_unified_hdl_from_psoc(psoc), ta);
|
||||
if (status)
|
||||
target_if_err("Failed to start OCB timing advert %d", status);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* target_if_ocb_stop_timing_advert() - stop sending the timing
|
||||
* advertisement frame on a channel
|
||||
* @psoc: pointer to PSOC object
|
||||
* @ta: pointer to the timing advertisement
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS on success
|
||||
*/
|
||||
static QDF_STATUS
|
||||
target_if_ocb_stop_timing_advert(struct wlan_objmgr_psoc *psoc,
|
||||
struct ocb_timing_advert_param *ta)
|
||||
{
|
||||
QDF_STATUS status;
|
||||
|
||||
status =
|
||||
wmi_unified_ocb_stop_timing_advert(
|
||||
get_wmi_unified_hdl_from_psoc(psoc), ta);
|
||||
if (status)
|
||||
target_if_err("Failed to stop OCB timing advert %d", status);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* target_if_ocb_get_tsf_timer() - get tsf timer
|
||||
* @psoc: pointer to PSOC object
|
||||
* @request: pointer to the request
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS on success
|
||||
*/
|
||||
static QDF_STATUS
|
||||
target_if_ocb_get_tsf_timer(struct wlan_objmgr_psoc *psoc,
|
||||
struct ocb_get_tsf_timer_param *request)
|
||||
{
|
||||
QDF_STATUS status;
|
||||
|
||||
status = wmi_unified_ocb_get_tsf_timer(
|
||||
get_wmi_unified_hdl_from_psoc(psoc), request);
|
||||
if (status)
|
||||
target_if_err("Failed to send get tsf timer cmd: %d", status);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* target_if_dcc_get_stats() - get the DCC channel stats
|
||||
* @psoc: pointer to PSOC object
|
||||
* @get_stats_param: pointer to the dcc stats request
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS on success
|
||||
*/
|
||||
static QDF_STATUS
|
||||
target_if_dcc_get_stats(struct wlan_objmgr_psoc *psoc,
|
||||
struct ocb_dcc_get_stats_param *get_stats_param)
|
||||
{
|
||||
QDF_STATUS status;
|
||||
|
||||
status = wmi_unified_dcc_get_stats_cmd(
|
||||
get_wmi_unified_hdl_from_psoc(psoc), get_stats_param);
|
||||
if (status)
|
||||
target_if_err("Failed to send get DCC stats cmd: %d", status);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* target_if_dcc_clear_stats() - send command to clear the DCC stats
|
||||
* @psoc: pointer to PSOC object
|
||||
* @clear_stats_param: parameters to the command
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS on success
|
||||
*/
|
||||
static QDF_STATUS
|
||||
target_if_dcc_clear_stats(struct wlan_objmgr_psoc *psoc,
|
||||
struct ocb_dcc_clear_stats_param *clear_stats_param)
|
||||
{
|
||||
QDF_STATUS status;
|
||||
|
||||
status = wmi_unified_dcc_clear_stats(
|
||||
get_wmi_unified_hdl_from_psoc(psoc), clear_stats_param);
|
||||
if (status)
|
||||
target_if_err("Failed to send clear DCC stats cmd: %d", status);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* target_if_dcc_update_ndl() - command to update the NDL data
|
||||
* @psoc: pointer to PSOC object
|
||||
* @update_ndl_param: pointer to the request parameters
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS on success
|
||||
*/
|
||||
static QDF_STATUS
|
||||
target_if_dcc_update_ndl(struct wlan_objmgr_psoc *psoc,
|
||||
struct ocb_dcc_update_ndl_param *update_ndl_param)
|
||||
{
|
||||
QDF_STATUS status;
|
||||
|
||||
/* Send the WMI command */
|
||||
status = wmi_unified_dcc_update_ndl(get_wmi_unified_hdl_from_psoc(psoc),
|
||||
update_ndl_param);
|
||||
if (status)
|
||||
target_if_err("Failed to send NDL update cmd: %d", status);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* target_if_ocb_set_config_resp() - handler for channel config response
|
||||
* @scn: scn handle
|
||||
* @event_buf: pointer to the event buffer
|
||||
* @len: length of the buffer
|
||||
*
|
||||
* Return: 0 on success
|
||||
*/
|
||||
static int
|
||||
target_if_ocb_set_config_resp(ol_scn_t scn, uint8_t *event_buf,
|
||||
uint32_t len)
|
||||
{
|
||||
int rc;
|
||||
QDF_STATUS status;
|
||||
uint32_t resp;
|
||||
struct wlan_objmgr_pdev *pdev;
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
struct wlan_ocb_rx_ops *ocb_rx_ops;
|
||||
|
||||
target_if_debug("scn:%pK, data:%pK, datalen:%d",
|
||||
scn, event_buf, len);
|
||||
if (!scn || !event_buf) {
|
||||
target_if_err("scn: 0x%pK, data: 0x%pK", scn, event_buf);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
psoc = target_if_get_psoc_from_scn_hdl(scn);
|
||||
if (!psoc) {
|
||||
target_if_err("null psoc");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
pdev = wlan_objmgr_get_pdev_by_id(psoc, 0,
|
||||
WLAN_OCB_SB_ID);
|
||||
if (!pdev) {
|
||||
target_if_err("pdev is NULL");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
ocb_rx_ops = target_if_ocb_get_rx_ops(pdev);
|
||||
if (ocb_rx_ops->ocb_set_config_status) {
|
||||
status = wmi_extract_ocb_set_channel_config_resp(
|
||||
get_wmi_unified_hdl_from_psoc(psoc),
|
||||
event_buf, &resp);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
target_if_err("Failed to extract config status");
|
||||
rc = -EINVAL;
|
||||
goto exit;
|
||||
}
|
||||
status = ocb_rx_ops->ocb_set_config_status(psoc, resp);
|
||||
if (status != QDF_STATUS_SUCCESS) {
|
||||
target_if_err("ocb_set_config_status failed.");
|
||||
rc = -EINVAL;
|
||||
goto exit;
|
||||
}
|
||||
rc = 0;
|
||||
} else {
|
||||
target_if_fatal("No ocb_set_config_status callback");
|
||||
rc = -EINVAL;
|
||||
}
|
||||
exit:
|
||||
wlan_objmgr_pdev_release_ref(pdev, WLAN_OCB_SB_ID);
|
||||
|
||||
return rc;
|
||||
};
|
||||
|
||||
/**
|
||||
* target_if_ocb_get_tsf_timer_resp() - handler for TSF timer response
|
||||
* @scn: scn handle
|
||||
* @event_buf: pointer to the event buffer
|
||||
* @len: length of the buffer
|
||||
*
|
||||
* Return: 0 on success
|
||||
*/
|
||||
static int target_if_ocb_get_tsf_timer_resp(ol_scn_t scn,
|
||||
uint8_t *event_buf,
|
||||
uint32_t len)
|
||||
{
|
||||
int rc;
|
||||
QDF_STATUS status;
|
||||
struct wlan_objmgr_pdev *pdev;
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
struct ocb_get_tsf_timer_response response;
|
||||
struct wlan_ocb_rx_ops *ocb_rx_ops;
|
||||
|
||||
target_if_debug("scn:%pK, data:%pK, datalen:%d",
|
||||
scn, event_buf, len);
|
||||
|
||||
if (!scn || !event_buf) {
|
||||
target_if_err("scn: 0x%pK, data: 0x%pK", scn, event_buf);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
psoc = target_if_get_psoc_from_scn_hdl(scn);
|
||||
if (!psoc) {
|
||||
target_if_err("null psoc");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
pdev = wlan_objmgr_get_pdev_by_id(psoc, 0,
|
||||
WLAN_OCB_SB_ID);
|
||||
if (!pdev) {
|
||||
target_if_err("pdev is NULL");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
ocb_rx_ops = target_if_ocb_get_rx_ops(pdev);
|
||||
if (ocb_rx_ops->ocb_tsf_timer) {
|
||||
status = wmi_extract_ocb_tsf_timer(
|
||||
get_wmi_unified_hdl_from_psoc(psoc),
|
||||
event_buf, &response);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
target_if_err("Failed to extract tsf timer");
|
||||
rc = -EINVAL;
|
||||
goto exit;
|
||||
}
|
||||
status = ocb_rx_ops->ocb_tsf_timer(psoc, &response);
|
||||
if (status != QDF_STATUS_SUCCESS) {
|
||||
target_if_err("ocb_tsf_timer failed.");
|
||||
rc = -EINVAL;
|
||||
goto exit;
|
||||
}
|
||||
rc = 0;
|
||||
} else {
|
||||
target_if_fatal("No ocb_tsf_timer callback");
|
||||
rc = -EINVAL;
|
||||
}
|
||||
exit:
|
||||
wlan_objmgr_pdev_release_ref(pdev, WLAN_OCB_SB_ID);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
/**
|
||||
* target_if_dcc_update_ndl_resp() - handler for update NDL response
|
||||
* @scn: scn handle
|
||||
* @event_buf: pointer to the event buffer
|
||||
* @len: length of the buffer
|
||||
*
|
||||
* Return: 0 on success
|
||||
*/
|
||||
static int target_if_dcc_update_ndl_resp(ol_scn_t scn,
|
||||
uint8_t *event_buf,
|
||||
uint32_t len)
|
||||
{
|
||||
int rc;
|
||||
QDF_STATUS status;
|
||||
struct wlan_objmgr_pdev *pdev;
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
struct ocb_dcc_update_ndl_response *resp;
|
||||
struct wlan_ocb_rx_ops *ocb_rx_ops;
|
||||
|
||||
target_if_debug("scn:%pK, data:%pK, datalen:%d",
|
||||
scn, event_buf, len);
|
||||
|
||||
if (!scn || !event_buf) {
|
||||
target_if_err("scn: 0x%pK, data: 0x%pK", scn, event_buf);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
psoc = target_if_get_psoc_from_scn_hdl(scn);
|
||||
if (!psoc) {
|
||||
target_if_err("null psoc");
|
||||
return -EINVAL;
|
||||
}
|
||||
pdev = wlan_objmgr_get_pdev_by_id(psoc, 0,
|
||||
WLAN_OCB_SB_ID);
|
||||
if (!pdev) {
|
||||
target_if_err("pdev is NULL");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* Allocate and populate the response */
|
||||
resp = qdf_mem_malloc(sizeof(*resp));
|
||||
if (!resp) {
|
||||
rc = -ENOMEM;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
ocb_rx_ops = target_if_ocb_get_rx_ops(pdev);
|
||||
if (ocb_rx_ops->ocb_dcc_ndl_update) {
|
||||
status = wmi_extract_dcc_update_ndl_resp(
|
||||
get_wmi_unified_hdl_from_psoc(psoc),
|
||||
event_buf, resp);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
target_if_err("Failed to extract ndl status");
|
||||
rc = -EINVAL;
|
||||
goto exit;
|
||||
}
|
||||
status = ocb_rx_ops->ocb_dcc_ndl_update(psoc, resp);
|
||||
if (status != QDF_STATUS_SUCCESS) {
|
||||
target_if_err("dcc_ndl_update failed.");
|
||||
rc = -EINVAL;
|
||||
goto exit;
|
||||
}
|
||||
rc = 0;
|
||||
} else {
|
||||
target_if_fatal("No dcc_ndl_update callback");
|
||||
rc = -EINVAL;
|
||||
}
|
||||
exit:
|
||||
wlan_objmgr_pdev_release_ref(pdev, WLAN_OCB_SB_ID);
|
||||
if (resp)
|
||||
qdf_mem_free(resp);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
/**
|
||||
* target_if_dcc_get_stats_resp() - handler for get stats response
|
||||
* @scn: scn handle
|
||||
* @event_buf: pointer to the event buffer
|
||||
* @len: length of the buffer
|
||||
*
|
||||
* Return: 0 on success
|
||||
*/
|
||||
static int target_if_dcc_get_stats_resp(ol_scn_t scn,
|
||||
uint8_t *event_buf,
|
||||
uint32_t len)
|
||||
{
|
||||
int rc;
|
||||
QDF_STATUS status;
|
||||
struct wlan_objmgr_pdev *pdev;
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
struct ocb_dcc_get_stats_response *response;
|
||||
struct wlan_ocb_rx_ops *ocb_rx_ops;
|
||||
|
||||
target_if_debug("scn:%pK, data:%pK, datalen:%d",
|
||||
scn, event_buf, len);
|
||||
|
||||
if (!scn || !event_buf) {
|
||||
target_if_err("scn: 0x%pK, data: 0x%pK", scn, event_buf);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
psoc = target_if_get_psoc_from_scn_hdl(scn);
|
||||
if (!psoc) {
|
||||
target_if_err("null psoc");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
pdev = wlan_objmgr_get_pdev_by_id(psoc, 0,
|
||||
WLAN_OCB_SB_ID);
|
||||
if (!pdev) {
|
||||
target_if_err("pdev is NULL");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
ocb_rx_ops = target_if_ocb_get_rx_ops(pdev);
|
||||
if (ocb_rx_ops->ocb_dcc_stats_indicate) {
|
||||
status = wmi_extract_dcc_stats(
|
||||
get_wmi_unified_hdl_from_psoc(psoc),
|
||||
event_buf, &response);
|
||||
if (!response || QDF_IS_STATUS_ERROR(status)) {
|
||||
target_if_err("Cannot get DCC stats");
|
||||
rc = -ENOMEM;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
status = ocb_rx_ops->ocb_dcc_stats_indicate(psoc,
|
||||
response,
|
||||
true);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
target_if_err("dcc_stats_indicate failed.");
|
||||
rc = -EINVAL;
|
||||
goto exit;
|
||||
}
|
||||
rc = 0;
|
||||
} else {
|
||||
target_if_fatal("No dcc_stats_indicate callback");
|
||||
rc = -EINVAL;
|
||||
}
|
||||
exit:
|
||||
wlan_objmgr_pdev_release_ref(pdev, WLAN_OCB_SB_ID);
|
||||
if (response)
|
||||
qdf_mem_free(response);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
/**
|
||||
* target_if_dcc_stats_resp() - handler for DCC stats indication event
|
||||
* @scn: scn handle
|
||||
* @event_buf: pointer to the event buffer
|
||||
* @len: length of the buffer
|
||||
*
|
||||
* Return: 0 on success
|
||||
*/
|
||||
static int target_if_dcc_stats_resp(ol_scn_t scn, uint8_t *event_buf,
|
||||
uint32_t len)
|
||||
{
|
||||
int rc;
|
||||
QDF_STATUS status;
|
||||
struct wlan_objmgr_pdev *pdev;
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
struct ocb_dcc_get_stats_response *response;
|
||||
struct wlan_ocb_rx_ops *ocb_rx_ops;
|
||||
|
||||
target_if_debug("scn:%pK, data:%pK, datalen:%d",
|
||||
scn, event_buf, len);
|
||||
|
||||
if (!scn || !event_buf) {
|
||||
target_if_err("scn: 0x%pK, data: 0x%pK", scn, event_buf);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
psoc = target_if_get_psoc_from_scn_hdl(scn);
|
||||
if (!psoc) {
|
||||
target_if_err("null psoc");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
pdev = wlan_objmgr_get_pdev_by_id(psoc, 0,
|
||||
WLAN_OCB_SB_ID);
|
||||
if (!pdev) {
|
||||
target_if_err("pdev is NULL");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
ocb_rx_ops = target_if_ocb_get_rx_ops(pdev);
|
||||
if (ocb_rx_ops->ocb_dcc_stats_indicate) {
|
||||
status = wmi_extract_dcc_stats(
|
||||
get_wmi_unified_hdl_from_psoc(psoc),
|
||||
event_buf, &response);
|
||||
if (!response || QDF_IS_STATUS_ERROR(status)) {
|
||||
target_if_err("Cannot get DCC stats");
|
||||
rc = -ENOMEM;
|
||||
goto exit;
|
||||
}
|
||||
status = ocb_rx_ops->ocb_dcc_stats_indicate(psoc,
|
||||
response,
|
||||
false);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
target_if_err("dcc_stats_indicate failed.");
|
||||
rc = -EINVAL;
|
||||
goto exit;
|
||||
}
|
||||
rc = 0;
|
||||
} else {
|
||||
target_if_fatal("dcc_stats_indicate failed.");
|
||||
response = NULL;
|
||||
rc = -EINVAL;
|
||||
}
|
||||
exit:
|
||||
wlan_objmgr_pdev_release_ref(pdev, WLAN_OCB_SB_ID);
|
||||
if (response)
|
||||
qdf_mem_free(response);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
QDF_STATUS target_if_ocb_register_event_handler(struct wlan_objmgr_psoc *psoc,
|
||||
void *arg)
|
||||
{
|
||||
QDF_STATUS rc;
|
||||
|
||||
/* Initialize the members in WMA used by wma_ocb */
|
||||
rc = wmi_unified_register_event(get_wmi_unified_hdl_from_psoc(psoc),
|
||||
wmi_ocb_set_config_resp_event_id,
|
||||
target_if_ocb_set_config_resp);
|
||||
if (QDF_IS_STATUS_ERROR(rc)) {
|
||||
target_if_err("Failed to register OCB config resp event cb");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
rc = wmi_unified_register_event(
|
||||
get_wmi_unified_hdl_from_psoc(psoc),
|
||||
wmi_ocb_get_tsf_timer_resp_event_id,
|
||||
target_if_ocb_get_tsf_timer_resp);
|
||||
if (QDF_IS_STATUS_ERROR(rc)) {
|
||||
target_if_err("Failed to register OCB TSF resp event cb");
|
||||
goto unreg_set_config;
|
||||
}
|
||||
|
||||
rc = wmi_unified_register_event(
|
||||
get_wmi_unified_hdl_from_psoc(psoc),
|
||||
wmi_dcc_get_stats_resp_event_id,
|
||||
target_if_dcc_get_stats_resp);
|
||||
if (QDF_IS_STATUS_ERROR(rc)) {
|
||||
target_if_err("Failed to register DCC get stats resp event cb");
|
||||
goto unreg_tsf_timer;
|
||||
}
|
||||
|
||||
rc = wmi_unified_register_event(
|
||||
get_wmi_unified_hdl_from_psoc(psoc),
|
||||
wmi_dcc_update_ndl_resp_event_id,
|
||||
target_if_dcc_update_ndl_resp);
|
||||
if (QDF_IS_STATUS_ERROR(rc)) {
|
||||
target_if_err("Failed to register NDL update event cb");
|
||||
goto unreg_get_stats;
|
||||
}
|
||||
|
||||
rc = wmi_unified_register_event(get_wmi_unified_hdl_from_psoc(psoc),
|
||||
wmi_dcc_stats_event_id,
|
||||
target_if_dcc_stats_resp);
|
||||
if (QDF_IS_STATUS_ERROR(rc)) {
|
||||
target_if_err("Failed to register DCC stats event cb");
|
||||
goto unreg_ndl;
|
||||
}
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
|
||||
unreg_ndl:
|
||||
wmi_unified_unregister_event_handler(
|
||||
get_wmi_unified_hdl_from_psoc(psoc),
|
||||
wmi_dcc_update_ndl_resp_event_id);
|
||||
unreg_get_stats:
|
||||
wmi_unified_unregister_event_handler(
|
||||
get_wmi_unified_hdl_from_psoc(psoc),
|
||||
wmi_dcc_get_stats_resp_event_id);
|
||||
unreg_tsf_timer:
|
||||
wmi_unified_unregister_event_handler(
|
||||
get_wmi_unified_hdl_from_psoc(psoc),
|
||||
wmi_ocb_get_tsf_timer_resp_event_id);
|
||||
unreg_set_config:
|
||||
wmi_unified_unregister_event(get_wmi_unified_hdl_from_psoc(psoc),
|
||||
wmi_ocb_set_config_resp_event_id);
|
||||
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
target_if_ocb_unregister_event_handler(struct wlan_objmgr_psoc *psoc,
|
||||
void *arg)
|
||||
{
|
||||
QDF_STATUS rc;
|
||||
|
||||
rc = wmi_unified_unregister_event_handler(
|
||||
get_wmi_unified_hdl_from_psoc(psoc),
|
||||
wmi_dcc_stats_event_id);
|
||||
|
||||
if (QDF_IS_STATUS_ERROR(rc))
|
||||
target_if_err("Failed to unregister DCC stats event cb");
|
||||
|
||||
rc = wmi_unified_unregister_event_handler(
|
||||
get_wmi_unified_hdl_from_psoc(psoc),
|
||||
wmi_dcc_update_ndl_resp_event_id);
|
||||
|
||||
if (QDF_IS_STATUS_ERROR(rc))
|
||||
target_if_err("Failed to unregister NDL update event cb");
|
||||
|
||||
rc = wmi_unified_unregister_event_handler(
|
||||
get_wmi_unified_hdl_from_psoc(psoc),
|
||||
wmi_dcc_get_stats_resp_event_id);
|
||||
|
||||
if (QDF_IS_STATUS_ERROR(rc))
|
||||
target_if_err("Failed to unregister DCC get stats resp cb");
|
||||
|
||||
rc = wmi_unified_unregister_event_handler(
|
||||
get_wmi_unified_hdl_from_psoc(psoc),
|
||||
wmi_ocb_get_tsf_timer_resp_event_id);
|
||||
|
||||
if (QDF_IS_STATUS_ERROR(rc))
|
||||
target_if_err("Failed to unregister OCB TSF resp event cb");
|
||||
|
||||
rc = wmi_unified_unregister_event(get_wmi_unified_hdl_from_psoc(psoc),
|
||||
wmi_ocb_set_config_resp_event_id);
|
||||
|
||||
if (QDF_IS_STATUS_ERROR(rc))
|
||||
target_if_err("Failed to unregister OCB config resp event cb");
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
target_if_ocb_register_tx_ops(struct wlan_ocb_tx_ops *ocb_txops)
|
||||
{
|
||||
ocb_txops->ocb_set_config = target_if_ocb_set_config;
|
||||
ocb_txops->ocb_set_utc_time = target_if_ocb_set_utc_time;
|
||||
ocb_txops->ocb_start_timing_advert = target_if_ocb_start_timing_advert;
|
||||
ocb_txops->ocb_stop_timing_advert = target_if_ocb_stop_timing_advert;
|
||||
ocb_txops->ocb_get_tsf_timer = target_if_ocb_get_tsf_timer;
|
||||
ocb_txops->ocb_dcc_get_stats = target_if_dcc_get_stats;
|
||||
ocb_txops->ocb_dcc_clear_stats = target_if_dcc_clear_stats;
|
||||
ocb_txops->ocb_dcc_update_ndl = target_if_dcc_update_ndl;
|
||||
ocb_txops->ocb_reg_ev_handler = target_if_ocb_register_event_handler;
|
||||
ocb_txops->ocb_unreg_ev_handler =
|
||||
target_if_ocb_unregister_event_handler;
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
@@ -1,140 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2017-2018 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: offload lmac interface APIs for P2P
|
||||
*/
|
||||
|
||||
#ifndef _TARGET_IF_P2P_H_
|
||||
#define _TARGET_IF_P2P_H_
|
||||
|
||||
#include <qdf_types.h>
|
||||
|
||||
struct wlan_objmgr_psoc;
|
||||
struct p2p_ps_config;
|
||||
struct p2p_lo_start;
|
||||
|
||||
#ifdef FEATURE_P2P_LISTEN_OFFLOAD
|
||||
|
||||
/**
|
||||
* target_if_p2p_register_lo_event_handler() - Register lo event handler
|
||||
* @psoc: soc object
|
||||
* @arg: additional argument
|
||||
*
|
||||
* Target interface API to register P2P listen offload event handler.
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS - in case of success
|
||||
*/
|
||||
QDF_STATUS target_if_p2p_register_lo_event_handler(
|
||||
struct wlan_objmgr_psoc *psoc, void *arg);
|
||||
|
||||
/**
|
||||
* target_if_p2p_unregister_lo_event_handler() - Unregister lo event handler
|
||||
* @psoc: soc object
|
||||
* @arg: additional argument
|
||||
*
|
||||
* Target interface API to unregister P2P listen offload event handler.
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS - in case of success
|
||||
*/
|
||||
QDF_STATUS target_if_p2p_unregister_lo_event_handler(
|
||||
struct wlan_objmgr_psoc *psoc, void *arg);
|
||||
|
||||
/**
|
||||
* target_if_p2p_lo_start() - Start listen offload
|
||||
* @psoc: soc object
|
||||
* @lo_start: lo start information
|
||||
*
|
||||
* Target interface API to start listen offload.
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS - in case of success
|
||||
*/
|
||||
QDF_STATUS target_if_p2p_lo_start(struct wlan_objmgr_psoc *psoc,
|
||||
struct p2p_lo_start *lo_start);
|
||||
|
||||
/**
|
||||
* target_if_p2p_lo_stop() - Stop listen offload
|
||||
* @psoc: soc object
|
||||
* @vdev_id: vdev id
|
||||
*
|
||||
* Target interface API to stop listen offload.
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS - in case of success
|
||||
*/
|
||||
QDF_STATUS target_if_p2p_lo_stop(struct wlan_objmgr_psoc *psoc,
|
||||
uint32_t vdev_id);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* target_if_p2p_register_tx_ops() - Register P2P component TX OPS
|
||||
* @tx_ops: lmac if transmit ops
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
void target_if_p2p_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops);
|
||||
|
||||
/**
|
||||
* target_if_p2p_register_noa_event_handler() - Register noa event handler
|
||||
* @psoc: soc object
|
||||
* @arg: additional argument
|
||||
*
|
||||
* Target interface API to register P2P noa event handler.
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS - in case of success
|
||||
*/
|
||||
QDF_STATUS target_if_p2p_register_noa_event_handler(
|
||||
struct wlan_objmgr_psoc *psoc, void *arg);
|
||||
|
||||
/**
|
||||
* target_if_p2p_unregister_noa_event_handler() - Unregister noa event handler
|
||||
* @psoc: soc object
|
||||
* @arg: additional argument
|
||||
*
|
||||
* Target interface API to unregister P2P listen offload event handler.
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS - in case of success
|
||||
*/
|
||||
QDF_STATUS target_if_p2p_unregister_noa_event_handler(
|
||||
struct wlan_objmgr_psoc *psoc, void *arg);
|
||||
|
||||
/**
|
||||
* target_if_p2p_set_ps() - Set power save
|
||||
* @psoc: soc object
|
||||
* @arg: additional argument
|
||||
*
|
||||
* Target interface API to set power save.
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS - in case of success
|
||||
*/
|
||||
QDF_STATUS target_if_p2p_set_ps(struct wlan_objmgr_psoc *psoc,
|
||||
struct p2p_ps_config *ps_config);
|
||||
|
||||
/**
|
||||
* target_if_p2p_set_noa() - Disable / Enable NOA
|
||||
* @psoc: soc object
|
||||
* @vdev_id: vdev id
|
||||
* @disable_noa: TRUE - Disable NoA, FALSE - Enable NoA
|
||||
*
|
||||
* Target interface API to Disable / Enable P2P NOA.
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS - in case of success
|
||||
*/
|
||||
QDF_STATUS target_if_p2p_set_noa(struct wlan_objmgr_psoc *psoc,
|
||||
uint32_t vdev_id, bool disable_noa);
|
||||
|
||||
#endif /* _TARGET_IF_P2P_H_ */
|
@@ -1,479 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2017-2020 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: offload lmac interface APIs definitions for P2P
|
||||
*/
|
||||
|
||||
#include <wmi_unified_api.h>
|
||||
#include <wlan_p2p_public_struct.h>
|
||||
#include "target_if.h"
|
||||
#include "target_if_p2p.h"
|
||||
#include "init_deinit_lmac.h"
|
||||
|
||||
static inline struct wlan_lmac_if_p2p_rx_ops *
|
||||
target_if_psoc_get_p2p_rx_ops(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
return &(psoc->soc_cb.rx_ops->p2p);
|
||||
}
|
||||
|
||||
#ifdef FEATURE_P2P_LISTEN_OFFLOAD
|
||||
static inline void
|
||||
target_if_p2p_lo_register_tx_ops(struct wlan_lmac_if_p2p_tx_ops *p2p_tx_ops)
|
||||
{
|
||||
p2p_tx_ops->lo_start = target_if_p2p_lo_start;
|
||||
p2p_tx_ops->lo_stop = target_if_p2p_lo_stop;
|
||||
p2p_tx_ops->reg_lo_ev_handler =
|
||||
target_if_p2p_register_lo_event_handler;
|
||||
p2p_tx_ops->unreg_lo_ev_handler =
|
||||
target_if_p2p_unregister_lo_event_handler;
|
||||
}
|
||||
|
||||
/**
|
||||
* target_p2p_lo_event_handler() - WMI callback for lo stop event
|
||||
* @scn: pointer to scn
|
||||
* @event_buf: event buffer
|
||||
* @len: buffer length
|
||||
*
|
||||
* This function gets called from WMI when triggered wmi event
|
||||
* wmi_p2p_lo_stop_event_id.
|
||||
*
|
||||
* Return: 0 - success
|
||||
* others - failure
|
||||
*/
|
||||
static int target_p2p_lo_event_handler(ol_scn_t scn, uint8_t *data,
|
||||
uint32_t datalen)
|
||||
{
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
struct wmi_unified *wmi_handle;
|
||||
struct p2p_lo_event *event_info;
|
||||
struct wlan_lmac_if_p2p_rx_ops *p2p_rx_ops;
|
||||
QDF_STATUS status = QDF_STATUS_E_FAILURE;
|
||||
|
||||
target_if_debug("scn:%pK, data:%pK, datalen:%d", scn, data, datalen);
|
||||
|
||||
if (!scn || !data) {
|
||||
target_if_err("scn: 0x%pK, data: 0x%pK", scn, data);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
psoc = target_if_get_psoc_from_scn_hdl(scn);
|
||||
if (!psoc) {
|
||||
target_if_err("null psoc");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("null wmi handle");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
event_info = qdf_mem_malloc(sizeof(*event_info));
|
||||
if (!event_info)
|
||||
return -ENOMEM;
|
||||
|
||||
if (wmi_extract_p2p_lo_stop_ev_param(wmi_handle, data,
|
||||
event_info)) {
|
||||
target_if_err("Failed to extract wmi p2p lo stop event");
|
||||
qdf_mem_free(event_info);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
p2p_rx_ops = target_if_psoc_get_p2p_rx_ops(psoc);
|
||||
if (p2p_rx_ops->lo_ev_handler) {
|
||||
status = p2p_rx_ops->lo_ev_handler(psoc, event_info);
|
||||
target_if_debug("call lo event handler, status:%d",
|
||||
status);
|
||||
} else {
|
||||
qdf_mem_free(event_info);
|
||||
target_if_debug("no valid lo event handler");
|
||||
}
|
||||
|
||||
return qdf_status_to_os_return(status);
|
||||
}
|
||||
|
||||
QDF_STATUS target_if_p2p_register_lo_event_handler(
|
||||
struct wlan_objmgr_psoc *psoc, void *arg)
|
||||
{
|
||||
QDF_STATUS status;
|
||||
wmi_unified_t wmi_handle = lmac_get_wmi_unified_hdl(psoc);
|
||||
|
||||
target_if_debug("psoc:%pK, arg:%pK", psoc, arg);
|
||||
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi handle");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
status = wmi_unified_register_event(wmi_handle,
|
||||
wmi_p2p_lo_stop_event_id,
|
||||
target_p2p_lo_event_handler);
|
||||
|
||||
target_if_debug("wmi register lo event handle, status:%d", status);
|
||||
|
||||
if (QDF_IS_STATUS_ERROR(status))
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
else
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
QDF_STATUS target_if_p2p_unregister_lo_event_handler(
|
||||
struct wlan_objmgr_psoc *psoc, void *arg)
|
||||
{
|
||||
QDF_STATUS status;
|
||||
wmi_unified_t wmi_handle = lmac_get_wmi_unified_hdl(psoc);
|
||||
|
||||
target_if_debug("psoc:%pK, arg:%pK", psoc, arg);
|
||||
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi handle");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
status = wmi_unified_unregister_event(wmi_handle,
|
||||
wmi_p2p_lo_stop_event_id);
|
||||
|
||||
target_if_debug("wmi unregister lo event handle, status:%d", status);
|
||||
|
||||
if (QDF_IS_STATUS_ERROR(status))
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
else
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
QDF_STATUS target_if_p2p_lo_start(struct wlan_objmgr_psoc *psoc,
|
||||
struct p2p_lo_start *lo_start)
|
||||
{
|
||||
wmi_unified_t wmi_handle = lmac_get_wmi_unified_hdl(psoc);
|
||||
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi handle");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
if (!lo_start) {
|
||||
target_if_err("lo start parameters is null");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
target_if_debug("psoc:%pK, vdev_id:%d", psoc, lo_start->vdev_id);
|
||||
|
||||
return wmi_unified_p2p_lo_start_cmd(wmi_handle, lo_start);
|
||||
}
|
||||
|
||||
QDF_STATUS target_if_p2p_lo_stop(struct wlan_objmgr_psoc *psoc,
|
||||
uint32_t vdev_id)
|
||||
{
|
||||
wmi_unified_t wmi_handle = lmac_get_wmi_unified_hdl(psoc);
|
||||
|
||||
target_if_debug("psoc:%pK, vdev_id:%d", psoc, vdev_id);
|
||||
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi handle");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
return wmi_unified_p2p_lo_stop_cmd(wmi_handle,
|
||||
(uint8_t)vdev_id);
|
||||
}
|
||||
#else
|
||||
static inline void
|
||||
target_if_p2p_lo_register_tx_ops(struct wlan_lmac_if_p2p_tx_ops *p2p_tx_ops)
|
||||
{
|
||||
}
|
||||
#endif /* FEATURE_P2P_LISTEN_OFFLOAD */
|
||||
|
||||
/**
|
||||
* target_p2p_noa_event_handler() - WMI callback for noa event
|
||||
* @scn: pointer to scn
|
||||
* @event_buf: event buffer
|
||||
* @len: buffer length
|
||||
*
|
||||
* This function gets called from WMI when triggered WMI event
|
||||
* wmi_p2p_noa_event_id.
|
||||
*
|
||||
* Return: 0 - success
|
||||
* others - failure
|
||||
*/
|
||||
static int target_p2p_noa_event_handler(ol_scn_t scn, uint8_t *data,
|
||||
uint32_t datalen)
|
||||
{
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
struct wmi_unified *wmi_handle;
|
||||
struct p2p_noa_info *event_info;
|
||||
struct wlan_lmac_if_p2p_rx_ops *p2p_rx_ops;
|
||||
QDF_STATUS status = QDF_STATUS_E_FAILURE;
|
||||
|
||||
target_if_debug("scn:%pK, data:%pK, datalen:%d", scn, data, datalen);
|
||||
|
||||
if (!scn || !data) {
|
||||
target_if_err("scn: 0x%pK, data: 0x%pK", scn, data);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
psoc = target_if_get_psoc_from_scn_hdl(scn);
|
||||
if (!psoc) {
|
||||
target_if_err("null psoc");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("null wmi handle");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
event_info = qdf_mem_malloc(sizeof(*event_info));
|
||||
if (!event_info)
|
||||
return -ENOMEM;
|
||||
|
||||
if (wmi_extract_p2p_noa_ev_param(wmi_handle, data,
|
||||
event_info)) {
|
||||
target_if_err("failed to extract wmi p2p noa event");
|
||||
qdf_mem_free(event_info);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
p2p_rx_ops = target_if_psoc_get_p2p_rx_ops(psoc);
|
||||
if (p2p_rx_ops->noa_ev_handler) {
|
||||
status = p2p_rx_ops->noa_ev_handler(psoc, event_info);
|
||||
target_if_debug("call noa event handler, status:%d",
|
||||
status);
|
||||
} else {
|
||||
qdf_mem_free(event_info);
|
||||
target_if_debug("no valid noa event handler");
|
||||
}
|
||||
|
||||
return qdf_status_to_os_return(status);
|
||||
}
|
||||
|
||||
QDF_STATUS target_if_p2p_register_noa_event_handler(
|
||||
struct wlan_objmgr_psoc *psoc, void *arg)
|
||||
{
|
||||
int status;
|
||||
wmi_unified_t wmi_handle = lmac_get_wmi_unified_hdl(psoc);
|
||||
|
||||
target_if_debug("psoc:%pK, arg:%pK", psoc, arg);
|
||||
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi handle");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
status = wmi_unified_register_event(wmi_handle,
|
||||
wmi_p2p_noa_event_id,
|
||||
target_p2p_noa_event_handler);
|
||||
|
||||
target_if_debug("wmi register noa event handle, status:%d",
|
||||
status);
|
||||
|
||||
return status == 0 ? QDF_STATUS_SUCCESS : QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
QDF_STATUS target_if_p2p_unregister_noa_event_handler(
|
||||
struct wlan_objmgr_psoc *psoc, void *arg)
|
||||
{
|
||||
QDF_STATUS status;
|
||||
wmi_unified_t wmi_handle = lmac_get_wmi_unified_hdl(psoc);
|
||||
|
||||
target_if_debug("psoc:%pK, arg:%pK", psoc, arg);
|
||||
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi handle");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
status = wmi_unified_unregister_event(wmi_handle,
|
||||
wmi_p2p_noa_event_id);
|
||||
|
||||
target_if_debug("wmi unregister noa event handle, status:%d",
|
||||
status);
|
||||
|
||||
if (QDF_IS_STATUS_ERROR(status))
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
else
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
QDF_STATUS target_if_p2p_set_ps(struct wlan_objmgr_psoc *psoc,
|
||||
struct p2p_ps_config *ps_config)
|
||||
{
|
||||
struct p2p_ps_params cmd;
|
||||
QDF_STATUS status;
|
||||
wmi_unified_t wmi_handle = lmac_get_wmi_unified_hdl(psoc);
|
||||
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi handle");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
if (!ps_config) {
|
||||
target_if_err("ps config parameters is null");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
target_if_debug("psoc:%pK, vdev_id:%d, opp_ps:%d", psoc,
|
||||
ps_config->vdev_id, ps_config->opp_ps);
|
||||
|
||||
cmd.opp_ps = ps_config->opp_ps;
|
||||
cmd.ctwindow = ps_config->ct_window;
|
||||
cmd.count = ps_config->count;
|
||||
cmd.duration = ps_config->duration;
|
||||
cmd.interval = ps_config->interval;
|
||||
cmd.single_noa_duration = ps_config->single_noa_duration;
|
||||
cmd.ps_selection = ps_config->ps_selection;
|
||||
cmd.session_id = ps_config->vdev_id;
|
||||
|
||||
if (ps_config->opp_ps)
|
||||
status = wmi_unified_set_p2pgo_oppps_req(wmi_handle,
|
||||
&cmd);
|
||||
else
|
||||
status = wmi_unified_set_p2pgo_noa_req_cmd(wmi_handle,
|
||||
&cmd);
|
||||
|
||||
if (status != QDF_STATUS_SUCCESS)
|
||||
target_if_err("Failed to send set uapsd param, %d",
|
||||
status);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
QDF_STATUS target_if_p2p_set_noa(struct wlan_objmgr_psoc *psoc,
|
||||
uint32_t vdev_id, bool disable_noa)
|
||||
{
|
||||
struct vdev_set_params param;
|
||||
wmi_unified_t wmi_handle = lmac_get_wmi_unified_hdl(psoc);
|
||||
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi handle");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
target_if_debug("psoc:%pK, vdev_id:%d disable_noa:%d",
|
||||
psoc, vdev_id, disable_noa);
|
||||
param.vdev_id = vdev_id;
|
||||
param.param_id = WMI_VDEV_PARAM_DISABLE_NOA_P2P_GO;
|
||||
param.param_value = (uint32_t)disable_noa;
|
||||
|
||||
return wmi_unified_vdev_set_param_send(wmi_handle, ¶m);
|
||||
}
|
||||
|
||||
static int target_p2p_mac_rx_filter_event_handler(ol_scn_t scn, uint8_t *data,
|
||||
uint32_t datalen)
|
||||
{
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
struct wmi_unified *wmi_handle;
|
||||
struct p2p_set_mac_filter_evt event_info;
|
||||
struct wlan_lmac_if_p2p_rx_ops *p2p_rx_ops;
|
||||
QDF_STATUS status = QDF_STATUS_E_FAILURE;
|
||||
|
||||
if (!scn || !data) {
|
||||
target_if_err("scn: 0x%pK, data: 0x%pK", scn, data);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
psoc = target_if_get_psoc_from_scn_hdl(scn);
|
||||
if (!psoc) {
|
||||
target_if_err("null psoc");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("null wmi handle");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (wmi_extract_mac_addr_rx_filter_evt_param(wmi_handle, data,
|
||||
&event_info)) {
|
||||
target_if_err("failed to extract wmi p2p noa event");
|
||||
return -EINVAL;
|
||||
}
|
||||
target_if_debug("vdev_id %d status %d", event_info.vdev_id,
|
||||
event_info.status);
|
||||
p2p_rx_ops = target_if_psoc_get_p2p_rx_ops(psoc);
|
||||
if (p2p_rx_ops && p2p_rx_ops->add_mac_addr_filter_evt_handler)
|
||||
status = p2p_rx_ops->add_mac_addr_filter_evt_handler(
|
||||
psoc, &event_info);
|
||||
else
|
||||
target_if_debug("no add mac addr filter event handler");
|
||||
|
||||
return qdf_status_to_os_return(status);
|
||||
}
|
||||
|
||||
static QDF_STATUS target_if_p2p_register_macaddr_rx_filter_evt_handler(
|
||||
struct wlan_objmgr_psoc *psoc, bool reg)
|
||||
{
|
||||
int status;
|
||||
wmi_unified_t wmi_handle = lmac_get_wmi_unified_hdl(psoc);
|
||||
|
||||
target_if_debug("psoc:%pK, register %d mac addr rx evt", psoc, reg);
|
||||
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi handle");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
if (reg)
|
||||
status = wmi_unified_register_event(
|
||||
wmi_handle,
|
||||
wmi_vdev_add_macaddr_rx_filter_event_id,
|
||||
target_p2p_mac_rx_filter_event_handler);
|
||||
else
|
||||
status = wmi_unified_unregister_event(
|
||||
wmi_handle,
|
||||
wmi_vdev_add_macaddr_rx_filter_event_id);
|
||||
|
||||
return status == 0 ? QDF_STATUS_SUCCESS : QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
static QDF_STATUS target_if_p2p_set_mac_addr_rx_filter_cmd(
|
||||
struct wlan_objmgr_psoc *psoc, struct p2p_set_mac_filter *param)
|
||||
{
|
||||
wmi_unified_t wmi_handle = lmac_get_wmi_unified_hdl(psoc);
|
||||
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi handle");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
return wmi_send_set_mac_addr_rx_filter_cmd(wmi_handle, param);
|
||||
}
|
||||
|
||||
void target_if_p2p_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops)
|
||||
{
|
||||
struct wlan_lmac_if_p2p_tx_ops *p2p_tx_ops;
|
||||
|
||||
if (!tx_ops) {
|
||||
target_if_err("lmac tx_ops is null");
|
||||
return;
|
||||
}
|
||||
|
||||
p2p_tx_ops = &tx_ops->p2p;
|
||||
p2p_tx_ops->set_ps = target_if_p2p_set_ps;
|
||||
p2p_tx_ops->set_noa = target_if_p2p_set_noa;
|
||||
p2p_tx_ops->reg_noa_ev_handler =
|
||||
target_if_p2p_register_noa_event_handler;
|
||||
p2p_tx_ops->unreg_noa_ev_handler =
|
||||
target_if_p2p_unregister_noa_event_handler;
|
||||
p2p_tx_ops->reg_mac_addr_rx_filter_handler =
|
||||
target_if_p2p_register_macaddr_rx_filter_evt_handler;
|
||||
p2p_tx_ops->set_mac_addr_rx_filter_cmd =
|
||||
target_if_p2p_set_mac_addr_rx_filter_cmd;
|
||||
/* register P2P listen offload callbacks */
|
||||
target_if_p2p_lo_register_tx_ops(p2p_tx_ops);
|
||||
}
|
@@ -1,51 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2020 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 various api/struct which shall be used
|
||||
* by packet capture component for wmi cmd (tx path) and
|
||||
* event (rx) handling.
|
||||
*/
|
||||
|
||||
#ifndef _TARGET_IF_PKT_CAPTURE_H_
|
||||
#define _TARGET_IF_PKT_CAPTURE_H_
|
||||
|
||||
#include <wlan_pkt_capture_main.h>
|
||||
#include <wlan_pkt_capture_ucfg_api.h>
|
||||
#include <wlan_pkt_capture_mgmt_txrx.h>
|
||||
#include <wlan_pkt_capture_public_structs.h>
|
||||
#include <target_if.h>
|
||||
#include <linux/ieee80211.h>
|
||||
|
||||
/**
|
||||
* target_if_pkt_capture_register_rx_ops() - Register packet capture RX ops
|
||||
* @rx_ops: packet capture component reception ops
|
||||
* Return: None
|
||||
*/
|
||||
void
|
||||
target_if_pkt_capture_register_rx_ops(struct wlan_pkt_capture_rx_ops *rx_ops);
|
||||
|
||||
/**
|
||||
* target_if_pkt_capture_register_tx_ops() - Register packet capture TX ops
|
||||
* @tx_ops: pkt capture component transmit ops
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
void target_if_pkt_capture_register_tx_ops(struct wlan_pkt_capture_tx_ops
|
||||
*tx_ops);
|
||||
#endif /* _TARGET_IF_PKT_CAPTURE_H_ */
|
@@ -1,478 +0,0 @@
|
||||
/*
|
||||
* 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: Target interface file for pkt_capture component to
|
||||
* Implement api's which shall be used by pkt_capture component
|
||||
* in target_if internally.
|
||||
*/
|
||||
|
||||
#include <target_if_pkt_capture.h>
|
||||
#include <wlan_pkt_capture_tgt_api.h>
|
||||
#include <wmi_unified_api.h>
|
||||
#include <target_if.h>
|
||||
#include <init_deinit_lmac.h>
|
||||
|
||||
/**
|
||||
* target_if_set_packet_capture_mode() - set packet capture mode
|
||||
* @psoc: pointer to psoc object
|
||||
* @vdev_id: vdev id
|
||||
* @mode: mode to set
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
static QDF_STATUS
|
||||
target_if_set_packet_capture_mode(struct wlan_objmgr_psoc *psoc,
|
||||
uint8_t vdev_id,
|
||||
enum pkt_capture_mode mode)
|
||||
{
|
||||
wmi_unified_t wmi_handle = lmac_get_wmi_unified_hdl(psoc);
|
||||
QDF_STATUS status = QDF_STATUS_E_FAILURE;
|
||||
struct vdev_set_params param;
|
||||
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi handle");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
target_if_debug("psoc:%pK, vdev_id:%d mode:%d",
|
||||
psoc, vdev_id, mode);
|
||||
|
||||
param.vdev_id = vdev_id;
|
||||
param.param_id = WMI_VDEV_PARAM_PACKET_CAPTURE_MODE;
|
||||
param.param_value = (uint32_t)mode;
|
||||
|
||||
status = wmi_unified_vdev_set_param_send(wmi_handle, ¶m);
|
||||
if (QDF_IS_STATUS_SUCCESS(status))
|
||||
ucfg_pkt_capture_set_pktcap_mode(psoc, mode);
|
||||
else
|
||||
pkt_capture_err("failed to set packet capture mode");
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
#ifdef WLAN_FEATURE_PKT_CAPTURE_V2
|
||||
/**
|
||||
* target_if_set_packet_capture_config() - set packet capture config
|
||||
* @psoc: pointer to psoc object
|
||||
* @vdev_id: vdev id
|
||||
* @config_value: config value
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
static QDF_STATUS
|
||||
target_if_set_packet_capture_config
|
||||
(struct wlan_objmgr_psoc *psoc,
|
||||
uint8_t vdev_id,
|
||||
enum pkt_capture_config config_value)
|
||||
{
|
||||
wmi_unified_t wmi_handle = lmac_get_wmi_unified_hdl(psoc);
|
||||
QDF_STATUS status = QDF_STATUS_E_FAILURE;
|
||||
struct wlan_objmgr_vdev *vdev;
|
||||
struct vdev_set_params param;
|
||||
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi handle");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc, vdev_id,
|
||||
WLAN_PKT_CAPTURE_ID);
|
||||
if (!vdev) {
|
||||
pkt_capture_err("vdev is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
target_if_debug("psoc:%pK, vdev_id:%d config_value:%d",
|
||||
psoc, vdev_id, config_value);
|
||||
|
||||
param.vdev_id = vdev_id;
|
||||
param.param_id = WMI_VDEV_PARAM_SMART_MONITOR_CONFIG;
|
||||
param.param_value = (uint32_t)config_value;
|
||||
|
||||
status = wmi_unified_vdev_set_param_send(wmi_handle, ¶m);
|
||||
if (QDF_IS_STATUS_SUCCESS(status))
|
||||
ucfg_pkt_capture_set_pktcap_config(vdev, config_value);
|
||||
else
|
||||
pkt_capture_err("failed to set packet capture config");
|
||||
|
||||
wlan_objmgr_vdev_release_ref(vdev, WLAN_PKT_CAPTURE_ID);
|
||||
return status;
|
||||
}
|
||||
#else
|
||||
static QDF_STATUS
|
||||
target_if_set_packet_capture_config
|
||||
(struct wlan_objmgr_psoc *psoc,
|
||||
uint8_t vdev_id,
|
||||
enum pkt_capture_config config_value)
|
||||
{
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* target_if_set_packet_capture_beacon_interval() - set packet capture beacon
|
||||
* interval
|
||||
* @psoc: pointer to psoc object
|
||||
* @vdev_id: vdev id
|
||||
* @nth_value: Beacon report period
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
static QDF_STATUS
|
||||
target_if_set_packet_capture_beacon_interval
|
||||
(struct wlan_objmgr_psoc *psoc,
|
||||
uint8_t vdev_id,
|
||||
uint32_t nth_value)
|
||||
{
|
||||
wmi_unified_t wmi_handle = lmac_get_wmi_unified_hdl(psoc);
|
||||
QDF_STATUS status = QDF_STATUS_E_FAILURE;
|
||||
struct vdev_set_params param;
|
||||
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi handle");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
target_if_debug("psoc:%pK, vdev_id:%d nth_value:%d",
|
||||
psoc, vdev_id, nth_value);
|
||||
|
||||
param.vdev_id = vdev_id;
|
||||
param.param_id = WMI_VDEV_PARAM_NTH_BEACON_TO_HOST;
|
||||
param.param_value = nth_value;
|
||||
|
||||
status = wmi_unified_vdev_set_param_send(wmi_handle, ¶m);
|
||||
if (QDF_IS_STATUS_ERROR(status))
|
||||
pkt_capture_err("failed to set beacon interval");
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* target_if_mgmt_offload_data_event_handler() - offload event handler
|
||||
* @handle: scn handle
|
||||
* @data: mgmt data
|
||||
* @data_len: data length
|
||||
*
|
||||
* Process management offload frame.
|
||||
*
|
||||
* Return: 0 for success or error code
|
||||
*/
|
||||
static int
|
||||
target_if_mgmt_offload_data_event_handler(void *handle, uint8_t *data,
|
||||
uint32_t data_len)
|
||||
{
|
||||
static uint8_t limit_prints_invalid_len = RATE_LIMIT - 1;
|
||||
struct mgmt_offload_event_params params;
|
||||
struct wmi_unified *wmi_handle;
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
struct wlan_objmgr_pdev *pdev;
|
||||
QDF_STATUS status;
|
||||
qdf_nbuf_t wbuf;
|
||||
|
||||
psoc = target_if_get_psoc_from_scn_hdl(handle);
|
||||
if (!psoc) {
|
||||
pkt_capture_err("psoc is NULL");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid WMI handle");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
pdev = target_if_get_pdev_from_scn_hdl(handle);
|
||||
if (!pdev) {
|
||||
pkt_capture_err("pdev is NULL");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (!(ucfg_pkt_capture_get_pktcap_mode(psoc) &
|
||||
PKT_CAPTURE_MODE_MGMT_ONLY))
|
||||
return -EINVAL;
|
||||
|
||||
status = wmi_unified_extract_vdev_mgmt_offload_event(wmi_handle, data,
|
||||
¶ms);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
pkt_capture_err("Extract mgmt offload event failed");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (!params.buf) {
|
||||
pkt_capture_err("Mgmt offload buf is NULL");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (params.buf_len < sizeof(struct ieee80211_hdr_3addr) ||
|
||||
params.buf_len > data_len) {
|
||||
limit_prints_invalid_len++;
|
||||
if (limit_prints_invalid_len == RATE_LIMIT) {
|
||||
pkt_capture_debug(
|
||||
"Invalid mgmt packet, data_len %u, params.buf_len %u",
|
||||
data_len, params.buf_len);
|
||||
limit_prints_invalid_len = 0;
|
||||
}
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
wbuf = qdf_nbuf_alloc(NULL,
|
||||
roundup(params.buf_len + RESERVE_BYTES, 4),
|
||||
RESERVE_BYTES, 4, false);
|
||||
if (!wbuf) {
|
||||
pkt_capture_err("Failed to allocate wbuf for mgmt pkt len(%u)",
|
||||
params.buf_len);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
qdf_nbuf_put_tail(wbuf, params.buf_len);
|
||||
qdf_nbuf_set_protocol(wbuf, ETH_P_CONTROL);
|
||||
qdf_mem_copy(qdf_nbuf_data(wbuf), params.buf, params.buf_len);
|
||||
|
||||
status = params.tx_status;
|
||||
if (QDF_STATUS_SUCCESS !=
|
||||
ucfg_pkt_capture_process_mgmt_tx_data(pdev, ¶ms,
|
||||
wbuf, status))
|
||||
qdf_nbuf_free(wbuf);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* target_if_register_mgmt_data_offload_event() - Register mgmt data offload
|
||||
* event handler
|
||||
* @psoc: wlan psoc object
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
static QDF_STATUS
|
||||
target_if_register_mgmt_data_offload_event(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
wmi_unified_t wmi_handle;
|
||||
|
||||
PKT_CAPTURE_ENTER();
|
||||
|
||||
if (!psoc) {
|
||||
pkt_capture_err("psoc got NULL");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
|
||||
if (!wmi_handle) {
|
||||
pkt_capture_err("wmi_handle is NULL");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
if ((ucfg_pkt_capture_get_mode(psoc) != PACKET_CAPTURE_MODE_DISABLE) &&
|
||||
wmi_service_enabled(wmi_handle,
|
||||
wmi_service_packet_capture_support)) {
|
||||
QDF_STATUS status;
|
||||
|
||||
status = wmi_unified_register_event_handler(
|
||||
wmi_handle,
|
||||
wmi_mgmt_offload_data_event_id,
|
||||
target_if_mgmt_offload_data_event_handler,
|
||||
WMI_RX_WORK_CTX);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
pkt_capture_err("Failed to register MGMT offload handler");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
PKT_CAPTURE_EXIT();
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* target_if_unregister_mgmt_data_offload_event() - Unregister mgmt data offload
|
||||
* event handler
|
||||
* @psoc: wlan psoc object
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
static QDF_STATUS
|
||||
target_if_unregister_mgmt_data_offload_event(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
wmi_unified_t wmi_handle;
|
||||
QDF_STATUS status;
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
pkt_capture_err("Invalid wmi handle");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
status = wmi_unified_unregister_event(wmi_handle,
|
||||
wmi_mgmt_offload_data_event_id);
|
||||
if (status)
|
||||
pkt_capture_err("unregister mgmt data offload event cb failed");
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
#ifdef WLAN_FEATURE_PKT_CAPTURE_V2
|
||||
static int
|
||||
target_if_smart_monitor_event_handler(void *handle, uint8_t *data,
|
||||
uint32_t len)
|
||||
{
|
||||
struct smu_event_params params;
|
||||
struct wmi_unified *wmi_handle;
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
QDF_STATUS status;
|
||||
|
||||
psoc = target_if_get_psoc_from_scn_hdl(handle);
|
||||
if (!psoc) {
|
||||
pkt_capture_err("psoc is NULL");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid WMI handle");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (!(ucfg_pkt_capture_get_pktcap_mode(psoc) &
|
||||
PKT_CAPTURE_MODE_MGMT_ONLY))
|
||||
return -EINVAL;
|
||||
|
||||
status = wmi_unified_extract_smart_monitor_event(wmi_handle, data,
|
||||
¶ms);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
pkt_capture_err("Extract smart monitor event failed");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
tgt_pkt_capture_smu_event(psoc, ¶ms);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* target_if_register_smart_monitor_event() - Register smu event
|
||||
* @psoc: wlan psoc object
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
static QDF_STATUS
|
||||
target_if_register_smart_monitor_event(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
wmi_unified_t wmi_handle;
|
||||
|
||||
if (!psoc) {
|
||||
pkt_capture_err("psoc got NULL");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
|
||||
if (!wmi_handle) {
|
||||
pkt_capture_err("wmi_handle is NULL");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
if ((ucfg_pkt_capture_get_mode(psoc) != PACKET_CAPTURE_MODE_DISABLE) &&
|
||||
wmi_service_enabled(wmi_handle,
|
||||
wmi_service_packet_capture_support)) {
|
||||
uint8_t status;
|
||||
|
||||
status = wmi_unified_register_event_handler(
|
||||
wmi_handle,
|
||||
wmi_vdev_smart_monitor_event_id,
|
||||
target_if_smart_monitor_event_handler,
|
||||
WMI_RX_WORK_CTX);
|
||||
if (status) {
|
||||
pkt_capture_err("Failed to register smart monitor handler");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* target_if_unregister_smart_monitor_event() - Unregister smu event
|
||||
* @psoc: wlan psoc object
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
static QDF_STATUS
|
||||
target_if_unregister_smart_monitor_event(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
wmi_unified_t wmi_handle;
|
||||
QDF_STATUS status;
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
pkt_capture_err("Invalid wmi handle");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
status = wmi_unified_unregister_event(wmi_handle,
|
||||
wmi_vdev_smart_monitor_event_id);
|
||||
if (status)
|
||||
pkt_capture_err("unregister smart monitor event handler failed");
|
||||
|
||||
return status;
|
||||
}
|
||||
#else
|
||||
static QDF_STATUS
|
||||
target_if_register_smart_monitor_event(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static QDF_STATUS
|
||||
target_if_unregister_smart_monitor_event(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
#endif
|
||||
void
|
||||
target_if_pkt_capture_register_rx_ops(struct wlan_pkt_capture_rx_ops *rx_ops)
|
||||
{
|
||||
if (!rx_ops) {
|
||||
target_if_err("packet capture rx_ops is null");
|
||||
return;
|
||||
}
|
||||
|
||||
rx_ops->pkt_capture_register_ev_handlers =
|
||||
target_if_register_mgmt_data_offload_event;
|
||||
|
||||
rx_ops->pkt_capture_unregister_ev_handlers =
|
||||
target_if_unregister_mgmt_data_offload_event;
|
||||
|
||||
rx_ops->pkt_capture_register_smart_monitor_event =
|
||||
target_if_register_smart_monitor_event;
|
||||
|
||||
rx_ops->pkt_capture_unregister_smart_monitor_event =
|
||||
target_if_unregister_smart_monitor_event;
|
||||
}
|
||||
|
||||
void
|
||||
target_if_pkt_capture_register_tx_ops(struct wlan_pkt_capture_tx_ops *tx_ops)
|
||||
{
|
||||
if (!tx_ops) {
|
||||
target_if_err("packet capture tx_ops is null");
|
||||
return;
|
||||
}
|
||||
|
||||
tx_ops->pkt_capture_send_mode = target_if_set_packet_capture_mode;
|
||||
tx_ops->pkt_capture_send_config = target_if_set_packet_capture_config;
|
||||
tx_ops->pkt_capture_send_beacon_interval =
|
||||
target_if_set_packet_capture_beacon_interval;
|
||||
}
|
@@ -1,540 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2017-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 various api/struct which shall be used
|
||||
* by pmo component for wmi cmd (tx path) and
|
||||
* event (rx) handling.
|
||||
*/
|
||||
|
||||
#ifndef _TARGET_IF_PMO_H_
|
||||
#define _TARGET_IF_PMO_H_
|
||||
|
||||
#include "target_if.h"
|
||||
#include "wlan_pmo_tgt_api.h"
|
||||
#include "wlan_pmo_obj_mgmt_public_struct.h"
|
||||
|
||||
/**
|
||||
* target_if_pmo_enable_wow_wakeup_event() - Enable wow wakeup events.
|
||||
* @vdev:objmgr vdev handle
|
||||
* @bitmap: Event bitmap
|
||||
* @enable: enable/disable
|
||||
*
|
||||
* Return: QDF status
|
||||
*/
|
||||
QDF_STATUS target_if_pmo_enable_wow_wakeup_event(struct wlan_objmgr_vdev *vdev,
|
||||
uint32_t *bitmap);
|
||||
|
||||
/**
|
||||
* target_if_pmo_disable_wow_wakeup_event() - Disable wow wakeup events.
|
||||
* @vdev:objmgr vdev handle
|
||||
* @bitmap: Event bitmap
|
||||
* @enable: enable/disable
|
||||
*
|
||||
* Return: QDF status
|
||||
*/
|
||||
QDF_STATUS target_if_pmo_disable_wow_wakeup_event(
|
||||
struct wlan_objmgr_vdev *vdev, uint32_t *bitmap);
|
||||
|
||||
/**
|
||||
* target_if_pmo_send_wow_patterns_to_fw() - Sends WOW patterns to FW.
|
||||
* @vdev: objmgr vdev handle
|
||||
* @ptrn_id: pattern id
|
||||
* @ptrn: pattern
|
||||
* @ptrn_len: pattern length
|
||||
* @ptrn_offset: pattern offset
|
||||
* @mask: mask
|
||||
* @mask_len: mask length
|
||||
* @user: true for user configured pattern and false for default pattern
|
||||
*
|
||||
* Return: QDF status
|
||||
*/
|
||||
QDF_STATUS target_if_pmo_send_wow_patterns_to_fw(struct wlan_objmgr_vdev *vdev,
|
||||
uint8_t ptrn_id,
|
||||
const uint8_t *ptrn, uint8_t ptrn_len,
|
||||
uint8_t ptrn_offset, const uint8_t *mask,
|
||||
uint8_t mask_len, bool user);
|
||||
|
||||
QDF_STATUS target_if_pmo_del_wow_patterns_to_fw(struct wlan_objmgr_vdev *vdev,
|
||||
uint8_t ptrn_id);
|
||||
|
||||
/**
|
||||
* target_if_pmo_send_enhance_mc_offload_req() - send enhance mc offload req
|
||||
* @vdev: objmgr vdev
|
||||
* @action: enable or disable enhance multicast offload
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS on success else error code
|
||||
*/
|
||||
QDF_STATUS target_if_pmo_send_enhance_mc_offload_req(
|
||||
struct wlan_objmgr_vdev *vdev,
|
||||
bool enable);
|
||||
|
||||
/**
|
||||
* target_if_pmo_set_mc_filter_req() - set mcast filter command to fw
|
||||
* @vdev: objmgr vdev handle
|
||||
* @multicastAddr: mcast address
|
||||
*
|
||||
* Return: 0 for success or error code
|
||||
*/
|
||||
QDF_STATUS target_if_pmo_set_mc_filter_req(struct wlan_objmgr_vdev *vdev,
|
||||
struct qdf_mac_addr multicast_addr);
|
||||
|
||||
/**
|
||||
* target_if_pmo_clear_mc_filter_req() - clear mcast filter command to fw
|
||||
* @vdev: objmgr vdev handle
|
||||
* @multicastAddr: mcast address
|
||||
*
|
||||
* Return: 0 for success or error code
|
||||
*/
|
||||
QDF_STATUS target_if_pmo_clear_mc_filter_req(struct wlan_objmgr_vdev *vdev,
|
||||
struct qdf_mac_addr multicast_addr);
|
||||
|
||||
/**
|
||||
* target_if_pmo_get_multiple_mc_filter_support() - get multiple mc filter
|
||||
* request fw support
|
||||
* @psoc: the psoc containing the vdev to configure
|
||||
*
|
||||
* Return: true if fw supports else false
|
||||
*/
|
||||
bool target_if_pmo_get_multiple_mc_filter_support(
|
||||
struct wlan_objmgr_psoc *psoc);
|
||||
|
||||
/**
|
||||
* target_if_pmo_set_multiple_mc_filter_req() - set multiple mcast filter
|
||||
* command to fw
|
||||
* @vdev: objmgr vdev handle
|
||||
* @multicastAddr: mcast address
|
||||
*
|
||||
* Return: 0 for success or error code
|
||||
*/
|
||||
QDF_STATUS target_if_pmo_set_multiple_mc_filter_req(
|
||||
struct wlan_objmgr_vdev *vdev,
|
||||
struct pmo_mc_addr_list *mc_list);
|
||||
|
||||
/**
|
||||
* target_if_pmo_clear_multiple_mc_filter_req() - clear multiple mcast
|
||||
* filter command to fw
|
||||
* @vdev: objmgr vdev handle
|
||||
* @multicastAddr: mcast address
|
||||
*
|
||||
* Return: 0 for success or error code
|
||||
*/
|
||||
QDF_STATUS target_if_pmo_clear_multiple_mc_filter_req(
|
||||
struct wlan_objmgr_vdev *vdev,
|
||||
struct pmo_mc_addr_list *mc_list);
|
||||
|
||||
/**
|
||||
* target_if_pmo_send_ra_filter_req() - set RA filter pattern in fw
|
||||
* @vdev: objmgr vdev handle
|
||||
* @default_pattern: default pattern id
|
||||
* @rate_limit_interval: ra rate limit interval
|
||||
*
|
||||
* Return: QDF status
|
||||
*/
|
||||
QDF_STATUS target_if_pmo_send_ra_filter_req(struct wlan_objmgr_vdev *vdev,
|
||||
uint8_t default_pattern, uint16_t rate_limit_interval);
|
||||
|
||||
/**
|
||||
* target_if_pmo_send_action_frame_patterns() - register action frame map to fw
|
||||
* @handle: Pointer to wma handle
|
||||
* @vdev_id: VDEV ID
|
||||
*
|
||||
* This is called to push action frames wow patterns from local
|
||||
* cache to firmware.
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS target_if_pmo_send_action_frame_patterns(
|
||||
struct wlan_objmgr_vdev *vdev,
|
||||
struct pmo_action_wakeup_set_params *ip_cmd);
|
||||
|
||||
/**
|
||||
* target_if_pmo_conf_hw_filter() - configure hardware filter in DTIM mode
|
||||
* @psoc: the psoc containing the vdev to configure
|
||||
* @req: the request parameters
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS target_if_pmo_conf_hw_filter(struct wlan_objmgr_psoc *psoc,
|
||||
struct pmo_hw_filter_params *req);
|
||||
|
||||
#ifdef WLAN_FEATURE_PACKET_FILTERING
|
||||
/**
|
||||
* target_if_pmo_send_pkt_filter_req() - enable packet filter
|
||||
* @vdev: objmgr vdev
|
||||
* @rcv_filter_param: filter params
|
||||
*
|
||||
* This function enable packet filter
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS for success or error code
|
||||
*/
|
||||
QDF_STATUS target_if_pmo_send_pkt_filter_req(struct wlan_objmgr_vdev *vdev,
|
||||
struct pmo_rcv_pkt_fltr_cfg *rcv_filter_param);
|
||||
|
||||
/**
|
||||
* target_if_pmo_clear_pkt_filter_req() - disable packet filter
|
||||
* @vdev: objmgr vdev
|
||||
* @rcv_clear_param: filter params
|
||||
*
|
||||
* This function disable packet filter
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS for success or error code
|
||||
*/
|
||||
QDF_STATUS target_if_pmo_clear_pkt_filter_req(struct wlan_objmgr_vdev *vdev,
|
||||
struct pmo_rcv_pkt_fltr_clear_param *rcv_clear_param);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* target_if_pmo_send_arp_offload_req() - sends arp request to fwr
|
||||
* @vdev: objmgr vdev
|
||||
* @arp_offload_req: arp offload req
|
||||
* @ns_offload_req: ns offload request
|
||||
*
|
||||
* This functions sends arp request to fwr.
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS for success or error code
|
||||
*/
|
||||
QDF_STATUS target_if_pmo_send_arp_offload_req(
|
||||
struct wlan_objmgr_vdev *vdev,
|
||||
struct pmo_arp_offload_params *arp_offload_req,
|
||||
struct pmo_ns_offload_params *ns_offload_req);
|
||||
|
||||
#ifdef WLAN_NS_OFFLOAD
|
||||
/**
|
||||
* target_if_pmo_send_ns_offload_req() - sends ns request to fwr
|
||||
* @vdev: objmgr vdev
|
||||
* @arp_offload_req: arp offload req
|
||||
* @ns_offload_req: ns offload request
|
||||
*
|
||||
* This functions sends ns request to fwr.
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS for success or error code
|
||||
*/
|
||||
QDF_STATUS target_if_pmo_send_ns_offload_req(
|
||||
struct wlan_objmgr_vdev *vdev,
|
||||
struct pmo_arp_offload_params *arp_offload_req,
|
||||
struct pmo_ns_offload_params *ns_offload_req);
|
||||
#else /* WLAN_NS_OFFLOAD */
|
||||
static inline QDF_STATUS
|
||||
target_if_pmo_send_ns_offload_req(struct wlan_objmgr_vdev *vdev,
|
||||
struct pmo_arp_offload_params *arp_offload_req,
|
||||
struct pmo_ns_offload_params *ns_offload_req)
|
||||
{
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
#endif /* WLAN_NS_OFFLOAD */
|
||||
/**
|
||||
* target_if_pmo_send_gtk_offload_req() - send gtk offload request in fwr
|
||||
* @vdev: objmgr vdev handle
|
||||
* @gtk_offload_req: gtk offload request
|
||||
*
|
||||
* Return: QDF status
|
||||
*/
|
||||
QDF_STATUS target_if_pmo_send_gtk_offload_req(struct wlan_objmgr_vdev *vdev,
|
||||
struct pmo_gtk_req *gtk_offload_req);
|
||||
|
||||
/**
|
||||
* target_if_pmo_send_gtk_response_req() - send gtk response request in fwr
|
||||
* @vdev: objmgr vdev handle
|
||||
*
|
||||
* Return: QDF status
|
||||
*/
|
||||
QDF_STATUS target_if_pmo_send_gtk_response_req(struct wlan_objmgr_vdev *vdev);
|
||||
|
||||
/**
|
||||
* target_if_pmo_gtk_offload_status_event() - GTK offload status event handler
|
||||
* @scn_handle: scn handle
|
||||
* @event: event buffer
|
||||
* @len: buffer length
|
||||
*
|
||||
* Return: 0 for success or error code
|
||||
*/
|
||||
int target_if_pmo_gtk_offload_status_event(void *scn_handle,
|
||||
uint8_t *event, uint32_t len);
|
||||
|
||||
/**
|
||||
* target_if_pmo_send_lphb_enable() - enable command of LPHB config req
|
||||
* @psoc: objmgr psoc handle
|
||||
* @ts_lphb_enable: lphb enable request which needs to configure in fwr
|
||||
*
|
||||
* Return: QDF status
|
||||
*/
|
||||
QDF_STATUS target_if_pmo_send_lphb_enable(struct wlan_objmgr_psoc *psoc,
|
||||
struct pmo_lphb_enable_req *ts_lphb_enable);
|
||||
|
||||
/**
|
||||
* target_if_pmo_send_lphb_tcp_params() - set lphb tcp params config request
|
||||
* @psoc: objmgr psoc handle
|
||||
* @ts_lphb_tcp_param: lphb tcp params which needs to configure in fwr
|
||||
*
|
||||
* Return: QDF status
|
||||
*/
|
||||
QDF_STATUS target_if_pmo_send_lphb_tcp_params(struct wlan_objmgr_psoc *psoc,
|
||||
struct pmo_lphb_tcp_params *ts_lphb_tcp_param);
|
||||
|
||||
/**
|
||||
* target_if_pmo_send_lphb_tcp_pkt_filter() - send lphb tcp packet filter req
|
||||
* @psoc: objmgr psoc handle
|
||||
* @ts_lphb_tcp_filter: lphb tcp filter request which needs to configure in fwr
|
||||
*
|
||||
* Return: QDF status
|
||||
*/
|
||||
QDF_STATUS target_if_pmo_send_lphb_tcp_pkt_filter(struct wlan_objmgr_psoc *psoc,
|
||||
struct pmo_lphb_tcp_filter_req *ts_lphb_tcp_filter);
|
||||
|
||||
/**
|
||||
* target_if_pmo_send_lphb_udp_params() - Send udp param command of LPHB
|
||||
* @psoc: objmgr psoc handle
|
||||
* @ts_lphb_udp_param: lphb udp params which needs to configure in fwr
|
||||
*
|
||||
* Return: QDF status
|
||||
*/
|
||||
QDF_STATUS target_if_pmo_send_lphb_udp_params(struct wlan_objmgr_psoc *psoc,
|
||||
struct pmo_lphb_udp_params *ts_lphb_udp_param);
|
||||
|
||||
/**
|
||||
* target_if_pmo_send_lphb_udp_pkt_filter() - Send lphb udp pkt filter cmd req
|
||||
* @psoc: objmgr psoc handle
|
||||
* @ts_lphb_udp_filter: lphb udp filter request which needs to configure in fwr
|
||||
*
|
||||
* Return: QDF status
|
||||
*/
|
||||
QDF_STATUS target_if_pmo_send_lphb_udp_pkt_filter(struct wlan_objmgr_psoc *psoc,
|
||||
struct pmo_lphb_udp_filter_req *ts_lphb_udp_filter);
|
||||
|
||||
/**
|
||||
* target_if_pmo_lphb_evt_handler() - send LPHB indication to os if /HDD
|
||||
* @psoc: objmgr psoc handle
|
||||
* @event: lphb event buffer
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS for success else error code
|
||||
*/
|
||||
QDF_STATUS target_if_pmo_lphb_evt_handler(struct wlan_objmgr_psoc *psoc,
|
||||
uint8_t *event);
|
||||
|
||||
/**
|
||||
* target_if_pmo_send_vdev_update_param_req() - Send vdev param value to fwr
|
||||
* @vdev: objmgr vdev
|
||||
* @param_id: tell vdev param id which needs to be updated in fwr
|
||||
* @param_value: vdev parameter value
|
||||
*
|
||||
* Return: QDF status
|
||||
*/
|
||||
QDF_STATUS target_if_pmo_send_vdev_update_param_req(
|
||||
struct wlan_objmgr_vdev *vdev,
|
||||
uint32_t param_id, uint32_t param_value);
|
||||
|
||||
/**
|
||||
* target_if_pmo_send_vdev_ps_param_req() - Send vdev ps param value to fwr
|
||||
* @vdev: objmgr vdev
|
||||
* @param_id: tell vdev param id which needs to be updated in fwr
|
||||
* @param_value: vdev parameter value
|
||||
*
|
||||
* Return: QDF status
|
||||
*/
|
||||
QDF_STATUS target_if_pmo_send_vdev_ps_param_req(
|
||||
struct wlan_objmgr_vdev *vdev,
|
||||
uint32_t param_id,
|
||||
uint32_t param_value);
|
||||
|
||||
#ifdef WLAN_FEATURE_IGMP_OFFLOAD
|
||||
/**
|
||||
* target_if_pmo_send_igmp_offload_req() - Send igmp offload req to fw
|
||||
* @vdev: objmgr vdev
|
||||
* @pmo_igmp_req: igmp req
|
||||
*
|
||||
* Return: QDF status
|
||||
*/
|
||||
QDF_STATUS
|
||||
target_if_pmo_send_igmp_offload_req(
|
||||
struct wlan_objmgr_vdev *vdev,
|
||||
struct pmo_igmp_offload_req *pmo_igmp_req);
|
||||
#else
|
||||
static inline QDF_STATUS
|
||||
target_if_pmo_send_igmp_offload_req(
|
||||
struct wlan_objmgr_vdev *vdev,
|
||||
struct pmo_igmp_offload_req *pmo_igmp_req)
|
||||
{
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* target_if_pmo_psoc_update_bus_suspend() - update wmi bus suspend flag
|
||||
* @psoc: objmgr psoc
|
||||
* @value: bus suspend value
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
void target_if_pmo_psoc_update_bus_suspend(struct wlan_objmgr_psoc *psoc,
|
||||
uint8_t value);
|
||||
|
||||
/**
|
||||
* target_if_pmo_psoc_get_host_credits() - get available host credits
|
||||
* @psoc: objmgr psoc
|
||||
*
|
||||
* Return: return host credits
|
||||
*/
|
||||
int target_if_pmo_psoc_get_host_credits(struct wlan_objmgr_psoc *psoc);
|
||||
|
||||
/**
|
||||
* target_if_pmo_psoc_get_pending_cmnds() - get wmi pending commands
|
||||
* @psoc: objmgr psoc
|
||||
*
|
||||
* Return: return wmi pending commands
|
||||
*/
|
||||
int target_if_pmo_psoc_get_pending_cmnds(struct wlan_objmgr_psoc *psoc);
|
||||
|
||||
/**
|
||||
* target_if_pmo_update_target_suspend_flag() - set wmi target suspend flag
|
||||
* @psoc: objmgr psoc
|
||||
* @value: value
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
void target_if_pmo_update_target_suspend_flag(struct wlan_objmgr_psoc *psoc,
|
||||
uint8_t value);
|
||||
|
||||
/**
|
||||
* target_if_pmo_update_target_suspend_acked_flag() - set wmi target suspend
|
||||
* acked flag
|
||||
* @psoc: objmgr psoc
|
||||
* @value: value
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
void target_if_pmo_update_target_suspend_acked_flag(
|
||||
struct wlan_objmgr_psoc *psoc,
|
||||
uint8_t value);
|
||||
|
||||
/**
|
||||
* target_if_pmo_is_target_suspended() - get wmi target suspend flag
|
||||
* @psoc: objmgr psoc
|
||||
*
|
||||
* Return: true if target suspended, false otherwise
|
||||
*/
|
||||
bool target_if_pmo_is_target_suspended(struct wlan_objmgr_psoc *psoc);
|
||||
|
||||
/**
|
||||
* target_if_pmo_psoc_send_wow_enable_req() -send wow enable request
|
||||
* @psoc: objmgr psoc
|
||||
* @param: wow command params
|
||||
*
|
||||
* Return: return QDF_STATUS_SUCCESS on success else error code
|
||||
*/
|
||||
QDF_STATUS target_if_pmo_psoc_send_wow_enable_req(struct wlan_objmgr_psoc *psoc,
|
||||
struct pmo_wow_cmd_params *param);
|
||||
|
||||
/**
|
||||
* target_if_pmo_psoc_send_suspend_req() - fp to send suspend request
|
||||
* @psoc: objmgr psoc
|
||||
* @param: target suspend params
|
||||
*
|
||||
* Return: return QDF_STATUS_SUCCESS on success else error code
|
||||
*/
|
||||
QDF_STATUS target_if_pmo_psoc_send_suspend_req(struct wlan_objmgr_psoc *psoc,
|
||||
struct pmo_suspend_params *param);
|
||||
|
||||
/**
|
||||
* target_if_pmo_set_runtime_pm_in_progress() - set runtime pm status
|
||||
* @psoc: objmgr psoc
|
||||
* @value: set runtime pm status
|
||||
*
|
||||
* Return: none
|
||||
*/
|
||||
void target_if_pmo_set_runtime_pm_in_progress(struct wlan_objmgr_psoc *psoc,
|
||||
bool value);
|
||||
|
||||
/**
|
||||
* target_if_pmo_get_runtime_pm_in_progress() - fp to get runtime pm status
|
||||
* @psoc: objmgr psoc
|
||||
*
|
||||
* Return: true if runtime pm in progress else false
|
||||
*/
|
||||
bool target_if_pmo_get_runtime_pm_in_progress(struct wlan_objmgr_psoc *psoc);
|
||||
|
||||
/**
|
||||
* target_if_pmo_psoc_send_host_wakeup_ind() - send host wake ind to fwr
|
||||
* @psoc: objmgr psoc
|
||||
*
|
||||
* Return: return QDF_STATUS_SUCCESS on success else error code
|
||||
*/
|
||||
QDF_STATUS target_if_pmo_psoc_send_host_wakeup_ind(
|
||||
struct wlan_objmgr_psoc *psoc);
|
||||
|
||||
/**
|
||||
* target_if_pmo_psoc_send_target_resume_req() -send target resume request
|
||||
* @psoc: objmgr psoc
|
||||
*
|
||||
* Return: return QDF_STATUS_SUCCESS on success else error code
|
||||
*/
|
||||
QDF_STATUS target_if_pmo_psoc_send_target_resume_req(
|
||||
struct wlan_objmgr_psoc *psoc);
|
||||
|
||||
/**
|
||||
* target_if_pmo_psoc_send_d0wow_enable_req() - send d0 wow enable request
|
||||
* @psoc: objmgr psoc
|
||||
*
|
||||
* Return: return QDF_STATUS_SUCCESS on success else error code
|
||||
*/
|
||||
QDF_STATUS target_if_pmo_psoc_send_d0wow_enable_req(
|
||||
struct wlan_objmgr_psoc *psoc);
|
||||
|
||||
/**
|
||||
* target_if_pmo_psoc_send_d0wow_disable_req() - send d0 wow disable request
|
||||
* @psoc: objmgr psoc
|
||||
*
|
||||
* Return: return QDF_STATUS_SUCCESS on success else error code
|
||||
*/
|
||||
QDF_STATUS target_if_pmo_psoc_send_d0wow_disable_req(
|
||||
struct wlan_objmgr_psoc *psoc);
|
||||
|
||||
/**
|
||||
* target_if_pmo_psoc_send_idle_monitor_cmd() - send screen status to firmware
|
||||
* @psoc: objmgr psoc
|
||||
* @val: Idle monitor value
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS on success else error code
|
||||
*/
|
||||
QDF_STATUS
|
||||
target_if_pmo_psoc_send_idle_monitor_cmd(struct wlan_objmgr_psoc *psoc,
|
||||
uint8_t val);
|
||||
|
||||
/**
|
||||
* target_if_pmo_register_tx_ops() - Register PMO component TX OPS
|
||||
* @tx_ops: PMO if transmit ops
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
void target_if_pmo_register_tx_ops(struct wlan_pmo_tx_ops *tx_ops);
|
||||
|
||||
#ifdef WLAN_FEATURE_ICMP_OFFLOAD
|
||||
/**
|
||||
* target_if_pmo_send_icmp_offload_req() - sends icmp request to fwr
|
||||
* @psoc: objmgr psoc
|
||||
* @pmo_icmp_req: icmp offload request
|
||||
*
|
||||
* This functions sends icmp request to fwr.
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS for success or error code
|
||||
*/
|
||||
QDF_STATUS
|
||||
target_if_pmo_send_icmp_offload_req(struct wlan_objmgr_psoc *psoc,
|
||||
struct pmo_icmp_offload *pmo_icmp_req);
|
||||
#endif
|
||||
|
||||
#endif
|
@@ -1,67 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2017-2018 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: target_if_pmo_arp.c
|
||||
*
|
||||
* Target interface file for pmo component to
|
||||
* send arp offload related cmd and process event.
|
||||
*/
|
||||
|
||||
#include "target_if.h"
|
||||
#include "target_if_pmo.h"
|
||||
#include "wmi_unified_api.h"
|
||||
|
||||
QDF_STATUS target_if_pmo_send_arp_offload_req(
|
||||
struct wlan_objmgr_vdev *vdev,
|
||||
struct pmo_arp_offload_params *arp_offload_req,
|
||||
struct pmo_ns_offload_params *ns_offload_req)
|
||||
{
|
||||
uint8_t vdev_id;
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
QDF_STATUS status;
|
||||
wmi_unified_t wmi_handle;
|
||||
|
||||
if (!vdev) {
|
||||
target_if_err("vdev ptr passed is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
psoc = wlan_vdev_get_psoc(vdev);
|
||||
vdev_id = wlan_vdev_get_id(vdev);
|
||||
if (!psoc) {
|
||||
target_if_err("psoc handle is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi handle");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
status = wmi_unified_enable_arp_ns_offload_cmd(wmi_handle,
|
||||
arp_offload_req,
|
||||
ns_offload_req,
|
||||
vdev_id);
|
||||
if (status != QDF_STATUS_SUCCESS)
|
||||
target_if_err("Failed to enable ARP NDP/NSffload");
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
@@ -1,157 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2017-2018, 2020 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: target_if_pmo_gtk.c
|
||||
*
|
||||
* Target interface file for pmo component to
|
||||
* send gtk offload related cmd and process event.
|
||||
*/
|
||||
|
||||
#include "target_if.h"
|
||||
#include "target_if_pmo.h"
|
||||
#include "wmi_unified_api.h"
|
||||
|
||||
QDF_STATUS target_if_pmo_send_gtk_offload_req(struct wlan_objmgr_vdev *vdev,
|
||||
struct pmo_gtk_req *gtk_req)
|
||||
{
|
||||
uint8_t vdev_id;
|
||||
QDF_STATUS status;
|
||||
uint32_t gtk_offload_opcode;
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
wmi_unified_t wmi_handle;
|
||||
|
||||
if (!vdev) {
|
||||
target_if_err("vdev ptr passed is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
psoc = wlan_vdev_get_psoc(vdev);
|
||||
vdev_id = wlan_vdev_get_id(vdev);
|
||||
if (!psoc) {
|
||||
target_if_err("psoc handle is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
if (gtk_req->flags == PMO_GTK_OFFLOAD_ENABLE)
|
||||
gtk_offload_opcode = GTK_OFFLOAD_ENABLE_OPCODE;
|
||||
else
|
||||
gtk_offload_opcode = GTK_OFFLOAD_DISABLE_OPCODE;
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi handle");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
status = wmi_unified_send_gtk_offload_cmd(wmi_handle,
|
||||
vdev_id,
|
||||
gtk_req,
|
||||
gtk_req->flags,
|
||||
gtk_offload_opcode);
|
||||
if (status)
|
||||
target_if_err("Failed to send gtk offload cmd to fw");
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
QDF_STATUS target_if_pmo_send_gtk_response_req(struct wlan_objmgr_vdev *vdev)
|
||||
{
|
||||
uint8_t vdev_id;
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
QDF_STATUS status = QDF_STATUS_SUCCESS;
|
||||
uint32_t offload_req_opcode;
|
||||
wmi_unified_t wmi_handle;
|
||||
|
||||
if (!vdev) {
|
||||
target_if_err("vdev ptr passed is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
psoc = wlan_vdev_get_psoc(vdev);
|
||||
vdev_id = wlan_vdev_get_id(vdev);
|
||||
if (!psoc) {
|
||||
target_if_err("psoc handle is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
/* Request for GTK offload status */
|
||||
offload_req_opcode = GTK_OFFLOAD_REQUEST_STATUS_OPCODE;
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi handle");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
/* send the wmi command */
|
||||
status = wmi_unified_process_gtk_offload_getinfo_cmd(wmi_handle,
|
||||
vdev_id, offload_req_opcode);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
int target_if_pmo_gtk_offload_status_event(void *scn_handle,
|
||||
uint8_t *event, uint32_t len)
|
||||
{
|
||||
struct pmo_gtk_rsp_params *gtk_rsp_param;
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
QDF_STATUS ret;
|
||||
wmi_unified_t wmi_handle;
|
||||
|
||||
TARGET_IF_ENTER();
|
||||
psoc = target_if_get_psoc_from_scn_hdl(scn_handle);
|
||||
if (!psoc) {
|
||||
target_if_err("psoc ptr is NULL");
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
gtk_rsp_param = qdf_mem_malloc(sizeof(*gtk_rsp_param));
|
||||
if (!gtk_rsp_param) {
|
||||
ret = -ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi handle");
|
||||
qdf_mem_free(gtk_rsp_param);
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (wmi_extract_gtk_rsp_event(wmi_handle, event, gtk_rsp_param, len) !=
|
||||
QDF_STATUS_SUCCESS) {
|
||||
target_if_err("Extraction of gtk rsp event failed");
|
||||
qdf_mem_free(gtk_rsp_param);
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
ret = pmo_tgt_gtk_rsp_evt(psoc, (void *)gtk_rsp_param);
|
||||
if (ret != QDF_STATUS_SUCCESS) {
|
||||
target_if_err("Failed to rx_gtk_rsp_event");
|
||||
ret = -EINVAL;
|
||||
}
|
||||
qdf_mem_free(gtk_rsp_param);
|
||||
out:
|
||||
TARGET_IF_EXIT();
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@@ -1,53 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2017-2018 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: target_if_pmo_non_arp_bcast_fltr.c
|
||||
*
|
||||
* Target interface file for pmo component to
|
||||
* send non arp hw bcast filtering related cmd and process event.
|
||||
*/
|
||||
|
||||
#include "target_if.h"
|
||||
#include "target_if_pmo.h"
|
||||
#include "wmi_unified_api.h"
|
||||
#include "wlan_pmo_hw_filter_public_struct.h"
|
||||
|
||||
QDF_STATUS target_if_pmo_conf_hw_filter(struct wlan_objmgr_psoc *psoc,
|
||||
struct pmo_hw_filter_params *req)
|
||||
{
|
||||
QDF_STATUS status;
|
||||
wmi_unified_t wmi_handle;
|
||||
|
||||
if (!psoc) {
|
||||
target_if_err("psoc is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi handle");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
status = wmi_unified_conf_hw_filter_cmd(wmi_handle, req);
|
||||
|
||||
if (QDF_IS_STATUS_ERROR(status))
|
||||
target_if_err("Failed to configure HW Filter");
|
||||
|
||||
return status;
|
||||
}
|
@@ -1,49 +0,0 @@
|
||||
/*
|
||||
* 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: target_if_pmo_icmp.c
|
||||
*
|
||||
* Target interface file for pmo component to
|
||||
* send icmp offload related cmd and process event.
|
||||
*/
|
||||
|
||||
#include "target_if.h"
|
||||
#include "target_if_pmo.h"
|
||||
#include "wmi_unified_api.h"
|
||||
|
||||
QDF_STATUS
|
||||
target_if_pmo_send_icmp_offload_req(struct wlan_objmgr_psoc *psoc,
|
||||
struct pmo_icmp_offload *pmo_icmp_req)
|
||||
{
|
||||
QDF_STATUS status;
|
||||
wmi_unified_t wmi_handle;
|
||||
|
||||
if (!psoc) {
|
||||
target_if_err("psoc handle is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi handle");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
status = wmi_unified_config_icmp_offload_cmd(wmi_handle, pmo_icmp_req);
|
||||
|
||||
return status;
|
||||
}
|
@@ -1,280 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2017-2020 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: target_if_pmo_lphb.c
|
||||
*
|
||||
* Target interface file for pmo component to
|
||||
* send lphb offload related cmd and process event.
|
||||
*/
|
||||
#ifdef FEATURE_WLAN_LPHB
|
||||
|
||||
#include "target_if.h"
|
||||
#include "target_if_pmo.h"
|
||||
#include "wmi_unified_pmo_api.h"
|
||||
|
||||
QDF_STATUS target_if_pmo_send_lphb_enable(struct wlan_objmgr_psoc *psoc,
|
||||
struct pmo_lphb_enable_req *ts_lphb_enable)
|
||||
{
|
||||
wmi_hb_set_enable_cmd_fixed_param hb_enable_fp;
|
||||
wmi_unified_t wmi_handle;
|
||||
|
||||
if (!ts_lphb_enable) {
|
||||
target_if_err("LPHB Enable configuration is NULL");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
target_if_info("PMO_HB_SET_ENABLE enable=%d, item=%d, session=%d",
|
||||
ts_lphb_enable->enable,
|
||||
ts_lphb_enable->item, ts_lphb_enable->session);
|
||||
|
||||
if ((ts_lphb_enable->item != 1) && (ts_lphb_enable->item != 2)) {
|
||||
target_if_err("LPHB configuration wrong item %d",
|
||||
ts_lphb_enable->item);
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
/* fill in values */
|
||||
hb_enable_fp.vdev_id = ts_lphb_enable->session;
|
||||
hb_enable_fp.enable = ts_lphb_enable->enable;
|
||||
hb_enable_fp.item = ts_lphb_enable->item;
|
||||
hb_enable_fp.session = ts_lphb_enable->session;
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi handle");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
return wmi_unified_lphb_config_hbenable_cmd(wmi_handle, &hb_enable_fp);
|
||||
}
|
||||
|
||||
QDF_STATUS target_if_pmo_send_lphb_tcp_params(struct wlan_objmgr_psoc *psoc,
|
||||
struct pmo_lphb_tcp_params *ts_lphb_tcp_param)
|
||||
{
|
||||
wmi_hb_set_tcp_params_cmd_fixed_param hb_tcp_params_fp = {0};
|
||||
wmi_unified_t wmi_handle;
|
||||
|
||||
if (!ts_lphb_tcp_param) {
|
||||
target_if_err("TCP params LPHB configuration is NULL");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
target_if_info("PMO --> WMI_HB_SET_TCP_PARAMS srv_ip=%08x, "
|
||||
"dev_ip=%08x, src_port=%d, dst_port=%d, timeout=%d, "
|
||||
"session=%d, gateway_mac= "QDF_MAC_ADDR_FMT", time_period_sec=%d,"
|
||||
"tcp_sn=%d", ts_lphb_tcp_param->srv_ip,
|
||||
ts_lphb_tcp_param->dev_ip, ts_lphb_tcp_param->src_port,
|
||||
ts_lphb_tcp_param->dst_port, ts_lphb_tcp_param->timeout,
|
||||
ts_lphb_tcp_param->session,
|
||||
QDF_MAC_ADDR_REF(ts_lphb_tcp_param->gateway_mac.bytes),
|
||||
ts_lphb_tcp_param->time_period_sec, ts_lphb_tcp_param->tcp_sn);
|
||||
|
||||
/* fill in values */
|
||||
hb_tcp_params_fp.vdev_id = ts_lphb_tcp_param->session;
|
||||
hb_tcp_params_fp.srv_ip = ts_lphb_tcp_param->srv_ip;
|
||||
hb_tcp_params_fp.dev_ip = ts_lphb_tcp_param->dev_ip;
|
||||
hb_tcp_params_fp.seq = ts_lphb_tcp_param->tcp_sn;
|
||||
hb_tcp_params_fp.src_port = ts_lphb_tcp_param->src_port;
|
||||
hb_tcp_params_fp.dst_port = ts_lphb_tcp_param->dst_port;
|
||||
hb_tcp_params_fp.interval = ts_lphb_tcp_param->time_period_sec;
|
||||
hb_tcp_params_fp.timeout = ts_lphb_tcp_param->timeout;
|
||||
hb_tcp_params_fp.session = ts_lphb_tcp_param->session;
|
||||
WMI_CHAR_ARRAY_TO_MAC_ADDR(ts_lphb_tcp_param->gateway_mac.bytes,
|
||||
&hb_tcp_params_fp.gateway_mac);
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi handle");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
return wmi_unified_lphb_config_tcp_params_cmd(wmi_handle,
|
||||
&hb_tcp_params_fp);
|
||||
}
|
||||
|
||||
QDF_STATUS target_if_pmo_send_lphb_tcp_pkt_filter(struct wlan_objmgr_psoc *psoc,
|
||||
struct pmo_lphb_tcp_filter_req *ts_lphb_tcp_filter)
|
||||
{
|
||||
wmi_hb_set_tcp_pkt_filter_cmd_fixed_param hb_tcp_filter_fp = {0};
|
||||
wmi_unified_t wmi_handle;
|
||||
|
||||
if (!ts_lphb_tcp_filter) {
|
||||
target_if_err("TCP PKT FILTER LPHB configuration is NULL");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
target_if_info("SET_TCP_PKT_FILTER length=%d, offset=%d, session=%d, "
|
||||
"filter=%2x:%2x:%2x:%2x:%2x:%2x ...",
|
||||
ts_lphb_tcp_filter->length, ts_lphb_tcp_filter->offset,
|
||||
ts_lphb_tcp_filter->session, ts_lphb_tcp_filter->filter[0],
|
||||
ts_lphb_tcp_filter->filter[1], ts_lphb_tcp_filter->filter[2],
|
||||
ts_lphb_tcp_filter->filter[3], ts_lphb_tcp_filter->filter[4],
|
||||
ts_lphb_tcp_filter->filter[5]);
|
||||
|
||||
/* fill in values */
|
||||
hb_tcp_filter_fp.vdev_id = ts_lphb_tcp_filter->session;
|
||||
hb_tcp_filter_fp.length = ts_lphb_tcp_filter->length;
|
||||
hb_tcp_filter_fp.offset = ts_lphb_tcp_filter->offset;
|
||||
hb_tcp_filter_fp.session = ts_lphb_tcp_filter->session;
|
||||
memcpy((void *)&hb_tcp_filter_fp.filter,
|
||||
(void *)&ts_lphb_tcp_filter->filter,
|
||||
WMI_WLAN_HB_MAX_FILTER_SIZE);
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi handle");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
return wmi_unified_lphb_config_tcp_pkt_filter_cmd(wmi_handle,
|
||||
&hb_tcp_filter_fp);
|
||||
}
|
||||
|
||||
QDF_STATUS target_if_pmo_send_lphb_udp_params(struct wlan_objmgr_psoc *psoc,
|
||||
struct pmo_lphb_udp_params *ts_lphb_udp_param)
|
||||
{
|
||||
wmi_hb_set_udp_params_cmd_fixed_param hb_udp_params_fp = {0};
|
||||
wmi_unified_t wmi_handle;
|
||||
|
||||
if (!ts_lphb_udp_param) {
|
||||
target_if_err("UDP param for LPHB configuration is NULL");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
target_if_info("HB_SET_UDP_PARAMS srv_ip=%d, dev_ip=%d, src_port=%d, "
|
||||
"dst_port=%d, interval=%d, timeout=%d, session=%d, "
|
||||
"gateway_mac= "QDF_MAC_ADDR_FMT,
|
||||
ts_lphb_udp_param->srv_ip, ts_lphb_udp_param->dev_ip,
|
||||
ts_lphb_udp_param->src_port, ts_lphb_udp_param->dst_port,
|
||||
ts_lphb_udp_param->interval, ts_lphb_udp_param->timeout,
|
||||
ts_lphb_udp_param->session,
|
||||
QDF_MAC_ADDR_REF(ts_lphb_udp_param->gateway_mac.bytes));
|
||||
|
||||
/* fill in values */
|
||||
hb_udp_params_fp.vdev_id = ts_lphb_udp_param->session;
|
||||
hb_udp_params_fp.srv_ip = ts_lphb_udp_param->srv_ip;
|
||||
hb_udp_params_fp.dev_ip = ts_lphb_udp_param->dev_ip;
|
||||
hb_udp_params_fp.src_port = ts_lphb_udp_param->src_port;
|
||||
hb_udp_params_fp.dst_port = ts_lphb_udp_param->dst_port;
|
||||
hb_udp_params_fp.interval = ts_lphb_udp_param->interval;
|
||||
hb_udp_params_fp.timeout = ts_lphb_udp_param->timeout;
|
||||
hb_udp_params_fp.session = ts_lphb_udp_param->session;
|
||||
WMI_CHAR_ARRAY_TO_MAC_ADDR(ts_lphb_udp_param->gateway_mac.bytes,
|
||||
&hb_udp_params_fp.gateway_mac);
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi handle");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
return wmi_unified_lphb_config_udp_params_cmd(wmi_handle,
|
||||
&hb_udp_params_fp);
|
||||
}
|
||||
|
||||
/**
|
||||
* target_if_pmo_lphb_send_udp_pkt_filter() - Send LPHB udp pkt filter req
|
||||
* @psoc: objmgr psoc handle
|
||||
* @ts_lphb_udp_filter: lphb udp filter request which needs to configure in fwr
|
||||
*
|
||||
* Return: QDF status
|
||||
*/
|
||||
QDF_STATUS target_if_pmo_send_lphb_udp_pkt_filter(struct wlan_objmgr_psoc *psoc,
|
||||
struct pmo_lphb_udp_filter_req *ts_lphb_udp_filter)
|
||||
{
|
||||
wmi_hb_set_udp_pkt_filter_cmd_fixed_param hb_udp_filter_fp = {0};
|
||||
wmi_unified_t wmi_handle;
|
||||
|
||||
if (!ts_lphb_udp_filter) {
|
||||
target_if_err("LPHB UDP packet filter configuration is NULL");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
target_if_info("SET_UDP_PKT_FILTER length=%d, offset=%d, session=%d, "
|
||||
"filter=%2x:%2x:%2x:%2x:%2x:%2x ...",
|
||||
ts_lphb_udp_filter->length, ts_lphb_udp_filter->offset,
|
||||
ts_lphb_udp_filter->session, ts_lphb_udp_filter->filter[0],
|
||||
ts_lphb_udp_filter->filter[1], ts_lphb_udp_filter->filter[2],
|
||||
ts_lphb_udp_filter->filter[3], ts_lphb_udp_filter->filter[4],
|
||||
ts_lphb_udp_filter->filter[5]);
|
||||
|
||||
/* fill in values */
|
||||
hb_udp_filter_fp.vdev_id = ts_lphb_udp_filter->session;
|
||||
hb_udp_filter_fp.length = ts_lphb_udp_filter->length;
|
||||
hb_udp_filter_fp.offset = ts_lphb_udp_filter->offset;
|
||||
hb_udp_filter_fp.session = ts_lphb_udp_filter->session;
|
||||
qdf_mem_copy(&hb_udp_filter_fp.filter, &ts_lphb_udp_filter->filter,
|
||||
WMI_WLAN_HB_MAX_FILTER_SIZE);
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi handle");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
return wmi_unified_lphb_config_udp_pkt_filter_cmd(wmi_handle,
|
||||
&hb_udp_filter_fp);
|
||||
}
|
||||
|
||||
QDF_STATUS target_if_pmo_lphb_evt_handler(struct wlan_objmgr_psoc *psoc,
|
||||
uint8_t *event)
|
||||
{
|
||||
wmi_hb_ind_event_fixed_param *hb_fp;
|
||||
struct pmo_lphb_rsp *slphb_indication = NULL;
|
||||
QDF_STATUS qdf_status;
|
||||
|
||||
TARGET_IF_ENTER();
|
||||
if (!psoc) {
|
||||
target_if_err("psoc ptr is NULL");
|
||||
qdf_status = QDF_STATUS_E_NULL_VALUE;
|
||||
goto out;
|
||||
}
|
||||
|
||||
hb_fp = (wmi_hb_ind_event_fixed_param *) event;
|
||||
if (!hb_fp) {
|
||||
target_if_err("Invalid wmi_hb_ind_event_fixed_param buffer");
|
||||
qdf_status = QDF_STATUS_E_INVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
target_if_debug("lphb indication received with\n"
|
||||
"vdev_id=%d, session=%d, reason=%d",
|
||||
hb_fp->vdev_id, hb_fp->session, hb_fp->reason);
|
||||
|
||||
slphb_indication = (struct pmo_lphb_rsp *)qdf_mem_malloc(
|
||||
sizeof(struct pmo_lphb_rsp));
|
||||
if (!slphb_indication) {
|
||||
qdf_status = QDF_STATUS_E_NOMEM;
|
||||
goto out;
|
||||
}
|
||||
|
||||
slphb_indication->session_idx = hb_fp->session;
|
||||
slphb_indication->protocol_type = hb_fp->reason;
|
||||
slphb_indication->event_reason = hb_fp->reason;
|
||||
|
||||
qdf_status = pmo_tgt_lphb_rsp_evt(psoc, slphb_indication);
|
||||
if (qdf_status != QDF_STATUS_SUCCESS)
|
||||
target_if_err("Failed to lphb_rsp_event");
|
||||
out:
|
||||
if (slphb_indication)
|
||||
qdf_mem_free(slphb_indication);
|
||||
|
||||
return qdf_status;
|
||||
}
|
||||
#endif
|
||||
|
@@ -1,155 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2017-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: Target interface file for pmo component to
|
||||
* Implement api's which shall be used by pmo component
|
||||
* in target if internally.
|
||||
*/
|
||||
|
||||
#include "target_if_pmo.h"
|
||||
#include "wlan_pmo_common_public_struct.h"
|
||||
#include "wlan_pmo_icmp.h"
|
||||
|
||||
#ifdef WLAN_FEATURE_PACKET_FILTERING
|
||||
static inline
|
||||
void tgt_if_pmo_reg_pkt_filter_ops(struct wlan_pmo_tx_ops *pmo_tx_ops)
|
||||
{
|
||||
pmo_tx_ops->send_set_pkt_filter =
|
||||
target_if_pmo_send_pkt_filter_req;
|
||||
pmo_tx_ops->send_clear_pkt_filter =
|
||||
target_if_pmo_clear_pkt_filter_req;
|
||||
}
|
||||
#else
|
||||
static inline void
|
||||
tgt_if_pmo_reg_pkt_filter_ops(struct wlan_pmo_tx_ops *pmo_tx_ops)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
#ifdef WLAN_FEATURE_IGMP_OFFLOAD
|
||||
static void
|
||||
update_pmo_igmp_tx_ops(struct wlan_pmo_tx_ops *pmo_tx_ops)
|
||||
{
|
||||
pmo_tx_ops->send_igmp_offload_req =
|
||||
target_if_pmo_send_igmp_offload_req;
|
||||
}
|
||||
#else
|
||||
static inline void
|
||||
update_pmo_igmp_tx_ops(struct wlan_pmo_tx_ops *pmo_tx_ops)
|
||||
{}
|
||||
#endif
|
||||
#ifdef WLAN_FEATURE_ICMP_OFFLOAD
|
||||
static void tgt_if_pmo_icmp_tx_ops(struct wlan_pmo_tx_ops *pmo_tx_ops)
|
||||
{
|
||||
pmo_tx_ops->send_icmp_offload_req =
|
||||
target_if_pmo_send_icmp_offload_req;
|
||||
}
|
||||
#else
|
||||
static inline void
|
||||
tgt_if_pmo_icmp_tx_ops(struct wlan_pmo_tx_ops *pmo_tx_ops)
|
||||
{}
|
||||
#endif
|
||||
void target_if_pmo_register_tx_ops(struct wlan_pmo_tx_ops *pmo_tx_ops)
|
||||
{
|
||||
if (!pmo_tx_ops) {
|
||||
target_if_err("pmo_tx_ops is null");
|
||||
return;
|
||||
}
|
||||
|
||||
pmo_tx_ops->send_arp_offload_req =
|
||||
target_if_pmo_send_arp_offload_req;
|
||||
pmo_tx_ops->send_conf_hw_filter_req =
|
||||
target_if_pmo_conf_hw_filter;
|
||||
pmo_tx_ops->send_ns_offload_req =
|
||||
target_if_pmo_send_ns_offload_req;
|
||||
pmo_tx_ops->send_enable_wow_wakeup_event_req =
|
||||
target_if_pmo_enable_wow_wakeup_event;
|
||||
pmo_tx_ops->send_disable_wow_wakeup_event_req =
|
||||
target_if_pmo_disable_wow_wakeup_event;
|
||||
pmo_tx_ops->send_add_wow_pattern =
|
||||
target_if_pmo_send_wow_patterns_to_fw;
|
||||
pmo_tx_ops->del_wow_pattern =
|
||||
target_if_pmo_del_wow_patterns_to_fw;
|
||||
pmo_tx_ops->send_enhance_mc_offload_req =
|
||||
target_if_pmo_send_enhance_mc_offload_req;
|
||||
pmo_tx_ops->send_set_mc_filter_req =
|
||||
target_if_pmo_set_mc_filter_req;
|
||||
pmo_tx_ops->send_clear_mc_filter_req =
|
||||
target_if_pmo_clear_mc_filter_req;
|
||||
pmo_tx_ops->get_multiple_mc_filter_support =
|
||||
target_if_pmo_get_multiple_mc_filter_support;
|
||||
pmo_tx_ops->send_set_multiple_mc_filter_req =
|
||||
target_if_pmo_set_multiple_mc_filter_req;
|
||||
pmo_tx_ops->send_clear_multiple_mc_filter_req =
|
||||
target_if_pmo_clear_multiple_mc_filter_req;
|
||||
pmo_tx_ops->send_ra_filter_req =
|
||||
target_if_pmo_send_ra_filter_req;
|
||||
pmo_tx_ops->send_gtk_offload_req =
|
||||
target_if_pmo_send_gtk_offload_req;
|
||||
pmo_tx_ops->send_get_gtk_rsp_cmd =
|
||||
target_if_pmo_send_gtk_response_req;
|
||||
pmo_tx_ops->send_action_frame_pattern_req =
|
||||
target_if_pmo_send_action_frame_patterns;
|
||||
pmo_tx_ops->send_lphb_enable =
|
||||
target_if_pmo_send_lphb_enable;
|
||||
pmo_tx_ops->send_lphb_tcp_params =
|
||||
target_if_pmo_send_lphb_tcp_params;
|
||||
pmo_tx_ops->send_lphb_tcp_filter_req =
|
||||
target_if_pmo_send_lphb_tcp_pkt_filter;
|
||||
pmo_tx_ops->send_lphb_upd_params =
|
||||
target_if_pmo_send_lphb_udp_params;
|
||||
pmo_tx_ops->send_lphb_udp_filter_req =
|
||||
target_if_pmo_send_lphb_udp_pkt_filter;
|
||||
pmo_tx_ops->send_vdev_param_update_req =
|
||||
target_if_pmo_send_vdev_update_param_req;
|
||||
pmo_tx_ops->send_vdev_sta_ps_param_req =
|
||||
target_if_pmo_send_vdev_ps_param_req;
|
||||
pmo_tx_ops->psoc_update_wow_bus_suspend =
|
||||
target_if_pmo_psoc_update_bus_suspend;
|
||||
pmo_tx_ops->psoc_get_host_credits =
|
||||
target_if_pmo_psoc_get_host_credits;
|
||||
update_pmo_igmp_tx_ops(pmo_tx_ops);
|
||||
pmo_tx_ops->psoc_get_pending_cmnds =
|
||||
target_if_pmo_psoc_get_pending_cmnds;
|
||||
pmo_tx_ops->update_target_suspend_flag =
|
||||
target_if_pmo_update_target_suspend_flag;
|
||||
pmo_tx_ops->update_target_suspend_acked_flag =
|
||||
target_if_pmo_update_target_suspend_acked_flag;
|
||||
pmo_tx_ops->is_target_suspended =
|
||||
target_if_pmo_is_target_suspended;
|
||||
pmo_tx_ops->psoc_send_wow_enable_req =
|
||||
target_if_pmo_psoc_send_wow_enable_req;
|
||||
pmo_tx_ops->psoc_send_supend_req =
|
||||
target_if_pmo_psoc_send_suspend_req;
|
||||
pmo_tx_ops->psoc_set_runtime_pm_in_progress =
|
||||
target_if_pmo_set_runtime_pm_in_progress;
|
||||
pmo_tx_ops->psoc_get_runtime_pm_in_progress =
|
||||
target_if_pmo_get_runtime_pm_in_progress;
|
||||
pmo_tx_ops->psoc_send_host_wakeup_ind =
|
||||
target_if_pmo_psoc_send_host_wakeup_ind;
|
||||
pmo_tx_ops->psoc_send_target_resume_req =
|
||||
target_if_pmo_psoc_send_target_resume_req;
|
||||
pmo_tx_ops->psoc_send_d0wow_enable_req =
|
||||
target_if_pmo_psoc_send_d0wow_enable_req;
|
||||
pmo_tx_ops->psoc_send_d0wow_disable_req =
|
||||
target_if_pmo_psoc_send_d0wow_disable_req;
|
||||
pmo_tx_ops->psoc_send_idle_roam_suspend_mode =
|
||||
target_if_pmo_psoc_send_idle_monitor_cmd;
|
||||
tgt_if_pmo_reg_pkt_filter_ops(pmo_tx_ops);
|
||||
tgt_if_pmo_icmp_tx_ops(pmo_tx_ops);
|
||||
}
|
||||
|
@@ -1,221 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2017-2018, 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: target_if_pmo_mc_addr_filtering.c
|
||||
*
|
||||
* Target interface file for pmo component to
|
||||
* send mc address filtering offload related cmd and process event.
|
||||
*/
|
||||
|
||||
|
||||
#include "target_if.h"
|
||||
#include "target_if_pmo.h"
|
||||
#include "wmi_unified_api.h"
|
||||
|
||||
QDF_STATUS target_if_pmo_set_mc_filter_req(
|
||||
struct wlan_objmgr_vdev *vdev,
|
||||
struct qdf_mac_addr multicast_addr)
|
||||
{
|
||||
uint8_t vdev_id;
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
QDF_STATUS status;
|
||||
wmi_unified_t wmi_handle;
|
||||
|
||||
if (!vdev) {
|
||||
target_if_err("vdev ptr passed is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
psoc = wlan_vdev_get_psoc(vdev);
|
||||
vdev_id = wlan_vdev_get_id(vdev);
|
||||
if (!psoc) {
|
||||
target_if_err("psoc handle is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi handle");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
status = wmi_unified_add_clear_mcbc_filter_cmd(wmi_handle, vdev_id,
|
||||
multicast_addr, false);
|
||||
if (status)
|
||||
target_if_err("Failed to send add/clear mcbc filter cmd");
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
QDF_STATUS target_if_pmo_clear_mc_filter_req(
|
||||
struct wlan_objmgr_vdev *vdev,
|
||||
struct qdf_mac_addr multicast_addr)
|
||||
{
|
||||
uint8_t vdev_id;
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
QDF_STATUS status;
|
||||
wmi_unified_t wmi_handle;
|
||||
|
||||
if (!vdev) {
|
||||
target_if_err("vdev ptr passed is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
psoc = wlan_vdev_get_psoc(vdev);
|
||||
vdev_id = wlan_vdev_get_id(vdev);
|
||||
if (!psoc) {
|
||||
target_if_err("psoc handle is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi handle");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
status = wmi_unified_add_clear_mcbc_filter_cmd(wmi_handle, vdev_id,
|
||||
multicast_addr, true);
|
||||
if (status)
|
||||
target_if_err("Failed to send add/clear mcbc filter cmd");
|
||||
|
||||
return status;
|
||||
|
||||
}
|
||||
|
||||
bool target_if_pmo_get_multiple_mc_filter_support(
|
||||
struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
wmi_unified_t wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi handle");
|
||||
return false;
|
||||
}
|
||||
|
||||
return wmi_service_enabled(wmi_handle,
|
||||
wmi_service_multiple_mcast_filter_set);
|
||||
}
|
||||
|
||||
QDF_STATUS target_if_pmo_set_multiple_mc_filter_req(
|
||||
struct wlan_objmgr_vdev *vdev,
|
||||
struct pmo_mc_addr_list *mc_list)
|
||||
{
|
||||
uint8_t vdev_id;
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
struct pmo_mcast_filter_params *filter_params;
|
||||
QDF_STATUS status;
|
||||
wmi_unified_t wmi_handle;
|
||||
|
||||
if (!vdev) {
|
||||
target_if_err("vdev ptr passed is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
psoc = wlan_vdev_get_psoc(vdev);
|
||||
vdev_id = wlan_vdev_get_id(vdev);
|
||||
if (!psoc) {
|
||||
target_if_err("psoc handle is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
filter_params = qdf_mem_malloc(sizeof(*filter_params));
|
||||
if (!filter_params) {
|
||||
target_if_err("memory alloc failed for filter_params");
|
||||
return QDF_STATUS_E_NOMEM;
|
||||
}
|
||||
|
||||
filter_params->multicast_addr_cnt = mc_list->mc_cnt;
|
||||
qdf_mem_copy(filter_params->multicast_addr,
|
||||
mc_list->mc_addr,
|
||||
mc_list->mc_cnt * ATH_MAC_LEN);
|
||||
/* add one/multiple mc list */
|
||||
filter_params->action = 1;
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi handle");
|
||||
qdf_mem_free(filter_params);
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
status = wmi_unified_multiple_add_clear_mcbc_filter_cmd(wmi_handle,
|
||||
vdev_id,
|
||||
filter_params);
|
||||
if (status)
|
||||
target_if_err("Failed to send add/clear mcbc filter cmd");
|
||||
|
||||
qdf_mem_free(filter_params);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
QDF_STATUS target_if_pmo_clear_multiple_mc_filter_req(
|
||||
struct wlan_objmgr_vdev *vdev,
|
||||
struct pmo_mc_addr_list *mc_list)
|
||||
{
|
||||
uint8_t vdev_id;
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
struct pmo_mcast_filter_params *filter_params;
|
||||
QDF_STATUS status;
|
||||
wmi_unified_t wmi_handle;
|
||||
|
||||
if (!vdev) {
|
||||
target_if_err("vdev ptr passed is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
psoc = wlan_vdev_get_psoc(vdev);
|
||||
vdev_id = wlan_vdev_get_id(vdev);
|
||||
if (!psoc) {
|
||||
target_if_err("psoc handle is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
filter_params = qdf_mem_malloc(sizeof(*filter_params));
|
||||
if (!filter_params) {
|
||||
target_if_err("memory alloc failed for filter_params");
|
||||
return QDF_STATUS_E_NOMEM;
|
||||
}
|
||||
|
||||
filter_params->multicast_addr_cnt = mc_list->mc_cnt;
|
||||
qdf_mem_copy(filter_params->multicast_addr,
|
||||
mc_list->mc_addr,
|
||||
mc_list->mc_cnt * ATH_MAC_LEN);
|
||||
/* delete one/multiple mc list */
|
||||
filter_params->action = 0;
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi handle");
|
||||
qdf_mem_free(filter_params);
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
status = wmi_unified_multiple_add_clear_mcbc_filter_cmd(wmi_handle,
|
||||
vdev_id,
|
||||
filter_params);
|
||||
if (status)
|
||||
target_if_err("Failed to send add/clear mcbc filter cmd");
|
||||
|
||||
qdf_mem_free(filter_params);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
@@ -1,66 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2017-2018 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: target_if_pmo_ns.c
|
||||
*
|
||||
* Target interface file for pmo component to
|
||||
* send ns offload related cmd and process event.
|
||||
*/
|
||||
|
||||
#include "target_if.h"
|
||||
#include "target_if_pmo.h"
|
||||
#include "wmi_unified_api.h"
|
||||
|
||||
QDF_STATUS target_if_pmo_send_ns_offload_req(
|
||||
struct wlan_objmgr_vdev *vdev,
|
||||
struct pmo_arp_offload_params *arp_offload_req,
|
||||
struct pmo_ns_offload_params *ns_offload_req)
|
||||
{
|
||||
uint8_t vdev_id;
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
QDF_STATUS status;
|
||||
wmi_unified_t wmi_handle;
|
||||
|
||||
if (!vdev) {
|
||||
target_if_err("vdev ptr passed is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
psoc = wlan_vdev_get_psoc(vdev);
|
||||
vdev_id = wlan_vdev_get_id(vdev);
|
||||
if (!psoc) {
|
||||
target_if_err("psoc handle is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi handle");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
status = wmi_unified_enable_arp_ns_offload_cmd(wmi_handle,
|
||||
arp_offload_req,
|
||||
ns_offload_req,
|
||||
vdev_id);
|
||||
if (status != QDF_STATUS_SUCCESS)
|
||||
target_if_err("Failed to enable ARP NDP/NSffload");
|
||||
|
||||
return status;
|
||||
}
|
||||
|
@@ -1,108 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2017-2018 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: target_if_pmo_pkt_filter.c
|
||||
*
|
||||
* Target interface file for pmo component to
|
||||
* send packet filter related cmd and process event.
|
||||
*/
|
||||
|
||||
#include "target_if.h"
|
||||
#include "target_if_pmo.h"
|
||||
#include "wmi_unified_pmo_api.h"
|
||||
#include "wlan_pmo_pkt_filter_public_struct.h"
|
||||
|
||||
QDF_STATUS target_if_pmo_send_pkt_filter_req(struct wlan_objmgr_vdev *vdev,
|
||||
struct pmo_rcv_pkt_fltr_cfg *rcv_filter_param)
|
||||
{
|
||||
uint8_t vdev_id;
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
QDF_STATUS status;
|
||||
wmi_unified_t wmi_handle;
|
||||
|
||||
if (!vdev) {
|
||||
target_if_err("vdev ptr passed is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
psoc = wlan_vdev_get_psoc(vdev);
|
||||
vdev_id = wlan_vdev_get_id(vdev);
|
||||
if (!psoc) {
|
||||
target_if_err("psoc handle is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi handle");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
/* send the command along with data */
|
||||
status = wmi_unified_config_packet_filter_cmd(wmi_handle, vdev_id,
|
||||
rcv_filter_param,
|
||||
rcv_filter_param->filter_id, true);
|
||||
if (status) {
|
||||
target_if_err("Failed to send pkt_filter cmd");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
/* Enable packet filter */
|
||||
status = wmi_unified_enable_disable_packet_filter_cmd(wmi_handle,
|
||||
vdev_id, true);
|
||||
if (status)
|
||||
target_if_err("Failed to send packet filter wmi cmd to fw");
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
QDF_STATUS target_if_pmo_clear_pkt_filter_req(struct wlan_objmgr_vdev *vdev,
|
||||
struct pmo_rcv_pkt_fltr_clear_param *rcv_clear_param)
|
||||
{
|
||||
uint8_t vdev_id;
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
QDF_STATUS status;
|
||||
wmi_unified_t wmi_handle;
|
||||
|
||||
if (!vdev) {
|
||||
target_if_err("vdev ptr passed is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
psoc = wlan_vdev_get_psoc(vdev);
|
||||
vdev_id = wlan_vdev_get_id(vdev);
|
||||
if (!psoc) {
|
||||
target_if_err("psoc handle is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi handle");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
/* send the command along with data */
|
||||
status = wmi_unified_config_packet_filter_cmd(wmi_handle, vdev_id, NULL,
|
||||
rcv_clear_param->filter_id, false);
|
||||
|
||||
if (status)
|
||||
target_if_err("Failed to clear filter cmd");
|
||||
|
||||
return status;
|
||||
}
|
@@ -1,135 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2017-2018 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: target_if_pmo_static.c
|
||||
*
|
||||
* Target interface file for pmo component to
|
||||
* send wow related cmd and process event.
|
||||
*/
|
||||
|
||||
|
||||
#include "target_if.h"
|
||||
#include "target_if_pmo.h"
|
||||
#include "wmi_unified_api.h"
|
||||
|
||||
QDF_STATUS target_if_pmo_send_ra_filter_req(struct wlan_objmgr_vdev *vdev,
|
||||
uint8_t default_pattern, uint16_t rate_limit_interval)
|
||||
{
|
||||
uint8_t vdev_id;
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
QDF_STATUS status;
|
||||
wmi_unified_t wmi_handle;
|
||||
|
||||
if (!vdev) {
|
||||
target_if_err("vdev ptr passed is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
psoc = wlan_vdev_get_psoc(vdev);
|
||||
vdev_id = wlan_vdev_get_id(vdev);
|
||||
if (!psoc) {
|
||||
target_if_err("psoc handle is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi handle");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
status = wmi_unified_wow_sta_ra_filter_cmd(wmi_handle,
|
||||
vdev_id,
|
||||
default_pattern,
|
||||
rate_limit_interval);
|
||||
if (status)
|
||||
target_if_err("Failed to send RA rate limit to fw");
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
QDF_STATUS target_if_pmo_send_action_frame_patterns(
|
||||
struct wlan_objmgr_vdev *vdev,
|
||||
struct pmo_action_wakeup_set_params *ip_cmd)
|
||||
{
|
||||
uint8_t vdev_id;
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
QDF_STATUS status;
|
||||
wmi_unified_t wmi_handle;
|
||||
|
||||
if (!vdev) {
|
||||
target_if_err("vdev ptr passed is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
psoc = wlan_vdev_get_psoc(vdev);
|
||||
vdev_id = wlan_vdev_get_id(vdev);
|
||||
if (!psoc) {
|
||||
target_if_err("psoc handle is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi handle");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
status = wmi_unified_action_frame_patterns_cmd(wmi_handle, ip_cmd);
|
||||
if (status != QDF_STATUS_SUCCESS)
|
||||
target_if_err("Failed to config wow action frame map, ret %d",
|
||||
status);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
QDF_STATUS target_if_pmo_send_enhance_mc_offload_req(
|
||||
struct wlan_objmgr_vdev *vdev, bool enable)
|
||||
{
|
||||
uint8_t vdev_id;
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
QDF_STATUS status;
|
||||
wmi_unified_t wmi_handle;
|
||||
|
||||
if (!vdev) {
|
||||
target_if_err("vdev ptr passed is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
psoc = wlan_vdev_get_psoc(vdev);
|
||||
vdev_id = wlan_vdev_get_id(vdev);
|
||||
if (!psoc) {
|
||||
target_if_err("psoc handle is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi handle");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
status = wmi_unified_enable_enhance_multicast_offload_cmd(wmi_handle,
|
||||
vdev_id,
|
||||
enable);
|
||||
if (status)
|
||||
target_if_err("Failed to config wow wakeup event");
|
||||
|
||||
return status;
|
||||
}
|
||||
|
@@ -1,442 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2017-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: target_if_pmo_static.c
|
||||
*
|
||||
* Target interface file for pmo component to
|
||||
* send suspend / resume related cmd and process event.
|
||||
*/
|
||||
|
||||
#include "wma.h"
|
||||
#include "target_if.h"
|
||||
#include "target_if_pmo.h"
|
||||
#include "wmi_unified_api.h"
|
||||
#include "qdf_types.h"
|
||||
#include "pld_common.h"
|
||||
#include <cds_api.h>
|
||||
#include <cdp_txrx_cmn.h>
|
||||
|
||||
#define TGT_WILDCARD_PDEV_ID 0x0
|
||||
|
||||
QDF_STATUS target_if_pmo_send_vdev_update_param_req(
|
||||
struct wlan_objmgr_vdev *vdev,
|
||||
uint32_t param_id, uint32_t param_value)
|
||||
{
|
||||
uint8_t vdev_id;
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
struct vdev_set_params param = {0};
|
||||
wmi_unified_t wmi_handle;
|
||||
|
||||
if (!vdev) {
|
||||
target_if_err("vdev ptr passed is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
psoc = wlan_vdev_get_psoc(vdev);
|
||||
vdev_id = wlan_vdev_get_id(vdev);
|
||||
if (!psoc) {
|
||||
target_if_err("psoc handle is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
/* Any new param_id added here please also add it to
|
||||
* wmi_tag_vdev_set_cmd to be tagged for runtime PM feature
|
||||
* so that it will not invoke runtime PM "get" which will
|
||||
* result resume right after suspend (WOW_ENABLE).
|
||||
*/
|
||||
|
||||
switch (param_id) {
|
||||
case pmo_vdev_param_listen_interval:
|
||||
param_id = WMI_VDEV_PARAM_LISTEN_INTERVAL;
|
||||
break;
|
||||
case pmo_vdev_param_dtim_policy:
|
||||
param_id = WMI_VDEV_PARAM_DTIM_POLICY;
|
||||
break;
|
||||
case pmo_vdev_param_forced_dtim_count:
|
||||
param_id = WMI_VDEV_PARAM_FORCE_DTIM_CNT;
|
||||
break;
|
||||
case pmo_vdev_param_moddtim:
|
||||
param_id = WMI_VDEV_PARAM_MODDTIM_CNT;
|
||||
break;
|
||||
default:
|
||||
target_if_err("invalid vdev param id %d", param_id);
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi handle");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
param.vdev_id = vdev_id;
|
||||
param.param_id = param_id;
|
||||
param.param_value = param_value;
|
||||
target_if_debug("set vdev param vdev_id: %d value: %d for param_id: %d",
|
||||
vdev_id, param_value, param_id);
|
||||
return wmi_unified_vdev_set_param_send(wmi_handle, ¶m);
|
||||
}
|
||||
|
||||
#ifdef WLAN_FEATURE_IGMP_OFFLOAD
|
||||
QDF_STATUS target_if_pmo_send_igmp_offload_req(
|
||||
struct wlan_objmgr_vdev *vdev,
|
||||
struct pmo_igmp_offload_req *pmo_igmp_req)
|
||||
{
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
wmi_unified_t wmi_handle;
|
||||
|
||||
if (!vdev) {
|
||||
target_if_err("vdev ptr passed is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
psoc = wlan_vdev_get_psoc(vdev);
|
||||
if (!psoc) {
|
||||
target_if_err("psoc handle is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi handle");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
return wmi_unified_send_igmp_offload_cmd(wmi_handle,
|
||||
pmo_igmp_req);
|
||||
}
|
||||
#endif
|
||||
|
||||
QDF_STATUS target_if_pmo_send_vdev_ps_param_req(
|
||||
struct wlan_objmgr_vdev *vdev,
|
||||
uint32_t param_id,
|
||||
uint32_t param_value)
|
||||
{
|
||||
uint8_t vdev_id;
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
QDF_STATUS status;
|
||||
struct sta_ps_params sta_ps_param = {0};
|
||||
wmi_unified_t wmi_handle;
|
||||
|
||||
if (!vdev) {
|
||||
target_if_err("vdev ptr passed is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
psoc = wlan_vdev_get_psoc(vdev);
|
||||
vdev_id = wlan_vdev_get_id(vdev);
|
||||
if (!psoc) {
|
||||
target_if_err("psoc handle is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Any new param_id added here must be added to
|
||||
* wmi_tag_sta_powersave_cmd() to be tagged for runtime PM feature
|
||||
* so that it will not invoke runtime PM "get" which will
|
||||
* result resume right after suspend (WOW_ENABLE).
|
||||
*/
|
||||
switch (param_id) {
|
||||
case pmo_sta_ps_enable_advanced_power:
|
||||
param_id = WMI_STA_PS_ENABLE_QPOWER;
|
||||
break;
|
||||
case pmo_sta_ps_param_inactivity_time:
|
||||
param_id = WMI_STA_PS_PARAM_INACTIVITY_TIME;
|
||||
break;
|
||||
case pmo_sta_ps_param_ito_repeat_count:
|
||||
param_id = WMI_STA_PS_PARAM_MAX_RESET_ITO_COUNT_ON_TIM_NO_TXRX;
|
||||
break;
|
||||
default:
|
||||
target_if_err("invalid vdev param id %d", param_id);
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
sta_ps_param.vdev_id = vdev_id;
|
||||
sta_ps_param.param_id = param_id;
|
||||
sta_ps_param.value = param_value;
|
||||
target_if_debug("set vdev param vdev_id: %d value: %d for param_id: %d",
|
||||
vdev_id, param_value, param_id);
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi handle");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
status = wmi_unified_sta_ps_cmd_send(wmi_handle, &sta_ps_param);
|
||||
if (QDF_IS_STATUS_ERROR(status))
|
||||
return status;
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
void target_if_pmo_psoc_update_bus_suspend(struct wlan_objmgr_psoc *psoc,
|
||||
uint8_t value)
|
||||
{
|
||||
wmi_unified_t wmi_handle;
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi handle");
|
||||
return;
|
||||
}
|
||||
|
||||
wmi_set_is_wow_bus_suspended(wmi_handle, value);
|
||||
}
|
||||
|
||||
int target_if_pmo_psoc_get_host_credits(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
wmi_unified_t wmi_handle;
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi handle");
|
||||
return 0;
|
||||
}
|
||||
|
||||
return wmi_get_host_credits(wmi_handle);
|
||||
}
|
||||
|
||||
int target_if_pmo_psoc_get_pending_cmnds(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
wmi_unified_t wmi_handle;
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi handle");
|
||||
return 0;
|
||||
}
|
||||
|
||||
return wmi_get_pending_cmds(wmi_handle);
|
||||
}
|
||||
|
||||
void target_if_pmo_update_target_suspend_flag(struct wlan_objmgr_psoc *psoc,
|
||||
uint8_t value)
|
||||
{
|
||||
wmi_unified_t wmi_handle;
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi handle");
|
||||
return;
|
||||
}
|
||||
|
||||
wmi_set_target_suspend(wmi_handle, value);
|
||||
}
|
||||
|
||||
void target_if_pmo_update_target_suspend_acked_flag(
|
||||
struct wlan_objmgr_psoc *psoc,
|
||||
uint8_t value)
|
||||
{
|
||||
wmi_unified_t wmi_handle;
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi handle");
|
||||
return;
|
||||
}
|
||||
|
||||
wmi_set_target_suspend_acked(wmi_handle, value);
|
||||
}
|
||||
|
||||
bool target_if_pmo_is_target_suspended(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
wmi_unified_t wmi_handle;
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi handle");
|
||||
return false;
|
||||
}
|
||||
|
||||
return wmi_is_target_suspended(wmi_handle);
|
||||
}
|
||||
|
||||
QDF_STATUS target_if_pmo_psoc_send_wow_enable_req(
|
||||
struct wlan_objmgr_psoc *psoc,
|
||||
struct pmo_wow_cmd_params *param)
|
||||
{
|
||||
wmi_unified_t wmi_handle;
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi handle");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
wma_check_and_set_wake_timer(INSTALL_KEY_TIMEOUT_MS);
|
||||
return wmi_unified_wow_enable_send(wmi_handle,
|
||||
(struct wow_cmd_params *)param,
|
||||
TGT_WILDCARD_PDEV_ID);
|
||||
}
|
||||
|
||||
QDF_STATUS target_if_pmo_psoc_send_suspend_req(
|
||||
struct wlan_objmgr_psoc *psoc,
|
||||
struct pmo_suspend_params *param)
|
||||
{
|
||||
wmi_unified_t wmi_handle;
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi handle");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
return wmi_unified_suspend_send(wmi_handle,
|
||||
(struct suspend_params *) param,
|
||||
TGT_WILDCARD_PDEV_ID);
|
||||
}
|
||||
|
||||
void target_if_pmo_set_runtime_pm_in_progress(struct wlan_objmgr_psoc *psoc,
|
||||
bool value)
|
||||
{
|
||||
wmi_unified_t wmi_handle;
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi handle");
|
||||
return;
|
||||
}
|
||||
|
||||
return wmi_set_runtime_pm_inprogress(wmi_handle, value);
|
||||
}
|
||||
|
||||
bool target_if_pmo_get_runtime_pm_in_progress(
|
||||
struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
wmi_unified_t wmi_handle;
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi handle");
|
||||
return false;
|
||||
}
|
||||
|
||||
return wmi_get_runtime_pm_inprogress(wmi_handle);
|
||||
}
|
||||
|
||||
#ifdef HOST_WAKEUP_OVER_QMI
|
||||
QDF_STATUS target_if_pmo_psoc_send_host_wakeup_ind(
|
||||
struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
qdf_device_t qdf_dev;
|
||||
int ret;
|
||||
|
||||
qdf_dev = wlan_psoc_get_qdf_dev(psoc);
|
||||
if (!qdf_dev)
|
||||
return QDF_STATUS_E_INVAL;
|
||||
|
||||
ret = pld_exit_power_save(qdf_dev->dev);
|
||||
if (ret) {
|
||||
target_if_err("Failed to exit power save, ret: %d", ret);
|
||||
return qdf_status_from_os_return(ret);
|
||||
}
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
#else
|
||||
QDF_STATUS target_if_pmo_psoc_send_host_wakeup_ind(
|
||||
struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
wmi_unified_t wmi_handle;
|
||||
bool tx_pending_ind = false;
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi handle");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
if (cdp_get_tx_inqueue(cds_get_context(QDF_MODULE_ID_SOC)))
|
||||
tx_pending_ind = true;
|
||||
|
||||
return wmi_unified_host_wakeup_ind_to_fw_cmd(wmi_handle,
|
||||
tx_pending_ind);
|
||||
}
|
||||
#endif
|
||||
|
||||
QDF_STATUS target_if_pmo_psoc_send_target_resume_req(
|
||||
struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
wmi_unified_t wmi_handle;
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi handle");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
return wmi_unified_resume_send(wmi_handle, TGT_WILDCARD_PDEV_ID);
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
target_if_pmo_psoc_send_idle_monitor_cmd(struct wlan_objmgr_psoc *psoc,
|
||||
uint8_t val)
|
||||
{
|
||||
wmi_unified_t wmi_handle;
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi handle");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
return wmi_unified_send_idle_trigger_monitor(wmi_handle, val);
|
||||
}
|
||||
|
||||
#ifdef FEATURE_WLAN_D0WOW
|
||||
QDF_STATUS target_if_pmo_psoc_send_d0wow_enable_req(
|
||||
struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
wmi_unified_t wmi_handle;
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi handle");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
return wmi_unified_d0wow_enable_send(wmi_handle, TGT_WILDCARD_PDEV_ID);
|
||||
}
|
||||
|
||||
QDF_STATUS target_if_pmo_psoc_send_d0wow_disable_req(
|
||||
struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
wmi_unified_t wmi_handle;
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi handle");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
return wmi_unified_d0wow_disable_send(wmi_handle, TGT_WILDCARD_PDEV_ID);
|
||||
}
|
||||
#else
|
||||
QDF_STATUS target_if_pmo_psoc_send_d0wow_enable_req(
|
||||
struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
QDF_STATUS target_if_pmo_psoc_send_d0wow_disable_req(
|
||||
struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
#endif
|
@@ -1,166 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2017-2018 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: target_if_pmo_wow.c
|
||||
*
|
||||
* Target interface file for pmo component to
|
||||
* send wow related cmd and process event.
|
||||
*/
|
||||
|
||||
|
||||
#include "target_if.h"
|
||||
#include "target_if_pmo.h"
|
||||
#include "wmi_unified_api.h"
|
||||
|
||||
QDF_STATUS target_if_pmo_enable_wow_wakeup_event(struct wlan_objmgr_vdev *vdev,
|
||||
uint32_t *bitmap)
|
||||
{
|
||||
uint8_t vdev_id;
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
QDF_STATUS status;
|
||||
wmi_unified_t wmi_handle;
|
||||
|
||||
if (!vdev) {
|
||||
target_if_err("vdev ptr passed is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
psoc = wlan_vdev_get_psoc(vdev);
|
||||
vdev_id = wlan_vdev_get_id(vdev);
|
||||
if (!psoc) {
|
||||
target_if_err("psoc handle is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi handle");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
status = wmi_unified_add_wow_wakeup_event_cmd(wmi_handle, vdev_id,
|
||||
bitmap, true);
|
||||
if (status)
|
||||
target_if_err("Failed to config wow wakeup event");
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
QDF_STATUS target_if_pmo_disable_wow_wakeup_event(struct wlan_objmgr_vdev *vdev,
|
||||
uint32_t *bitmap)
|
||||
{
|
||||
uint8_t vdev_id;
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
QDF_STATUS status;
|
||||
wmi_unified_t wmi_handle;
|
||||
|
||||
if (!vdev) {
|
||||
target_if_err("vdev ptr passed is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
psoc = wlan_vdev_get_psoc(vdev);
|
||||
vdev_id = wlan_vdev_get_id(vdev);
|
||||
if (!psoc) {
|
||||
target_if_err("psoc handle is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi handle");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
status = wmi_unified_add_wow_wakeup_event_cmd(wmi_handle, vdev_id,
|
||||
bitmap, false);
|
||||
if (status)
|
||||
target_if_err("Failed to config wow wakeup event");
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
QDF_STATUS target_if_pmo_send_wow_patterns_to_fw(struct wlan_objmgr_vdev *vdev,
|
||||
uint8_t ptrn_id,
|
||||
const uint8_t *ptrn, uint8_t ptrn_len,
|
||||
uint8_t ptrn_offset, const uint8_t *mask,
|
||||
uint8_t mask_len, bool user)
|
||||
{
|
||||
uint8_t vdev_id;
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
QDF_STATUS status;
|
||||
wmi_unified_t wmi_handle;
|
||||
|
||||
if (!vdev) {
|
||||
target_if_err("vdev ptr passed is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
psoc = wlan_vdev_get_psoc(vdev);
|
||||
vdev_id = wlan_vdev_get_id(vdev);
|
||||
if (!psoc) {
|
||||
target_if_err("psoc handle is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi handle");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
status = wmi_unified_wow_patterns_to_fw_cmd(wmi_handle,
|
||||
vdev_id, ptrn_id, ptrn,
|
||||
ptrn_len, ptrn_offset,
|
||||
mask, mask_len, user, 0);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
QDF_STATUS target_if_pmo_del_wow_patterns_to_fw(struct wlan_objmgr_vdev *vdev,
|
||||
uint8_t ptrn_id)
|
||||
{
|
||||
uint8_t vdev_id;
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
QDF_STATUS status;
|
||||
wmi_unified_t wmi_handle;
|
||||
|
||||
if (!vdev) {
|
||||
target_if_err("vdev ptr passed is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
psoc = wlan_vdev_get_psoc(vdev);
|
||||
vdev_id = wlan_vdev_get_id(vdev);
|
||||
if (!psoc) {
|
||||
target_if_err("psoc handle is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid wmi handle");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
status = wmi_unified_wow_delete_pattern_cmd(wmi_handle, ptrn_id,
|
||||
vdev_id);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
@@ -1,99 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2017-2019 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: offload lmac interface APIs for tdls
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __TARGET_IF_TDLS_H__
|
||||
#define __TARGET_IF_TDLS_H__
|
||||
|
||||
struct tdls_info;
|
||||
struct wlan_objmgr_psoc;
|
||||
struct tdls_peer_update_state;
|
||||
struct tdls_channel_switch_params;
|
||||
struct sta_uapsd_trig_params;
|
||||
|
||||
/**
|
||||
* target_if_tdls_update_fw_state() - lmac handler to update tdls fw state
|
||||
* @psoc: psoc object
|
||||
* @param: tdls state parameter
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS
|
||||
target_if_tdls_update_fw_state(struct wlan_objmgr_psoc *psoc,
|
||||
struct tdls_info *param);
|
||||
|
||||
/**
|
||||
* target_if_tdls_update_peer_state() - lmac handler to update tdls peer state
|
||||
* @psoc: psoc object
|
||||
* @peer_params: tdls peer state params
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS
|
||||
target_if_tdls_update_peer_state(struct wlan_objmgr_psoc *psoc,
|
||||
struct tdls_peer_update_state *peer_params);
|
||||
|
||||
/**
|
||||
* target_if_tdls_set_offchan_mode() - lmac handler to set tdls off channel mode
|
||||
* @psoc: psoc object
|
||||
* @params: tdls channel swithc params
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS
|
||||
target_if_tdls_set_offchan_mode(struct wlan_objmgr_psoc *psoc,
|
||||
struct tdls_channel_switch_params *params);
|
||||
|
||||
/**
|
||||
* target_if_tdls_register_event_handler() - lmac handler to register tdls event
|
||||
* handler
|
||||
* @psoc : psoc object
|
||||
* @arg: argument passed to lmac
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS
|
||||
target_if_tdls_register_event_handler(struct wlan_objmgr_psoc *psoc,
|
||||
void *arg);
|
||||
|
||||
/**
|
||||
* target_if_tdls_unregister_event_handler() - lmac handler to unregister tdls
|
||||
* event handler
|
||||
* @psoc : psoc object
|
||||
* @arg: argument passed to lmac
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS
|
||||
target_if_tdls_unregister_event_handler(struct wlan_objmgr_psoc *psoc,
|
||||
void *arg);
|
||||
|
||||
/**
|
||||
* target_if_tdls_register_tx_ops() - lmac handler to register tdls tx ops
|
||||
* callback functions
|
||||
* @tx_ops: wlan_lmac_if_tx_ops object
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS
|
||||
target_if_tdls_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops);
|
||||
#endif
|
@@ -1,184 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2017-2020 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: offload lmac interface APIs for tdls
|
||||
*
|
||||
*/
|
||||
|
||||
#include <qdf_mem.h>
|
||||
#include <target_if.h>
|
||||
#include <qdf_status.h>
|
||||
#include <wmi_unified_api.h>
|
||||
#include <wmi_unified_priv.h>
|
||||
#include <wmi_unified_param.h>
|
||||
#include <wlan_objmgr_psoc_obj.h>
|
||||
#include <wlan_tdls_tgt_api.h>
|
||||
#include <target_if_tdls.h>
|
||||
#include <cdp_txrx_peer_ops.h>
|
||||
#include <wlan_utility.h>
|
||||
|
||||
static inline struct wlan_lmac_if_tdls_rx_ops *
|
||||
target_if_tdls_get_rx_ops(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
return &psoc->soc_cb.rx_ops->tdls_rx_ops;
|
||||
}
|
||||
|
||||
static int
|
||||
target_if_tdls_event_handler(ol_scn_t scn, uint8_t *data, uint32_t datalen)
|
||||
{
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
struct wmi_unified *wmi_handle;
|
||||
struct wlan_lmac_if_tdls_rx_ops *tdls_rx_ops;
|
||||
struct tdls_event_info info;
|
||||
QDF_STATUS status;
|
||||
|
||||
if (!scn || !data) {
|
||||
target_if_err("scn: 0x%pK, data: 0x%pK", scn, data);
|
||||
return -EINVAL;
|
||||
}
|
||||
psoc = target_if_get_psoc_from_scn_hdl(scn);
|
||||
if (!psoc) {
|
||||
target_if_err("null psoc");
|
||||
return -EINVAL;
|
||||
}
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
|
||||
if (!wmi_handle) {
|
||||
target_if_err("null wmi_handle");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (wmi_extract_vdev_tdls_ev_param(wmi_handle, data, &info)) {
|
||||
target_if_err("Failed to extract wmi tdls event");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
tdls_rx_ops = target_if_tdls_get_rx_ops(psoc);
|
||||
if (tdls_rx_ops && tdls_rx_ops->tdls_ev_handler) {
|
||||
status = tdls_rx_ops->tdls_ev_handler(psoc, &info);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
target_if_err("fail to handle tdls event");
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
target_if_tdls_update_fw_state(struct wlan_objmgr_psoc *psoc,
|
||||
struct tdls_info *param)
|
||||
{
|
||||
QDF_STATUS status;
|
||||
enum wmi_tdls_state tdls_state;
|
||||
struct wmi_unified *wmi_handle;
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid WMI handle");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
if (TDLS_SUPPORT_EXP_TRIG_ONLY == param->tdls_state)
|
||||
tdls_state = WMI_TDLS_ENABLE_PASSIVE;
|
||||
else if (TDLS_SUPPORT_IMP_MODE == param->tdls_state ||
|
||||
TDLS_SUPPORT_EXT_CONTROL == param->tdls_state)
|
||||
tdls_state = WMI_TDLS_ENABLE_CONNECTION_TRACKER_IN_HOST;
|
||||
else
|
||||
tdls_state = WMI_TDLS_DISABLE;
|
||||
|
||||
status = wmi_unified_update_fw_tdls_state_cmd(wmi_handle,
|
||||
param, tdls_state);
|
||||
|
||||
target_if_debug("vdev_id %d", param->vdev_id);
|
||||
return status;
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
target_if_tdls_update_peer_state(struct wlan_objmgr_psoc *psoc,
|
||||
struct tdls_peer_update_state *peer_params)
|
||||
{
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
target_if_tdls_set_offchan_mode(struct wlan_objmgr_psoc *psoc,
|
||||
struct tdls_channel_switch_params *params)
|
||||
{
|
||||
QDF_STATUS status;
|
||||
struct wmi_unified *wmi_handle;
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid WMI handle");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
status = wmi_unified_set_tdls_offchan_mode_cmd(wmi_handle,
|
||||
params);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
target_if_tdls_register_event_handler(struct wlan_objmgr_psoc *psoc,
|
||||
void *arg)
|
||||
{
|
||||
struct wmi_unified *wmi_handle;
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("null wmi_handle");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
return wmi_unified_register_event(wmi_handle,
|
||||
wmi_tdls_peer_event_id,
|
||||
target_if_tdls_event_handler);
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
target_if_tdls_unregister_event_handler(struct wlan_objmgr_psoc *psoc,
|
||||
void *arg)
|
||||
{
|
||||
struct wmi_unified *wmi_handle;
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("null wmi_handle");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
return wmi_unified_unregister_event(wmi_handle,
|
||||
wmi_tdls_peer_event_id);
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
target_if_tdls_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops)
|
||||
{
|
||||
struct wlan_lmac_if_tdls_tx_ops *tdls_txops;
|
||||
|
||||
tdls_txops = &tx_ops->tdls_tx_ops;
|
||||
|
||||
tdls_txops->update_fw_state = target_if_tdls_update_fw_state;
|
||||
tdls_txops->update_peer_state = target_if_tdls_update_peer_state;
|
||||
tdls_txops->set_offchan_mode = target_if_tdls_set_offchan_mode;
|
||||
tdls_txops->tdls_reg_ev_handler = target_if_tdls_register_event_handler;
|
||||
tdls_txops->tdls_unreg_ev_handler =
|
||||
target_if_tdls_unregister_event_handler;
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
@@ -1,37 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2020, 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: This file contains definitions for target_if WFA test commands sent
|
||||
* to FW.
|
||||
*/
|
||||
|
||||
#ifndef TARGET_IF_WFA_TESTCMD_H__
|
||||
#define TARGET_IF_WFA_TESTCMD_H__
|
||||
|
||||
#include "wlan_mlme_main.h"
|
||||
|
||||
/**
|
||||
* target_if_wfatestcmd_register_tx_ops() - Target IF API to register WFA
|
||||
* test command related tx op.
|
||||
* @tx_ops: Pointer to tx ops fp struct
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS
|
||||
target_if_wfatestcmd_register_tx_ops(struct wlan_wfa_cmd_tx_ops *tx_ops);
|
||||
|
||||
#endif
|
@@ -1,80 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2020, 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: This file contains definitions for target_if wfa send test cmd.
|
||||
*/
|
||||
|
||||
#include "qdf_types.h"
|
||||
#include "target_if_wfa_testcmd.h"
|
||||
#include "target_if.h"
|
||||
#include "wlan_mlme_dbg.h"
|
||||
#include "wlan_mlme_api.h"
|
||||
#include "wlan_mlme_main.h"
|
||||
|
||||
static struct wmi_unified
|
||||
*target_if_wfa_get_wmi_handle_from_vdev(struct wlan_objmgr_vdev *vdev)
|
||||
{
|
||||
struct wlan_objmgr_pdev *pdev;
|
||||
struct wmi_unified *wmi_handle;
|
||||
|
||||
pdev = wlan_vdev_get_pdev(vdev);
|
||||
if (!pdev) {
|
||||
target_if_err("PDEV is NULL");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_pdev(pdev);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("wmi_handle is null");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return wmi_handle;
|
||||
}
|
||||
|
||||
/**
|
||||
* target_if_wfa_send_cmd() - Send WFA test cmd to WMI
|
||||
* @vdev: VDEV object pointer
|
||||
* @wfa_test: Pointer to WFA test params
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
static QDF_STATUS
|
||||
target_if_wfa_send_cmd(struct wlan_objmgr_vdev *vdev,
|
||||
struct set_wfatest_params *wfa_test)
|
||||
{
|
||||
wmi_unified_t wmi_handle;
|
||||
|
||||
wmi_handle = target_if_wfa_get_wmi_handle_from_vdev(vdev);
|
||||
if (!wmi_handle)
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
|
||||
return wmi_unified_wfa_test_cmd(wmi_handle, wfa_test);
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
target_if_wfatestcmd_register_tx_ops(struct wlan_wfa_cmd_tx_ops *tx_ops)
|
||||
{
|
||||
if (!tx_ops) {
|
||||
target_if_err("target if tx ops is NULL!");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
tx_ops->send_wfa_test_cmd = target_if_wfa_send_cmd;
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
Посилання в новій задачі
Заблокувати користувача