base-modem,cinterion: no need for a peek_current_data_port() method
We already get the data port given as input parameter in disconnect_3gpp(), so there is no point in trying to find out which the data port is.
This commit is contained in:
@@ -781,24 +781,9 @@ disconnect_3gpp (MMBroadbandBearer *self,
|
||||
gpointer user_data)
|
||||
{
|
||||
Disconnect3gppContext *ctx;
|
||||
MMPort *port;
|
||||
|
||||
g_assert (primary != NULL);
|
||||
|
||||
/* Note: Not sure how else to get active data port? Can this be done without adding this
|
||||
* function to mm-base-modem.c?
|
||||
* TODO: Dual SIM how do we know which interface to grab/disconnect if two are active? */
|
||||
/* Get the Net port to be torn down */
|
||||
port = mm_base_modem_peek_current_data_port (MM_BASE_MODEM (modem), MM_PORT_TYPE_NET);
|
||||
if (!port) {
|
||||
g_simple_async_report_error_in_idle (G_OBJECT (self),
|
||||
callback,
|
||||
user_data,
|
||||
MM_CORE_ERROR,
|
||||
MM_CORE_ERROR_NOT_FOUND,
|
||||
"No valid data port found to tear down.");
|
||||
return;
|
||||
}
|
||||
g_assert (data != NULL);
|
||||
|
||||
/* Setup connection context */
|
||||
ctx = g_slice_new0 (Disconnect3gppContext);
|
||||
@@ -808,7 +793,7 @@ disconnect_3gpp (MMBroadbandBearer *self,
|
||||
callback,
|
||||
user_data,
|
||||
disconnect_3gpp);
|
||||
ctx->data = g_object_ref (port);
|
||||
ctx->data = g_object_ref (data);
|
||||
ctx->primary = g_object_ref (primary);
|
||||
|
||||
/* Maps Bearer->Net Interface-> PDP Context
|
||||
|
@@ -697,26 +697,6 @@ mm_base_modem_peek_best_data_port (MMBaseModem *self,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
MMPort *
|
||||
mm_base_modem_peek_current_data_port (MMBaseModem *self,
|
||||
MMPortType type)
|
||||
{
|
||||
GList *l;
|
||||
|
||||
g_return_val_if_fail (MM_IS_BASE_MODEM (self), NULL);
|
||||
|
||||
/* Return first connected data port */
|
||||
for (l = self->priv->data; l; l = g_list_next (l)) {
|
||||
if (mm_port_get_connected ((MMPort *)l->data) &&
|
||||
(mm_port_get_port_type ((MMPort *)l->data) == type ||
|
||||
type == MM_PORT_TYPE_UNKNOWN)) {
|
||||
return (MMPort *)l->data;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
GList *
|
||||
mm_base_modem_get_data_ports (MMBaseModem *self)
|
||||
{
|
||||
|
@@ -131,7 +131,6 @@ MMPortMbim *mm_base_modem_peek_port_mbim_for_data (MMBaseModem *self, MMPo
|
||||
#endif
|
||||
MMPortSerialAt *mm_base_modem_peek_best_at_port (MMBaseModem *self, GError **error);
|
||||
MMPort *mm_base_modem_peek_best_data_port (MMBaseModem *self, MMPortType type);
|
||||
MMPort *mm_base_modem_peek_current_data_port (MMBaseModem *self, MMPortType type);
|
||||
GList *mm_base_modem_peek_data_ports (MMBaseModem *self);
|
||||
|
||||
MMPortSerialAt *mm_base_modem_get_port_primary (MMBaseModem *self);
|
||||
|
Reference in New Issue
Block a user