mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-04-21 13:30:54 +02:00
core/p2p-wifi: various minor cleanups
This commit is contained in:
parent
6e45cd900c
commit
43aa288fd8
4 changed files with 13 additions and 15 deletions
|
|
@ -309,7 +309,7 @@ complete_connection (NMDevice *device,
|
|||
}
|
||||
|
||||
setting_peer = nm_wifi_p2p_peer_get_address (peer);
|
||||
g_assert (setting_peer);
|
||||
g_return_val_if_fail (setting_peer, FALSE);
|
||||
}
|
||||
|
||||
/* Add a P2P wifi setting if one doesn't exist yet */
|
||||
|
|
@ -1248,7 +1248,6 @@ constructed (GObject *object)
|
|||
|
||||
G_OBJECT_CLASS (nm_device_p2p_wifi_parent_class)->constructed (object);
|
||||
|
||||
/* Connect to the supplicant manager */
|
||||
priv->sup_mgr = g_object_ref (nm_supplicant_manager_get ());
|
||||
|
||||
nm_device_add_pending_action (NM_DEVICE (self), NM_PENDING_ACTION_WAITING_FOR_SUPPLICANT, FALSE);
|
||||
|
|
|
|||
|
|
@ -38,7 +38,6 @@
|
|||
|
||||
#define NM_DEVICE_P2P_WIFI_MGMT_IFACE "mgmt-iface"
|
||||
|
||||
|
||||
typedef struct _NMDeviceP2PWifi NMDeviceP2PWifi;
|
||||
typedef struct _NMDeviceP2PWifiClass NMDeviceP2PWifiClass;
|
||||
|
||||
|
|
|
|||
|
|
@ -22,13 +22,13 @@
|
|||
#include "nm-default.h"
|
||||
|
||||
#include "nm-device-wifi.h"
|
||||
#include "nm-device-p2p-wifi.h"
|
||||
|
||||
#include <netinet/in.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "nm-device-p2p-wifi.h"
|
||||
#include "nm-wifi-ap.h"
|
||||
#include "nm-common-macros.h"
|
||||
#include "devices/nm-device.h"
|
||||
|
|
@ -2047,8 +2047,8 @@ supplicant_iface_state_cb (NMSupplicantInterface *iface,
|
|||
&& new_state <= NM_SUPPLICANT_INTERFACE_STATE_COMPLETED)
|
||||
priv->ssid_found = TRUE;
|
||||
|
||||
if (old_state < NM_SUPPLICANT_INTERFACE_STATE_READY &&
|
||||
new_state >= NM_SUPPLICANT_INTERFACE_STATE_READY)
|
||||
if ( old_state < NM_SUPPLICANT_INTERFACE_STATE_READY
|
||||
&& new_state >= NM_SUPPLICANT_INTERFACE_STATE_READY)
|
||||
recheck_p2p_availability (self);
|
||||
|
||||
switch (new_state) {
|
||||
|
|
@ -2247,7 +2247,8 @@ recheck_p2p_availability (NMDeviceWifi *self)
|
|||
NULL);
|
||||
|
||||
if (p2p_available && !priv->p2p_device) {
|
||||
g_autofree char *iface_name = NULL;
|
||||
gs_free char *iface_name = NULL;
|
||||
|
||||
/* Create a P2P device. "p2p-dev-" is the same prefix as chosen by
|
||||
* wpa_supplicant internally.
|
||||
*/
|
||||
|
|
@ -2265,8 +2266,7 @@ recheck_p2p_availability (NMDeviceWifi *self)
|
|||
} else if (!p2p_available && priv->p2p_device) {
|
||||
/* Destroy the P2P device. */
|
||||
g_object_remove_weak_pointer (G_OBJECT (priv->p2p_device), (gpointer*) &priv->p2p_device);
|
||||
nm_device_p2p_wifi_remove (priv->p2p_device);
|
||||
priv->p2p_device = NULL;
|
||||
nm_device_p2p_wifi_remove (g_steal_pointer (&priv->p2p_device));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -3509,7 +3509,7 @@ nm_device_wifi_class_init (NMDeviceWifiClass *klass)
|
|||
g_signal_new (NM_DEVICE_WIFI_P2P_DEVICE_CREATED,
|
||||
G_OBJECT_CLASS_TYPE (object_class),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0,
|
||||
NULL, NULL, NULL,
|
||||
0, NULL, NULL,
|
||||
g_cclosure_marshal_VOID__OBJECT,
|
||||
G_TYPE_NONE, 1, NM_TYPE_DEVICE);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -656,10 +656,10 @@ static const NMDBusInterfaceInfoExtended interface_info_p2p_peer = {
|
|||
};
|
||||
|
||||
static void
|
||||
nm_wifi_p2p_peer_class_init (NMWifiP2PPeerClass *p2p_peer_class)
|
||||
nm_wifi_p2p_peer_class_init (NMWifiP2PPeerClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (p2p_peer_class);
|
||||
NMDBusObjectClass *dbus_object_class = NM_DBUS_OBJECT_CLASS (p2p_peer_class);
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
NMDBusObjectClass *dbus_object_class = NM_DBUS_OBJECT_CLASS (klass);
|
||||
|
||||
g_type_class_add_private (object_class, sizeof (NMWifiP2PPeerPrivate));
|
||||
|
||||
|
|
@ -667,7 +667,7 @@ nm_wifi_p2p_peer_class_init (NMWifiP2PPeerClass *p2p_peer_class)
|
|||
dbus_object_class->interface_infos = NM_DBUS_INTERFACE_INFOS (&interface_info_p2p_peer);
|
||||
|
||||
object_class->get_property = get_property;
|
||||
object_class->finalize = finalize;
|
||||
object_class->finalize = finalize;
|
||||
|
||||
obj_properties[PROP_FLAGS] =
|
||||
g_param_spec_uint (NM_WIFI_P2P_PEER_FLAGS, "", "",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue