Velocity Userspace
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  /* 'overflow' only used in MRPC_FWLOGRD_RAM_WITH_FLAG
50  * and MRPC_FWLOGRD_FLASH_WITH_FLAG subcommand */
51  uint8_t overflow;
52  uint8_t reserved1;
53  uint32_t total;
54  uint32_t count;
55  uint32_t remain;
56  uint32_t next_start;
57  uint32_t sdk_version;
58  uint32_t fw_version;
59  uint32_t reserved2;
60  } hdr;
61 
62  struct log_a_data data[(MRPC_MAX_DATA_LEN -
63  sizeof(struct log_a_retr_hdr)) /
64  sizeof(struct log_a_data)];
65 };
66 
67 struct log_b_retr {
68  uint8_t sub_cmd_id;
69  uint8_t reserved[3];
70  uint32_t offset;
71  uint32_t length;
72 };
73 
75  struct log_b_retr_hdr {
76  uint8_t sub_cmd_id;
77  uint8_t reserved[3];
78  uint32_t length;
79  uint32_t remain;
80  } hdr;
81  uint8_t data[MRPC_MAX_DATA_LEN - sizeof(struct log_b_retr_hdr)];
82 };
83 
84 #endif
log_b_retr_result::log_b_retr_hdr
Definition: log.h:75
log_a_retr_result::log_a_retr_hdr
Definition: log.h:46
log_a_data
Definition: log.h:41
log_b_retr
Definition: log.h:67
log_a_retr
Definition: log.h:32
log_a_retr_result
Definition: log.h:45
log_b_retr_result
Definition: log.h:74