Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (c) 2012, 2014-2015 The Linux Foundation. All rights reserved. |
| 3 | * |
| 4 | * Previously licensed under the ISC license by Qualcomm Atheros, Inc. |
| 5 | * |
| 6 | * |
| 7 | * Permission to use, copy, modify, and/or distribute this software for |
| 8 | * any purpose with or without fee is hereby granted, provided that the |
| 9 | * above copyright notice and this permission notice appear in all |
| 10 | * copies. |
| 11 | * |
| 12 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL |
| 13 | * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED |
| 14 | * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE |
| 15 | * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL |
| 16 | * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
| 17 | * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 18 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 19 | * PERFORMANCE OF THIS SOFTWARE. |
| 20 | */ |
| 21 | |
| 22 | /* |
| 23 | * This file was originally distributed by Qualcomm Atheros, Inc. |
| 24 | * under proprietary terms before Copyright ownership was assigned |
| 25 | * to the Linux Foundation. |
| 26 | */ |
| 27 | |
| 28 | /** |
| 29 | * @file ol_txrx_status.h |
| 30 | * @brief Functions provided for visibility and debugging. |
| 31 | * NOTE: This file is used by both kernel driver SW and userspace SW. |
| 32 | * Thus, do not reference use any kernel header files or defs in this file! |
| 33 | */ |
| 34 | #ifndef _OL_TXRX_STATS__H_ |
| 35 | #define _OL_TXRX_STATS__H_ |
| 36 | |
| 37 | #include <athdefs.h> /* uint64_t */ |
| 38 | |
| 39 | |
| 40 | |
| 41 | struct ol_txrx_stats_elem { |
| 42 | uint64_t pkts; |
| 43 | uint64_t bytes; |
| 44 | }; |
| 45 | |
| 46 | #define NUM_MAX_TSO_SEGS 8 |
| 47 | #define NUM_MAX_TSO_SEGS_MASK (NUM_MAX_TSO_SEGS - 1) |
| 48 | |
| 49 | #define NUM_MAX_TSO_MSDUS 128 |
| 50 | #define NUM_MAX_TSO_MSDUS_MASK (NUM_MAX_TSO_MSDUS - 1) |
| 51 | |
| 52 | struct ol_txrx_stats_tso_msdu { |
| 53 | struct cdf_tso_seg_t tso_segs[NUM_MAX_TSO_SEGS]; |
| 54 | uint32_t num_seg; |
| 55 | uint32_t tso_seg_idx; |
| 56 | }; |
| 57 | |
| 58 | struct ol_txrx_stats_tso_info { |
| 59 | struct ol_txrx_stats_tso_msdu tso_msdu_info[NUM_MAX_TSO_MSDUS]; |
| 60 | uint32_t tso_msdu_idx; |
| 61 | }; |
| 62 | |
| 63 | /** |
| 64 | * @brief data stats published by the host txrx layer |
| 65 | */ |
| 66 | struct ol_txrx_stats { |
| 67 | struct { |
| 68 | /* MSDUs given to the txrx layer by the management stack */ |
| 69 | struct ol_txrx_stats_elem mgmt; |
| 70 | /* MSDUs successfully sent across the WLAN */ |
| 71 | struct ol_txrx_stats_elem delivered; |
| 72 | struct { |
| 73 | /* MSDUs that the host did not accept */ |
| 74 | struct ol_txrx_stats_elem host_reject; |
| 75 | /* MSDUs which could not be downloaded to the target */ |
| 76 | struct ol_txrx_stats_elem download_fail; |
| 77 | /* MSDUs which the target discarded |
| 78 | (lack of memory or old age) */ |
| 79 | struct ol_txrx_stats_elem target_discard; |
| 80 | /* MSDUs which the target sent but |
| 81 | couldn't get an ack for */ |
| 82 | struct ol_txrx_stats_elem no_ack; |
| 83 | } dropped; |
| 84 | /* contains information of packets recevied per tx completion*/ |
| 85 | struct { |
| 86 | uint32_t pkts_1; |
| 87 | uint32_t pkts_2_10; |
| 88 | uint32_t pkts_11_20; |
| 89 | uint32_t pkts_21_30; |
| 90 | uint32_t pkts_31_40; |
| 91 | uint32_t pkts_41_50; |
| 92 | uint32_t pkts_51_60; |
| 93 | uint32_t pkts_61_plus; |
| 94 | } comp_histogram; |
| 95 | /* TSO (TCP segmentation offload) information */ |
| 96 | struct { |
| 97 | struct ol_txrx_stats_elem tso_pkts; |
| 98 | #if defined(FEATURE_TSO) |
| 99 | struct ol_txrx_stats_tso_info tso_info; |
| 100 | #endif |
| 101 | } tso; |
| 102 | } tx; |
| 103 | struct { |
| 104 | /* MSDUs given to the OS shim */ |
| 105 | struct ol_txrx_stats_elem delivered; |
| 106 | struct { |
| 107 | /* MSDUs forwarded to network stack */ |
| 108 | u_int32_t packets_stack; |
| 109 | /* MSDUs forwarded from the rx path to the tx path */ |
| 110 | u_int32_t packets_fwd; |
| 111 | /* MSDUs forwarded to stack and tx path */ |
| 112 | u_int32_t packets_stack_n_fwd; |
| 113 | } intra_bss_fwd; |
| 114 | } rx; |
| 115 | }; |
| 116 | |
| 117 | /* |
| 118 | * Structure to consolidate host stats |
| 119 | */ |
| 120 | struct ieee80211req_ol_ath_host_stats { |
| 121 | struct ol_txrx_stats txrx_stats; |
| 122 | struct { |
| 123 | int pkt_q_fail_count; |
| 124 | int pkt_q_empty_count; |
| 125 | int send_q_empty_count; |
| 126 | } htc; |
| 127 | struct { |
| 128 | int pipe_no_resrc_count; |
| 129 | int ce_ring_delta_fail_count; |
| 130 | } hif; |
| 131 | }; |
| 132 | |
| 133 | #endif /* _OL_TXRX_STATS__H_ */ |