[RFC] Code reordering, comments welcome

Aleksander Morgado aleksander at aleksander.es
Mon Feb 29 16:32:27 UTC 2016


On Sun, Jan 31, 2016 at 2:30 AM, Aleksander Morgado
<aleksander at aleksander.es> wrote:
> 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...).

FYI, this already started here:
https://cgit.freedesktop.org/ModemManager/ModemManager/log/?h=aleksander/reorder-sources

-- 
Aleksander
https://aleksander.es


More information about the ModemManager-devel mailing list