2009-12-14 11:51:50 +00:00
|
|
|
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
|
|
|
|
/*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library 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
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301 USA.
|
|
|
|
*
|
2014-07-04 17:33:18 +00:00
|
|
|
* Copyright 2011 - 2012 Red Hat, Inc.
|
|
|
|
* Copyright 2009 Novell, Inc.
|
2009-12-14 11:51:50 +00:00
|
|
|
*/
|
|
|
|
|
2016-02-19 13:57:48 +00:00
|
|
|
#include "nm-default.h"
|
2014-11-13 15:07:02 +00:00
|
|
|
|
2009-12-14 11:51:50 +00:00
|
|
|
#include <string.h>
|
2011-03-11 04:27:10 +00:00
|
|
|
#include <netinet/ether.h>
|
|
|
|
|
2016-02-19 13:57:48 +00:00
|
|
|
#include "nm-setting-connection.h"
|
|
|
|
#include "nm-setting-wimax.h"
|
2009-12-14 11:51:50 +00:00
|
|
|
|
2011-01-04 05:55:38 +00:00
|
|
|
#include "nm-device-wimax.h"
|
2009-12-14 11:51:50 +00:00
|
|
|
#include "nm-object-private.h"
|
|
|
|
#include "nm-object-cache.h"
|
|
|
|
#include "nm-dbus-glib-types.h"
|
|
|
|
#include "nm-types-private.h"
|
2012-03-07 18:22:37 +00:00
|
|
|
#include "nm-device-private.h"
|
2009-12-14 11:51:50 +00:00
|
|
|
|
2011-01-04 05:55:38 +00:00
|
|
|
G_DEFINE_TYPE (NMDeviceWimax, nm_device_wimax, NM_TYPE_DEVICE)
|
2009-12-14 11:51:50 +00:00
|
|
|
|
2011-01-04 05:55:38 +00:00
|
|
|
#define NM_DEVICE_WIMAX_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE_WIMAX, NMDeviceWimaxPrivate))
|
2009-12-14 11:51:50 +00:00
|
|
|
|
2011-01-04 05:55:38 +00:00
|
|
|
void _nm_device_wimax_set_wireless_enabled (NMDeviceWimax *wimax, gboolean enabled);
|
2009-12-14 11:51:50 +00:00
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
DBusGProxy *proxy;
|
|
|
|
|
|
|
|
char *hw_address;
|
|
|
|
NMWimaxNsp *active_nsp;
|
|
|
|
GPtrArray *nsps;
|
2011-01-06 21:18:19 +00:00
|
|
|
|
|
|
|
guint center_freq;
|
|
|
|
gint rssi;
|
|
|
|
gint cinr;
|
|
|
|
gint tx_power;
|
|
|
|
char *bsid;
|
2011-01-04 05:55:38 +00:00
|
|
|
} NMDeviceWimaxPrivate;
|
2009-12-14 11:51:50 +00:00
|
|
|
|
|
|
|
enum {
|
|
|
|
PROP_0,
|
|
|
|
PROP_HW_ADDRESS,
|
|
|
|
PROP_ACTIVE_NSP,
|
2011-01-06 21:18:19 +00:00
|
|
|
PROP_CENTER_FREQ,
|
|
|
|
PROP_RSSI,
|
|
|
|
PROP_CINR,
|
|
|
|
PROP_TX_POWER,
|
|
|
|
PROP_BSID,
|
2014-01-08 18:09:40 +00:00
|
|
|
PROP_NSPS,
|
2009-12-14 11:51:50 +00:00
|
|
|
|
|
|
|
LAST_PROP
|
|
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
|
|
NSP_ADDED,
|
|
|
|
NSP_REMOVED,
|
|
|
|
|
|
|
|
LAST_SIGNAL
|
|
|
|
};
|
|
|
|
static guint signals[LAST_SIGNAL] = { 0 };
|
|
|
|
|
2012-03-14 13:10:03 +00:00
|
|
|
/**
|
|
|
|
* nm_device_wimax_error_quark:
|
|
|
|
*
|
|
|
|
* Registers an error quark for #NMDeviceWimax if necessary.
|
|
|
|
*
|
|
|
|
* Returns: the error quark used for #NMDeviceWimax errors.
|
wimax: drop WiMAX support (bgo #747846)
Even Fedora is no longer shipping the WiMAX SDK, so it's likely we'll
eventually accidentally break some of the code in src/devices/wimax/
(if we haven't already). Discussion on the list showed a consensus for
dropping support for WiMAX.
So, remove the SDK checks from configure.ac, remove the WiMAX device
plugin and associated manager support, and deprecate all the APIs.
For compatibility reasons, it is still possible to create and save
WiMAX connections, to toggle the software WiMAX rfkill state, and to
change the "WIMAX" log level, although none of these have any effect,
since no NMDeviceWimax will ever be created.
nmcli was only compiling in support for most WiMAX operations when NM
as a whole was built with WiMAX support, so that code has been removed
now as well. (It is still possible to use nmcli to create and edit
WiMAX connections, but those connections will never be activatable.)
2015-04-13 21:07:00 +00:00
|
|
|
*
|
|
|
|
* Deprecated: 1.2: WiMAX is no longer supported.
|
2012-03-14 13:10:03 +00:00
|
|
|
**/
|
|
|
|
GQuark
|
|
|
|
nm_device_wimax_error_quark (void)
|
|
|
|
{
|
|
|
|
static GQuark quark = 0;
|
|
|
|
|
|
|
|
if (G_UNLIKELY (quark == 0))
|
|
|
|
quark = g_quark_from_static_string ("nm-device-wimax-error-quark");
|
|
|
|
return quark;
|
|
|
|
}
|
|
|
|
|
2009-12-14 11:51:50 +00:00
|
|
|
/**
|
2011-01-04 05:55:38 +00:00
|
|
|
* nm_device_wimax_new:
|
2009-12-14 11:51:50 +00:00
|
|
|
* @connection: the #DBusGConnection
|
2011-03-10 18:35:43 +00:00
|
|
|
* @path: the D-Bus object path of the WiMAX device
|
2009-12-14 11:51:50 +00:00
|
|
|
*
|
2011-01-04 05:55:38 +00:00
|
|
|
* Creates a new #NMDeviceWimax.
|
2009-12-14 11:51:50 +00:00
|
|
|
*
|
2011-03-10 18:35:43 +00:00
|
|
|
* Returns: (transfer full): a new WiMAX device
|
wimax: drop WiMAX support (bgo #747846)
Even Fedora is no longer shipping the WiMAX SDK, so it's likely we'll
eventually accidentally break some of the code in src/devices/wimax/
(if we haven't already). Discussion on the list showed a consensus for
dropping support for WiMAX.
So, remove the SDK checks from configure.ac, remove the WiMAX device
plugin and associated manager support, and deprecate all the APIs.
For compatibility reasons, it is still possible to create and save
WiMAX connections, to toggle the software WiMAX rfkill state, and to
change the "WIMAX" log level, although none of these have any effect,
since no NMDeviceWimax will ever be created.
nmcli was only compiling in support for most WiMAX operations when NM
as a whole was built with WiMAX support, so that code has been removed
now as well. (It is still possible to use nmcli to create and edit
WiMAX connections, but those connections will never be activatable.)
2015-04-13 21:07:00 +00:00
|
|
|
*
|
|
|
|
* Deprecated: 1.2: WiMAX is no longer supported.
|
2009-12-14 11:51:50 +00:00
|
|
|
**/
|
|
|
|
GObject *
|
2011-01-04 05:55:38 +00:00
|
|
|
nm_device_wimax_new (DBusGConnection *connection, const char *path)
|
2009-12-14 11:51:50 +00:00
|
|
|
{
|
2011-12-20 20:15:42 +00:00
|
|
|
GObject *device;
|
|
|
|
|
2009-12-14 11:51:50 +00:00
|
|
|
g_return_val_if_fail (connection != NULL, NULL);
|
|
|
|
g_return_val_if_fail (path != NULL, NULL);
|
|
|
|
|
2011-12-20 20:15:42 +00:00
|
|
|
device = g_object_new (NM_TYPE_DEVICE_WIMAX,
|
2014-05-09 18:45:59 +00:00
|
|
|
NM_OBJECT_DBUS_CONNECTION, connection,
|
|
|
|
NM_OBJECT_DBUS_PATH, path,
|
|
|
|
NULL);
|
2011-12-20 20:15:42 +00:00
|
|
|
_nm_object_ensure_inited (NM_OBJECT (device));
|
|
|
|
return device;
|
2009-12-14 11:51:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2011-01-04 05:55:38 +00:00
|
|
|
* nm_device_wimax_get_hw_address:
|
2011-01-21 20:46:09 +00:00
|
|
|
* @wimax: a #NMDeviceWimax
|
2009-12-14 11:51:50 +00:00
|
|
|
*
|
2011-01-04 05:55:38 +00:00
|
|
|
* Gets the hardware (MAC) address of the #NMDeviceWimax
|
2009-12-14 11:51:50 +00:00
|
|
|
*
|
|
|
|
* Returns: the hardware address. This is the internal string used by the
|
2011-01-21 20:46:09 +00:00
|
|
|
* device, and must not be modified.
|
wimax: drop WiMAX support (bgo #747846)
Even Fedora is no longer shipping the WiMAX SDK, so it's likely we'll
eventually accidentally break some of the code in src/devices/wimax/
(if we haven't already). Discussion on the list showed a consensus for
dropping support for WiMAX.
So, remove the SDK checks from configure.ac, remove the WiMAX device
plugin and associated manager support, and deprecate all the APIs.
For compatibility reasons, it is still possible to create and save
WiMAX connections, to toggle the software WiMAX rfkill state, and to
change the "WIMAX" log level, although none of these have any effect,
since no NMDeviceWimax will ever be created.
nmcli was only compiling in support for most WiMAX operations when NM
as a whole was built with WiMAX support, so that code has been removed
now as well. (It is still possible to use nmcli to create and edit
WiMAX connections, but those connections will never be activatable.)
2015-04-13 21:07:00 +00:00
|
|
|
*
|
|
|
|
* Deprecated: 1.2: WiMAX is no longer supported.
|
2009-12-14 11:51:50 +00:00
|
|
|
**/
|
|
|
|
const char *
|
2011-01-04 05:55:38 +00:00
|
|
|
nm_device_wimax_get_hw_address (NMDeviceWimax *wimax)
|
2009-12-14 11:51:50 +00:00
|
|
|
{
|
2011-01-04 05:55:38 +00:00
|
|
|
g_return_val_if_fail (NM_IS_DEVICE_WIMAX (wimax), NULL);
|
2009-12-14 11:51:50 +00:00
|
|
|
|
2012-01-19 23:23:28 +00:00
|
|
|
_nm_object_ensure_inited (NM_OBJECT (wimax));
|
|
|
|
return NM_DEVICE_WIMAX_GET_PRIVATE (wimax)->hw_address;
|
2009-12-14 11:51:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2011-01-04 05:55:38 +00:00
|
|
|
* nm_device_wimax_get_active_nsp:
|
|
|
|
* @wimax: a #NMDeviceWimax
|
2009-12-14 11:51:50 +00:00
|
|
|
*
|
|
|
|
* Gets the active #NMWimaxNsp.
|
|
|
|
*
|
2011-01-21 20:46:09 +00:00
|
|
|
* Returns: (transfer full): the access point or %NULL if none is active
|
wimax: drop WiMAX support (bgo #747846)
Even Fedora is no longer shipping the WiMAX SDK, so it's likely we'll
eventually accidentally break some of the code in src/devices/wimax/
(if we haven't already). Discussion on the list showed a consensus for
dropping support for WiMAX.
So, remove the SDK checks from configure.ac, remove the WiMAX device
plugin and associated manager support, and deprecate all the APIs.
For compatibility reasons, it is still possible to create and save
WiMAX connections, to toggle the software WiMAX rfkill state, and to
change the "WIMAX" log level, although none of these have any effect,
since no NMDeviceWimax will ever be created.
nmcli was only compiling in support for most WiMAX operations when NM
as a whole was built with WiMAX support, so that code has been removed
now as well. (It is still possible to use nmcli to create and edit
WiMAX connections, but those connections will never be activatable.)
2015-04-13 21:07:00 +00:00
|
|
|
*
|
|
|
|
* Deprecated: 1.2: WiMAX is no longer supported.
|
2009-12-14 11:51:50 +00:00
|
|
|
**/
|
|
|
|
NMWimaxNsp *
|
2011-01-04 05:55:38 +00:00
|
|
|
nm_device_wimax_get_active_nsp (NMDeviceWimax *wimax)
|
2009-12-14 11:51:50 +00:00
|
|
|
{
|
|
|
|
NMDeviceState state;
|
|
|
|
|
2011-01-04 05:55:38 +00:00
|
|
|
g_return_val_if_fail (NM_IS_DEVICE_WIMAX (wimax), NULL);
|
2009-12-14 11:51:50 +00:00
|
|
|
|
|
|
|
state = nm_device_get_state (NM_DEVICE (wimax));
|
|
|
|
switch (state) {
|
|
|
|
case NM_DEVICE_STATE_PREPARE:
|
|
|
|
case NM_DEVICE_STATE_CONFIG:
|
|
|
|
case NM_DEVICE_STATE_NEED_AUTH:
|
|
|
|
case NM_DEVICE_STATE_IP_CONFIG:
|
2011-03-17 18:39:09 +00:00
|
|
|
case NM_DEVICE_STATE_IP_CHECK:
|
|
|
|
case NM_DEVICE_STATE_SECONDARIES:
|
2009-12-14 11:51:50 +00:00
|
|
|
case NM_DEVICE_STATE_ACTIVATED:
|
2011-03-17 18:39:09 +00:00
|
|
|
case NM_DEVICE_STATE_DEACTIVATING:
|
2009-12-14 11:51:50 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
return NULL;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2012-01-19 23:23:28 +00:00
|
|
|
_nm_object_ensure_inited (NM_OBJECT (wimax));
|
|
|
|
return NM_DEVICE_WIMAX_GET_PRIVATE (wimax)->active_nsp;
|
2009-12-14 11:51:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2011-01-04 05:55:38 +00:00
|
|
|
* nm_device_wimax_get_nsps:
|
|
|
|
* @wimax: a #NMDeviceWimax
|
2009-12-14 11:51:50 +00:00
|
|
|
*
|
2011-01-04 05:55:38 +00:00
|
|
|
* Gets all the scanned NSPs of the #NMDeviceWimax.
|
2009-12-14 11:51:50 +00:00
|
|
|
*
|
2014-07-07 18:09:04 +00:00
|
|
|
* Returns: (element-type NMWimaxNsp): a #GPtrArray containing
|
2013-10-11 14:12:44 +00:00
|
|
|
* all the scanned #NMWimaxNsps.
|
2009-12-14 11:51:50 +00:00
|
|
|
* The returned array is owned by the client and should not be modified.
|
wimax: drop WiMAX support (bgo #747846)
Even Fedora is no longer shipping the WiMAX SDK, so it's likely we'll
eventually accidentally break some of the code in src/devices/wimax/
(if we haven't already). Discussion on the list showed a consensus for
dropping support for WiMAX.
So, remove the SDK checks from configure.ac, remove the WiMAX device
plugin and associated manager support, and deprecate all the APIs.
For compatibility reasons, it is still possible to create and save
WiMAX connections, to toggle the software WiMAX rfkill state, and to
change the "WIMAX" log level, although none of these have any effect,
since no NMDeviceWimax will ever be created.
nmcli was only compiling in support for most WiMAX operations when NM
as a whole was built with WiMAX support, so that code has been removed
now as well. (It is still possible to use nmcli to create and edit
WiMAX connections, but those connections will never be activatable.)
2015-04-13 21:07:00 +00:00
|
|
|
*
|
|
|
|
* Deprecated: 1.2: WiMAX is no longer supported.
|
2009-12-14 11:51:50 +00:00
|
|
|
**/
|
|
|
|
const GPtrArray *
|
2011-01-04 05:55:38 +00:00
|
|
|
nm_device_wimax_get_nsps (NMDeviceWimax *wimax)
|
2009-12-14 11:51:50 +00:00
|
|
|
{
|
2011-01-04 05:55:38 +00:00
|
|
|
g_return_val_if_fail (NM_IS_DEVICE_WIMAX (wimax), NULL);
|
2009-12-14 11:51:50 +00:00
|
|
|
|
2012-01-10 17:38:19 +00:00
|
|
|
_nm_object_ensure_inited (NM_OBJECT (wimax));
|
|
|
|
return handle_ptr_array_return (NM_DEVICE_WIMAX_GET_PRIVATE (wimax)->nsps);
|
2009-12-14 11:51:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2011-01-04 05:55:38 +00:00
|
|
|
* nm_device_wimax_get_nsp_by_path:
|
|
|
|
* @wimax: a #NMDeviceWimax
|
2009-12-14 11:51:50 +00:00
|
|
|
* @path: the object path of the NSP
|
|
|
|
*
|
|
|
|
* Gets a #NMWimaxNsp by path.
|
|
|
|
*
|
2011-01-21 20:46:09 +00:00
|
|
|
* Returns: (transfer none): the access point or %NULL if none is found.
|
wimax: drop WiMAX support (bgo #747846)
Even Fedora is no longer shipping the WiMAX SDK, so it's likely we'll
eventually accidentally break some of the code in src/devices/wimax/
(if we haven't already). Discussion on the list showed a consensus for
dropping support for WiMAX.
So, remove the SDK checks from configure.ac, remove the WiMAX device
plugin and associated manager support, and deprecate all the APIs.
For compatibility reasons, it is still possible to create and save
WiMAX connections, to toggle the software WiMAX rfkill state, and to
change the "WIMAX" log level, although none of these have any effect,
since no NMDeviceWimax will ever be created.
nmcli was only compiling in support for most WiMAX operations when NM
as a whole was built with WiMAX support, so that code has been removed
now as well. (It is still possible to use nmcli to create and edit
WiMAX connections, but those connections will never be activatable.)
2015-04-13 21:07:00 +00:00
|
|
|
*
|
|
|
|
* Deprecated: 1.2: WiMAX is no longer supported.
|
2009-12-14 11:51:50 +00:00
|
|
|
**/
|
|
|
|
NMWimaxNsp *
|
2011-01-04 05:55:38 +00:00
|
|
|
nm_device_wimax_get_nsp_by_path (NMDeviceWimax *wimax,
|
2014-05-09 18:45:59 +00:00
|
|
|
const char *path)
|
2009-12-14 11:51:50 +00:00
|
|
|
{
|
|
|
|
const GPtrArray *nsps;
|
|
|
|
int i;
|
|
|
|
NMWimaxNsp *nsp = NULL;
|
|
|
|
|
2011-01-04 05:55:38 +00:00
|
|
|
g_return_val_if_fail (NM_IS_DEVICE_WIMAX (wimax), NULL);
|
2009-12-14 11:51:50 +00:00
|
|
|
g_return_val_if_fail (path != NULL, NULL);
|
|
|
|
|
2011-01-04 05:55:38 +00:00
|
|
|
nsps = nm_device_wimax_get_nsps (wimax);
|
2009-12-14 11:51:50 +00:00
|
|
|
if (!nsps)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
for (i = 0; i < nsps->len; i++) {
|
|
|
|
NMWimaxNsp *candidate = g_ptr_array_index (nsps, i);
|
|
|
|
if (!strcmp (nm_object_get_path (NM_OBJECT (candidate)), path)) {
|
|
|
|
nsp = candidate;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return nsp;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2011-01-04 05:55:38 +00:00
|
|
|
clean_up_nsps (NMDeviceWimax *self, gboolean notify)
|
2009-12-14 11:51:50 +00:00
|
|
|
{
|
2011-01-04 05:55:38 +00:00
|
|
|
NMDeviceWimaxPrivate *priv;
|
2009-12-14 11:51:50 +00:00
|
|
|
|
2011-01-04 05:55:38 +00:00
|
|
|
g_return_if_fail (NM_IS_DEVICE_WIMAX (self));
|
2009-12-14 11:51:50 +00:00
|
|
|
|
2011-01-04 05:55:38 +00:00
|
|
|
priv = NM_DEVICE_WIMAX_GET_PRIVATE (self);
|
2009-12-14 11:51:50 +00:00
|
|
|
|
|
|
|
if (priv->active_nsp) {
|
|
|
|
g_object_unref (priv->active_nsp);
|
|
|
|
priv->active_nsp = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (priv->nsps) {
|
|
|
|
while (priv->nsps->len) {
|
|
|
|
NMWimaxNsp *nsp = NM_WIMAX_NSP (g_ptr_array_index (priv->nsps, 0));
|
|
|
|
|
|
|
|
if (notify)
|
|
|
|
g_signal_emit (self, signals[NSP_REMOVED], 0, nsp);
|
|
|
|
g_ptr_array_remove (priv->nsps, nsp);
|
|
|
|
g_object_unref (nsp);
|
|
|
|
}
|
|
|
|
g_ptr_array_free (priv->nsps, TRUE);
|
|
|
|
priv->nsps = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-01-06 21:18:19 +00:00
|
|
|
/**
|
|
|
|
* nm_device_wimax_get_center_frequency:
|
2011-01-21 20:46:09 +00:00
|
|
|
* @self: a #NMDeviceWimax
|
2011-01-06 21:18:19 +00:00
|
|
|
*
|
|
|
|
* Gets 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.
|
|
|
|
*
|
|
|
|
* Returns: the center frequency in KHz, or 0
|
wimax: drop WiMAX support (bgo #747846)
Even Fedora is no longer shipping the WiMAX SDK, so it's likely we'll
eventually accidentally break some of the code in src/devices/wimax/
(if we haven't already). Discussion on the list showed a consensus for
dropping support for WiMAX.
So, remove the SDK checks from configure.ac, remove the WiMAX device
plugin and associated manager support, and deprecate all the APIs.
For compatibility reasons, it is still possible to create and save
WiMAX connections, to toggle the software WiMAX rfkill state, and to
change the "WIMAX" log level, although none of these have any effect,
since no NMDeviceWimax will ever be created.
nmcli was only compiling in support for most WiMAX operations when NM
as a whole was built with WiMAX support, so that code has been removed
now as well. (It is still possible to use nmcli to create and edit
WiMAX connections, but those connections will never be activatable.)
2015-04-13 21:07:00 +00:00
|
|
|
*
|
|
|
|
* Deprecated: 1.2: WiMAX is no longer supported.
|
2011-01-06 21:18:19 +00:00
|
|
|
**/
|
|
|
|
guint
|
2011-01-21 20:46:09 +00:00
|
|
|
nm_device_wimax_get_center_frequency (NMDeviceWimax *self)
|
2011-01-06 21:18:19 +00:00
|
|
|
{
|
2011-01-21 20:46:09 +00:00
|
|
|
g_return_val_if_fail (NM_IS_DEVICE_WIMAX (self), 0);
|
2011-01-06 21:18:19 +00:00
|
|
|
|
2012-01-19 23:23:28 +00:00
|
|
|
_nm_object_ensure_inited (NM_OBJECT (self));
|
|
|
|
return NM_DEVICE_WIMAX_GET_PRIVATE (self)->center_freq;
|
2011-01-06 21:18:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* nm_device_wimax_get_rssi:
|
2011-01-21 20:46:09 +00:00
|
|
|
* @self: a #NMDeviceWimax
|
2011-01-06 21:18:19 +00:00
|
|
|
*
|
|
|
|
* Gets the 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.
|
|
|
|
*
|
|
|
|
* Returns: the RSSI in dBm, or 0
|
wimax: drop WiMAX support (bgo #747846)
Even Fedora is no longer shipping the WiMAX SDK, so it's likely we'll
eventually accidentally break some of the code in src/devices/wimax/
(if we haven't already). Discussion on the list showed a consensus for
dropping support for WiMAX.
So, remove the SDK checks from configure.ac, remove the WiMAX device
plugin and associated manager support, and deprecate all the APIs.
For compatibility reasons, it is still possible to create and save
WiMAX connections, to toggle the software WiMAX rfkill state, and to
change the "WIMAX" log level, although none of these have any effect,
since no NMDeviceWimax will ever be created.
nmcli was only compiling in support for most WiMAX operations when NM
as a whole was built with WiMAX support, so that code has been removed
now as well. (It is still possible to use nmcli to create and edit
WiMAX connections, but those connections will never be activatable.)
2015-04-13 21:07:00 +00:00
|
|
|
*
|
|
|
|
* Deprecated: 1.2: WiMAX is no longer supported.
|
2011-01-06 21:18:19 +00:00
|
|
|
**/
|
|
|
|
gint
|
2011-01-21 20:46:09 +00:00
|
|
|
nm_device_wimax_get_rssi (NMDeviceWimax *self)
|
2011-01-06 21:18:19 +00:00
|
|
|
{
|
2011-01-21 20:46:09 +00:00
|
|
|
g_return_val_if_fail (NM_IS_DEVICE_WIMAX (self), 0);
|
2011-01-06 21:18:19 +00:00
|
|
|
|
2012-01-19 23:23:28 +00:00
|
|
|
_nm_object_ensure_inited (NM_OBJECT (self));
|
|
|
|
return NM_DEVICE_WIMAX_GET_PRIVATE (self)->rssi;
|
2011-01-06 21:18:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* nm_device_wimax_get_cinr:
|
2011-01-21 20:46:09 +00:00
|
|
|
* @self: a #NMDeviceWimax
|
2011-01-06 21:18:19 +00:00
|
|
|
*
|
|
|
|
* Gets the 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.
|
|
|
|
*
|
|
|
|
* Returns: the CINR in dB, or 0
|
wimax: drop WiMAX support (bgo #747846)
Even Fedora is no longer shipping the WiMAX SDK, so it's likely we'll
eventually accidentally break some of the code in src/devices/wimax/
(if we haven't already). Discussion on the list showed a consensus for
dropping support for WiMAX.
So, remove the SDK checks from configure.ac, remove the WiMAX device
plugin and associated manager support, and deprecate all the APIs.
For compatibility reasons, it is still possible to create and save
WiMAX connections, to toggle the software WiMAX rfkill state, and to
change the "WIMAX" log level, although none of these have any effect,
since no NMDeviceWimax will ever be created.
nmcli was only compiling in support for most WiMAX operations when NM
as a whole was built with WiMAX support, so that code has been removed
now as well. (It is still possible to use nmcli to create and edit
WiMAX connections, but those connections will never be activatable.)
2015-04-13 21:07:00 +00:00
|
|
|
*
|
|
|
|
* Deprecated: 1.2: WiMAX is no longer supported.
|
2011-01-06 21:18:19 +00:00
|
|
|
**/
|
|
|
|
gint
|
2011-01-21 20:46:09 +00:00
|
|
|
nm_device_wimax_get_cinr (NMDeviceWimax *self)
|
2011-01-06 21:18:19 +00:00
|
|
|
{
|
2011-01-21 20:46:09 +00:00
|
|
|
g_return_val_if_fail (NM_IS_DEVICE_WIMAX (self), 0);
|
2011-01-06 21:18:19 +00:00
|
|
|
|
2012-01-19 23:23:28 +00:00
|
|
|
_nm_object_ensure_inited (NM_OBJECT (self));
|
|
|
|
return NM_DEVICE_WIMAX_GET_PRIVATE (self)->cinr;
|
2011-01-06 21:18:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* nm_device_wimax_get_tx_power:
|
2011-01-21 20:46:09 +00:00
|
|
|
* @self: a #NMDeviceWimax
|
2011-01-06 21:18:19 +00:00
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* Returns: the TX power in dBm, or 0
|
wimax: drop WiMAX support (bgo #747846)
Even Fedora is no longer shipping the WiMAX SDK, so it's likely we'll
eventually accidentally break some of the code in src/devices/wimax/
(if we haven't already). Discussion on the list showed a consensus for
dropping support for WiMAX.
So, remove the SDK checks from configure.ac, remove the WiMAX device
plugin and associated manager support, and deprecate all the APIs.
For compatibility reasons, it is still possible to create and save
WiMAX connections, to toggle the software WiMAX rfkill state, and to
change the "WIMAX" log level, although none of these have any effect,
since no NMDeviceWimax will ever be created.
nmcli was only compiling in support for most WiMAX operations when NM
as a whole was built with WiMAX support, so that code has been removed
now as well. (It is still possible to use nmcli to create and edit
WiMAX connections, but those connections will never be activatable.)
2015-04-13 21:07:00 +00:00
|
|
|
*
|
|
|
|
* Deprecated: 1.2: WiMAX is no longer supported.
|
2011-01-06 21:18:19 +00:00
|
|
|
**/
|
|
|
|
gint
|
2011-01-21 20:46:09 +00:00
|
|
|
nm_device_wimax_get_tx_power (NMDeviceWimax *self)
|
2011-01-06 21:18:19 +00:00
|
|
|
{
|
2011-01-21 20:46:09 +00:00
|
|
|
g_return_val_if_fail (NM_IS_DEVICE_WIMAX (self), 0);
|
2011-01-06 21:18:19 +00:00
|
|
|
|
2012-01-19 23:23:28 +00:00
|
|
|
_nm_object_ensure_inited (NM_OBJECT (self));
|
|
|
|
return NM_DEVICE_WIMAX_GET_PRIVATE (self)->tx_power;
|
2011-01-06 21:18:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* nm_device_wimax_get_bsid:
|
2011-01-21 20:46:09 +00:00
|
|
|
* @self: a #NMDeviceWimax
|
2011-01-06 21:18:19 +00:00
|
|
|
*
|
|
|
|
* Gets the ID of the serving Base Station when the device is connected.
|
|
|
|
*
|
2013-04-19 13:48:01 +00:00
|
|
|
* Returns: the ID of the serving Base Station, or %NULL
|
wimax: drop WiMAX support (bgo #747846)
Even Fedora is no longer shipping the WiMAX SDK, so it's likely we'll
eventually accidentally break some of the code in src/devices/wimax/
(if we haven't already). Discussion on the list showed a consensus for
dropping support for WiMAX.
So, remove the SDK checks from configure.ac, remove the WiMAX device
plugin and associated manager support, and deprecate all the APIs.
For compatibility reasons, it is still possible to create and save
WiMAX connections, to toggle the software WiMAX rfkill state, and to
change the "WIMAX" log level, although none of these have any effect,
since no NMDeviceWimax will ever be created.
nmcli was only compiling in support for most WiMAX operations when NM
as a whole was built with WiMAX support, so that code has been removed
now as well. (It is still possible to use nmcli to create and edit
WiMAX connections, but those connections will never be activatable.)
2015-04-13 21:07:00 +00:00
|
|
|
*
|
|
|
|
* Deprecated: 1.2: WiMAX is no longer supported.
|
2011-01-06 21:18:19 +00:00
|
|
|
**/
|
|
|
|
const char *
|
2011-01-21 20:46:09 +00:00
|
|
|
nm_device_wimax_get_bsid (NMDeviceWimax *self)
|
2011-01-06 21:18:19 +00:00
|
|
|
{
|
2011-01-21 20:46:09 +00:00
|
|
|
g_return_val_if_fail (NM_IS_DEVICE_WIMAX (self), NULL);
|
2011-01-06 21:18:19 +00:00
|
|
|
|
2012-01-19 23:23:28 +00:00
|
|
|
_nm_object_ensure_inited (NM_OBJECT (self));
|
|
|
|
return NM_DEVICE_WIMAX_GET_PRIVATE (self)->bsid;
|
2011-01-06 21:18:19 +00:00
|
|
|
}
|
|
|
|
|
2011-04-25 22:07:38 +00:00
|
|
|
static gboolean
|
2012-03-14 13:10:03 +00:00
|
|
|
connection_compatible (NMDevice *device, NMConnection *connection, GError **error)
|
2011-03-11 04:27:10 +00:00
|
|
|
{
|
2011-04-25 22:07:38 +00:00
|
|
|
NMSettingConnection *s_con;
|
|
|
|
NMSettingWimax *s_wimax;
|
|
|
|
const char *ctype;
|
|
|
|
const GByteArray *mac;
|
|
|
|
const char *hw_str;
|
|
|
|
struct ether_addr *hw_mac;
|
|
|
|
|
|
|
|
s_con = nm_connection_get_setting_connection (connection);
|
|
|
|
g_assert (s_con);
|
|
|
|
|
|
|
|
ctype = nm_setting_connection_get_connection_type (s_con);
|
2012-03-14 13:10:03 +00:00
|
|
|
if (strcmp (ctype, NM_SETTING_WIMAX_SETTING_NAME) != 0) {
|
|
|
|
g_set_error (error, NM_DEVICE_WIMAX_ERROR, NM_DEVICE_WIMAX_ERROR_NOT_WIMAX_CONNECTION,
|
|
|
|
"The connection was not a Wimax connection.");
|
2011-04-25 22:07:38 +00:00
|
|
|
return FALSE;
|
2012-03-14 13:10:03 +00:00
|
|
|
}
|
2011-03-11 04:27:10 +00:00
|
|
|
|
2011-04-25 22:07:38 +00:00
|
|
|
s_wimax = nm_connection_get_setting_wimax (connection);
|
2012-03-14 13:10:03 +00:00
|
|
|
if (!s_wimax) {
|
|
|
|
g_set_error (error, NM_DEVICE_WIMAX_ERROR, NM_DEVICE_WIMAX_ERROR_INVALID_WIMAX_CONNECTION,
|
|
|
|
"The connection was not a valid Wimax connection.");
|
2011-04-25 22:07:38 +00:00
|
|
|
return FALSE;
|
2012-03-14 13:10:03 +00:00
|
|
|
}
|
2011-04-25 22:07:38 +00:00
|
|
|
|
|
|
|
/* Check MAC address */
|
|
|
|
hw_str = nm_device_wimax_get_hw_address (NM_DEVICE_WIMAX (device));
|
|
|
|
if (hw_str) {
|
|
|
|
hw_mac = ether_aton (hw_str);
|
2012-03-14 13:10:03 +00:00
|
|
|
if (!hw_mac) {
|
|
|
|
g_set_error (error, NM_DEVICE_WIMAX_ERROR, NM_DEVICE_WIMAX_ERROR_INVALID_DEVICE_MAC,
|
|
|
|
"Invalid device MAC address.");
|
|
|
|
return FALSE;
|
|
|
|
}
|
2011-04-25 22:07:38 +00:00
|
|
|
mac = nm_setting_wimax_get_mac_address (s_wimax);
|
2012-03-14 13:10:03 +00:00
|
|
|
if (mac && hw_mac && memcmp (mac->data, hw_mac->ether_addr_octet, ETH_ALEN)) {
|
|
|
|
g_set_error (error, NM_DEVICE_WIMAX_ERROR, NM_DEVICE_WIMAX_ERROR_MAC_MISMATCH,
|
|
|
|
"The MACs of the device and the connection didn't match.");
|
2011-04-25 22:07:38 +00:00
|
|
|
return FALSE;
|
2012-03-14 13:10:03 +00:00
|
|
|
}
|
2011-03-11 04:27:10 +00:00
|
|
|
}
|
|
|
|
|
2013-03-11 14:16:24 +00:00
|
|
|
return NM_DEVICE_CLASS (nm_device_wimax_parent_class)->connection_compatible (device, connection, error);
|
2011-03-11 04:27:10 +00:00
|
|
|
}
|
|
|
|
|
2014-02-11 14:55:04 +00:00
|
|
|
static GType
|
|
|
|
get_setting_type (NMDevice *device)
|
|
|
|
{
|
|
|
|
return NM_TYPE_SETTING_WIMAX;
|
|
|
|
}
|
|
|
|
|
2013-12-16 15:30:59 +00:00
|
|
|
static const char *
|
|
|
|
get_hw_address (NMDevice *device)
|
|
|
|
{
|
|
|
|
return nm_device_wimax_get_hw_address (NM_DEVICE_WIMAX (device));
|
|
|
|
}
|
|
|
|
|
2016-10-02 16:22:50 +00:00
|
|
|
/*****************************************************************************/
|
2009-12-14 11:51:50 +00:00
|
|
|
|
|
|
|
static void
|
2012-03-07 18:22:37 +00:00
|
|
|
nm_device_wimax_init (NMDeviceWimax *device)
|
2009-12-14 11:51:50 +00:00
|
|
|
{
|
2012-03-12 18:46:20 +00:00
|
|
|
_nm_device_set_device_type (NM_DEVICE (device), NM_DEVICE_TYPE_WIMAX);
|
2009-12-14 11:51:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
get_property (GObject *object,
|
|
|
|
guint prop_id,
|
|
|
|
GValue *value,
|
|
|
|
GParamSpec *pspec)
|
|
|
|
{
|
2011-01-04 05:55:38 +00:00
|
|
|
NMDeviceWimax *self = NM_DEVICE_WIMAX (object);
|
2009-12-14 11:51:50 +00:00
|
|
|
|
2012-03-28 13:06:12 +00:00
|
|
|
_nm_object_ensure_inited (NM_OBJECT (object));
|
|
|
|
|
2009-12-14 11:51:50 +00:00
|
|
|
switch (prop_id) {
|
|
|
|
case PROP_HW_ADDRESS:
|
2011-01-04 05:55:38 +00:00
|
|
|
g_value_set_string (value, nm_device_wimax_get_hw_address (self));
|
2009-12-14 11:51:50 +00:00
|
|
|
break;
|
|
|
|
case PROP_ACTIVE_NSP:
|
2011-01-04 05:55:38 +00:00
|
|
|
g_value_set_object (value, nm_device_wimax_get_active_nsp (self));
|
2009-12-14 11:51:50 +00:00
|
|
|
break;
|
2011-01-06 21:18:19 +00:00
|
|
|
case PROP_CENTER_FREQ:
|
|
|
|
g_value_set_uint (value, nm_device_wimax_get_center_frequency (self));
|
|
|
|
break;
|
|
|
|
case PROP_RSSI:
|
|
|
|
g_value_set_int (value, nm_device_wimax_get_rssi (self));
|
|
|
|
break;
|
|
|
|
case PROP_CINR:
|
|
|
|
g_value_set_int (value, nm_device_wimax_get_cinr (self));
|
|
|
|
break;
|
|
|
|
case PROP_TX_POWER:
|
|
|
|
g_value_set_int (value, nm_device_wimax_get_tx_power (self));
|
|
|
|
break;
|
|
|
|
case PROP_BSID:
|
|
|
|
g_value_set_string (value, nm_device_wimax_get_bsid (self));
|
|
|
|
break;
|
2014-01-08 18:09:40 +00:00
|
|
|
case PROP_NSPS:
|
|
|
|
g_value_set_boxed (value, nm_device_wimax_get_nsps (self));
|
|
|
|
break;
|
2009-12-14 11:51:50 +00:00
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-01-06 21:18:19 +00:00
|
|
|
static void
|
|
|
|
clear_link_status (NMDeviceWimax *self)
|
|
|
|
{
|
|
|
|
NMDeviceWimaxPrivate *priv = NM_DEVICE_WIMAX_GET_PRIVATE (self);
|
|
|
|
|
|
|
|
if (priv->center_freq) {
|
|
|
|
priv->center_freq = 0;
|
|
|
|
_nm_object_queue_notify (NM_OBJECT (self), NM_DEVICE_WIMAX_CENTER_FREQUENCY);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (priv->rssi) {
|
|
|
|
priv->rssi = 0;
|
|
|
|
_nm_object_queue_notify (NM_OBJECT (self), NM_DEVICE_WIMAX_RSSI);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (priv->cinr) {
|
|
|
|
priv->cinr = 0;
|
|
|
|
_nm_object_queue_notify (NM_OBJECT (self), NM_DEVICE_WIMAX_CINR);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (priv->tx_power) {
|
|
|
|
priv->tx_power = 0;
|
|
|
|
_nm_object_queue_notify (NM_OBJECT (self), NM_DEVICE_WIMAX_TX_POWER);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (priv->bsid) {
|
|
|
|
g_free (priv->bsid);
|
|
|
|
priv->bsid = NULL;
|
|
|
|
_nm_object_queue_notify (NM_OBJECT (self), NM_DEVICE_WIMAX_BSID);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-12-14 11:51:50 +00:00
|
|
|
static void
|
|
|
|
state_changed_cb (NMDevice *device, GParamSpec *pspec, gpointer user_data)
|
|
|
|
{
|
2011-01-04 05:55:38 +00:00
|
|
|
NMDeviceWimax *self = NM_DEVICE_WIMAX (device);
|
|
|
|
NMDeviceWimaxPrivate *priv = NM_DEVICE_WIMAX_GET_PRIVATE (self);
|
2011-01-06 21:18:19 +00:00
|
|
|
NMDeviceState state;
|
2009-12-14 11:51:50 +00:00
|
|
|
|
2011-01-06 21:18:19 +00:00
|
|
|
state = nm_device_get_state (device);
|
|
|
|
switch (state) {
|
2009-12-14 11:51:50 +00:00
|
|
|
case NM_DEVICE_STATE_UNKNOWN:
|
|
|
|
case NM_DEVICE_STATE_UNMANAGED:
|
|
|
|
case NM_DEVICE_STATE_UNAVAILABLE:
|
|
|
|
case NM_DEVICE_STATE_DISCONNECTED:
|
|
|
|
case NM_DEVICE_STATE_FAILED:
|
|
|
|
if (priv->active_nsp) {
|
|
|
|
g_object_unref (priv->active_nsp);
|
|
|
|
priv->active_nsp = NULL;
|
|
|
|
}
|
2011-01-04 05:55:38 +00:00
|
|
|
_nm_object_queue_notify (NM_OBJECT (device), NM_DEVICE_WIMAX_ACTIVE_NSP);
|
2011-01-06 21:18:19 +00:00
|
|
|
clear_link_status (self);
|
|
|
|
break;
|
|
|
|
case NM_DEVICE_STATE_PREPARE:
|
|
|
|
case NM_DEVICE_STATE_CONFIG:
|
|
|
|
case NM_DEVICE_STATE_NEED_AUTH:
|
|
|
|
case NM_DEVICE_STATE_IP_CONFIG:
|
|
|
|
clear_link_status (self);
|
2009-12-14 11:51:50 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-01-20 12:52:17 +00:00
|
|
|
register_properties (NMDeviceWimax *wimax)
|
2009-12-14 11:51:50 +00:00
|
|
|
{
|
2011-01-04 05:55:38 +00:00
|
|
|
NMDeviceWimaxPrivate *priv = NM_DEVICE_WIMAX_GET_PRIVATE (wimax);
|
2012-01-20 12:52:17 +00:00
|
|
|
const NMPropertiesInfo property_info[] = {
|
2014-01-08 18:09:40 +00:00
|
|
|
{ NM_DEVICE_WIMAX_HW_ADDRESS, &priv->hw_address },
|
|
|
|
{ NM_DEVICE_WIMAX_ACTIVE_NSP, &priv->active_nsp, NULL, NM_TYPE_WIMAX_NSP },
|
2012-01-20 12:52:17 +00:00
|
|
|
{ NM_DEVICE_WIMAX_CENTER_FREQUENCY, &priv->center_freq },
|
2014-01-08 18:09:40 +00:00
|
|
|
{ NM_DEVICE_WIMAX_RSSI, &priv->rssi },
|
|
|
|
{ NM_DEVICE_WIMAX_CINR, &priv->cinr },
|
|
|
|
{ NM_DEVICE_WIMAX_TX_POWER, &priv->tx_power },
|
|
|
|
{ NM_DEVICE_WIMAX_BSID, &priv->bsid },
|
|
|
|
{ NM_DEVICE_WIMAX_NSPS, &priv->nsps, NULL, NM_TYPE_WIMAX_NSP, "nsp" },
|
2009-12-14 11:51:50 +00:00
|
|
|
{ NULL },
|
|
|
|
};
|
|
|
|
|
2012-01-20 12:52:17 +00:00
|
|
|
_nm_object_register_properties (NM_OBJECT (wimax),
|
|
|
|
priv->proxy,
|
|
|
|
property_info);
|
2014-01-08 18:09:40 +00:00
|
|
|
}
|
2012-01-10 17:38:19 +00:00
|
|
|
|
2014-01-08 18:09:40 +00:00
|
|
|
static void
|
|
|
|
nsp_removed (NMDeviceWimax *self, NMWimaxNsp *nsp)
|
|
|
|
{
|
|
|
|
NMDeviceWimaxPrivate *priv = NM_DEVICE_WIMAX_GET_PRIVATE (self);
|
|
|
|
|
|
|
|
if (nsp == priv->active_nsp) {
|
|
|
|
g_object_unref (priv->active_nsp);
|
|
|
|
priv->active_nsp = NULL;
|
|
|
|
_nm_object_queue_notify (NM_OBJECT (self), NM_DEVICE_WIMAX_ACTIVE_NSP);
|
|
|
|
}
|
2009-12-14 11:51:50 +00:00
|
|
|
}
|
|
|
|
|
2011-12-20 20:15:42 +00:00
|
|
|
static void
|
|
|
|
constructed (GObject *object)
|
2009-12-14 11:51:50 +00:00
|
|
|
{
|
2013-03-01 21:58:31 +00:00
|
|
|
NMDeviceWimaxPrivate *priv = NM_DEVICE_WIMAX_GET_PRIVATE (object);
|
2009-12-14 11:51:50 +00:00
|
|
|
|
2011-12-20 20:15:42 +00:00
|
|
|
G_OBJECT_CLASS (nm_device_wimax_parent_class)->constructed (object);
|
2009-12-14 11:51:50 +00:00
|
|
|
|
2013-03-01 21:58:31 +00:00
|
|
|
priv->proxy = _nm_object_new_proxy (NM_OBJECT (object), NULL, NM_DBUS_INTERFACE_DEVICE_WIMAX);
|
2012-01-20 12:52:17 +00:00
|
|
|
register_properties (NM_DEVICE_WIMAX (object));
|
2009-12-14 11:51:50 +00:00
|
|
|
|
|
|
|
g_signal_connect (object,
|
|
|
|
"notify::" NM_DEVICE_STATE,
|
|
|
|
G_CALLBACK (state_changed_cb),
|
|
|
|
NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dispose (GObject *object)
|
|
|
|
{
|
2011-01-04 05:55:38 +00:00
|
|
|
NMDeviceWimaxPrivate *priv = NM_DEVICE_WIMAX_GET_PRIVATE (object);
|
2009-12-14 11:51:50 +00:00
|
|
|
|
2012-04-23 15:02:48 +00:00
|
|
|
if (priv->hw_address) {
|
|
|
|
g_free (priv->hw_address);
|
|
|
|
priv->hw_address = NULL;
|
2009-12-14 11:51:50 +00:00
|
|
|
}
|
|
|
|
|
2012-04-23 15:02:48 +00:00
|
|
|
if (priv->bsid) {
|
|
|
|
g_free (priv->bsid);
|
|
|
|
priv->bsid = NULL;
|
|
|
|
}
|
2011-01-06 21:18:19 +00:00
|
|
|
|
2011-01-04 05:55:38 +00:00
|
|
|
clean_up_nsps (NM_DEVICE_WIMAX (object), FALSE);
|
2012-04-23 15:02:48 +00:00
|
|
|
g_clear_object (&priv->proxy);
|
2009-12-14 11:51:50 +00:00
|
|
|
|
2011-01-04 05:55:38 +00:00
|
|
|
G_OBJECT_CLASS (nm_device_wimax_parent_class)->dispose (object);
|
2009-12-14 11:51:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2011-01-04 05:55:38 +00:00
|
|
|
nm_device_wimax_class_init (NMDeviceWimaxClass *wimax_class)
|
2009-12-14 11:51:50 +00:00
|
|
|
{
|
|
|
|
GObjectClass *object_class = G_OBJECT_CLASS (wimax_class);
|
2011-03-11 04:27:10 +00:00
|
|
|
NMDeviceClass *device_class = NM_DEVICE_CLASS (wimax_class);
|
2009-12-14 11:51:50 +00:00
|
|
|
|
2011-01-04 05:55:38 +00:00
|
|
|
g_type_class_add_private (wimax_class, sizeof (NMDeviceWimaxPrivate));
|
2009-12-14 11:51:50 +00:00
|
|
|
|
|
|
|
/* virtual methods */
|
2011-12-20 20:15:42 +00:00
|
|
|
object_class->constructed = constructed;
|
2009-12-14 11:51:50 +00:00
|
|
|
object_class->get_property = get_property;
|
|
|
|
object_class->dispose = dispose;
|
2012-03-14 13:10:03 +00:00
|
|
|
device_class->connection_compatible = connection_compatible;
|
2014-02-11 14:55:04 +00:00
|
|
|
device_class->get_setting_type = get_setting_type;
|
2013-12-16 15:30:59 +00:00
|
|
|
device_class->get_hw_address = get_hw_address;
|
2014-01-08 18:09:40 +00:00
|
|
|
wimax_class->nsp_removed = nsp_removed;
|
2009-12-14 11:51:50 +00:00
|
|
|
|
|
|
|
/* properties */
|
|
|
|
|
2011-01-04 22:37:33 +00:00
|
|
|
/**
|
|
|
|
* NMDeviceWimax:hw-address:
|
|
|
|
*
|
|
|
|
* The hardware (MAC) address of the device.
|
wimax: drop WiMAX support (bgo #747846)
Even Fedora is no longer shipping the WiMAX SDK, so it's likely we'll
eventually accidentally break some of the code in src/devices/wimax/
(if we haven't already). Discussion on the list showed a consensus for
dropping support for WiMAX.
So, remove the SDK checks from configure.ac, remove the WiMAX device
plugin and associated manager support, and deprecate all the APIs.
For compatibility reasons, it is still possible to create and save
WiMAX connections, to toggle the software WiMAX rfkill state, and to
change the "WIMAX" log level, although none of these have any effect,
since no NMDeviceWimax will ever be created.
nmcli was only compiling in support for most WiMAX operations when NM
as a whole was built with WiMAX support, so that code has been removed
now as well. (It is still possible to use nmcli to create and edit
WiMAX connections, but those connections will never be activatable.)
2015-04-13 21:07:00 +00:00
|
|
|
*
|
|
|
|
* Deprecated: 1.2: WiMAX is no longer supported.
|
2011-01-04 22:37:33 +00:00
|
|
|
**/
|
|
|
|
g_object_class_install_property
|
|
|
|
(object_class, PROP_HW_ADDRESS,
|
2014-06-09 20:17:37 +00:00
|
|
|
g_param_spec_string (NM_DEVICE_WIMAX_HW_ADDRESS, "", "",
|
2011-01-04 22:37:33 +00:00
|
|
|
NULL,
|
2014-06-09 20:17:37 +00:00
|
|
|
G_PARAM_READABLE |
|
|
|
|
G_PARAM_STATIC_STRINGS));
|
2011-01-04 22:37:33 +00:00
|
|
|
|
2009-12-14 11:51:50 +00:00
|
|
|
/**
|
2011-01-04 05:55:38 +00:00
|
|
|
* NMDeviceWimax:active-nsp:
|
2009-12-14 11:51:50 +00:00
|
|
|
*
|
|
|
|
* The active #NMWimaxNsp of the device.
|
wimax: drop WiMAX support (bgo #747846)
Even Fedora is no longer shipping the WiMAX SDK, so it's likely we'll
eventually accidentally break some of the code in src/devices/wimax/
(if we haven't already). Discussion on the list showed a consensus for
dropping support for WiMAX.
So, remove the SDK checks from configure.ac, remove the WiMAX device
plugin and associated manager support, and deprecate all the APIs.
For compatibility reasons, it is still possible to create and save
WiMAX connections, to toggle the software WiMAX rfkill state, and to
change the "WIMAX" log level, although none of these have any effect,
since no NMDeviceWimax will ever be created.
nmcli was only compiling in support for most WiMAX operations when NM
as a whole was built with WiMAX support, so that code has been removed
now as well. (It is still possible to use nmcli to create and edit
WiMAX connections, but those connections will never be activatable.)
2015-04-13 21:07:00 +00:00
|
|
|
*
|
|
|
|
* Deprecated: 1.2: WiMAX is no longer supported.
|
2009-12-14 11:51:50 +00:00
|
|
|
**/
|
|
|
|
g_object_class_install_property
|
|
|
|
(object_class, PROP_ACTIVE_NSP,
|
2014-06-09 20:17:37 +00:00
|
|
|
g_param_spec_object (NM_DEVICE_WIMAX_ACTIVE_NSP, "", "",
|
|
|
|
NM_TYPE_WIMAX_NSP,
|
|
|
|
G_PARAM_READABLE |
|
|
|
|
G_PARAM_STATIC_STRINGS));
|
2009-12-14 11:51:50 +00:00
|
|
|
|
2011-01-06 21:18:19 +00:00
|
|
|
/**
|
|
|
|
* 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.
|
wimax: drop WiMAX support (bgo #747846)
Even Fedora is no longer shipping the WiMAX SDK, so it's likely we'll
eventually accidentally break some of the code in src/devices/wimax/
(if we haven't already). Discussion on the list showed a consensus for
dropping support for WiMAX.
So, remove the SDK checks from configure.ac, remove the WiMAX device
plugin and associated manager support, and deprecate all the APIs.
For compatibility reasons, it is still possible to create and save
WiMAX connections, to toggle the software WiMAX rfkill state, and to
change the "WIMAX" log level, although none of these have any effect,
since no NMDeviceWimax will ever be created.
nmcli was only compiling in support for most WiMAX operations when NM
as a whole was built with WiMAX support, so that code has been removed
now as well. (It is still possible to use nmcli to create and edit
WiMAX connections, but those connections will never be activatable.)
2015-04-13 21:07:00 +00:00
|
|
|
*
|
|
|
|
* Deprecated: 1.2: WiMAX is no longer supported.
|
2011-01-06 21:18:19 +00:00
|
|
|
**/
|
|
|
|
g_object_class_install_property
|
|
|
|
(object_class, PROP_CENTER_FREQ,
|
2014-06-09 20:17:37 +00:00
|
|
|
g_param_spec_uint (NM_DEVICE_WIMAX_CENTER_FREQUENCY, "", "",
|
2011-01-06 21:18:19 +00:00
|
|
|
0, G_MAXUINT, 0,
|
2014-06-09 20:17:37 +00:00
|
|
|
G_PARAM_READABLE |
|
|
|
|
G_PARAM_STATIC_STRINGS));
|
2011-01-06 21:18:19 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 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.
|
wimax: drop WiMAX support (bgo #747846)
Even Fedora is no longer shipping the WiMAX SDK, so it's likely we'll
eventually accidentally break some of the code in src/devices/wimax/
(if we haven't already). Discussion on the list showed a consensus for
dropping support for WiMAX.
So, remove the SDK checks from configure.ac, remove the WiMAX device
plugin and associated manager support, and deprecate all the APIs.
For compatibility reasons, it is still possible to create and save
WiMAX connections, to toggle the software WiMAX rfkill state, and to
change the "WIMAX" log level, although none of these have any effect,
since no NMDeviceWimax will ever be created.
nmcli was only compiling in support for most WiMAX operations when NM
as a whole was built with WiMAX support, so that code has been removed
now as well. (It is still possible to use nmcli to create and edit
WiMAX connections, but those connections will never be activatable.)
2015-04-13 21:07:00 +00:00
|
|
|
*
|
|
|
|
* Deprecated: 1.2: WiMAX is no longer supported.
|
2011-01-06 21:18:19 +00:00
|
|
|
**/
|
|
|
|
g_object_class_install_property
|
|
|
|
(object_class, PROP_RSSI,
|
2014-06-09 20:17:37 +00:00
|
|
|
g_param_spec_int (NM_DEVICE_WIMAX_RSSI, "", "",
|
2011-01-06 21:18:19 +00:00
|
|
|
G_MININT, G_MAXINT, 0,
|
2014-06-09 20:17:37 +00:00
|
|
|
G_PARAM_READABLE |
|
|
|
|
G_PARAM_STATIC_STRINGS));
|
2011-01-06 21:18:19 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 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.
|
wimax: drop WiMAX support (bgo #747846)
Even Fedora is no longer shipping the WiMAX SDK, so it's likely we'll
eventually accidentally break some of the code in src/devices/wimax/
(if we haven't already). Discussion on the list showed a consensus for
dropping support for WiMAX.
So, remove the SDK checks from configure.ac, remove the WiMAX device
plugin and associated manager support, and deprecate all the APIs.
For compatibility reasons, it is still possible to create and save
WiMAX connections, to toggle the software WiMAX rfkill state, and to
change the "WIMAX" log level, although none of these have any effect,
since no NMDeviceWimax will ever be created.
nmcli was only compiling in support for most WiMAX operations when NM
as a whole was built with WiMAX support, so that code has been removed
now as well. (It is still possible to use nmcli to create and edit
WiMAX connections, but those connections will never be activatable.)
2015-04-13 21:07:00 +00:00
|
|
|
*
|
|
|
|
* Deprecated: 1.2: WiMAX is no longer supported.
|
2011-01-06 21:18:19 +00:00
|
|
|
**/
|
|
|
|
g_object_class_install_property
|
|
|
|
(object_class, PROP_CINR,
|
2014-06-09 20:17:37 +00:00
|
|
|
g_param_spec_int (NM_DEVICE_WIMAX_CINR, "", "",
|
2011-01-06 21:18:19 +00:00
|
|
|
G_MININT, G_MAXINT, 0,
|
2014-06-09 20:17:37 +00:00
|
|
|
G_PARAM_READABLE |
|
|
|
|
G_PARAM_STATIC_STRINGS));
|
2011-01-06 21:18:19 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 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.
|
wimax: drop WiMAX support (bgo #747846)
Even Fedora is no longer shipping the WiMAX SDK, so it's likely we'll
eventually accidentally break some of the code in src/devices/wimax/
(if we haven't already). Discussion on the list showed a consensus for
dropping support for WiMAX.
So, remove the SDK checks from configure.ac, remove the WiMAX device
plugin and associated manager support, and deprecate all the APIs.
For compatibility reasons, it is still possible to create and save
WiMAX connections, to toggle the software WiMAX rfkill state, and to
change the "WIMAX" log level, although none of these have any effect,
since no NMDeviceWimax will ever be created.
nmcli was only compiling in support for most WiMAX operations when NM
as a whole was built with WiMAX support, so that code has been removed
now as well. (It is still possible to use nmcli to create and edit
WiMAX connections, but those connections will never be activatable.)
2015-04-13 21:07:00 +00:00
|
|
|
*
|
|
|
|
* Deprecated: 1.2: WiMAX is no longer supported.
|
2011-01-06 21:18:19 +00:00
|
|
|
**/
|
|
|
|
g_object_class_install_property
|
|
|
|
(object_class, PROP_TX_POWER,
|
2014-06-09 20:17:37 +00:00
|
|
|
g_param_spec_int (NM_DEVICE_WIMAX_TX_POWER, "", "",
|
2011-01-06 21:18:19 +00:00
|
|
|
G_MININT, G_MAXINT, 0,
|
2014-06-09 20:17:37 +00:00
|
|
|
G_PARAM_READABLE |
|
|
|
|
G_PARAM_STATIC_STRINGS));
|
2011-01-06 21:18:19 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* NMDeviceWimax:bsid:
|
|
|
|
*
|
|
|
|
* The ID of the serving base station as received from the network. Has
|
|
|
|
* no meaning when the device is not connected.
|
wimax: drop WiMAX support (bgo #747846)
Even Fedora is no longer shipping the WiMAX SDK, so it's likely we'll
eventually accidentally break some of the code in src/devices/wimax/
(if we haven't already). Discussion on the list showed a consensus for
dropping support for WiMAX.
So, remove the SDK checks from configure.ac, remove the WiMAX device
plugin and associated manager support, and deprecate all the APIs.
For compatibility reasons, it is still possible to create and save
WiMAX connections, to toggle the software WiMAX rfkill state, and to
change the "WIMAX" log level, although none of these have any effect,
since no NMDeviceWimax will ever be created.
nmcli was only compiling in support for most WiMAX operations when NM
as a whole was built with WiMAX support, so that code has been removed
now as well. (It is still possible to use nmcli to create and edit
WiMAX connections, but those connections will never be activatable.)
2015-04-13 21:07:00 +00:00
|
|
|
*
|
|
|
|
* Deprecated: 1.2: WiMAX is no longer supported.
|
2011-01-06 21:18:19 +00:00
|
|
|
**/
|
|
|
|
g_object_class_install_property
|
|
|
|
(object_class, PROP_BSID,
|
2014-06-09 20:17:37 +00:00
|
|
|
g_param_spec_string (NM_DEVICE_WIMAX_BSID, "", "",
|
2011-01-06 21:18:19 +00:00
|
|
|
NULL,
|
2014-06-09 20:17:37 +00:00
|
|
|
G_PARAM_READABLE |
|
|
|
|
G_PARAM_STATIC_STRINGS));
|
2011-01-06 21:18:19 +00:00
|
|
|
|
2014-01-08 18:09:40 +00:00
|
|
|
/**
|
|
|
|
* NMDeviceWimax:nsps:
|
|
|
|
*
|
|
|
|
* List of all WiMAX Network Service Providers the device can see.
|
|
|
|
*
|
|
|
|
* Since: 0.9.10
|
wimax: drop WiMAX support (bgo #747846)
Even Fedora is no longer shipping the WiMAX SDK, so it's likely we'll
eventually accidentally break some of the code in src/devices/wimax/
(if we haven't already). Discussion on the list showed a consensus for
dropping support for WiMAX.
So, remove the SDK checks from configure.ac, remove the WiMAX device
plugin and associated manager support, and deprecate all the APIs.
For compatibility reasons, it is still possible to create and save
WiMAX connections, to toggle the software WiMAX rfkill state, and to
change the "WIMAX" log level, although none of these have any effect,
since no NMDeviceWimax will ever be created.
nmcli was only compiling in support for most WiMAX operations when NM
as a whole was built with WiMAX support, so that code has been removed
now as well. (It is still possible to use nmcli to create and edit
WiMAX connections, but those connections will never be activatable.)
2015-04-13 21:07:00 +00:00
|
|
|
* Deprecated: 1.2: WiMAX is no longer supported.
|
2014-01-08 18:09:40 +00:00
|
|
|
**/
|
|
|
|
g_object_class_install_property
|
|
|
|
(object_class, PROP_NSPS,
|
2014-06-09 20:17:37 +00:00
|
|
|
g_param_spec_boxed (NM_DEVICE_WIMAX_NSPS, "", "",
|
2014-01-08 18:09:40 +00:00
|
|
|
NM_TYPE_OBJECT_ARRAY,
|
2014-06-09 20:17:37 +00:00
|
|
|
G_PARAM_READABLE |
|
|
|
|
G_PARAM_STATIC_STRINGS));
|
2014-01-08 18:09:40 +00:00
|
|
|
|
2009-12-14 11:51:50 +00:00
|
|
|
/* signals */
|
|
|
|
|
|
|
|
/**
|
2011-01-04 05:55:38 +00:00
|
|
|
* NMDeviceWimax::nsp-added:
|
2009-12-14 11:51:50 +00:00
|
|
|
* @self: the wimax device that received the signal
|
|
|
|
* @nsp: the new NSP
|
|
|
|
*
|
|
|
|
* Notifies that a #NMWimaxNsp is added to the wimax device.
|
wimax: drop WiMAX support (bgo #747846)
Even Fedora is no longer shipping the WiMAX SDK, so it's likely we'll
eventually accidentally break some of the code in src/devices/wimax/
(if we haven't already). Discussion on the list showed a consensus for
dropping support for WiMAX.
So, remove the SDK checks from configure.ac, remove the WiMAX device
plugin and associated manager support, and deprecate all the APIs.
For compatibility reasons, it is still possible to create and save
WiMAX connections, to toggle the software WiMAX rfkill state, and to
change the "WIMAX" log level, although none of these have any effect,
since no NMDeviceWimax will ever be created.
nmcli was only compiling in support for most WiMAX operations when NM
as a whole was built with WiMAX support, so that code has been removed
now as well. (It is still possible to use nmcli to create and edit
WiMAX connections, but those connections will never be activatable.)
2015-04-13 21:07:00 +00:00
|
|
|
*
|
|
|
|
* Deprecated: 1.2: WiMAX is no longer supported.
|
2009-12-14 11:51:50 +00:00
|
|
|
**/
|
|
|
|
signals[NSP_ADDED] =
|
|
|
|
g_signal_new ("nsp-added",
|
2014-05-09 18:45:59 +00:00
|
|
|
G_OBJECT_CLASS_TYPE (object_class),
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
G_STRUCT_OFFSET (NMDeviceWimaxClass, nsp_added),
|
|
|
|
NULL, NULL,
|
|
|
|
g_cclosure_marshal_VOID__OBJECT,
|
|
|
|
G_TYPE_NONE, 1,
|
|
|
|
G_TYPE_OBJECT);
|
2009-12-14 11:51:50 +00:00
|
|
|
|
|
|
|
/**
|
2011-01-04 05:55:38 +00:00
|
|
|
* NMDeviceWimax::nsp-removed:
|
2009-12-14 11:51:50 +00:00
|
|
|
* @self: the wimax device that received the signal
|
|
|
|
* @nsp: the removed NSP
|
|
|
|
*
|
|
|
|
* Notifies that a #NMWimaxNsp is removed from the wimax device.
|
wimax: drop WiMAX support (bgo #747846)
Even Fedora is no longer shipping the WiMAX SDK, so it's likely we'll
eventually accidentally break some of the code in src/devices/wimax/
(if we haven't already). Discussion on the list showed a consensus for
dropping support for WiMAX.
So, remove the SDK checks from configure.ac, remove the WiMAX device
plugin and associated manager support, and deprecate all the APIs.
For compatibility reasons, it is still possible to create and save
WiMAX connections, to toggle the software WiMAX rfkill state, and to
change the "WIMAX" log level, although none of these have any effect,
since no NMDeviceWimax will ever be created.
nmcli was only compiling in support for most WiMAX operations when NM
as a whole was built with WiMAX support, so that code has been removed
now as well. (It is still possible to use nmcli to create and edit
WiMAX connections, but those connections will never be activatable.)
2015-04-13 21:07:00 +00:00
|
|
|
*
|
|
|
|
* Deprecated: 1.2: WiMAX is no longer supported.
|
2009-12-14 11:51:50 +00:00
|
|
|
**/
|
|
|
|
signals[NSP_REMOVED] =
|
|
|
|
g_signal_new ("nsp-removed",
|
2014-05-09 18:45:59 +00:00
|
|
|
G_OBJECT_CLASS_TYPE (object_class),
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
G_STRUCT_OFFSET (NMDeviceWimaxClass, nsp_removed),
|
|
|
|
NULL, NULL,
|
|
|
|
g_cclosure_marshal_VOID__OBJECT,
|
|
|
|
G_TYPE_NONE, 1,
|
|
|
|
G_TYPE_OBJECT);
|
2009-12-14 11:51:50 +00:00
|
|
|
}
|