qcacmn: Move DP OL ops to target if layer
Move few common dp_ol_if_ops functions to target_if layer as part of DP-CP interaction convergence Change-Id: I9ad740af687f550f64ef8f81919159b73204e7b8 CRs-Fixed: 2243694
This commit is contained in:
91
target_if/dp/inc/target_if_dp.h
Normal file
91
target_if/dp/inc/target_if_dp.h
Normal file
@@ -0,0 +1,91 @@
|
||||
/*
|
||||
* 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: This target interface shall be used by DP
|
||||
* to communicate with target using WMI.
|
||||
*/
|
||||
|
||||
#ifndef _WLAN_TARGET_IF_DP_H_
|
||||
#define _WLAN_TARGET_IF_DP_H_
|
||||
|
||||
#include <qdf_types.h>
|
||||
#include <qdf_status.h>
|
||||
#include <wmi_unified_priv.h>
|
||||
#include <wlan_objmgr_psoc_obj.h>
|
||||
#include <target_if.h>
|
||||
#include <cdp_txrx_ops.h>
|
||||
|
||||
/**
|
||||
* target_if_peer_set_default_routing() - set peer default routing
|
||||
* @pdev: pdev pointer
|
||||
* @peer_macaddr: peer mac address
|
||||
* @vdev_id: vdev id
|
||||
* @hash_based: hash based routing
|
||||
* @ring_num: ring number
|
||||
*
|
||||
* return: void
|
||||
*/
|
||||
void
|
||||
target_if_peer_set_default_routing(struct cdp_ctrl_objmgr_pdev *pdev,
|
||||
uint8_t *peer_macaddr, uint8_t vdev_id,
|
||||
bool hash_based, uint8_t ring_num);
|
||||
|
||||
/**
|
||||
* target_if_peer_rx_reorder_queue_setup() - setup rx reorder queue
|
||||
* @pdev: pdev pointer
|
||||
* @vdev_id: vdev id
|
||||
* @peer_macaddr: peer mac address
|
||||
* @hw_qdesc: hw queue descriptor
|
||||
* @tid: tid number
|
||||
* @queue_no: queue number
|
||||
*
|
||||
* return: QDF_STATUS_SUCCESS for success or error code
|
||||
*/
|
||||
QDF_STATUS
|
||||
target_if_peer_rx_reorder_queue_setup(struct cdp_ctrl_objmgr_pdev *pdev,
|
||||
uint8_t vdev_id, uint8_t *peer_macaddr,
|
||||
qdf_dma_addr_t hw_qdesc, int tid,
|
||||
uint16_t queue_no);
|
||||
|
||||
/**
|
||||
* target_if_peer_rx_reorder_queue_remove() - remove rx reorder queue
|
||||
* @pdev: pdev pointer
|
||||
* @vdev_id: vdev id
|
||||
* @peer_macaddr: peer mac address
|
||||
* @peer_tid_bitmap: peer tid bitmap
|
||||
*
|
||||
* return: QDF_STATUS_SUCCESS for success or error code
|
||||
*/
|
||||
QDF_STATUS
|
||||
target_if_peer_rx_reorder_queue_remove(struct cdp_ctrl_objmgr_pdev *pdev,
|
||||
uint8_t vdev_id, uint8_t *peer_macaddr,
|
||||
uint32_t peer_tid_bitmap);
|
||||
|
||||
/**
|
||||
* target_if_lro_hash_config() - send LRO hash config to FW
|
||||
* @psoc_handle: psoc handle pointer
|
||||
* @lro_hash_cfg: LRO hash config parameters
|
||||
*
|
||||
* return: QDF_STATUS_SUCCESS for success or error code
|
||||
*/
|
||||
QDF_STATUS
|
||||
target_if_lro_hash_config(struct wlan_objmgr_psoc *psoc_handle,
|
||||
struct cdp_lro_hash_config *lro_hash_cfg);
|
||||
|
||||
#endif
|
135
target_if/dp/src/target_if_dp.c
Normal file
135
target_if/dp/src/target_if_dp.c
Normal file
@@ -0,0 +1,135 @@
|
||||
/*
|
||||
* 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: defines DP interaction with FW using WMI
|
||||
*/
|
||||
|
||||
#include <qdf_status.h>
|
||||
#include "target_if_dp.h"
|
||||
#include <init_deinit_lmac.h>
|
||||
|
||||
void
|
||||
target_if_peer_set_default_routing(struct cdp_ctrl_objmgr_pdev *pdev,
|
||||
uint8_t *peer_macaddr, uint8_t vdev_id,
|
||||
bool hash_based, uint8_t ring_num)
|
||||
{
|
||||
uint32_t value;
|
||||
struct peer_set_params param;
|
||||
struct common_wmi_handle *pdev_wmi_handle;
|
||||
|
||||
pdev_wmi_handle =
|
||||
lmac_get_pdev_wmi_handle((struct wlan_objmgr_pdev *)pdev);
|
||||
if (!pdev_wmi_handle) {
|
||||
target_if_err("pdev wmi handle NULL");
|
||||
return;
|
||||
}
|
||||
|
||||
qdf_mem_set(¶m, sizeof(param), 0);
|
||||
|
||||
/* TODO: Need bit definitions for ring number and hash based routing
|
||||
* fields in common wmi header file
|
||||
*/
|
||||
value = ((hash_based) ? 1 : 0) | (ring_num << 1);
|
||||
|
||||
param.param_id = WMI_HOST_PEER_SET_DEFAULT_ROUTING;
|
||||
param.vdev_id = vdev_id;
|
||||
param.param_value = value;
|
||||
|
||||
if (wmi_set_peer_param_send(pdev_wmi_handle, peer_macaddr, ¶m)) {
|
||||
target_if_err("Unable to set default routing for peer "
|
||||
QDF_MAC_ADDR_STR,
|
||||
QDF_MAC_ADDR_ARRAY(peer_macaddr));
|
||||
}
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
target_if_peer_rx_reorder_queue_setup(struct cdp_ctrl_objmgr_pdev *pdev,
|
||||
uint8_t vdev_id, uint8_t *peer_macaddr,
|
||||
qdf_dma_addr_t hw_qdesc, int tid,
|
||||
uint16_t queue_no)
|
||||
{
|
||||
struct rx_reorder_queue_setup_params param;
|
||||
struct common_wmi_handle *pdev_wmi_handle;
|
||||
|
||||
pdev_wmi_handle =
|
||||
lmac_get_pdev_wmi_handle((struct wlan_objmgr_pdev *)pdev);
|
||||
if (!pdev_wmi_handle) {
|
||||
target_if_err("pdev wmi handle NULL");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
param.tid = tid;
|
||||
param.vdev_id = vdev_id;
|
||||
param.peer_macaddr = peer_macaddr;
|
||||
param.hw_qdesc_paddr_lo = hw_qdesc & 0xffffffff;
|
||||
param.hw_qdesc_paddr_hi = (uint64_t)hw_qdesc >> 32;
|
||||
param.queue_no = queue_no;
|
||||
return wmi_unified_peer_rx_reorder_queue_setup_send(pdev_wmi_handle,
|
||||
¶m);
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
target_if_peer_rx_reorder_queue_remove(struct cdp_ctrl_objmgr_pdev *pdev,
|
||||
uint8_t vdev_id, uint8_t *peer_macaddr,
|
||||
uint32_t peer_tid_bitmap)
|
||||
{
|
||||
struct rx_reorder_queue_remove_params param;
|
||||
struct common_wmi_handle *pdev_wmi_handle;
|
||||
|
||||
pdev_wmi_handle =
|
||||
lmac_get_pdev_wmi_handle((struct wlan_objmgr_pdev *)pdev);
|
||||
if (!pdev_wmi_handle) {
|
||||
target_if_err("pdev wmi handle NULL");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
param.vdev_id = vdev_id;
|
||||
param.peer_macaddr = peer_macaddr;
|
||||
param.peer_tid_bitmap = peer_tid_bitmap;
|
||||
return wmi_unified_peer_rx_reorder_queue_remove_send(pdev_wmi_handle,
|
||||
¶m);
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
target_if_lro_hash_config(struct wlan_objmgr_psoc *psoc_handle,
|
||||
struct cdp_lro_hash_config *lro_hash_cfg)
|
||||
{
|
||||
struct wmi_lro_config_cmd_t wmi_lro_cmd = {0};
|
||||
struct common_wmi_handle *wmi_handle;
|
||||
|
||||
wmi_handle = lmac_get_wmi_hdl(psoc_handle);
|
||||
if (!lro_hash_cfg || !wmi_handle) {
|
||||
target_if_err("wmi_handle: 0x%pK, lro_hash_cfg: 0x%pK",
|
||||
wmi_handle, lro_hash_cfg);
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
wmi_lro_cmd.lro_enable = lro_hash_cfg->lro_enable;
|
||||
wmi_lro_cmd.tcp_flag = lro_hash_cfg->tcp_flag;
|
||||
wmi_lro_cmd.tcp_flag_mask = lro_hash_cfg->tcp_flag_mask;
|
||||
|
||||
qdf_mem_copy(wmi_lro_cmd.toeplitz_hash_ipv4,
|
||||
lro_hash_cfg->toeplitz_hash_ipv4,
|
||||
LRO_IPV4_SEED_ARR_SZ * sizeof(uint32_t));
|
||||
|
||||
qdf_mem_copy(wmi_lro_cmd.toeplitz_hash_ipv6,
|
||||
lro_hash_cfg->toeplitz_hash_ipv6,
|
||||
LRO_IPV6_SEED_ARR_SZ * sizeof(uint32_t));
|
||||
|
||||
return wmi_unified_lro_config_cmd(wmi_handle,
|
||||
&wmi_lro_cmd);
|
||||
}
|
Reference in New Issue
Block a user