Files
s390-tools/zpcimon/opticsmon.h
Niklas Schnelle 113e9ebfef zpcimon: Split optics monitoring out into separate monitor
Introduce the concept of a generic zPCI device monitor by creating the
zpcimon_ops operations struct turning all optics specific calls into
abstract monitor calls. Handle monitors as a static array of zpcimon_ops
based monitors of which the now split out optics monitor is currently
the only one. All operations are in principle optional though a monitor
which provides an init operation must also provide the corresponding
destroy operation.

Keep the base64 based JSON pair as non optics specific for later re-use
and make it just skip the output in the very unlikely case that encoding
fails. In follow on commits a monitor for NVMe devices collecting SMART
data will be added.

Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2026-07-24 18:21:50 +02:00

21 lines
465 B
C

/*
* Copyright IBM Corp. 2025
*
* s390-tools is free software; you can redistribute it and/or modify
* it under the terms of the MIT license. See LICENSE for details.
*/
#ifndef ZPCIMON_OPTICSMON_H
#define ZPCIMON_OPTICSMON_H
#include "ethtool.h"
#include "link_mon.h"
struct options;
struct opticsmon_ctx {
struct ethtool_nl_ctx ethtool_ctx;
struct link_mon_nl_ctx lctx;
};
extern const struct zpcimon_ops opticsmon_ops;
#endif /* ZPCIMON_OPTICSMON_H */