mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-01 14:10:12 +01:00
modem: remove originating device multiple serial port workaround
For now, handle multiple serial ports on a vendor/driver basis in the modem creator function; HAL emits device added signals for the ttys in random order, so just using the first serial port doesn't work. This was mainly added for 'hso' devices anyway, for which multiple serial ports are already handled correctly by the creator.
This commit is contained in:
parent
7103dbe426
commit
153cb64d4e
1 changed files with 0 additions and 31 deletions
|
|
@ -1160,29 +1160,6 @@ nm_manager_get_device_by_udi (NMManager *manager, const char *udi)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static NMDevice *
|
||||
nm_manager_get_device_by_originating_device (NMManager *manager, const char *od)
|
||||
{
|
||||
GSList *iter;
|
||||
|
||||
for (iter = NM_MANAGER_GET_PRIVATE (manager)->devices; iter; iter = iter->next) {
|
||||
const char *candidate_od = g_object_get_data (G_OBJECT (iter->data), ORIGDEV_TAG);
|
||||
|
||||
if (candidate_od && !strcmp (candidate_od, od))
|
||||
return NM_DEVICE (iter->data);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
nm_manager_set_originating_device (NMDevice *device, const char *originating_device)
|
||||
{
|
||||
g_return_if_fail (device != NULL);
|
||||
g_return_if_fail (originating_device != NULL);
|
||||
|
||||
g_object_set_data_full (G_OBJECT (device), ORIGDEV_TAG, g_strdup (originating_device), g_free);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
nm_manager_udi_is_managed (NMManager *self, const char *udi)
|
||||
{
|
||||
|
|
@ -1692,18 +1669,10 @@ hal_manager_udi_added_cb (NMHalManager *hal_mgr,
|
|||
if (nm_manager_get_device_by_udi (self, udi))
|
||||
return;
|
||||
|
||||
/* Only ignore multiple ports for serial devices */
|
||||
if (general_type == NM_TYPE_SERIAL_DEVICE) {
|
||||
if (nm_manager_get_device_by_originating_device (self, originating_device))
|
||||
return;
|
||||
}
|
||||
|
||||
device = creator_fn (hal_mgr, udi, originating_device, nm_manager_udi_is_managed (self, udi));
|
||||
if (!device)
|
||||
return;
|
||||
|
||||
nm_manager_set_originating_device (NM_DEVICE (device), originating_device);
|
||||
|
||||
priv->devices = g_slist_append (priv->devices, device);
|
||||
|
||||
g_signal_connect (device, "state-changed",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue