[RFC] Code reordering, comments welcome

Aleksander Morgado aleksander at aleksander.es
Sat Jan 30 17:30:03 PST 2016


Hey,

The src/ directory is a bit messy, and some files are growing out of
control (e.g. mm-broadband-modem.c, mm-broadband-modem-qmi.c, ...).
How about we reorder a bit the code like this?

src/core  <---- main app code, including probing stuff.
src/ports <---- ports (e.g. the 'libports' we internally generate)
src/base <---- Base modem, sim, bearer objects (protocol independent
abstract classes).
src/at <---- the generic AT broadband modem, sim, bearer (*)
src/qmi <---- the generic QMI broadband modem, sim, bearer
src/mbim <---- the generic QMI broadband modem, sim, bearer

Then, for e.g. the QMI modem we could have
per-implemented-interface-files; e.g.:
mm-broadband-modem-qmi.c  <---- generic/common QMI stuff
mm-broadband-modem-qmi-3gpp.c  <---- 3GPP interface specific QMI implementation
mm-broadband-modem-qmi-3gpp2.c  <---- 3GPP2 interface specific QMI
implementation
mm-broadband-modem-qmi-location.c  <---- Location interface specific
QMI implementation

(*) The new MMBroadbandModemAt would have only the AT-specific stuff
from the current mm-broadband-modem.c; the generic
protocol-independent logic should be kept in an abstract
MMBroadbandModem (or even in the MMBaseModem).

If we agree to do something like this, I believe it should be done
before the next stable release, so that then backporting patches to
the latest stable is straightforward.

I think it's a bit of work, but I wouldn't mind to do it if the
overall result ends up being easier to maintain and also easier to
learn for newcomers (I've already been told a couple of times that
having everything in the same directory doesn't help to understand how
the different parts of the daemon work...).

What does everyone think?

-- 
Aleksander
https://aleksander.es


More information about the ModemManager-devel mailing list