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:
Akshay Kosigi 2018-05-17 12:16:57 +05:30 • committed by nshrivas
commit 0e7fdae9fd
4 changed files with 244 additions and 13 deletions

View file

@ -714,15 +714,19 @@ struct cdp_lro_hash_config {
};
struct ol_if_ops {
void (*peer_set_default_routing)(void *scn_handle,
uint8_t *peer_macaddr, uint8_t vdev_id,
bool hash_based, uint8_t ring_num);
int (*peer_rx_reorder_queue_setup)(void *scn_handle,
uint8_t vdev_id, uint8_t *peer_mac,
qdf_dma_addr_t hw_qdesc, int tid, uint16_t queue_num);
int (*peer_rx_reorder_queue_remove)(void *scn_handle,
uint8_t vdev_id, uint8_t *peer_macaddr,
uint32_t tid_mask);
void
(*peer_set_default_routing)(struct cdp_ctrl_objmgr_pdev *ctrl_pdev,
uint8_t *peer_macaddr, uint8_t vdev_id,
bool hash_based, uint8_t ring_num);
QDF_STATUS
(*peer_rx_reorder_queue_setup)(struct cdp_ctrl_objmgr_pdev *ctrl_pdev,
uint8_t vdev_id, uint8_t *peer_mac,
qdf_dma_addr_t hw_qdesc, int tid,
uint16_t queue_num);
QDF_STATUS
(*peer_rx_reorder_queue_remove)(struct cdp_ctrl_objmgr_pdev *ctrl_pdev,
uint8_t vdev_id, uint8_t *peer_macaddr,
uint32_t tid_mask);
int (*peer_unref_delete)(void *scn_handle, uint8_t vdev_id,
uint8_t *peer_macaddr);
bool (*is_hw_dbs_2x2_capable)(struct wlan_objmgr_psoc *psoc);
@ -734,8 +738,9 @@ struct ol_if_ops {
uint32_t flags);
void (*peer_del_wds_entry)(void *ol_soc_handle,
uint8_t *wds_macaddr);
QDF_STATUS (*lro_hash_config)(void *scn_handle,
struct cdp_lro_hash_config *rx_offld_hash);
QDF_STATUS
(*lro_hash_config)(struct wlan_objmgr_psoc *ctrl_psoc,
struct cdp_lro_hash_config *rx_offld_hash);
void (*update_dp_stats)(void *soc, void *stats, uint16_t id,
uint8_t type);
uint8_t (*rx_invalid_peer)(void *ctrl_pdev, void *msg);

View file

@ -3716,8 +3716,8 @@ static void dp_peer_setup_wifi3(struct cdp_vdev *vdev_hdl, void *peer_hdl)
if (soc->cdp_soc.ol_ops->peer_set_default_routing) {
/* TODO: Check the destination ring number to be passed to FW */
soc->cdp_soc.ol_ops->peer_set_default_routing(
pdev->ctrl_pdev, peer->mac_addr.raw,
peer->vdev->vdev_id, hash_based, reo_dest);
pdev->ctrl_pdev, peer->mac_addr.raw,
peer->vdev->vdev_id, hash_based, reo_dest);
}
dp_peer_rx_init(pdev, peer);

View 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

View 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(&param, 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, &param)) {
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,
&param);
}
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,
&param);
}
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);
}