mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
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>
21 lines
465 B
C
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 */
|