source: ReferenceDesigns/w3_802.11/c/wlan_mac_high_framework/include/wlan_mac_event_log.h

Last change on this file was 6319, checked in by chunter, 5 years ago

1.8.0 release wlan-mac-se

File size: 3.9 KB
Line 
1/** @file wlan_mac_event_log.h
2 *  @brief MAC Event Log Framework
3 *
4 *  Contains code for logging MAC events in DRAM.
5 *
6 *  @copyright Copyright 2013-2019, Mango Communications. All rights reserved.
7 *          Distributed under the Mango Communications Reference Design License
8 *              See LICENSE.txt included in the design archive or
9 *              at http://mangocomm.com/802.11/license
10 *
11 *  This file is part of the Mango 802.11 Reference Design (https://mangocomm.com/802.11)
12 */
13
14
15
16
17/*************************** Constant Definitions ****************************/
18#ifndef WLAN_MAC_EVENT_LOG_H_
19#define WLAN_MAC_EVENT_LOG_H_
20
21/***************************** Include Files *********************************/
22#include "xil_types.h"
23
24
25
26
27// ****************************************************************************
28// Define Event Log Constants
29//
30
31// Define default event logging state
32//   '0' - Event logging is disabled on boot
33//   '1' - Event logging is enabled on boot
34//
35#define EVENT_LOG_DEFAULT_LOGGING                          1
36
37
38// Define event logging enable / disable
39#define EVENT_LOG_LOGGING_ENABLE                           1
40#define EVENT_LOG_LOGGING_DISABLE                          2
41
42
43// Define event wrapping enable / disable
44#define EVENT_LOG_WRAP_ENABLE                              1
45#define EVENT_LOG_WRAP_DISABLE                             2
46
47
48// Define event wrap buffer
49//   This is the number of additional bytes that the head address will be incremented
50//   on each request.  Currently, when the log wraps, the head address will stay just
51//   ahead of the next address which will add overhead to the logging calls.  This
52//   will allow the head address to be incremented by an additional buffer so that
53//   the head pointer will not have to increment as often.  By default this is zero.
54//
55#define EVENT_LOG_WRAPPING_BUFFER                          0
56
57
58// Maximum number of events to store in log
59//   A maximum event length of -1 is used to signal that the entire DRAM after the queue
60//   should be used for logging events. If MAX_EVENT_LOG > 0, then that number of events
61//   will be the maximum.
62//
63#define MAX_EVENT_LOG                                     -1
64
65
66// Define magic number that will indicate the start of an event
67//   - Magic number was chose so that:
68//       - It would not be in DDR address space
69//       - It is human readable
70//
71#define EVENT_LOG_MAGIC_NUMBER                             0xACED0000
72
73
74// Define constants for function flags
75//   NOTE:  the transmit flag is defined in wlan_exp_common.h since it is used in multiple places
76#define EVENT_LOG_NO_COUNTS                                0
77#define EVENT_LOG_COUNTS                                   1
78
79
80/*********************** Global Structure Definitions ************************/
81
82//-----------------------------------------------
83// Log Entry Header
84//   - This is used by the event log but is not exposed to the user
85//
86typedef struct entry_header{
87    u32 entry_id;
88    u16 entry_type;
89    u16 entry_length;
90} entry_header;
91
92
93
94/*************************** Function Prototypes *****************************/
95
96void      event_log_init( char* start_address, u32 size );
97
98void      event_log_reset();
99
100int       event_log_config_wrap( u32 enable );
101int       event_log_config_logging( u32 enable );
102
103u32       event_log_get_data( u32 start_index, u32 size, u8** address_ret );
104u32       event_log_get_size( u32 start_index );
105u32       event_log_get_total_size( void );
106u32       event_log_get_capacity( void );
107u32       event_log_get_next_entry_index( void );
108u32       event_log_get_oldest_entry_index( void );
109u32       event_log_get_num_wraps( void );
110u32       event_log_get_flags( void );
111void*     event_log_get_next_empty_entry( u16 entry_type, u16 entry_size );
112
113void      print_event_log( u32 num_events );
114void      print_event_log_size();
115
116#endif /* WLAN_MAC_EVENT_LOG_H_ */
Note: See TracBrowser for help on using the repository browser.