api: expose ignored ports as MM_MODEM_PORT_TYPE_IGNORED

At the moment, ignored ports show up as (unknown) in the ports list
in mmcli. This makes it look like something went wrong while probing.

Actually ModemManager already tracks unknown and ignored ports separately
(MM_PORT_TYPE_UNKNOWN vs MM_PORT_TYPE_IGNORED) but the API always exposes
them as MM_MODEM_PORT_TYPE_UNKNOWN.

Add MM_MODEM_PORT_TYPE_IGNORED and use this for ignored ports so they
show up as (ignored) instead in mmcli.
This commit is contained in:
Stephan Gerhold
2020-10-27 15:05:31 +01:00
committed by Aleksander Morgado
parent fb14d0dbb2
commit a174edb74d
2 changed files with 5 additions and 1 deletions

View File

@@ -538,6 +538,7 @@ typedef enum { /*< underscore_name=mm_modem_band >*/
* @MM_MODEM_PORT_TYPE_QMI: QMI port. * @MM_MODEM_PORT_TYPE_QMI: QMI port.
* @MM_MODEM_PORT_TYPE_MBIM: MBIM port. * @MM_MODEM_PORT_TYPE_MBIM: MBIM port.
* @MM_MODEM_PORT_TYPE_AUDIO: Audio port. Since 1.12. * @MM_MODEM_PORT_TYPE_AUDIO: Audio port. Since 1.12.
* @MM_MODEM_PORT_TYPE_IGNORED: Ignored port. Since 1.16.
* *
* Type of modem port. * Type of modem port.
* *
@@ -552,6 +553,7 @@ typedef enum { /*< underscore_name=mm_modem_port_type >*/
MM_MODEM_PORT_TYPE_QMI = 6, MM_MODEM_PORT_TYPE_QMI = 6,
MM_MODEM_PORT_TYPE_MBIM = 7, MM_MODEM_PORT_TYPE_MBIM = 7,
MM_MODEM_PORT_TYPE_AUDIO = 8, MM_MODEM_PORT_TYPE_AUDIO = 8,
MM_MODEM_PORT_TYPE_IGNORED = 9,
} MMModemPortType; } MMModemPortType;
/** /**

View File

@@ -965,8 +965,10 @@ mm_base_modem_get_port_infos (MMBaseModem *self,
case MM_PORT_TYPE_MBIM: case MM_PORT_TYPE_MBIM:
port_infos[i].type = MM_MODEM_PORT_TYPE_MBIM; port_infos[i].type = MM_MODEM_PORT_TYPE_MBIM;
break; break;
case MM_PORT_TYPE_UNKNOWN:
case MM_PORT_TYPE_IGNORED: case MM_PORT_TYPE_IGNORED:
port_info.type = MM_MODEM_PORT_TYPE_IGNORED;
break;
case MM_PORT_TYPE_UNKNOWN:
default: default:
port_infos[i].type = MM_MODEM_PORT_TYPE_UNKNOWN; port_infos[i].type = MM_MODEM_PORT_TYPE_UNKNOWN;
break; break;