Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (c) 2012-2014 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 | * The file is used to define structures that are shared between |
| 30 | * kernel space and user space pktlog application. |
| 31 | */ |
| 32 | |
| 33 | #ifndef _PKTLOG_AC_API_ |
| 34 | #define _PKTLOG_AC_API_ |
| 35 | #ifndef REMOVE_PKT_LOG |
| 36 | |
| 37 | /** |
| 38 | * @typedef ol_pktlog_dev_handle |
| 39 | * @brief opaque handle for pktlog device object |
| 40 | */ |
| 41 | struct ol_pktlog_dev_t; |
| 42 | typedef struct ol_pktlog_dev_t *ol_pktlog_dev_handle; |
| 43 | |
| 44 | /** |
| 45 | * @typedef ol_softc_handle |
| 46 | * @brief opaque handle for ol_softc |
| 47 | */ |
| 48 | struct ol_softc; |
| 49 | typedef struct ol_softc *ol_softc_handle; |
| 50 | |
| 51 | /** |
| 52 | * @typedef net_device_handle |
| 53 | * @brief opaque handle linux phy device object |
| 54 | */ |
| 55 | struct net_device; |
| 56 | typedef struct net_device *net_device_handle; |
| 57 | |
| 58 | void ol_pl_set_name(ol_softc_handle scn, net_device_handle dev); |
| 59 | |
| 60 | void ol_pl_sethandle(ol_pktlog_dev_handle *pl_handle, ol_softc_handle scn); |
| 61 | |
| 62 | /* Packet log state information */ |
| 63 | #ifndef _PKTLOG_INFO |
| 64 | #define _PKTLOG_INFO |
| 65 | struct ath_pktlog_info { |
| 66 | struct ath_pktlog_buf *buf; |
| 67 | uint32_t log_state; |
| 68 | uint32_t saved_state; |
| 69 | uint32_t options; |
| 70 | |
| 71 | /* Size of buffer in bytes */ |
| 72 | int32_t buf_size; |
| 73 | spinlock_t log_lock; |
| 74 | |
| 75 | /* Threshold of TCP SACK packets for triggered stop */ |
| 76 | int sack_thr; |
| 77 | |
| 78 | /* # of tail packets to log after triggered stop */ |
| 79 | int tail_length; |
| 80 | |
| 81 | /* throuput threshold in bytes for triggered stop */ |
| 82 | uint32_t thruput_thresh; |
| 83 | |
| 84 | /* (aggregated or single) packet size in bytes */ |
| 85 | uint32_t pktlen; |
| 86 | |
| 87 | /* a temporary variable for counting TX throughput only */ |
| 88 | /* PER threshold for triggered stop, 10 for 10%, range [1, 99] */ |
| 89 | uint32_t per_thresh; |
| 90 | |
| 91 | /* Phyerr threshold for triggered stop */ |
| 92 | uint32_t phyerr_thresh; |
| 93 | |
| 94 | /* time period for counting trigger parameters, in milisecond */ |
| 95 | uint32_t trigger_interval; |
| 96 | uint32_t start_time_thruput; |
| 97 | uint32_t start_time_per; |
| 98 | }; |
| 99 | #endif /* _PKTLOG_INFO */ |
| 100 | #else /* REMOVE_PKT_LOG */ |
| 101 | typedef void *ol_pktlog_dev_handle; |
| 102 | #define ol_pl_sethandle(pl_handle, scn) \ |
| 103 | do { \ |
| 104 | (void)pl_handle; \ |
| 105 | (void)scn; \ |
| 106 | } while (0) |
| 107 | |
| 108 | #define ol_pl_set_name(scn, dev) \ |
| 109 | do { \ |
| 110 | (void)scn; \ |
| 111 | (void)dev; \ |
| 112 | } while (0) |
| 113 | |
| 114 | #endif /* REMOVE_PKT_LOG */ |
| 115 | #endif /* _PKTLOG_AC_API_ */ |