summaryrefslogtreecommitdiffstats
path: root/plugins/ocp/ocp-fw-activation-history.h
blob: 15733a3fd5d471c03d0db24c8b3a3a23bbee61a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
 * Copyright (c) 2022 Solidigm.
 *
 * Authors: karl.dedow@solidigm.com
 */
#include "common.h"
#include "linux/types.h"

#ifndef OCP_FIRMWARE_ACTIVATION_HISTORY_H
#define OCP_FIRMWARE_ACTIVATION_HISTORY_H

struct command;
struct plugin;

struct __packed fw_activation_history_entry {
	__u8 ver_num;
	__u8 entry_length;
	__le16 reserved1;
	__le16 activation_count;
	__le64 timestamp;
	__le64 reserved2;
	__le64 power_cycle_count;
	char previous_fw[8];
	char new_fw[8];
	__u8 slot_number;
	__u8 commit_action;
	__le16 result;
	__u8 reserved3[14];
};

struct __packed fw_activation_history {
	__u8 log_id;
	__u8 reserved1[3];
	__le32 valid_entries;
	struct fw_activation_history_entry entries[20];
	__u8 reserved2[2790];
	__le16 log_page_version;
	__le64 log_page_guid[2];
};

int ocp_fw_activation_history_log(int argc, char **argv, struct command *cmd,
				  struct plugin *plugin);

#endif