Switchtec Userspace  PROJECT_NUMBER = PROJECT_NUMBER=PROJECT_NUMBER = 2.2
pmon.h
1 /*
2  * Microsemi Switchtec(tm) PCIe Management Library
3  * Copyright (c) 2017, Microsemi Corporation
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a
6  * copy of this software and associated documentation files (the "Software"),
7  * to deal in the Software without restriction, including without limitation
8  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9  * and/or sell copies of the Software, and to permit persons to whom the
10  * Software is furnished to do so, subject to the following conditions:
11  *
12  * The above copyright notice and this permission notice shall be included
13  * in all copies or substantial portions of the Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
16  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
19  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
20  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
21  * OTHER DEALINGS IN THE SOFTWARE.
22  *
23  */
24 
25 #ifndef LIBSWITCHTEC_PMON_H
26 #define LIBSWITCHTEC_PMON_H
27 
28 #include <stdint.h>
29 #include <switchtec/switchtec.h>
30 
31 #pragma pack(push, 1)
32 
34  uint8_t sub_cmd_id;
35  uint8_t stack_id;
36  uint8_t counter_id;
37  uint8_t num_counters;
38 
39  struct {
40  uint32_t mask;
41  uint8_t ieg;
42  uint32_t thresh;
43  } counters[63];
44 };
45 
47  uint32_t mask;
48  uint8_t ieg;
49  uint32_t thresh;
50 };
51 
53  uint8_t sub_cmd_id;
54  uint8_t stack_id;
55  uint8_t counter_id;
56  uint8_t num_counters;
57  uint8_t read_clear;
58 };
59 
61  uint32_t value;
62  uint32_t threshold;
63 };
64 
65 struct pmon_bw_get {
66  uint8_t sub_cmd_id;
67  uint8_t count;
68  struct {
69  uint8_t id;
70  uint8_t clear;
71  } ports[SWITCHTEC_MAX_PORTS];
72 };
73 
74 struct pmon_bw_set {
75  uint8_t sub_cmd_id;
76  uint8_t count;
77  struct {
78  uint8_t id;
79  uint8_t bw_type;
80  } ports[SWITCHTEC_MAX_PORTS];
81 };
82 
84  uint8_t sub_cmd_id;
85  uint8_t count;
86  struct {
87  uint8_t egress;
88  uint8_t ingress;
89  } ports[SWITCHTEC_MAX_PORTS];
90 };
91 
92 struct pmon_lat_get {
93  uint8_t sub_cmd_id;
94  uint8_t count;
95  uint8_t clear;
96  uint8_t port_ids[SWITCHTEC_MAX_PORTS];
97 };
98 
99 struct pmon_lat_data {
100  uint16_t cur_ns;
101  uint16_t max_ns;
102 };
103 
104 #pragma pack(pop)
105 
106 #endif
Main Switchtec header.