diff --git a/dp/inc/cdp_txrx_bus.h b/dp/inc/cdp_txrx_bus.h new file mode 100644 index 0000000000..575d6c4147 --- /dev/null +++ b/dp/inc/cdp_txrx_bus.h @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2016 The Linux Foundation. All rights reserved. + * + * Previously licensed under the ISC license by Qualcomm Atheros, Inc. + * + * + * 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. + */ + +/* + * This file was originally distributed by Qualcomm Atheros, Inc. + * under proprietary terms before Copyright ownership was assigned + * to the Linux Foundation. + */ + /** + * @file cdp_txrx_bus.h + * @brief Define the host data path bus related functions + */ +#ifndef _CDP_TXRX_BUS_H_ +#define _CDP_TXRX_BUS_H_ + +QDF_STATUS ol_txrx_bus_suspend(void); +QDF_STATUS ol_txrx_bus_resume(void); + +#endif /* _CDP_TXRX_BUS_H_ */ diff --git a/dp/inc/cdp_txrx_cfg.h b/dp/inc/cdp_txrx_cfg.h new file mode 100644 index 0000000000..98ca251e9d --- /dev/null +++ b/dp/inc/cdp_txrx_cfg.h @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2016 The Linux Foundation. All rights reserved. + * + * Previously licensed under the ISC license by Qualcomm Atheros, Inc. + * + * + * 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. + */ + +/* + * This file was originally distributed by Qualcomm Atheros, Inc. + * under proprietary terms before Copyright ownership was assigned + * to the Linux Foundation. + */ + /** + * @file cdp_txrx_cfg.h + * @brief Define the host data path configuration API functions + */ +#ifndef _CDP_TXRX_CFG_H_ +#define _CDP_TXRX_CFG_H_ + +/** + * struct txrx_pdev_cfg_param_t - configuration information + * passed to the data path + */ +struct txrx_pdev_cfg_param_t { + uint8_t is_full_reorder_offload; + /* IPA Micro controller data path offload enable flag */ + uint8_t is_uc_offload_enabled; + /* IPA Micro controller data path offload TX buffer count */ + uint32_t uc_tx_buffer_count; + /* IPA Micro controller data path offload TX buffer size */ + uint32_t uc_tx_buffer_size; + /* IPA Micro controller data path offload RX indication ring count */ + uint32_t uc_rx_indication_ring_count; + /* IPA Micro controller data path offload TX partition base */ + uint32_t uc_tx_partition_base; + /* IP, TCP and UDP checksum offload */ + bool ip_tcp_udp_checksum_offload; + /* Rx processing in thread from TXRX */ + bool enable_rxthread; + /* CE classification enabled through INI */ + bool ce_classify_enabled; +#ifdef QCA_LL_TX_FLOW_CONTROL_V2 + /* Threshold to stop queue in percentage */ + uint32_t tx_flow_stop_queue_th; + /* Start queue offset in percentage */ + uint32_t tx_flow_start_queue_offset; +#endif +}; + +void ol_set_cfg_rx_fwd_disabled(ol_pdev_handle pdev, uint8_t disable_rx_fwd); + +void ol_set_cfg_packet_log_enabled(ol_pdev_handle pdev, uint8_t val); + +ol_pdev_handle ol_pdev_cfg_attach(qdf_device_t osdev, + struct txrx_pdev_cfg_param_t cfg_param); + +void ol_vdev_rx_set_intrabss_fwd(ol_txrx_vdev_handle vdev, bool val); + +#endif /* _CDP_TXRX_CFG_H_ */ diff --git a/dp/inc/cdp_txrx_flow_ctrl_legacy.h b/dp/inc/cdp_txrx_flow_ctrl_legacy.h new file mode 100644 index 0000000000..c1d7b5e009 --- /dev/null +++ b/dp/inc/cdp_txrx_flow_ctrl_legacy.h @@ -0,0 +1,115 @@ +/* + * Copyright (c) 2016 The Linux Foundation. All rights reserved. + * + * Previously licensed under the ISC license by Qualcomm Atheros, Inc. + * + * + * 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. + */ + +/* + * This file was originally distributed by Qualcomm Atheros, Inc. + * under proprietary terms before Copyright ownership was assigned + * to the Linux Foundation. + */ + /** + * @file cdp_txrx_flow_ctrl_legacy.h + * @brief Define the host data path legacy flow control API + * functions + */ +#ifndef _CDP_TXRX_FC_LEG_H_ +#define _CDP_TXRX_FC_LEG_H_ + +/** + * enum netif_action_type - Type of actions on netif queues + * @WLAN_STOP_ALL_NETIF_QUEUE: stop all netif queues + * @WLAN_START_ALL_NETIF_QUEUE: start all netif queues + * @WLAN_WAKE_ALL_NETIF_QUEUE: wake all netif queues + * @WLAN_STOP_ALL_NETIF_QUEUE_N_CARRIER: stop all queues and off carrier + * @WLAN_START_ALL_NETIF_QUEUE_N_CARRIER: start all queues and on carrier + * @WLAN_NETIF_TX_DISABLE: disable tx + * @WLAN_NETIF_TX_DISABLE_N_CARRIER: disable tx and off carrier + * @WLAN_NETIF_CARRIER_ON: on carrier + * @WLAN_NETIF_CARRIER_OFF: off carrier + */ +enum netif_action_type { + WLAN_STOP_ALL_NETIF_QUEUE, + WLAN_START_ALL_NETIF_QUEUE, + WLAN_WAKE_ALL_NETIF_QUEUE, + WLAN_STOP_ALL_NETIF_QUEUE_N_CARRIER, + WLAN_START_ALL_NETIF_QUEUE_N_CARRIER, + WLAN_NETIF_TX_DISABLE, + WLAN_NETIF_TX_DISABLE_N_CARRIER, + WLAN_NETIF_CARRIER_ON, + WLAN_NETIF_CARRIER_OFF, + WLAN_NETIF_ACTION_TYPE_MAX, +}; + +/** + * enum netif_reason_type - reason for netif queue action + * @WLAN_CONTROL_PATH: action from control path + * @WLAN_DATA_FLOW_CONTROL: because of flow control + * @WLAN_FW_PAUSE: because of firmware pause + * @WLAN_TX_ABORT: because of tx abort + * @WLAN_VDEV_STOP: because of vdev stop + * @WLAN_PEER_UNAUTHORISED: because of peer is unauthorised + * @WLAN_THERMAL_MITIGATION: because of thermal mitigation + */ +enum netif_reason_type { + WLAN_CONTROL_PATH, + WLAN_DATA_FLOW_CONTROL, + WLAN_FW_PAUSE, + WLAN_TX_ABORT, + WLAN_VDEV_STOP, + WLAN_PEER_UNAUTHORISED, + WLAN_THERMAL_MITIGATION, + WLAN_REASON_TYPE_MAX, +}; + +#ifdef QCA_LL_LEGACY_TX_FLOW_CONTROL +/** + * ol_txrx_tx_flow_control_fp - tx flow control notification + * function from txrx to OS shim + * @osif_dev - the virtual device's OS shim object + * @tx_resume - tx os q should be resumed or not + */ +typedef void (*ol_txrx_tx_flow_control_fp)(void *osif_dev, + bool tx_resume); + +int ol_txrx_register_tx_flow_control(uint8_t vdev_id, + ol_txrx_tx_flow_control_fp flowControl, + void *osif_fc_ctx); + +int ol_txrx_deregister_tx_flow_control_cb(uint8_t vdev_id); + +void ol_txrx_flow_control_cb(ol_txrx_vdev_handle vdev, + bool tx_resume); +bool +ol_txrx_get_tx_resource(uint8_t sta_id, + unsigned int low_watermark, + unsigned int high_watermark_offset); + +int +ol_txrx_ll_set_tx_pause_q_depth(uint8_t vdev_id, int pause_q_depth); + +#endif /* QCA_LL_LEGACY_TX_FLOW_CONTROL */ + +void ol_txrx_vdev_flush(ol_txrx_vdev_handle data_vdev); + +void ol_txrx_vdev_pause(ol_txrx_vdev_handle vdev, uint32_t reason); + +void ol_txrx_vdev_unpause(ol_txrx_vdev_handle data_vdev, uint32_t reason); + +#endif /* _CDP_TXRX_FC_LEG_H_ */ diff --git a/dp/inc/cdp_txrx_flow_ctrl_v2.h b/dp/inc/cdp_txrx_flow_ctrl_v2.h new file mode 100644 index 0000000000..53948c39c5 --- /dev/null +++ b/dp/inc/cdp_txrx_flow_ctrl_v2.h @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2016 The Linux Foundation. All rights reserved. + * + * Previously licensed under the ISC license by Qualcomm Atheros, Inc. + * + * + * 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. + */ + +/* + * This file was originally distributed by Qualcomm Atheros, Inc. + * under proprietary terms before Copyright ownership was assigned + * to the Linux Foundation. + */ + /** + * @file cdp_txrx_flow_ctrl_v2.h + * @brief Define the host data path flow control version 2 API + * functions + */ +#ifndef _CDP_TXRX_FC_V2_H_ +#define _CDP_TXRX_FC_V2_H_ + +#include "cdp_txrx_flow_ctrl_legacy.h" + +/** + * @typedef ol_tx_pause_callback_fp + * @brief OSIF function registered with the data path + */ +typedef void (*ol_tx_pause_callback_fp)(uint8_t vdev_id, + enum netif_action_type action, + enum netif_reason_type reason); + +#ifdef QCA_LL_TX_FLOW_CONTROL_V2 +QDF_STATUS ol_txrx_register_pause_cb(ol_tx_pause_callback_fp pause_cb); + +void ol_tx_set_desc_global_pool_size(uint32_t num_msdu_desc); +#else +static inline +QDF_STATUS ol_txrx_register_pause_cb(ol_tx_pause_callback_fp pause_cb) +{ + return QDF_STATUS_SUCCESS; + +} + +static inline void ol_tx_set_desc_global_pool_size(uint32_t num_msdu_desc) +{ + return; +} +#endif + +#endif /* _CDP_TXRX_FC_V2_H_ */ diff --git a/dp/inc/cdp_txrx_ipa.h b/dp/inc/cdp_txrx_ipa.h new file mode 100644 index 0000000000..a2d6265909 --- /dev/null +++ b/dp/inc/cdp_txrx_ipa.h @@ -0,0 +1,128 @@ +/* + * Copyright (c) 2016 The Linux Foundation. All rights reserved. + * + * Previously licensed under the ISC license by Qualcomm Atheros, Inc. + * + * + * 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. + */ + +/* + * This file was originally distributed by Qualcomm Atheros, Inc. + * under proprietary terms before Copyright ownership was assigned + * to the Linux Foundation. + */ + /** + * @file cdp_txrx_ipa.h + * @brief Define the host data path IP Acceleraor API functions + */ +#ifndef _CDP_TXRX_IPA_H_ +#define _CDP_TXRX_IPA_H_ + +#ifdef IPA_OFFLOAD + +/** + * ol_txrx_ipa_resources - Resources needed for IPA + */ +struct ol_txrx_ipa_resources { + qdf_dma_addr_t ce_sr_base_paddr; + uint32_t ce_sr_ring_size; + qdf_dma_addr_t ce_reg_paddr; + + qdf_dma_addr_t tx_comp_ring_base_paddr; + uint32_t tx_comp_ring_size; + uint32_t tx_num_alloc_buffer; + + qdf_dma_addr_t rx_rdy_ring_base_paddr; + uint32_t rx_rdy_ring_size; + qdf_dma_addr_t rx_proc_done_idx_paddr; + void *rx_proc_done_idx_vaddr; + + qdf_dma_addr_t rx2_rdy_ring_base_paddr; + uint32_t rx2_rdy_ring_size; + qdf_dma_addr_t rx2_proc_done_idx_paddr; + void *rx2_proc_done_idx_vaddr; +}; + +void +ol_txrx_ipa_uc_get_resource(ol_txrx_pdev_handle pdev, + struct ol_txrx_ipa_resources *ipa_res); + +void +ol_txrx_ipa_uc_set_doorbell_paddr(ol_txrx_pdev_handle pdev, + qdf_dma_addr_t ipa_tx_uc_doorbell_paddr, + qdf_dma_addr_t ipa_rx_uc_doorbell_paddr); + +void +ol_txrx_ipa_uc_set_active(ol_txrx_pdev_handle pdev, + bool uc_active, bool is_tx); + +void ol_txrx_ipa_uc_op_response(ol_txrx_pdev_handle pdev, uint8_t *op_msg); + +void ol_txrx_ipa_uc_register_op_cb(ol_txrx_pdev_handle pdev, + void (*ipa_uc_op_cb_type)(uint8_t *op_msg, + void *osif_ctxt), + void *osif_dev); + +void ol_txrx_ipa_uc_get_stat(ol_txrx_pdev_handle pdev); + +qdf_nbuf_t ol_tx_send_ipa_data_frame(void *vdev, qdf_nbuf_t skb); +#else + +static inline void +ol_txrx_ipa_uc_get_resource(ol_txrx_pdev_handle pdev, + struct ol_txrx_ipa_resources *ipa_res) +{ + return; +} + +static inline void +ol_txrx_ipa_uc_set_doorbell_paddr(ol_txrx_pdev_handle pdev, + qdf_dma_addr_t ipa_tx_uc_doorbell_paddr, + qdf_dma_addr_t ipa_rx_uc_doorbell_paddr) +{ + return; +} + +static inline void +ol_txrx_ipa_uc_set_active(ol_txrx_pdev_handle pdev, + bool uc_active, bool is_tx) +{ + return; +} + +static inline void +ol_txrx_ipa_uc_op_response(ol_txrx_pdev_handle pdev, uint8_t *op_msg) +{ + return; +} + +static inline void +ol_txrx_ipa_uc_register_op_cb(ol_txrx_pdev_handle pdev, + void (*ipa_uc_op_cb_type)(uint8_t *op_msg, + void *osif_ctxt), + void *osif_dev) +{ + return; +} + +static inline void ol_txrx_ipa_uc_get_stat(ol_txrx_pdev_handle pdev) +{ + return; +} +#endif /* IPA_OFFLOAD */ + +#endif /* _CDP_TXRX_IPA_H_ */ + diff --git a/dp/inc/cdp_txrx_lro.h b/dp/inc/cdp_txrx_lro.h new file mode 100644 index 0000000000..155d9a7f31 --- /dev/null +++ b/dp/inc/cdp_txrx_lro.h @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2016 The Linux Foundation. All rights reserved. + * + * Previously licensed under the ISC license by Qualcomm Atheros, Inc. + * + * + * 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. + */ + +/* + * This file was originally distributed by Qualcomm Atheros, Inc. + * under proprietary terms before Copyright ownership was assigned + * to the Linux Foundation. + */ + /** + * @file cdp_txrx_lro.h + * @brief Define the host data path Large Receive Offload API + * functions + */ +#ifndef _CDP_TXRX_LRO_H_ +#define _CDP_TXRX_LRO_H_ + +void ol_register_lro_flush_cb(void (handler)(void *), void *data); +void ol_deregister_lro_flush_cb(void); + +#endif /* _CDP_TXRX_LRO_H_ */ diff --git a/dp/inc/cdp_txrx_misc.h b/dp/inc/cdp_txrx_misc.h new file mode 100644 index 0000000000..c28102a5f5 --- /dev/null +++ b/dp/inc/cdp_txrx_misc.h @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2016 The Linux Foundation. All rights reserved. + * + * Previously licensed under the ISC license by Qualcomm Atheros, Inc. + * + * + * 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. + */ + +/* + * This file was originally distributed by Qualcomm Atheros, Inc. + * under proprietary terms before Copyright ownership was assigned + * to the Linux Foundation. + */ + /** + * @file cdp_txrx_misc.h + * @brief Define the host data path miscelleneous API functions + * called by the host control SW and the OS interface module + */ +#ifndef _CDP_TXRX_MISC_H_ +#define _CDP_TXRX_MISC_H_ + +/** + * @enum ol_tx_spec + * @brief indicate what non-standard transmission actions to apply + * @details + * Indicate one or more of the following: + * - The tx frame already has a complete 802.11 header. + * Thus, skip 802.3/native-WiFi to 802.11 header encapsulation and + * A-MSDU aggregation. + * - The tx frame should not be aggregated (A-MPDU or A-MSDU) + * - The tx frame is already encrypted - don't attempt encryption. + * - The tx frame is a segment of a TCP jumbo frame. + * - This tx frame should not be unmapped and freed by the txrx layer + * after transmission, but instead given to a registered tx completion + * callback. + * More than one of these specification can apply, though typically + * only a single specification is applied to a tx frame. + * A compound specification can be created, as a bit-OR of these + * specifications. + */ +enum ol_tx_spec { + OL_TX_SPEC_STD = 0x0, /* do regular processing */ + OL_TX_SPEC_RAW = 0x1, /* skip encap + A-MSDU aggr */ + OL_TX_SPEC_NO_AGGR = 0x2, /* skip encap + all aggr */ + OL_TX_SPEC_NO_ENCRYPT = 0x4, /* skip encap + encrypt */ + OL_TX_SPEC_TSO = 0x8, /* TCP segmented */ + OL_TX_SPEC_NWIFI_NO_ENCRYPT = 0x10, /* skip encrypt for nwifi */ + OL_TX_SPEC_NO_FREE = 0x20, /* give to cb rather than free */ +}; + + +qdf_nbuf_t +ol_tx_non_std(ol_txrx_vdev_handle vdev, + enum ol_tx_spec tx_spec, qdf_nbuf_t msdu_list); + +#endif /* _CDP_TXRX_MISC_H_ */ + + + + + + + + + + + + + + + diff --git a/dp/inc/cdp_txrx_peer_ops.h b/dp/inc/cdp_txrx_peer_ops.h new file mode 100644 index 0000000000..0c160c47bb --- /dev/null +++ b/dp/inc/cdp_txrx_peer_ops.h @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2016 The Linux Foundation. All rights reserved. + * + * Previously licensed under the ISC license by Qualcomm Atheros, Inc. + * + * + * 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. + */ + +/* + * This file was originally distributed by Qualcomm Atheros, Inc. + * under proprietary terms before Copyright ownership was assigned + * to the Linux Foundation. + */ + /** + * @file cdp_txrx_peer.h + * @brief Define the host data path peer API functions + * called by the host control SW and the OS interface module + */ +#ifndef _CDP_TXRX_PEER_H_ +#define _CDP_TXRX_PEER_H_ + +typedef QDF_STATUS (*ol_rx_callback_fp)(void *p_cds_gctx, + qdf_nbuf_t pDataBuff, + uint8_t ucSTAId); + +/** + * struct ol_txrx_peer_state - Peer state information + */ +enum ol_txrx_peer_state { + OL_TXRX_PEER_STATE_INVALID, + OL_TXRX_PEER_STATE_DISC, /* initial state */ + OL_TXRX_PEER_STATE_CONN, /* authentication in progress */ + OL_TXRX_PEER_STATE_AUTH, /* authentication successful */ +}; + +/** + * struct ol_txrx_desc_type - txrx descriptor type + * @sta_id: sta id + * @is_qos_enabled: is station qos enabled + * @is_wapi_supported: is station wapi supported + */ +struct ol_txrx_desc_type { + uint8_t sta_id; + uint8_t is_qos_enabled; + uint8_t is_wapi_supported; +}; + +QDF_STATUS ol_txrx_register_peer(struct ol_txrx_desc_type *sta_desc); + +QDF_STATUS ol_txrx_clear_peer(uint8_t sta_id); + +QDF_STATUS ol_txrx_change_peer_state(uint8_t sta_id, + enum ol_txrx_peer_state sta_state, + bool roam_synch_in_progress); + +ol_txrx_peer_handle ol_txrx_find_peer_by_addr(ol_txrx_pdev_handle pdev, + uint8_t *peer_addr, + uint8_t *peer_id); + +ol_txrx_peer_handle +ol_txrx_find_peer_by_addr_and_vdev(ol_txrx_pdev_handle pdev, + ol_txrx_vdev_handle vdev, + uint8_t *peer_addr, uint8_t *peer_id); + +uint16_t ol_txrx_local_peer_id(ol_txrx_peer_handle peer); + +ol_txrx_peer_handle +ol_txrx_peer_find_by_local_id(ol_txrx_pdev_handle pdev, uint8_t local_peer_id); + +QDF_STATUS +ol_txrx_peer_state_update(ol_txrx_pdev_handle pdev, uint8_t *peer_addr, + enum ol_txrx_peer_state state); + +QDF_STATUS ol_txrx_get_vdevid(struct ol_txrx_peer_t *peer, uint8_t *vdev_id); +void *ol_txrx_get_vdev_by_sta_id(uint8_t sta_id); + +QDF_STATUS ol_txrx_register_ocb_peer(void *cds_ctx, uint8_t *mac_addr, + uint8_t *peer_id); + +#endif /* _CDP_TXRX_PEER_H_ */ diff --git a/dp/inc/cdp_txrx_stats.h b/dp/inc/cdp_txrx_stats.h new file mode 100644 index 0000000000..419282008f --- /dev/null +++ b/dp/inc/cdp_txrx_stats.h @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2016 The Linux Foundation. All rights reserved. + * + * Previously licensed under the ISC license by Qualcomm Atheros, Inc. + * + * + * 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. + */ + +/* + * This file was originally distributed by Qualcomm Atheros, Inc. + * under proprietary terms before Copyright ownership was assigned + * to the Linux Foundation. + */ + /** + * @file cdp_txrx_stats.h + * @brief Define the host data path statistics API functions + * called by the host control SW and the OS interface module + */ +#ifndef _CDP_TXRX_STATS_H_ +#define _CDP_TXRX_STATS_H_ + +void ol_txrx_display_stats(uint16_t bitmap); +void ol_txrx_clear_stats(uint16_t bitmap); +int ol_txrx_stats(uint8_t vdev_id, char *buffer, unsigned buf_len); + +#endif /* _CDP_TXRX_STATS_H_ */ diff --git a/dp/inc/cdp_txrx_tx_delay.h b/dp/inc/cdp_txrx_tx_delay.h new file mode 100644 index 0000000000..ebca275720 --- /dev/null +++ b/dp/inc/cdp_txrx_tx_delay.h @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2016 The Linux Foundation. All rights reserved. + * + * Previously licensed under the ISC license by Qualcomm Atheros, Inc. + * + * + * 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. + */ + +/* + * This file was originally distributed by Qualcomm Atheros, Inc. + * under proprietary terms before Copyright ownership was assigned + * to the Linux Foundation. + */ + /** + * @file cdp_txrx_tx_delay.h + * @brief Define the host data path histogram API functions + * called by the host control SW and the OS interface module + */ +#ifndef _CDP_TXRX_COMPUTE_TX_DELAY_H_ +#define _CDP_TXRX_COMPUTE_TX_DELAY_H_ + +#ifdef QCA_COMPUTE_TX_DELAY +void +ol_tx_delay(ol_txrx_pdev_handle pdev, + uint32_t *queue_delay_microsec, + uint32_t *tx_delay_microsec, int category); +void +ol_tx_delay_hist(ol_txrx_pdev_handle pdev, + uint16_t *bin_values, int category); +void +ol_tx_packet_count(ol_txrx_pdev_handle pdev, + uint16_t *out_packet_count, + uint16_t *out_packet_loss_count, int category); + +void ol_tx_set_compute_interval(ol_txrx_pdev_handle pdev, + uint32_t interval); +#else +static inline void +ol_tx_delay(ol_txrx_pdev_handle pdev, + uint32_t *queue_delay_microsec, + uint32_t *tx_delay_microsec, int category) +{ + return; +} + +static inline void +ol_tx_delay_hist(ol_txrx_pdev_handle pdev, + uint16_t *bin_values, int category) +{ + return; +} + +static inline void +ol_tx_packet_count(ol_txrx_pdev_handle pdev, + uint16_t *out_packet_count, + uint16_t *out_packet_loss_count, int category) +{ + return; +} + +static inline void +ol_tx_set_compute_interval(ol_txrx_pdev_handle pdev, + uint32_t interval) +{ + return; +} +#endif + +#endif /* _CDP_TXRX_COMPUTE_TX_DELAY_H_ */ diff --git a/dp/inc/cdp_txrx_tx_throttle.h b/dp/inc/cdp_txrx_tx_throttle.h new file mode 100644 index 0000000000..308e038ead --- /dev/null +++ b/dp/inc/cdp_txrx_tx_throttle.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2016 The Linux Foundation. All rights reserved. + * + * Previously licensed under the ISC license by Qualcomm Atheros, Inc. + * + * + * 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. + */ + +/* + * This file was originally distributed by Qualcomm Atheros, Inc. + * under proprietary terms before Copyright ownership was assigned + * to the Linux Foundation. + */ + /** + * @file cdp_txrx_tx_throttle.h + * @brief Define the host data path transmit throttle API + * functions called by the host control SW and the OS interface + * module + */ +#ifndef _CDP_TXRX_TX_THROTTLE_H_ +#define _CDP_TXRX_TX_THROTTLE_H_ + +void ol_tx_throttle_init_period(struct ol_txrx_pdev_t *pdev, int period); + +void ol_tx_throttle_set_level(struct ol_txrx_pdev_t *pdev, int level); + +#endif /* _CDP_TXRX_TX_THROTTLE_H_ */