summary refs log tree commit diff
path: root/shared/nm-platform/nmp-base.h
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2021-02-11 18:11:46 +0100
committerMichael Biebl <biebl@debian.org>2021-02-11 18:11:46 +0100
commit80ec1decc49c72efec2a8b87c06245c92c0ab807 (patch)
treee3b229aa94e8dcf0590f2317664176e7b8f7607b /shared/nm-platform/nmp-base.h
parent65f86e8f56267192d42f2b629fc6b0c99fb9cd0c (diff)
New upstream version 1.29.90 upstream/1.29.90
Diffstat (limited to 'shared/nm-platform/nmp-base.h')
-rw-r--r--shared/nm-platform/nmp-base.h94
1 files changed, 94 insertions, 0 deletions
diff --git a/shared/nm-platform/nmp-base.h b/shared/nm-platform/nmp-base.h
new file mode 100644
index 00000000..210c26d6
--- /dev/null
+++ b/shared/nm-platform/nmp-base.h
@@ -0,0 +1,94 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#ifndef __NMP_FWD_H__
+#define __NMP_FWD_H__
+
+#include "nm-base/nm-base.h"
+
+/*****************************************************************************/
+
+typedef enum {
+    NM_PLATFORM_LINK_DUPLEX_UNKNOWN,
+    NM_PLATFORM_LINK_DUPLEX_HALF,
+    NM_PLATFORM_LINK_DUPLEX_FULL,
+} NMPlatformLinkDuplexType;
+
+/*****************************************************************************/
+
+typedef struct {
+    /* We don't want to include <linux/ethtool.h> in header files,
+     * thus create a ABI compatible version of struct ethtool_drvinfo.*/
+    guint32 _private_cmd;
+    char    driver[32];
+    char    version[32];
+    char    fw_version[32];
+    char    _private_bus_info[32];
+    char    _private_erom_version[32];
+    char    _private_reserved2[12];
+    guint32 _private_n_priv_flags;
+    guint32 _private_n_stats;
+    guint32 _private_testinfo_len;
+    guint32 _private_eedump_len;
+    guint32 _private_regdump_len;
+} NMPUtilsEthtoolDriverInfo;
+
+typedef struct {
+    NMEthtoolID ethtool_id;
+
+    guint8 n_kernel_names;
+
+    /* one NMEthtoolID refers to one or more kernel_names. The reason for supporting this complexity
+     * (where one NMSettingEthtool option refers to multiple kernel features)  is to follow what
+     * ethtool does, where "tx" is an alias for multiple features. */
+    const char *const *kernel_names;
+} NMEthtoolFeatureInfo;
+
+typedef struct {
+    const NMEthtoolFeatureInfo *info;
+
+    guint idx_ss_features;
+
+    /* one NMEthtoolFeatureInfo references one or more kernel_names. This is the index
+     * of the matching info->kernel_names */
+    guint8 idx_kernel_name;
+
+    bool available : 1;
+    bool requested : 1;
+    bool active : 1;
+    bool never_changed : 1;
+} NMEthtoolFeatureState;
+
+typedef struct {
+    guint n_states;
+
+    guint n_ss_features;
+
+    /* indexed by NMEthtoolID - _NM_ETHTOOL_ID_FEATURE_FIRST */
+    const NMEthtoolFeatureState *const *states_indexed[_NM_ETHTOOL_ID_FEATURE_NUM];
+
+    /* the same content, here as a list of n_states entries. */
+    const NMEthtoolFeatureState states_list[];
+} NMEthtoolFeatureStates;
+
+/*****************************************************************************/
+
+typedef struct {
+    guint32
+        s[_NM_ETHTOOL_ID_COALESCE_NUM /* indexed by (NMEthtoolID - _NM_ETHTOOL_ID_COALESCE_FIRST) */
+    ];
+} NMEthtoolCoalesceState;
+
+/*****************************************************************************/
+
+typedef struct {
+    guint32 rx_pending;
+    guint32 rx_mini_pending;
+    guint32 rx_jumbo_pending;
+    guint32 tx_pending;
+} NMEthtoolRingState;
+
+/*****************************************************************************/
+
+typedef struct _NMPNetns NMPNetns;
+
+#endif /* __NMP_FWD_H__ */