]> Pileus Git - ~andy/linux/blob - drivers/staging/csr/csr_wifi_hip_ta_sampling.h
Merge branches 'from-henrik', 'hidraw', 'logitech', 'picolcd', 'ps3', 'uclogic',...
[~andy/linux] / drivers / staging / csr / csr_wifi_hip_ta_sampling.h
1 /*****************************************************************************
2
3             (c) Cambridge Silicon Radio Limited 2011
4             All rights reserved and confidential information of CSR
5
6             Refer to LICENSE.txt included with this source for details
7             on the license terms.
8
9 *****************************************************************************/
10
11 /*
12  * ---------------------------------------------------------------------------
13  *  FILE:     csr_wifi_hip_ta_sampling.h
14  *
15  *  PURPOSE:
16  *      This file contains Traffic Analysis definitions common to the
17  *      sampling and analysis modules.
18  *
19  * ---------------------------------------------------------------------------
20  */
21 #ifndef __TA_SAMPLING_H__
22 #define __TA_SAMPLING_H__
23
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27
28 #include "csr_wifi_hip_unifi.h"
29
30 typedef struct ta_l4stats
31 {
32     u32 rxTcpBytesCount;
33     u32 txTcpBytesCount;
34     u32 rxUdpBytesCount;
35     u32 txUdpBytesCount;
36 } ta_l4stats_t;
37
38 /*
39  * Context structure to preserve state between calls.
40  */
41
42 typedef struct ta_data
43 {
44     /* Current packet filter configuration */
45     u16 packet_filter;
46
47     /* Current packet custom filter configuration */
48     CsrWifiRouterCtrlTrafficFilter custom_filter;
49
50     /* The timestamp of the last tx packet processed. */
51     u32 tx_last_ts;
52
53     /* The timestamp of the last packet processed. */
54     u32 last_indication_time;
55
56     /* Statistics */
57     CsrWifiRouterCtrlTrafficStats stats;
58
59     /* Current traffic classification */
60     CsrWifiRouterCtrlTrafficType traffic_type;
61
62     /* Sum of packet rx rates for this interval used to calculate mean */
63     u32    rx_sum_rate;
64     ta_l4stats_t ta_l4stats;
65 } ta_data_t;
66
67
68 void unifi_ta_sampling_init(card_t *card);
69
70
71 #ifdef __cplusplus
72 }
73 #endif
74
75 #endif /* __TA_SAMPLING_H__ */