summary refs log tree commit diff
path: root/libnm/nm-device-wimax.c
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2020-10-05 22:27:18 +0200
committerMichael Biebl <biebl@debian.org>2020-10-05 22:27:18 +0200
commitaafc1dbe4712c86189bbc1d4d54ad8cb4c69be7e (patch)
treea2a9bb4d007339a0b1304540388230ccedac32bd /libnm/nm-device-wimax.c
parente7b44ef4c80907346ec7492a09c45277459924fc (diff)
New upstream version 1.27.90 upstream/1.27.90
Diffstat (limited to 'libnm/nm-device-wimax.c')
-rw-r--r--libnm/nm-device-wimax.c407
1 files changed, 208 insertions, 199 deletions
diff --git a/libnm/nm-device-wimax.c b/libnm/nm-device-wimax.c
index 54a972b5..c1a1a9ba 100644
--- a/libnm/nm-device-wimax.c
+++ b/libnm/nm-device-wimax.c
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: LGPL-2.1+
+/* SPDX-License-Identifier: LGPL-2.1+ */
 /*
  * Copyright (C) 2011 - 2012 Red Hat, Inc.
  * Copyright (C) 2009 Novell, Inc.
@@ -12,37 +12,36 @@
 
 /*****************************************************************************/
 
-NM_GOBJECT_PROPERTIES_DEFINE_BASE (
-	PROP_HW_ADDRESS,
-	PROP_ACTIVE_NSP,
-	PROP_CENTER_FREQ,
-	PROP_RSSI,
-	PROP_CINR,
-	PROP_TX_POWER,
-	PROP_BSID,
-	PROP_NSPS,
-);
+NM_GOBJECT_PROPERTIES_DEFINE_BASE(PROP_HW_ADDRESS,
+                                  PROP_ACTIVE_NSP,
+                                  PROP_CENTER_FREQ,
+                                  PROP_RSSI,
+                                  PROP_CINR,
+                                  PROP_TX_POWER,
+                                  PROP_BSID,
+                                  PROP_NSPS, );
 
 enum {
-	NSP_ADDED,
-	NSP_REMOVED,
+    NSP_ADDED,
+    NSP_REMOVED,
 
-	LAST_SIGNAL
+    LAST_SIGNAL
 };
 
-static guint signals[LAST_SIGNAL] = { 0 };
+static guint signals[LAST_SIGNAL] = {0};
 
 struct _NMDeviceWimax {
-	NMDevice parent;
+    NMDevice parent;
 };
 
 struct _NMDeviceWimaxClass {
-	NMDeviceClass parent;
+    NMDeviceClass parent;
 };
 
-G_DEFINE_TYPE (NMDeviceWimax, nm_device_wimax, NM_TYPE_DEVICE)
+G_DEFINE_TYPE(NMDeviceWimax, nm_device_wimax, NM_TYPE_DEVICE)
 
-#define NM_DEVICE_WIMAX_GET_PRIVATE(self) _NM_GET_PRIVATE(self, NMDeviceWimax, NM_IS_DEVICE_WIMAX, NMObject, NMDevice)
+#define NM_DEVICE_WIMAX_GET_PRIVATE(self) \
+    _NM_GET_PRIVATE(self, NMDeviceWimax, NM_IS_DEVICE_WIMAX, NMObject, NMDevice)
 
 /*****************************************************************************/
 
@@ -58,9 +57,9 @@ G_DEFINE_TYPE (NMDeviceWimax, nm_device_wimax, NM_TYPE_DEVICE)
  * Deprecated: 1.2: WiMAX is no longer supported.
  **/
 const char *
-nm_device_wimax_get_hw_address (NMDeviceWimax *wimax)
+nm_device_wimax_get_hw_address(NMDeviceWimax *wimax)
 {
-	g_return_val_if_reached (NULL);
+    g_return_val_if_reached(NULL);
 }
 
 /**
@@ -74,9 +73,9 @@ nm_device_wimax_get_hw_address (NMDeviceWimax *wimax)
  * Deprecated: 1.2: WiMAX is no longer supported.
  **/
 NMWimaxNsp *
-nm_device_wimax_get_active_nsp (NMDeviceWimax *wimax)
+nm_device_wimax_get_active_nsp(NMDeviceWimax *wimax)
 {
-	g_return_val_if_reached (NULL);
+    g_return_val_if_reached(NULL);
 }
 
 /**
@@ -92,9 +91,9 @@ nm_device_wimax_get_active_nsp (NMDeviceWimax *wimax)
  * Deprecated: 1.2: WiMAX is no longer supported.
  **/
 const GPtrArray *
-nm_device_wimax_get_nsps (NMDeviceWimax *wimax)
+nm_device_wimax_get_nsps(NMDeviceWimax *wimax)
 {
-	g_return_val_if_reached (NULL);
+    g_return_val_if_reached(NULL);
 }
 
 /**
@@ -109,10 +108,9 @@ nm_device_wimax_get_nsps (NMDeviceWimax *wimax)
  * Deprecated: 1.2: WiMAX is no longer supported.
  **/
 NMWimaxNsp *
-nm_device_wimax_get_nsp_by_path (NMDeviceWimax *wimax,
-                                 const char *path)
+nm_device_wimax_get_nsp_by_path(NMDeviceWimax *wimax, const char *path)
 {
-	g_return_val_if_reached (NULL);
+    g_return_val_if_reached(NULL);
 }
 
 /**
@@ -128,9 +126,9 @@ nm_device_wimax_get_nsp_by_path (NMDeviceWimax *wimax,
  * Deprecated: 1.2: WiMAX is no longer supported.
  **/
 guint
-nm_device_wimax_get_center_frequency (NMDeviceWimax *self)
+nm_device_wimax_get_center_frequency(NMDeviceWimax *self)
 {
-	g_return_val_if_reached (0);
+    g_return_val_if_reached(0);
 }
 
 /**
@@ -147,9 +145,9 @@ nm_device_wimax_get_center_frequency (NMDeviceWimax *self)
  * Deprecated: 1.2: WiMAX is no longer supported.
  **/
 int
-nm_device_wimax_get_rssi (NMDeviceWimax *self)
+nm_device_wimax_get_rssi(NMDeviceWimax *self)
 {
-	g_return_val_if_reached (0);
+    g_return_val_if_reached(0);
 }
 
 /**
@@ -165,9 +163,9 @@ nm_device_wimax_get_rssi (NMDeviceWimax *self)
  * Deprecated: 1.2: WiMAX is no longer supported.
  **/
 int
-nm_device_wimax_get_cinr (NMDeviceWimax *self)
+nm_device_wimax_get_cinr(NMDeviceWimax *self)
 {
-	g_return_val_if_reached (0);
+    g_return_val_if_reached(0);
 }
 
 /**
@@ -183,9 +181,9 @@ nm_device_wimax_get_cinr (NMDeviceWimax *self)
  * Deprecated: 1.2: WiMAX is no longer supported.
  **/
 int
-nm_device_wimax_get_tx_power (NMDeviceWimax *self)
+nm_device_wimax_get_tx_power(NMDeviceWimax *self)
 {
-	g_return_val_if_reached (0);
+    g_return_val_if_reached(0);
 }
 
 /**
@@ -199,182 +197,193 @@ nm_device_wimax_get_tx_power (NMDeviceWimax *self)
  * Deprecated: 1.2: WiMAX is no longer supported.
  **/
 const char *
-nm_device_wimax_get_bsid (NMDeviceWimax *self)
+nm_device_wimax_get_bsid(NMDeviceWimax *self)
 {
-	g_return_val_if_reached (0);
+    g_return_val_if_reached(0);
 }
 
 /*****************************************************************************/
 
 static void
-get_property (GObject *object,
-              guint prop_id,
-              GValue *value,
-              GParamSpec *pspec)
+get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
 {
-	g_return_if_reached ();
+    g_return_if_reached();
 }
 
 static void
-nm_device_wimax_init (NMDeviceWimax *device)
+nm_device_wimax_init(NMDeviceWimax *device)
 {
-	g_return_if_reached ();
+    g_return_if_reached();
 }
 
 static void
-nm_device_wimax_class_init (NMDeviceWimaxClass *wimax_class)
+nm_device_wimax_class_init(NMDeviceWimaxClass *wimax_class)
 {
-	GObjectClass *object_class = G_OBJECT_CLASS (wimax_class);
-
-	object_class->get_property = get_property;
-
-	/**
-	 * NMDeviceWimax:hw-address:
-	 *
-	 * The hardware (MAC) address of the device.
-	 *
-	 * Deprecated: 1.2: WiMAX is no longer supported.
-	 **/
-	obj_properties[PROP_HW_ADDRESS] =
-	    g_param_spec_string (NM_DEVICE_WIMAX_HW_ADDRESS, "", "",
-	                         NULL,
-	                         G_PARAM_READABLE |
-	                         G_PARAM_STATIC_STRINGS);
-
-	/**
-	 * NMDeviceWimax:active-nsp:
-	 *
-	 * The active #NMWimaxNsp of the device.
-	 *
-	 * Deprecated: 1.2: WiMAX is no longer supported.
-	 **/
-	obj_properties[PROP_ACTIVE_NSP] =
-	    g_param_spec_object (NM_DEVICE_WIMAX_ACTIVE_NSP, "", "",
-	                         NM_TYPE_WIMAX_NSP,
-	                         G_PARAM_READABLE |
-	                         G_PARAM_STATIC_STRINGS);
-
-	/**
-	 * NMDeviceWimax:center-frequency:
-	 *
-	 * The center frequency (in KHz) of the radio channel the device is using to
-	 * communicate with the network when connected.  Has no meaning when the
-	 * device is not connected.
-	 *
-	 * Deprecated: 1.2: WiMAX is no longer supported.
-	 **/
-	obj_properties[PROP_CENTER_FREQ] =
-	    g_param_spec_uint (NM_DEVICE_WIMAX_CENTER_FREQUENCY, "", "",
-	                       0, G_MAXUINT, 0,
-	                       G_PARAM_READABLE |
-	                       G_PARAM_STATIC_STRINGS);
-
-	/**
-	 * NMDeviceWimax:rssi:
-	 *
-	 * RSSI of the current radio link in dBm.  This value indicates how strong
-	 * the raw received RF signal from the base station is, but does not
-	 * indicate the overall quality of the radio link.  Has no meaning when the
-	 * device is not connected.
-	 *
-	 * Deprecated: 1.2: WiMAX is no longer supported.
-	 **/
-	obj_properties[PROP_RSSI] =
-	    g_param_spec_int (NM_DEVICE_WIMAX_RSSI, "", "",
-	                      G_MININT, G_MAXINT, 0,
-	                      G_PARAM_READABLE |
-	                      G_PARAM_STATIC_STRINGS);
-
-	/**
-	 * NMDeviceWimax:cinr:
-	 *
-	 * CINR (Carrier to Interference + Noise Ratio) of the current radio link
-	 * in dB.  CINR is a more accurate measure of radio link quality.  Has no
-	 * meaning when the device is not connected.
-	 *
-	 * Deprecated: 1.2: WiMAX is no longer supported.
-	 **/
-	obj_properties[PROP_CINR] =
-	    g_param_spec_int (NM_DEVICE_WIMAX_CINR, "", "",
-	                      G_MININT, G_MAXINT, 0,
-	                      G_PARAM_READABLE |
-	                      G_PARAM_STATIC_STRINGS);
-
-	/**
-	 * NMDeviceWimax:tx-power:
-	 *
-	 * Average power of the last burst transmitted by the device, in units of
-	 * 0.5 dBm.  i.e. a TxPower of -11 represents an actual device TX power of
-	 * -5.5 dBm.  Has no meaning when the device is not connected.
-	 *
-	 * Deprecated: 1.2: WiMAX is no longer supported.
-	 **/
-	obj_properties[PROP_TX_POWER] =
-	    g_param_spec_int (NM_DEVICE_WIMAX_TX_POWER, "", "",
-	                      G_MININT, G_MAXINT, 0,
-	                      G_PARAM_READABLE |
-	                      G_PARAM_STATIC_STRINGS);
-
-	/**
-	 * NMDeviceWimax:bsid:
-	 *
-	 * The ID of the serving base station as received from the network.  Has
-	 * no meaning when the device is not connected.
-	 *
-	 * Deprecated: 1.2: WiMAX is no longer supported.
-	 **/
-	obj_properties[PROP_BSID] =
-	    g_param_spec_string (NM_DEVICE_WIMAX_BSID, "", "",
-	                         NULL,
-	                         G_PARAM_READABLE |
-	                         G_PARAM_STATIC_STRINGS);
-
-	/**
-	 * NMDeviceWimax:nsps: (type GPtrArray(NMWimaxNsp))
-	 *
-	 * List of all WiMAX Network Service Providers the device can see.
-	 **/
-	obj_properties[PROP_NSPS] =
-	    g_param_spec_boxed (NM_DEVICE_WIMAX_NSPS, "", "",
-	                        G_TYPE_PTR_ARRAY,
-	                        G_PARAM_READABLE |
-	                        G_PARAM_STATIC_STRINGS);
-
-	g_object_class_install_properties (object_class, _PROPERTY_ENUMS_LAST, obj_properties);
-
-	/**
-	 * NMDeviceWimax::nsp-added:
-	 * @self: the wimax device that received the signal
-	 * @nsp: the new NSP
-	 *
-	 * Notifies that a #NMWimaxNsp is added to the wimax device.
-	 *
-	 * Deprecated: 1.2: WiMAX is no longer supported.
-	 **/
-	signals[NSP_ADDED] =
-	    g_signal_new ("nsp-added",
-	                  G_OBJECT_CLASS_TYPE (object_class),
-	                  G_SIGNAL_RUN_FIRST,
-	                  0, NULL, NULL,
-	                  g_cclosure_marshal_VOID__OBJECT,
-	                  G_TYPE_NONE, 1,
-	                  G_TYPE_OBJECT);
-
-	/**
-	 * NMDeviceWimax::nsp-removed:
-	 * @self: the wimax device that received the signal
-	 * @nsp: the removed NSP
-	 *
-	 * Notifies that a #NMWimaxNsp is removed from the wimax device.
-	 *
-	 * Deprecated: 1.2: WiMAX is no longer supported.
-	 **/
-	signals[NSP_REMOVED] =
-	    g_signal_new ("nsp-removed",
-	                  G_OBJECT_CLASS_TYPE (object_class),
-	                  G_SIGNAL_RUN_FIRST,
-	                  0, NULL, NULL,
-	                  g_cclosure_marshal_VOID__OBJECT,
-	                  G_TYPE_NONE, 1,
-	                  G_TYPE_OBJECT);
+    GObjectClass *object_class = G_OBJECT_CLASS(wimax_class);
+
+    object_class->get_property = get_property;
+
+    /**
+     * NMDeviceWimax:hw-address:
+     *
+     * The hardware (MAC) address of the device.
+     *
+     * Deprecated: 1.2: WiMAX is no longer supported.
+     **/
+    obj_properties[PROP_HW_ADDRESS] =
+        g_param_spec_string(NM_DEVICE_WIMAX_HW_ADDRESS,
+                            "",
+                            "",
+                            NULL,
+                            G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
+
+    /**
+     * NMDeviceWimax:active-nsp:
+     *
+     * The active #NMWimaxNsp of the device.
+     *
+     * Deprecated: 1.2: WiMAX is no longer supported.
+     **/
+    obj_properties[PROP_ACTIVE_NSP] =
+        g_param_spec_object(NM_DEVICE_WIMAX_ACTIVE_NSP,
+                            "",
+                            "",
+                            NM_TYPE_WIMAX_NSP,
+                            G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
+
+    /**
+     * NMDeviceWimax:center-frequency:
+     *
+     * The center frequency (in KHz) of the radio channel the device is using to
+     * communicate with the network when connected.  Has no meaning when the
+     * device is not connected.
+     *
+     * Deprecated: 1.2: WiMAX is no longer supported.
+     **/
+    obj_properties[PROP_CENTER_FREQ] = g_param_spec_uint(NM_DEVICE_WIMAX_CENTER_FREQUENCY,
+                                                         "",
+                                                         "",
+                                                         0,
+                                                         G_MAXUINT,
+                                                         0,
+                                                         G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
+
+    /**
+     * NMDeviceWimax:rssi:
+     *
+     * RSSI of the current radio link in dBm.  This value indicates how strong
+     * the raw received RF signal from the base station is, but does not
+     * indicate the overall quality of the radio link.  Has no meaning when the
+     * device is not connected.
+     *
+     * Deprecated: 1.2: WiMAX is no longer supported.
+     **/
+    obj_properties[PROP_RSSI] = g_param_spec_int(NM_DEVICE_WIMAX_RSSI,
+                                                 "",
+                                                 "",
+                                                 G_MININT,
+                                                 G_MAXINT,
+                                                 0,
+                                                 G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
+
+    /**
+     * NMDeviceWimax:cinr:
+     *
+     * CINR (Carrier to Interference + Noise Ratio) of the current radio link
+     * in dB.  CINR is a more accurate measure of radio link quality.  Has no
+     * meaning when the device is not connected.
+     *
+     * Deprecated: 1.2: WiMAX is no longer supported.
+     **/
+    obj_properties[PROP_CINR] = g_param_spec_int(NM_DEVICE_WIMAX_CINR,
+                                                 "",
+                                                 "",
+                                                 G_MININT,
+                                                 G_MAXINT,
+                                                 0,
+                                                 G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
+
+    /**
+     * NMDeviceWimax:tx-power:
+     *
+     * Average power of the last burst transmitted by the device, in units of
+     * 0.5 dBm.  i.e. a TxPower of -11 represents an actual device TX power of
+     * -5.5 dBm.  Has no meaning when the device is not connected.
+     *
+     * Deprecated: 1.2: WiMAX is no longer supported.
+     **/
+    obj_properties[PROP_TX_POWER] = g_param_spec_int(NM_DEVICE_WIMAX_TX_POWER,
+                                                     "",
+                                                     "",
+                                                     G_MININT,
+                                                     G_MAXINT,
+                                                     0,
+                                                     G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
+
+    /**
+     * NMDeviceWimax:bsid:
+     *
+     * The ID of the serving base station as received from the network.  Has
+     * no meaning when the device is not connected.
+     *
+     * Deprecated: 1.2: WiMAX is no longer supported.
+     **/
+    obj_properties[PROP_BSID] = g_param_spec_string(NM_DEVICE_WIMAX_BSID,
+                                                    "",
+                                                    "",
+                                                    NULL,
+                                                    G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
+
+    /**
+     * NMDeviceWimax:nsps: (type GPtrArray(NMWimaxNsp))
+     *
+     * List of all WiMAX Network Service Providers the device can see.
+     **/
+    obj_properties[PROP_NSPS] = g_param_spec_boxed(NM_DEVICE_WIMAX_NSPS,
+                                                   "",
+                                                   "",
+                                                   G_TYPE_PTR_ARRAY,
+                                                   G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
+
+    g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
+
+    /**
+     * NMDeviceWimax::nsp-added:
+     * @self: the wimax device that received the signal
+     * @nsp: the new NSP
+     *
+     * Notifies that a #NMWimaxNsp is added to the wimax device.
+     *
+     * Deprecated: 1.2: WiMAX is no longer supported.
+     **/
+    signals[NSP_ADDED] = g_signal_new("nsp-added",
+                                      G_OBJECT_CLASS_TYPE(object_class),
+                                      G_SIGNAL_RUN_FIRST,
+                                      0,
+                                      NULL,
+                                      NULL,
+                                      g_cclosure_marshal_VOID__OBJECT,
+                                      G_TYPE_NONE,
+                                      1,
+                                      G_TYPE_OBJECT);
+
+    /**
+     * NMDeviceWimax::nsp-removed:
+     * @self: the wimax device that received the signal
+     * @nsp: the removed NSP
+     *
+     * Notifies that a #NMWimaxNsp is removed from the wimax device.
+     *
+     * Deprecated: 1.2: WiMAX is no longer supported.
+     **/
+    signals[NSP_REMOVED] = g_signal_new("nsp-removed",
+                                        G_OBJECT_CLASS_TYPE(object_class),
+                                        G_SIGNAL_RUN_FIRST,
+                                        0,
+                                        NULL,
+                                        NULL,
+                                        g_cclosure_marshal_VOID__OBJECT,
+                                        G_TYPE_NONE,
+                                        1,
+                                        G_TYPE_OBJECT);
 }