aboutsummaryrefslogtreecommitdiff
path: root/src/kerneldevice/mm-kernel-device-generic.h
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2016-09-28 20:34:48 +0200
committerAleksander Morgado <aleksander@aleksander.es>2016-09-29 15:43:05 +0200
commitae9ede926a1747216b54e22398edde203ec9a03c (patch)
treec6d1c405982051497ed78fbbfc7cbb6a3f16e5e4 /src/kerneldevice/mm-kernel-device-generic.h
parentc4a584416ab4af81b6cae653625c78f9158de1e6 (diff)
core: use the kernel device object in the port object and the plugin interface
The mm_base_modem_grab_port() now receives a MMKernelDevice directly from the plugin, which is then stored in the MMPort corresponding to the port. This means that we have direct access to e.g. all properties set by udev rules everywhere, and we don't need additional GUdevClient objects (e.g. like the one used in the Huawei plugin to detect NDISDUP support during runtime). For virtual ports (e.g. generated during unit tests), we have a new 'generic' kernel device object which just provides the values from the kernel device properties given during its creation.
Diffstat (limited to 'src/kerneldevice/mm-kernel-device-generic.h')
-rw-r--r--src/kerneldevice/mm-kernel-device-generic.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/kerneldevice/mm-kernel-device-generic.h b/src/kerneldevice/mm-kernel-device-generic.h
new file mode 100644
index 00000000..87f99941
--- /dev/null
+++ b/src/kerneldevice/mm-kernel-device-generic.h
@@ -0,0 +1,51 @@
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details:
+ *
+ * Copyright (C) 2016 Velocloud, Inc.
+ */
+
+#ifndef MM_KERNEL_DEVICE_GENERIC_H
+#define MM_KERNEL_DEVICE_GENERIC_H
+
+#include <glib.h>
+#include <glib-object.h>
+
+#define _LIBMM_INSIDE_MM
+#include <libmm-glib.h>
+
+#include "mm-kernel-device.h"
+
+#define MM_TYPE_KERNEL_DEVICE_GENERIC (mm_kernel_device_generic_get_type ())
+#define MM_KERNEL_DEVICE_GENERIC(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_KERNEL_DEVICE_GENERIC, MMKernelDeviceGeneric))
+#define MM_KERNEL_DEVICE_GENERIC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_KERNEL_DEVICE_GENERIC, MMKernelDeviceGenericClass))
+#define MM_IS_KERNEL_DEVICE_GENERIC(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_KERNEL_DEVICE_GENERIC))
+#define MM_IS_KERNEL_DEVICE_GENERIC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_KERNEL_DEVICE_GENERIC))
+#define MM_KERNEL_DEVICE_GENERIC_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_KERNEL_DEVICE_GENERIC, MMKernelDeviceGenericClass))
+
+typedef struct _MMKernelDeviceGeneric MMKernelDeviceGeneric;
+typedef struct _MMKernelDeviceGenericClass MMKernelDeviceGenericClass;
+typedef struct _MMKernelDeviceGenericPrivate MMKernelDeviceGenericPrivate;
+
+struct _MMKernelDeviceGeneric {
+ MMKernelDevice parent;
+ MMKernelDeviceGenericPrivate *priv;
+};
+
+struct _MMKernelDeviceGenericClass {
+ MMKernelDeviceClass parent;
+};
+
+GType mm_kernel_device_generic_get_type (void);
+MMKernelDevice *mm_kernel_device_generic_new (MMKernelEventProperties *properties,
+ GError **error);
+
+#endif /* MM_KERNEL_DEVICE_GENERIC_H */