NetworkManager/src/devices/wwan
Thomas Haller 405ee7cad0 device: mark uses of device's state-reason with nm_device_state_reason_check()
The state-change of a device has a reason argument, which is mostly for information
only.

There are many places in code that are the source of a state-reason.
Mostly these are calls to:
  - nm_device_state_changed()
  - nm_device_queue_state()
  - nm_device_queue_recheck_available()
  - nm_device_set_unmanaged_by_*()
  - nm_device_master_release_one_slave()
  - nm_device_ip_method_failed()
  - nm_modem_emit_prepare_result()
  - nm_modem_emit_ppp_failed()
  - nm_manager_deactivate_connection()
  - NM_SET_OUT (out_failure_reason, NM_DEVICE_STATE_REASON_*);

However, there are a few places in code that look at the reason
to decide how to proceed. I think this is a bad pattern, because
cause and effect are decoupled and it gets hard to understand where
a certain reason is set and what consequences that has.

Add a nop-function nm_device_state_reason_check() to mark all uses
of the device state reason that derive decisions from it. That is,
highlight the "effect" part.
2017-02-23 17:07:28 +01:00
..
libnm-wwan.ver device: apply the mtu property of gsm and cdma settings 2017-02-20 09:18:25 +01:00
nm-device-modem.c device: mark uses of device's state-reason with nm_device_state_reason_check() 2017-02-23 17:07:28 +01:00
nm-device-modem.h build: don't add subdirectories to include search path but require qualified include 2016-11-21 14:26:37 +01:00
nm-modem-broadband.c modem: add nm_modem_emit_prepare_result() function 2017-02-23 12:33:41 +01:00
nm-modem-broadband.h core: refactor private data in "src" 2016-10-04 09:50:56 +02:00
nm-modem-manager.c core: refactor private data in "src" 2016-10-04 09:50:56 +02:00
nm-modem-manager.h core: refactor private data in "src" 2016-10-04 09:50:56 +02:00
nm-modem-ofono.c device: mark uses of device's state-reason with nm_device_state_reason_check() 2017-02-23 17:07:28 +01:00
nm-modem-ofono.h core: refactor private data in "src" 2016-10-04 09:50:56 +02:00
nm-modem.c modem: remove unused reason argument from nm_modem_device_state_changed() 2017-02-23 14:42:36 +01:00
nm-modem.h modem: remove unused reason argument from nm_modem_device_state_changed() 2017-02-23 14:42:36 +01:00
nm-wwan-factory.c build: don't add subdirectories to include search path but require qualified include 2016-11-21 14:26:37 +01:00