aboutsummaryrefslogtreecommitdiff
path: root/plugins/option
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2021-02-07 11:53:13 +0100
committerAleksander Morgado <aleksander@aleksander.es>2021-02-24 20:47:57 +0100
commit1b35d74c157417e40877535eec757e5cd725564f (patch)
treee9e26fb80e9d7f3141d017dd84b6e41a7a4783f5 /plugins/option
parentcc07d21410d707a3e3cf16c3fa187562dcdea58b (diff)
kernel-device: add get_interface_number() method
We already have methods to query for interface specific attributes like class/subclass/protocol, so add a new one for the interface number, and make sure we use ATTRS{bInterfaceNumber} to load it always, instead of assuming the ID_USB_INTERFACE_NUM property is set.
Diffstat (limited to 'plugins/option')
-rw-r--r--plugins/option/mm-plugin-option.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/option/mm-plugin-option.c b/plugins/option/mm-plugin-option.c
index 3ba183ec..1f72325c 100644
--- a/plugins/option/mm-plugin-option.c
+++ b/plugins/option/mm-plugin-option.c
@@ -56,7 +56,7 @@ grab_port (MMPlugin *self,
{
MMPortSerialAtFlag pflags = MM_PORT_SERIAL_AT_FLAG_NONE;
MMKernelDevice *port;
- guint usbif;
+ gint usbif;
/* The Option plugin cannot do anything with non-AT ports */
if (!mm_port_probe_is_at (probe)) {
@@ -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 = mm_kernel_device_get_property_as_int_hex (port, "ID_USB_INTERFACE_NUM");
+ usbif = mm_kernel_device_get_interface_number (port);
if (usbif == 0)
pflags = MM_PORT_SERIAL_AT_FLAG_PRIMARY | MM_PORT_SERIAL_AT_FLAG_PPP;