core: new kernel device object instead of an explicit GUdevDevice
Instead of relying constantly on GUdevDevice objects reported by GUdev, we now use a new generic object (MMKernelDevice) for which we provide an initial GUdev based backend.
This commit is contained in:
@@ -12,6 +12,7 @@ AM_CFLAGS = \
|
||||
-I$(top_srcdir) \
|
||||
-I$(top_srcdir)/src \
|
||||
-I$(top_builddir)/src \
|
||||
-I$(top_srcdir)/src/kerneldevice \
|
||||
-I$(top_srcdir)/include \
|
||||
-I$(top_builddir)/include \
|
||||
-I$(top_srcdir)/libmm-glib \
|
||||
|
@@ -176,8 +176,8 @@ grab_port (MMPlugin *self,
|
||||
mm_port_probe_get_port_subsys (probe),
|
||||
mm_port_probe_get_port_name (probe));
|
||||
pflags = MM_PORT_SERIAL_AT_FLAG_PPP;
|
||||
} else if (g_udev_device_get_property_as_boolean (mm_port_probe_peek_port (probe),
|
||||
"ID_MM_CINTERION_PORT_TYPE_GPS")) {
|
||||
} else if (mm_kernel_device_get_property_as_boolean (mm_port_probe_peek_port (probe),
|
||||
"ID_MM_CINTERION_PORT_TYPE_GPS")) {
|
||||
mm_dbg ("(%s/%s)' Port flagged as GPS",
|
||||
mm_port_probe_get_port_subsys (probe),
|
||||
mm_port_probe_get_port_name (probe));
|
||||
|
@@ -324,9 +324,9 @@ dell_custom_init (MMPortProbe *probe,
|
||||
gpointer user_data)
|
||||
{
|
||||
CustomInitContext *ctx;
|
||||
GUdevDevice *udevDevice;
|
||||
MMKernelDevice *port_device;
|
||||
|
||||
udevDevice = mm_port_probe_peek_port (probe);
|
||||
port_device = mm_port_probe_peek_port (probe);
|
||||
|
||||
ctx = g_slice_new0 (CustomInitContext);
|
||||
ctx->result = g_simple_async_result_new (G_OBJECT (probe),
|
||||
@@ -342,7 +342,7 @@ dell_custom_init (MMPortProbe *probe,
|
||||
|
||||
/* Dell-branded Telit modems always answer to +GMI
|
||||
* Avoid +CGMI and ATI sending for minimizing port probing time */
|
||||
if (g_udev_device_get_property_as_boolean (udevDevice, "ID_MM_TELIT_PORTS_TAGGED")) {
|
||||
if (mm_kernel_device_get_property_as_boolean (port_device, "ID_MM_TELIT_PORTS_TAGGED")) {
|
||||
ctx->cgmi_retries = 0;
|
||||
ctx->ati_retries = 0;
|
||||
}
|
||||
|
@@ -52,13 +52,13 @@ grab_port (MMPlugin *self,
|
||||
MMPortProbe *probe,
|
||||
GError **error)
|
||||
{
|
||||
GUdevDevice *port;
|
||||
MMKernelDevice *port;
|
||||
MMPortSerialAtFlag pflags = MM_PORT_SERIAL_AT_FLAG_NONE;
|
||||
|
||||
port = mm_port_probe_peek_port (probe);
|
||||
|
||||
/* Look for port type hints */
|
||||
if (mm_port_probe_is_at (probe) && g_udev_device_get_property_as_boolean (port, "ID_MM_HAIER_PORT_TYPE_MODEM")) {
|
||||
if (mm_port_probe_is_at (probe) && mm_kernel_device_get_property_as_boolean (port, "ID_MM_HAIER_PORT_TYPE_MODEM")) {
|
||||
mm_dbg ("HAIER: AT port '%s/%s' flagged as primary",
|
||||
mm_port_probe_get_port_subsys (probe),
|
||||
mm_port_probe_get_port_name (probe));
|
||||
|
@@ -229,7 +229,7 @@ try_next_usbif (MMDevice *device)
|
||||
if (g_str_equal (mm_port_probe_get_port_subsys (probe), "tty")) {
|
||||
gint usbif;
|
||||
|
||||
usbif = g_udev_device_get_property_as_int (mm_port_probe_peek_port (probe), "ID_USB_INTERFACE_NUM");
|
||||
usbif = mm_kernel_device_get_property_as_int (mm_port_probe_peek_port (probe), "ID_USB_INTERFACE_NUM");
|
||||
if (usbif == fi_ctx->first_usbif) {
|
||||
/* This is the one we just probed, which wasn't yet removed, so just skip it */
|
||||
} else if (usbif > fi_ctx->first_usbif &&
|
||||
@@ -254,7 +254,7 @@ static void
|
||||
huawei_custom_init_step (HuaweiCustomInitContext *ctx)
|
||||
{
|
||||
FirstInterfaceContext *fi_ctx;
|
||||
GUdevDevice *port;
|
||||
MMKernelDevice *port;
|
||||
|
||||
/* If cancelled, end */
|
||||
if (g_cancellable_is_cancelled (ctx->cancellable)) {
|
||||
@@ -292,7 +292,7 @@ huawei_custom_init_step (HuaweiCustomInitContext *ctx)
|
||||
|
||||
/* Try to get a port map from the modem */
|
||||
port = mm_port_probe_peek_port (ctx->probe);
|
||||
if (!ctx->getportmode_done && !g_udev_device_get_property_as_boolean (port, "ID_MM_HUAWEI_DISABLE_GETPORTMODE")) {
|
||||
if (!ctx->getportmode_done && !mm_kernel_device_get_property_as_boolean (port, "ID_MM_HUAWEI_DISABLE_GETPORTMODE")) {
|
||||
if (ctx->getportmode_retries == 0) {
|
||||
g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE);
|
||||
huawei_custom_init_context_complete_and_free (ctx);
|
||||
@@ -390,8 +390,8 @@ huawei_custom_init (MMPortProbe *probe,
|
||||
ctx->getportmode_retries = 3;
|
||||
|
||||
/* Custom init only to be run in the first interface */
|
||||
if (g_udev_device_get_property_as_int (mm_port_probe_peek_port (probe),
|
||||
"ID_USB_INTERFACE_NUM") != fi_ctx->first_usbif) {
|
||||
if (mm_kernel_device_get_property_as_int (mm_port_probe_peek_port (probe),
|
||||
"ID_USB_INTERFACE_NUM") != fi_ctx->first_usbif) {
|
||||
|
||||
if (fi_ctx->custom_init_run)
|
||||
/* If custom init was run already, we can consider this as successfully run */
|
||||
@@ -433,7 +433,7 @@ propagate_port_mode_results (GList *probes)
|
||||
MMPortSerialAtFlag at_port_flags = MM_PORT_SERIAL_AT_FLAG_NONE;
|
||||
gint usbif;
|
||||
|
||||
usbif = g_udev_device_get_property_as_int (mm_port_probe_peek_port (MM_PORT_PROBE (l->data)), "ID_USB_INTERFACE_NUM");
|
||||
usbif = mm_kernel_device_get_property_as_int (mm_port_probe_peek_port (MM_PORT_PROBE (l->data)), "ID_USB_INTERFACE_NUM");
|
||||
|
||||
if (GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (device), TAG_GETPORTMODE_SUPPORTED))) {
|
||||
if (usbif + 1 == GPOINTER_TO_INT (g_object_get_data (G_OBJECT (device), TAG_HUAWEI_PCUI_PORT))) {
|
||||
@@ -526,23 +526,23 @@ grab_port (MMPlugin *self,
|
||||
GError **error)
|
||||
{
|
||||
MMPortSerialAtFlag pflags = MM_PORT_SERIAL_AT_FLAG_NONE;
|
||||
GUdevDevice *port;
|
||||
MMKernelDevice *port;
|
||||
MMPortType port_type;
|
||||
|
||||
port_type = mm_port_probe_get_port_type (probe);
|
||||
port = mm_port_probe_peek_port (probe);
|
||||
|
||||
if (g_udev_device_get_property_as_boolean (port, "ID_MM_HUAWEI_AT_PORT")) {
|
||||
if (mm_kernel_device_get_property_as_boolean (port, "ID_MM_HUAWEI_AT_PORT")) {
|
||||
mm_dbg ("(%s/%s)' Port flagged as primary",
|
||||
mm_port_probe_get_port_subsys (probe),
|
||||
mm_port_probe_get_port_name (probe));
|
||||
pflags = MM_PORT_SERIAL_AT_FLAG_PRIMARY;
|
||||
} else if (g_udev_device_get_property_as_boolean (port, "ID_MM_HUAWEI_MODEM_PORT")) {
|
||||
} else if (mm_kernel_device_get_property_as_boolean (port, "ID_MM_HUAWEI_MODEM_PORT")) {
|
||||
mm_dbg ("(%s/%s) Port flagged as PPP",
|
||||
mm_port_probe_get_port_subsys (probe),
|
||||
mm_port_probe_get_port_name (probe));
|
||||
pflags = MM_PORT_SERIAL_AT_FLAG_PPP;
|
||||
} else if (g_udev_device_get_property_as_boolean (port, "ID_MM_HUAWEI_GPS_PORT")) {
|
||||
} else if (mm_kernel_device_get_property_as_boolean (port, "ID_MM_HUAWEI_GPS_PORT")) {
|
||||
mm_dbg ("(%s/%s) Port flagged as GPS",
|
||||
mm_port_probe_get_port_subsys (probe),
|
||||
mm_port_probe_get_port_name (probe));
|
||||
|
@@ -206,7 +206,7 @@ grab_port (MMPlugin *self,
|
||||
MMPortProbe *probe,
|
||||
GError **error)
|
||||
{
|
||||
GUdevDevice *port;
|
||||
MMKernelDevice *port;
|
||||
MMPortType ptype;
|
||||
MMPortSerialAtFlag pflags = MM_PORT_SERIAL_AT_FLAG_NONE;
|
||||
|
||||
@@ -217,12 +217,12 @@ grab_port (MMPlugin *self,
|
||||
* be the data/primary port on these devices. We have to tag them based on
|
||||
* what the Windows .INF files say the port layout should be.
|
||||
*/
|
||||
if (g_udev_device_get_property_as_boolean (port, "ID_MM_LONGCHEER_PORT_TYPE_MODEM")) {
|
||||
if (mm_kernel_device_get_property_as_boolean (port, "ID_MM_LONGCHEER_PORT_TYPE_MODEM")) {
|
||||
mm_dbg ("longcheer: AT port '%s/%s' flagged as primary",
|
||||
mm_port_probe_get_port_subsys (probe),
|
||||
mm_port_probe_get_port_name (probe));
|
||||
pflags = MM_PORT_SERIAL_AT_FLAG_PRIMARY;
|
||||
} else if (g_udev_device_get_property_as_boolean (port, "ID_MM_LONGCHEER_PORT_TYPE_AUX")) {
|
||||
} else if (mm_kernel_device_get_property_as_boolean (port, "ID_MM_LONGCHEER_PORT_TYPE_AUX")) {
|
||||
mm_dbg ("longcheer: AT port '%s/%s' flagged as secondary",
|
||||
mm_port_probe_get_port_subsys (probe),
|
||||
mm_port_probe_get_port_name (probe));
|
||||
|
@@ -72,13 +72,13 @@ grab_port (MMPlugin *self,
|
||||
GError **error)
|
||||
{
|
||||
MMPortSerialAtFlag pflags = MM_PORT_SERIAL_AT_FLAG_NONE;
|
||||
GUdevDevice *port;
|
||||
MMKernelDevice *port;
|
||||
MMPortType port_type;
|
||||
|
||||
port_type = mm_port_probe_get_port_type (probe);
|
||||
port = mm_port_probe_peek_port (probe);
|
||||
|
||||
if (g_udev_device_get_property_as_boolean (port, "ID_MM_ERICSSON_MBM_GPS_PORT")) {
|
||||
if (mm_kernel_device_get_property_as_boolean (port, "ID_MM_ERICSSON_MBM_GPS_PORT")) {
|
||||
mm_dbg ("(%s/%s) Port flagged as GPS",
|
||||
mm_port_probe_get_port_subsys (probe),
|
||||
mm_port_probe_get_port_name (probe));
|
||||
|
@@ -56,19 +56,19 @@ grab_port (MMPlugin *self,
|
||||
MMPortProbe *probe,
|
||||
GError **error)
|
||||
{
|
||||
GUdevDevice *port;
|
||||
MMKernelDevice *port;
|
||||
MMPortSerialAtFlag pflags = MM_PORT_SERIAL_AT_FLAG_NONE;
|
||||
|
||||
port = mm_port_probe_peek_port (probe);
|
||||
|
||||
if (mm_port_probe_is_at (probe)) {
|
||||
/* Get port type from udev */
|
||||
if (g_udev_device_get_property_as_boolean (port, "ID_MM_MTK_AT_PORT")) {
|
||||
if (mm_kernel_device_get_property_as_boolean (port, "ID_MM_MTK_AT_PORT")) {
|
||||
mm_dbg ("MTK: AT port '%s/%s' flagged as secondary",
|
||||
mm_port_probe_get_port_subsys (probe),
|
||||
mm_port_probe_get_port_name (probe));
|
||||
pflags = MM_PORT_SERIAL_AT_FLAG_SECONDARY;
|
||||
} else if (g_udev_device_get_property_as_boolean (port, "ID_MM_MTK_MODEM_PORT")) {
|
||||
} else if (mm_kernel_device_get_property_as_boolean (port, "ID_MM_MTK_MODEM_PORT")) {
|
||||
mm_dbg ("MTK: Modem port '%s/%s' flagged as primary",
|
||||
mm_port_probe_get_port_subsys (probe),
|
||||
mm_port_probe_get_port_name (probe));
|
||||
|
@@ -63,19 +63,19 @@ grab_port (MMPlugin *self,
|
||||
MMPortProbe *probe,
|
||||
GError **error)
|
||||
{
|
||||
GUdevDevice *port;
|
||||
MMKernelDevice *port;
|
||||
MMPortSerialAtFlag pflags = MM_PORT_SERIAL_AT_FLAG_NONE;
|
||||
|
||||
port = mm_port_probe_peek_port (probe);
|
||||
|
||||
/* Look for port type hints */
|
||||
if (mm_port_probe_is_at (probe)) {
|
||||
if (g_udev_device_get_property_as_boolean (port, "ID_MM_NOKIA_PORT_TYPE_MODEM")) {
|
||||
if (mm_kernel_device_get_property_as_boolean (port, "ID_MM_NOKIA_PORT_TYPE_MODEM")) {
|
||||
mm_dbg ("Nokia: AT port '%s/%s' flagged as primary",
|
||||
mm_port_probe_get_port_subsys (probe),
|
||||
mm_port_probe_get_port_name (probe));
|
||||
pflags = MM_PORT_SERIAL_AT_FLAG_PRIMARY;
|
||||
} else if (g_udev_device_get_property_as_boolean (port, "ID_MM_NOKIA_PORT_TYPE_AUX")) {
|
||||
} else if (mm_kernel_device_get_property_as_boolean (port, "ID_MM_NOKIA_PORT_TYPE_AUX")) {
|
||||
mm_dbg ("Nokia: AT port '%s/%s' flagged as secondary",
|
||||
mm_port_probe_get_port_subsys (probe),
|
||||
mm_port_probe_get_port_name (probe));
|
||||
|
@@ -56,13 +56,13 @@ hso_custom_init (MMPortProbe *probe,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
GUdevDevice *udev_port;
|
||||
MMKernelDevice *kernel_port;
|
||||
GSimpleAsyncResult *result;
|
||||
const gchar *subsys, *sysfs_path;
|
||||
|
||||
subsys = mm_port_probe_get_port_subsys (probe);
|
||||
udev_port = mm_port_probe_peek_port (probe);
|
||||
sysfs_path = g_udev_device_get_sysfs_path (udev_port);
|
||||
kernel_port = mm_port_probe_peek_port (probe);
|
||||
sysfs_path = mm_kernel_device_get_sysfs_path (kernel_port);
|
||||
|
||||
if (g_str_equal (subsys, "tty")) {
|
||||
gchar *hsotype_path;
|
||||
|
@@ -55,7 +55,7 @@ grab_port (MMPlugin *self,
|
||||
GError **error)
|
||||
{
|
||||
MMPortSerialAtFlag pflags = MM_PORT_SERIAL_AT_FLAG_NONE;
|
||||
GUdevDevice *port;
|
||||
MMKernelDevice *port;
|
||||
gint usbif;
|
||||
|
||||
/* The Option plugin cannot do anything with non-AT ports */
|
||||
@@ -73,7 +73,7 @@ grab_port (MMPlugin *self,
|
||||
* the modem/data port, per mail with Option engineers. Only this port
|
||||
* will emit responses to dialing commands.
|
||||
*/
|
||||
usbif = g_udev_device_get_property_as_int (port, "ID_USB_INTERFACE_NUM");
|
||||
usbif = mm_kernel_device_get_property_as_int (port, "ID_USB_INTERFACE_NUM");
|
||||
if (usbif == 0)
|
||||
pflags = MM_PORT_SERIAL_AT_FLAG_PRIMARY | MM_PORT_SERIAL_AT_FLAG_PPP;
|
||||
|
||||
|
@@ -69,7 +69,7 @@ grab_port (MMPlugin *self,
|
||||
MMPortProbe *probe,
|
||||
GError **error)
|
||||
{
|
||||
GUdevDevice *port;
|
||||
MMKernelDevice *port;
|
||||
MMPortType ptype;
|
||||
MMPortSerialAtFlag pflags = MM_PORT_SERIAL_AT_FLAG_NONE;
|
||||
|
||||
@@ -81,12 +81,12 @@ grab_port (MMPlugin *self,
|
||||
* be the data/primary port on these devices. We have to tag them based on
|
||||
* what the Windows .INF files say the port layout should be.
|
||||
*/
|
||||
if (g_udev_device_get_property_as_boolean (port, "ID_MM_SIMTECH_PORT_TYPE_MODEM")) {
|
||||
if (mm_kernel_device_get_property_as_boolean (port, "ID_MM_SIMTECH_PORT_TYPE_MODEM")) {
|
||||
mm_dbg ("Simtech: AT port '%s/%s' flagged as primary",
|
||||
mm_port_probe_get_port_subsys (probe),
|
||||
mm_port_probe_get_port_name (probe));
|
||||
pflags = MM_PORT_SERIAL_AT_FLAG_PRIMARY;
|
||||
} else if (g_udev_device_get_property_as_boolean (port, "ID_MM_SIMTECH_PORT_TYPE_AUX")) {
|
||||
} else if (mm_kernel_device_get_property_as_boolean (port, "ID_MM_SIMTECH_PORT_TYPE_AUX")) {
|
||||
mm_dbg ("Simtech: AT port '%s/%s' flagged as secondary",
|
||||
mm_port_probe_get_port_subsys (probe),
|
||||
mm_port_probe_get_port_name (probe));
|
||||
@@ -98,7 +98,7 @@ grab_port (MMPlugin *self,
|
||||
* to show up with more than two AT-capable ports.
|
||||
*/
|
||||
if (pflags == MM_PORT_SERIAL_AT_FLAG_NONE &&
|
||||
g_udev_device_get_property_as_boolean (port, "ID_MM_SIMTECH_TAGGED"))
|
||||
mm_kernel_device_get_property_as_boolean (port, "ID_MM_SIMTECH_TAGGED"))
|
||||
ptype = MM_PORT_TYPE_IGNORED;
|
||||
}
|
||||
|
||||
|
@@ -32,7 +32,7 @@ telit_grab_port (MMPlugin *self,
|
||||
MMPortProbe *probe,
|
||||
GError **error)
|
||||
{
|
||||
GUdevDevice *port;
|
||||
MMKernelDevice *port;
|
||||
MMDevice *device;
|
||||
MMPortType ptype;
|
||||
MMPortSerialAtFlag pflags = MM_PORT_SERIAL_AT_FLAG_NONE;
|
||||
@@ -48,33 +48,33 @@ telit_grab_port (MMPlugin *self,
|
||||
* If no udev rules are found, AT#PORTCFG (if supported) can be used for
|
||||
* identifying the port layout
|
||||
*/
|
||||
if (g_udev_device_get_property_as_boolean (port, TAG_TELIT_MODEM_PORT)) {
|
||||
if (mm_kernel_device_get_property_as_boolean (port, TAG_TELIT_MODEM_PORT)) {
|
||||
mm_dbg ("telit: AT port '%s/%s' flagged as primary",
|
||||
mm_port_probe_get_port_subsys (probe),
|
||||
mm_port_probe_get_port_name (probe));
|
||||
pflags = MM_PORT_SERIAL_AT_FLAG_PRIMARY;
|
||||
} else if (g_udev_device_get_property_as_boolean (port, TAG_TELIT_AUX_PORT)) {
|
||||
} else if (mm_kernel_device_get_property_as_boolean (port, TAG_TELIT_AUX_PORT)) {
|
||||
mm_dbg ("telit: AT port '%s/%s' flagged as secondary",
|
||||
mm_port_probe_get_port_subsys (probe),
|
||||
mm_port_probe_get_port_name (probe));
|
||||
pflags = MM_PORT_SERIAL_AT_FLAG_SECONDARY;
|
||||
} else if (g_udev_device_get_property_as_boolean (port, TAG_TELIT_NMEA_PORT)) {
|
||||
} else if (mm_kernel_device_get_property_as_boolean (port, TAG_TELIT_NMEA_PORT)) {
|
||||
mm_dbg ("telit: port '%s/%s' flagged as NMEA",
|
||||
mm_port_probe_get_port_subsys (probe),
|
||||
mm_port_probe_get_port_name (probe));
|
||||
ptype = MM_PORT_TYPE_GPS;
|
||||
} else if (g_object_get_data (G_OBJECT (device), TAG_GETPORTCFG_SUPPORTED) != NULL) {
|
||||
if (g_strcmp0 (g_udev_device_get_property (port, "ID_USB_INTERFACE_NUM"), g_object_get_data (G_OBJECT (device), TAG_TELIT_MODEM_PORT)) == 0) {
|
||||
if (g_strcmp0 (mm_kernel_device_get_property (port, "ID_USB_INTERFACE_NUM"), g_object_get_data (G_OBJECT (device), TAG_TELIT_MODEM_PORT)) == 0) {
|
||||
mm_dbg ("telit: AT port '%s/%s' flagged as primary",
|
||||
mm_port_probe_get_port_subsys (probe),
|
||||
mm_port_probe_get_port_name (probe));
|
||||
pflags = MM_PORT_SERIAL_AT_FLAG_PRIMARY;
|
||||
} else if (g_strcmp0 (g_udev_device_get_property (port, "ID_USB_INTERFACE_NUM"), g_object_get_data (G_OBJECT (device), TAG_TELIT_AUX_PORT)) == 0) {
|
||||
} else if (g_strcmp0 (mm_kernel_device_get_property (port, "ID_USB_INTERFACE_NUM"), g_object_get_data (G_OBJECT (device), TAG_TELIT_AUX_PORT)) == 0) {
|
||||
mm_dbg ("telit: AT port '%s/%s' flagged as secondary",
|
||||
mm_port_probe_get_port_subsys (probe),
|
||||
mm_port_probe_get_port_name (probe));
|
||||
pflags = MM_PORT_SERIAL_AT_FLAG_SECONDARY;
|
||||
} else if (g_strcmp0 (g_udev_device_get_property (port, "ID_USB_INTERFACE_NUM"), g_object_get_data (G_OBJECT (device), TAG_TELIT_NMEA_PORT)) == 0) {
|
||||
} else if (g_strcmp0 (mm_kernel_device_get_property (port, "ID_USB_INTERFACE_NUM"), g_object_get_data (G_OBJECT (device), TAG_TELIT_NMEA_PORT)) == 0) {
|
||||
mm_dbg ("telit: port '%s/%s' flagged as NMEA",
|
||||
mm_port_probe_get_port_subsys (probe),
|
||||
mm_port_probe_get_port_name (probe));
|
||||
@@ -245,7 +245,7 @@ telit_custom_init_context_complete_and_free (TelitCustomInitContext *ctx)
|
||||
static void
|
||||
telit_custom_init_step (TelitCustomInitContext *ctx)
|
||||
{
|
||||
GUdevDevice *port;
|
||||
MMKernelDevice *port;
|
||||
|
||||
/* If cancelled, end */
|
||||
if (g_cancellable_is_cancelled (ctx->cancellable)) {
|
||||
@@ -259,7 +259,7 @@ telit_custom_init_step (TelitCustomInitContext *ctx)
|
||||
*/
|
||||
port = mm_port_probe_peek_port (ctx->probe);
|
||||
if (!ctx->getportcfg_done &&
|
||||
g_strcmp0 (g_udev_device_get_property (port, "ID_USB_INTERFACE_NUM"), "00") == 0) {
|
||||
g_strcmp0 (mm_kernel_device_get_property (port, "ID_USB_INTERFACE_NUM"), "00") == 0) {
|
||||
|
||||
if (ctx->getportcfg_retries == 0)
|
||||
goto out;
|
||||
@@ -290,11 +290,11 @@ telit_custom_init (MMPortProbe *probe,
|
||||
gpointer user_data)
|
||||
{
|
||||
MMDevice *device;
|
||||
GUdevDevice *udevDevice;
|
||||
MMKernelDevice *port_device;
|
||||
TelitCustomInitContext *ctx;
|
||||
|
||||
device = mm_port_probe_peek_device (probe);
|
||||
udevDevice = mm_port_probe_peek_port (probe);
|
||||
port_device = mm_port_probe_peek_port (probe);
|
||||
|
||||
ctx = g_slice_new (TelitCustomInitContext);
|
||||
ctx->result = g_simple_async_result_new (G_OBJECT (probe),
|
||||
@@ -308,7 +308,7 @@ telit_custom_init (MMPortProbe *probe,
|
||||
ctx->getportcfg_retries = 3;
|
||||
|
||||
/* If the device is tagged for supporting #PORTCFG do the custom init */
|
||||
if (g_udev_device_get_property_as_boolean (udevDevice, "ID_MM_TELIT_PORTS_TAGGED")) {
|
||||
if (mm_kernel_device_get_property_as_boolean (port_device, "ID_MM_TELIT_PORTS_TAGGED")) {
|
||||
telit_custom_init_step (ctx);
|
||||
return;
|
||||
}
|
||||
|
@@ -220,7 +220,7 @@ grab_port (MMPlugin *self,
|
||||
MMPortProbe *probe,
|
||||
GError **error)
|
||||
{
|
||||
GUdevDevice *port;
|
||||
MMKernelDevice *port;
|
||||
MMPortType ptype;
|
||||
MMPortSerialAtFlag pflags = MM_PORT_SERIAL_AT_FLAG_NONE;
|
||||
|
||||
@@ -232,12 +232,12 @@ grab_port (MMPlugin *self,
|
||||
* be the data/primary port on these devices. We have to tag them based on
|
||||
* what the Windows .INF files say the port layout should be.
|
||||
*/
|
||||
if (g_udev_device_get_property_as_boolean (port, "ID_MM_X22X_PORT_TYPE_MODEM")) {
|
||||
if (mm_kernel_device_get_property_as_boolean (port, "ID_MM_X22X_PORT_TYPE_MODEM")) {
|
||||
mm_dbg ("x22x: AT port '%s/%s' flagged as primary",
|
||||
mm_port_probe_get_port_subsys (probe),
|
||||
mm_port_probe_get_port_name (probe));
|
||||
pflags = MM_PORT_SERIAL_AT_FLAG_PRIMARY;
|
||||
} else if (g_udev_device_get_property_as_boolean (port, "ID_MM_X22X_PORT_TYPE_AUX")) {
|
||||
} else if (mm_kernel_device_get_property_as_boolean (port, "ID_MM_X22X_PORT_TYPE_AUX")) {
|
||||
mm_dbg ("x22x: AT port '%s/%s' flagged as secondary",
|
||||
mm_port_probe_get_port_subsys (probe),
|
||||
mm_port_probe_get_port_name (probe));
|
||||
|
@@ -110,7 +110,7 @@ grab_port (MMPlugin *self,
|
||||
MMPortProbe *probe,
|
||||
GError **error)
|
||||
{
|
||||
GUdevDevice *port;
|
||||
MMKernelDevice *port;
|
||||
MMPortSerialAtFlag pflags = MM_PORT_SERIAL_AT_FLAG_NONE;
|
||||
MMPortType ptype;
|
||||
|
||||
@@ -128,12 +128,12 @@ grab_port (MMPlugin *self,
|
||||
|
||||
if (mm_port_probe_is_at (probe)) {
|
||||
/* Look for port type hints */
|
||||
if (g_udev_device_get_property_as_boolean (port, "ID_MM_ZTE_PORT_TYPE_MODEM")) {
|
||||
if (mm_kernel_device_get_property_as_boolean (port, "ID_MM_ZTE_PORT_TYPE_MODEM")) {
|
||||
mm_dbg ("ZTE: AT port '%s/%s' flagged as primary",
|
||||
mm_port_probe_get_port_subsys (probe),
|
||||
mm_port_probe_get_port_name (probe));
|
||||
pflags = MM_PORT_SERIAL_AT_FLAG_PRIMARY;
|
||||
} else if (g_udev_device_get_property_as_boolean (port, "ID_MM_ZTE_PORT_TYPE_AUX")) {
|
||||
} else if (mm_kernel_device_get_property_as_boolean (port, "ID_MM_ZTE_PORT_TYPE_AUX")) {
|
||||
mm_dbg ("ZTE: AT port '%s/%s' flagged as secondary",
|
||||
mm_port_probe_get_port_subsys (probe),
|
||||
mm_port_probe_get_port_name (probe));
|
||||
@@ -141,7 +141,7 @@ grab_port (MMPlugin *self,
|
||||
}
|
||||
}
|
||||
|
||||
if (g_udev_device_get_property_as_boolean (port, "ID_MM_ZTE_ICERA_DHCP")) {
|
||||
if (mm_kernel_device_get_property_as_boolean (port, "ID_MM_ZTE_ICERA_DHCP")) {
|
||||
mm_dbg ("ZTE: Icera-based modem will use DHCP");
|
||||
g_object_set (modem,
|
||||
MM_BROADBAND_MODEM_ICERA_DEFAULT_IP_METHOD, MM_BEARER_IP_METHOD_DHCP,
|
||||
|
Reference in New Issue
Block a user