port-mbim: allow specifying input subsystem
We have assumed until now that all MBIM ports are based on the cdc_mbim driver, exposed in the 'usbmisc' subsystem by the cdc-wdm driver. This may no longer be true, so allow creating MBIM ports with an explicit subsystem instead of defaulting always to USBMISC.
This commit is contained in:
@@ -230,7 +230,7 @@ base_modem_create_usbmisc_port (MMBaseModem *self,
|
||||
#endif
|
||||
#if defined WITH_MBIM
|
||||
if (ptype == MM_PORT_TYPE_MBIM)
|
||||
return MM_PORT (mm_port_mbim_new (name));
|
||||
return MM_PORT (mm_port_mbim_new (name, MM_PORT_SUBSYS_USBMISC));
|
||||
#endif
|
||||
if (ptype == MM_PORT_TYPE_AT)
|
||||
return MM_PORT (mm_port_serial_at_new (name, MM_PORT_SUBSYS_USBMISC));
|
||||
|
@@ -589,11 +589,12 @@ mm_port_mbim_peek_device (MMPortMbim *self)
|
||||
/*****************************************************************************/
|
||||
|
||||
MMPortMbim *
|
||||
mm_port_mbim_new (const gchar *name)
|
||||
mm_port_mbim_new (const gchar *name,
|
||||
MMPortSubsys subsys)
|
||||
{
|
||||
return MM_PORT_MBIM (g_object_new (MM_TYPE_PORT_MBIM,
|
||||
MM_PORT_DEVICE, name,
|
||||
MM_PORT_SUBSYS, MM_PORT_SUBSYS_USBMISC,
|
||||
MM_PORT_SUBSYS, subsys,
|
||||
MM_PORT_TYPE, MM_PORT_TYPE_MBIM,
|
||||
NULL));
|
||||
}
|
||||
|
@@ -53,7 +53,8 @@ struct _MMPortMbimClass {
|
||||
GType mm_port_mbim_get_type (void);
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMPortMbim, g_object_unref)
|
||||
|
||||
MMPortMbim *mm_port_mbim_new (const gchar *name);
|
||||
MMPortMbim *mm_port_mbim_new (const gchar *name,
|
||||
MMPortSubsys subsys);
|
||||
|
||||
void mm_port_mbim_open (MMPortMbim *self,
|
||||
#if defined WITH_QMI && QMI_MBIM_QMUX_SUPPORTED
|
||||
|
@@ -566,7 +566,8 @@ wdm_probe_mbim (MMPortProbe *self)
|
||||
mm_obj_dbg (self, "probing MBIM...");
|
||||
|
||||
/* Create a port and try to open it */
|
||||
ctx->mbim_port = mm_port_mbim_new (mm_kernel_device_get_name (self->priv->port));
|
||||
ctx->mbim_port = mm_port_mbim_new (mm_kernel_device_get_name (self->priv->port),
|
||||
MM_PORT_SUBSYS_USBMISC);
|
||||
mm_port_mbim_open (ctx->mbim_port,
|
||||
#if defined WITH_QMI && QMI_MBIM_QMUX_SUPPORTED
|
||||
FALSE, /* Don't check QMI over MBIM support at this stage */
|
||||
|
Reference in New Issue
Block a user