Switchtec Userspace  PROJECT_NUMBER = PROJECT_NUMBER=PROJECT_NUMBER = 2.2
log.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_LOG_H
26 #define LIBSWITCHTEC_LOG_H
27 
28 #include "mrpc.h"
29 #include <stdint.h>
30 #include <stddef.h>
31 
32 struct log_a_retr {
33  uint8_t sub_cmd_id;
34  uint8_t from_end;
35  uint8_t reserved1[6];
36  uint32_t count;
37  uint32_t reserved2;
38  uint32_t start;
39 };
40 
41 struct log_a_data {
42  uint32_t data[8];
43 };
44 
46  struct log_a_retr_hdr {
47  uint8_t sub_cmd_id;
48  uint8_t from_end;
49  uint8_t reserved1[2];
50  uint32_t total;
51  uint32_t count;
52  uint32_t remain;
53  uint32_t next_start;
54  uint32_t reserved2[3];
55  } hdr;
56 
57  struct log_a_data data[(MRPC_MAX_DATA_LEN -
58  sizeof(struct log_a_retr_hdr)) /
59  sizeof(struct log_a_data)];
60 };
61 
62 struct log_b_retr {
63  uint8_t sub_cmd_id;
64  uint8_t reserved[3];
65  uint32_t offset;
66  uint32_t length;
67 };
68 
70  struct log_b_retr_hdr {
71  uint8_t sub_cmd_id;
72  uint8_t reserved[3];
73  uint32_t length;
74  uint32_t remain;
75  } hdr;
76  uint8_t data[MRPC_MAX_DATA_LEN - sizeof(struct log_b_retr_hdr)];
77 };
78 
79 #endif
Definition: log.h:32
Definition: log.h:41
Definition: log.h:62