mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-25 02:30:08 +01:00
core: ensure all devices chain up to parent act_stage1_prepare
We'll be moving some code into the NMDevice implementation soon, which currently does nothing other than return success.
This commit is contained in:
parent
087e1dfbb9
commit
f95bca2dcf
4 changed files with 21 additions and 1 deletions
|
|
@ -147,6 +147,7 @@ get_generic_capabilities (NMDevice *dev)
|
|||
static NMActStageReturn
|
||||
act_stage1_prepare (NMDevice *dev, NMDeviceStateReason *reason)
|
||||
{
|
||||
NMActStageReturn ret;
|
||||
NMActRequest *req;
|
||||
NMConnection *connection;
|
||||
NMSettingInfiniband *s_infiniband;
|
||||
|
|
@ -156,6 +157,10 @@ act_stage1_prepare (NMDevice *dev, NMDeviceStateReason *reason)
|
|||
|
||||
g_return_val_if_fail (reason != NULL, NM_ACT_STAGE_RETURN_FAILURE);
|
||||
|
||||
ret = NM_DEVICE_CLASS (nm_device_infiniband_parent_class)->act_stage1_prepare (dev, reason);
|
||||
if (ret != NM_ACT_STAGE_RETURN_SUCCESS)
|
||||
return ret;
|
||||
|
||||
req = nm_device_get_act_request (dev);
|
||||
g_return_val_if_fail (req != NULL, NM_ACT_STAGE_RETURN_FAILURE);
|
||||
|
||||
|
|
@ -186,7 +191,7 @@ act_stage1_prepare (NMDevice *dev, NMDeviceStateReason *reason)
|
|||
return NM_ACT_STAGE_RETURN_FAILURE;
|
||||
}
|
||||
|
||||
return NM_DEVICE_CLASS (nm_device_infiniband_parent_class)->act_stage1_prepare (dev, reason);
|
||||
return NM_ACT_STAGE_RETURN_SUCCESS;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
|
|
@ -252,8 +252,13 @@ deactivate (NMDevice *device)
|
|||
static NMActStageReturn
|
||||
act_stage1_prepare (NMDevice *device, NMDeviceStateReason *reason)
|
||||
{
|
||||
NMActStageReturn ret;
|
||||
NMActRequest *req;
|
||||
|
||||
ret = NM_DEVICE_CLASS (nm_device_modem_parent_class)->act_stage1_prepare (device, reason);
|
||||
if (ret != NM_ACT_STAGE_RETURN_SUCCESS)
|
||||
return ret;
|
||||
|
||||
req = nm_device_get_act_request (device);
|
||||
g_assert (req);
|
||||
|
||||
|
|
|
|||
|
|
@ -252,8 +252,13 @@ static NMActStageReturn
|
|||
act_stage1_prepare (NMDevice *dev, NMDeviceStateReason *reason)
|
||||
{
|
||||
NMDeviceOlpcMeshPrivate *priv = NM_DEVICE_OLPC_MESH_GET_PRIVATE (dev);
|
||||
NMActStageReturn ret;
|
||||
gboolean scanning;
|
||||
|
||||
ret = NM_DEVICE_CLASS (nm_device_olpc_mesh_parent_class)->act_stage1_prepare (dev, reason);
|
||||
if (ret != NM_ACT_STAGE_RETURN_SUCCESS)
|
||||
return ret;
|
||||
|
||||
/* disconnect companion device, if it is connected */
|
||||
if (nm_device_get_act_request (NM_DEVICE (priv->companion))) {
|
||||
nm_log_info (LOGD_OLPC_MESH, "(%s): disconnecting companion device %s",
|
||||
|
|
|
|||
|
|
@ -2790,6 +2790,7 @@ act_stage1_prepare (NMDevice *dev, NMDeviceStateReason *reason)
|
|||
{
|
||||
NMDeviceWifi *self = NM_DEVICE_WIFI (dev);
|
||||
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self);
|
||||
NMActStageReturn ret;
|
||||
NMAccessPoint *ap = NULL;
|
||||
NMActRequest *req;
|
||||
NMConnection *connection;
|
||||
|
|
@ -2798,6 +2799,10 @@ act_stage1_prepare (NMDevice *dev, NMDeviceStateReason *reason)
|
|||
GSList *iter;
|
||||
const char *mode;
|
||||
|
||||
ret = NM_DEVICE_CLASS (nm_device_wifi_parent_class)->act_stage1_prepare (dev, reason);
|
||||
if (ret != NM_ACT_STAGE_RETURN_SUCCESS)
|
||||
return ret;
|
||||
|
||||
req = nm_device_get_act_request (NM_DEVICE (self));
|
||||
g_return_val_if_fail (req != NULL, NM_ACT_STAGE_RETURN_FAILURE);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue