Skip to content
  • Dan Williams's avatar
    wwan: use modem states instead of enabled/connected properties · 60804250
    Dan Williams authored
    Determining when the NMDeviceModem is available and when different
    connections are available is easier if the modem's state is tracked,
    instead of using the separate Enabled and Connected properties.
    These properties could not accurately represent the SIM lock state
    and prevented NetworkManager from making the modem available for
    auto-activation when locked, even if a PIN was available.
    
    In this new scheme, the NMDeviceModem is UNAVAILABLE when the
    ModemManager modem state is FAILED, UNKNOWN, or INITIALIZING.  It
    transitions to the NM DISCONNECTED state when the modem has finished
    initializing and has not failed.
    
    Once the NMDeviceModem is in DISCONNECTED state it can be activated
    even if the SIM is locked and a PIN is required; the PIN will be
    requested when starting activation, either from the connection itself
    or via a secrets request.  This makes auto-activation of WWAN
    connections possible.
    
    This also allows us to consolidate code dealing with modem enable/disable
    into the base NMModem class using the modem state, and to log more modem
    information for debugging purposes.
    60804250