blob: f8bb681a20a926f4960acc2be786dc63f4cd179d [file] [log] [blame]
Madan Mohan Koyyalamudie32d2192013-09-28 23:54:37 -07001/*
2 * Copyright (c) 2013, 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 */
Madan Mohan Koyyalamudie32d2192013-09-28 23:54:37 -070027/**
28 * @file ol_txrx_status.h
29 * @brief Functions provided for visibility and debugging.
30 * NOTE: This file is used by both kernel driver SW and userspace SW.
31 * Thus, do not reference use any kernel header files or defs in this file!
32 */
33#ifndef _OL_TXRX_STATS__H_
34#define _OL_TXRX_STATS__H_
35
36#include <athdefs.h> /* u_int64_t */
37
38#define TXRX_STATS_LEVEL_OFF 0
39#define TXRX_STATS_LEVEL_BASIC 1
40#define TXRX_STATS_LEVEL_FULL 2
41
42#ifndef TXRX_STATS_LEVEL
43#define TXRX_STATS_LEVEL TXRX_STATS_LEVEL_BASIC
44#endif
45
46typedef struct {
47 u_int64_t pkts;
48 u_int64_t bytes;
49} ol_txrx_stats_elem;
50
51/**
52 * @brief data stats published by the host txrx layer
53 */
54struct ol_txrx_stats {
55 struct {
56 /* MSDUs given to the txrx layer by the management stack */
57 ol_txrx_stats_elem mgmt;
58 /* MSDUs successfully sent across the WLAN */
59 ol_txrx_stats_elem delivered;
60 struct {
61 /* MSDUs that the host did not accept */
62 ol_txrx_stats_elem host_reject;
63 /* MSDUs which could not be downloaded to the target */
64 ol_txrx_stats_elem download_fail;
65 /* MSDUs which the target discarded (lack of mem or old age) */
66 ol_txrx_stats_elem target_discard;
67 /* MSDUs which the target sent but couldn't get an ack for */
68 ol_txrx_stats_elem no_ack;
69 } dropped;
70 } tx;
71 struct {
72 /* MSDUs given to the OS shim */
73 ol_txrx_stats_elem delivered;
74 /* MSDUs forwarded from the rx path to the tx path */
75 ol_txrx_stats_elem forwarded;
76 } rx;
77};
78
79/*
80 * Structure to consolidate host stats
81 */
82struct ieee80211req_ol_ath_host_stats {
83 struct ol_txrx_stats txrx_stats;
84 struct {
85 int pkt_q_fail_count;
86 int pkt_q_empty_count;
87 int send_q_empty_count;
88 } htc;
89 struct {
90 int pipe_no_resrc_count;
91 int ce_ring_delta_fail_count;
92 } hif;
93};
94
95#endif /* _OL_TXRX_STATS__H_ */