123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408 |
- /*
- * Copyright (c) 2016-2019,2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
- *
- * Permission to use, copy, modify, and/or distribute this software for
- * any purpose with or without fee is hereby granted, provided that the
- * 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: cdp_txrx_cfg.h
- * Define the host data path configuration API functions
- */
- #ifndef _CDP_TXRX_CFG_H_
- #define _CDP_TXRX_CFG_H_
- #include "cdp_txrx_handle.h"
- #include <cdp_txrx_cmn.h>
- /**
- * cdp_cfg_set_rx_fwd_disabled() - enable/disable rx forwarding
- * @soc: data path soc handle
- * @cfg_pdev: data path device instance
- * @disable_rx_fwd: enable or disable rx forwarding
- *
- * enable/disable rx forwarding
- *
- * return NONE
- */
- static inline void
- cdp_cfg_set_rx_fwd_disabled(ol_txrx_soc_handle soc, struct cdp_cfg *cfg_pdev,
- uint8_t disable_rx_fwd)
- {
- if (!soc || !soc->ops) {
- dp_cdp_debug("invalid instance");
- QDF_BUG(0);
- return;
- }
- if (!soc->ops->cfg_ops ||
- !soc->ops->cfg_ops->set_cfg_rx_fwd_disabled)
- return;
- soc->ops->cfg_ops->set_cfg_rx_fwd_disabled(cfg_pdev,
- disable_rx_fwd);
- }
- /**
- * cdp_cfg_set_packet_log_enabled() - enable/disable packet log
- * @soc: data path soc handle
- * @cfg_pdev: data path device instance
- * @val: enable or disable packet log
- *
- * packet log enable or disable
- *
- * return NONE
- */
- static inline void
- cdp_cfg_set_packet_log_enabled(ol_txrx_soc_handle soc,
- struct cdp_cfg *cfg_pdev, uint8_t val)
- {
- if (!soc || !soc->ops) {
- dp_cdp_debug("invalid instance");
- QDF_BUG(0);
- return;
- }
- if (!soc->ops->cfg_ops ||
- !soc->ops->cfg_ops->set_cfg_packet_log_enabled)
- return;
- soc->ops->cfg_ops->set_cfg_packet_log_enabled(cfg_pdev,
- val);
- }
- /**
- * cdp_cfg_attach() - attach config module
- * @soc: data path soc handle
- * @osdev: os instance
- * @cfg_param: configuration parameter should be propagated
- *
- * Allocate configuration module instance, and propagate configuration values
- *
- * return soc configuration module instance
- */
- static inline struct cdp_cfg
- *cdp_cfg_attach(ol_txrx_soc_handle soc,
- qdf_device_t osdev, void *cfg_param)
- {
- if (!soc || !soc->ops) {
- dp_cdp_debug("invalid instance");
- QDF_BUG(0);
- return NULL;
- }
- if (!soc->ops->cfg_ops ||
- !soc->ops->cfg_ops->cfg_attach)
- return NULL;
- return soc->ops->cfg_ops->cfg_attach(osdev, cfg_param);
- }
- /**
- * cdp_cfg_vdev_rx_set_intrabss_fwd() - enable/disable intra bass forwarding
- * @soc: data path soc handle
- * @vdev_id: virtual interface id
- * @val: enable or disable intra bss forwarding
- *
- * ap isolate, do not forward intra bss traffic
- *
- * return NONE
- */
- static inline void
- cdp_cfg_vdev_rx_set_intrabss_fwd(ol_txrx_soc_handle soc,
- uint8_t vdev_id, bool val)
- {
- if (!soc || !soc->ops) {
- dp_cdp_debug("invalid instance");
- QDF_BUG(0);
- return;
- }
- if (!soc->ops->cfg_ops ||
- !soc->ops->cfg_ops->vdev_rx_set_intrabss_fwd)
- return;
- soc->ops->cfg_ops->vdev_rx_set_intrabss_fwd(soc, vdev_id, val);
- }
- /**
- * cdp_cfg_is_rx_fwd_disabled() - get vdev rx forward
- * @soc: data path soc handle
- * @vdev: virtual interface instance
- *
- * Return rx forward feature enable status
- *
- * return 1 enabled
- * 0 disabled
- */
- static inline uint8_t
- cdp_cfg_is_rx_fwd_disabled(ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
- {
- if (!soc || !soc->ops) {
- dp_cdp_debug("invalid instance");
- QDF_BUG(0);
- return 0;
- }
- if (!soc->ops->cfg_ops ||
- !soc->ops->cfg_ops->is_rx_fwd_disabled)
- return 0;
- return soc->ops->cfg_ops->is_rx_fwd_disabled(vdev);
- }
- /**
- * cdp_cfg_tx_set_is_mgmt_over_wmi_enabled() - mgmt tx over wmi enable/disable
- * @soc: data path soc handle
- * @value: feature enable or disable
- *
- * Enable or disable management packet TX over WMI feature
- *
- * return None
- */
- static inline void
- cdp_cfg_tx_set_is_mgmt_over_wmi_enabled(ol_txrx_soc_handle soc,
- uint8_t value)
- {
- if (!soc || !soc->ops) {
- dp_cdp_debug("invalid instance");
- QDF_BUG(0);
- return;
- }
- if (!soc->ops->cfg_ops ||
- !soc->ops->cfg_ops->tx_set_is_mgmt_over_wmi_enabled)
- return;
- soc->ops->cfg_ops->tx_set_is_mgmt_over_wmi_enabled(value);
- }
- /**
- * cdp_cfg_is_high_latency() - query data path is in high or low latency
- * @soc: data path soc handle
- * @cfg_pdev: data path device instance
- *
- * query data path is in high or low latency
- *
- * return 1 high latency data path, usb or sdio
- * 0 low latency data path
- */
- static inline int
- cdp_cfg_is_high_latency(ol_txrx_soc_handle soc, struct cdp_cfg *cfg_pdev)
- {
- if (!soc || !soc->ops) {
- dp_cdp_debug("invalid instance");
- QDF_BUG(0);
- return 0;
- }
- if (!soc->ops->cfg_ops ||
- !soc->ops->cfg_ops->is_high_latency)
- return 0;
- return soc->ops->cfg_ops->is_high_latency(cfg_pdev);
- }
- /**
- * cdp_cfg_set_flow_control_parameters() - set flow control params
- * @soc: data path soc handle
- * @cfg_pdev: dp config module instance
- * @param: parameters should set
- *
- * set flow control params
- *
- * return None
- */
- static inline void
- cdp_cfg_set_flow_control_parameters(ol_txrx_soc_handle soc,
- struct cdp_cfg *cfg_pdev, void *param)
- {
- if (!soc || !soc->ops) {
- dp_cdp_debug("invalid instance");
- QDF_BUG(0);
- return;
- }
- if (!soc->ops->cfg_ops ||
- !soc->ops->cfg_ops->set_flow_control_parameters)
- return;
- soc->ops->cfg_ops->set_flow_control_parameters(cfg_pdev,
- param);
- }
- /**
- * cdp_cfg_set_flow_steering - Set Rx flow steering config based on CFG ini
- * config.
- * @soc: data path soc handle
- * @cfg_pdev: handle to the physical device
- * @val: 0 - disable, 1 - enable
- *
- * Return: None
- */
- static inline void cdp_cfg_set_flow_steering(ol_txrx_soc_handle soc,
- struct cdp_cfg *cfg_pdev, uint8_t val)
- {
- if (!soc || !soc->ops) {
- dp_cdp_debug("invalid instance");
- QDF_BUG(0);
- return;
- }
- if (!soc->ops->cfg_ops ||
- !soc->ops->cfg_ops->set_flow_steering)
- return;
- soc->ops->cfg_ops->set_flow_steering(cfg_pdev, val);
- }
- static inline void cdp_cfg_get_max_peer_id(ol_txrx_soc_handle soc,
- struct cdp_cfg *cfg_pdev)
- {
- }
- /**
- * cdp_cfg_set_ptp_rx_opt_enabled() - enable/disable ptp rx timestamping
- * @soc: data path soc handle
- * @cfg_pdev: data path device instance
- * @val: enable or disable packet log
- *
- * ptp rx timestamping enable or disable
- *
- * return NONE
- */
- static inline void
- cdp_cfg_set_ptp_rx_opt_enabled(ol_txrx_soc_handle soc,
- struct cdp_cfg *cfg_pdev, uint8_t val)
- {
- if (!soc || !soc->ops) {
- dp_cdp_debug("invalid instance");
- QDF_BUG(0);
- return;
- }
- if (!soc->ops->cfg_ops ||
- !soc->ops->cfg_ops->set_ptp_rx_opt_enabled)
- return;
- soc->ops->cfg_ops->set_ptp_rx_opt_enabled(cfg_pdev, val);
- }
- /**
- * cdp_cfg_set_new_htt_msg_format() - set htt h2t msg feature
- * @soc: datapath soc handle
- * @val: enable or disable new htt h2t msg feature
- *
- * Enable whether htt h2t message length includes htc header length
- *
- * return NONE
- */
- static inline void
- cdp_cfg_set_new_htt_msg_format(ol_txrx_soc_handle soc,
- uint8_t val)
- {
- if (!soc || !soc->ops) {
- dp_cdp_debug("invalid instance");
- return;
- }
- if (!soc->ops->cfg_ops ||
- !soc->ops->cfg_ops->set_new_htt_msg_format)
- return;
- soc->ops->cfg_ops->set_new_htt_msg_format(val);
- }
- /**
- * cdp_cfg_set_peer_unmap_conf_support() - set peer unmap conf feature
- * @soc: datapath soc handle
- * @val: enable or disable peer unmap conf feature
- *
- * Set if peer unmap confirmation feature is supported by both FW and in INI
- *
- * return NONE
- */
- static inline void
- cdp_cfg_set_peer_unmap_conf_support(ol_txrx_soc_handle soc, bool val)
- {
- if (!soc || !soc->ops) {
- dp_cdp_debug("invalid instance");
- QDF_BUG(0);
- return;
- }
- if (!soc->ops->cfg_ops ||
- !soc->ops->cfg_ops->set_peer_unmap_conf_support)
- return;
- soc->ops->cfg_ops->set_peer_unmap_conf_support(val);
- }
- /**
- * cdp_cfg_get_peer_unmap_conf_support() - check peer unmap conf feature
- * @soc: datapath soc handle
- *
- * Check if peer unmap confirmation feature is enabled
- *
- * return true is peer unmap confirmation feature is enabled else false
- */
- static inline bool
- cdp_cfg_get_peer_unmap_conf_support(ol_txrx_soc_handle soc)
- {
- if (!soc || !soc->ops) {
- dp_cdp_debug("invalid instance");
- QDF_BUG(0);
- return false;
- }
- if (!soc->ops->cfg_ops ||
- !soc->ops->cfg_ops->get_peer_unmap_conf_support)
- return false;
- return soc->ops->cfg_ops->get_peer_unmap_conf_support();
- }
- static inline void
- cdp_cfg_set_tx_compl_tsf64(ol_txrx_soc_handle soc,
- uint8_t val)
- {
- if (!soc || !soc->ops) {
- dp_debug("invalid instance");
- return;
- }
- if (!soc->ops->cfg_ops ||
- !soc->ops->cfg_ops->set_tx_compl_tsf64)
- return;
- soc->ops->cfg_ops->set_tx_compl_tsf64(val);
- }
- static inline bool
- cdp_cfg_get_tx_compl_tsf64(ol_txrx_soc_handle soc)
- {
- if (!soc || !soc->ops) {
- dp_debug("invalid instance");
- return false;
- }
- if (!soc->ops->cfg_ops ||
- !soc->ops->cfg_ops->get_tx_compl_tsf64)
- return false;
- return soc->ops->cfg_ops->get_tx_compl_tsf64();
- }
- #endif /* _CDP_TXRX_CFG_H_ */
|