mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-07 00:30:32 +01:00
modem-manager: let the `NMDeviceModem' handle hw_is_up() and hw_bring_up()
These actions don't require anything from the `NMModem' object, so just move them back to `NMDeviceModem'.
This commit is contained in:
parent
24b6fc9e62
commit
1f0dbd6790
3 changed files with 7 additions and 24 deletions
|
|
@ -591,24 +591,6 @@ nm_modem_device_state_changed (NMModem *self,
|
|||
|
||||
/*****************************************************************************/
|
||||
|
||||
gboolean
|
||||
nm_modem_hw_is_up (NMModem *self, NMDevice *device)
|
||||
{
|
||||
int ifindex = nm_device_get_ip_ifindex (device);
|
||||
|
||||
return ifindex > 0 ? nm_system_iface_is_up (ifindex) : TRUE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
nm_modem_hw_bring_up (NMModem *self, NMDevice *device, gboolean *no_firmware)
|
||||
{
|
||||
int ifindex = nm_device_get_ip_ifindex (device);
|
||||
|
||||
return ifindex > 0 ? nm_system_iface_set_up (ifindex, TRUE, no_firmware) : TRUE;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
const char *
|
||||
nm_modem_get_iface (NMModem *self)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -156,10 +156,6 @@ void nm_modem_device_state_changed (NMModem *modem,
|
|||
NMDeviceState old_state,
|
||||
NMDeviceStateReason reason);
|
||||
|
||||
gboolean nm_modem_hw_is_up (NMModem *modem, NMDevice *device);
|
||||
|
||||
gboolean nm_modem_hw_bring_up (NMModem *modem, NMDevice *device, gboolean *no_firmware);
|
||||
|
||||
gboolean nm_modem_get_mm_enabled (NMModem *self);
|
||||
|
||||
void nm_modem_set_mm_enabled (NMModem *self, gboolean enabled);
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@
|
|||
#include "nm-rfkill.h"
|
||||
#include "nm-marshal.h"
|
||||
#include "nm-logging.h"
|
||||
#include "nm-system.h"
|
||||
|
||||
G_DEFINE_TYPE (NMDeviceModem, nm_device_modem, NM_TYPE_DEVICE)
|
||||
|
||||
|
|
@ -245,13 +246,17 @@ complete_connection (NMDevice *device,
|
|||
static gboolean
|
||||
hw_is_up (NMDevice *device)
|
||||
{
|
||||
return nm_modem_hw_is_up (NM_DEVICE_MODEM_GET_PRIVATE (device)->modem, device);
|
||||
int ifindex = nm_device_get_ip_ifindex (device);
|
||||
|
||||
return ifindex > 0 ? nm_system_iface_is_up (ifindex) : TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
hw_bring_up (NMDevice *device, gboolean *no_firmware)
|
||||
{
|
||||
return nm_modem_hw_bring_up (NM_DEVICE_MODEM_GET_PRIVATE (device)->modem, device, no_firmware);
|
||||
int ifindex = nm_device_get_ip_ifindex (device);
|
||||
|
||||
return ifindex > 0 ? nm_system_iface_set_up (ifindex, TRUE, no_firmware) : TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue